Thank you.
I’m looking at this part of the code in nxs_functions_adv.php:
if (preg_match('%EXCERPT%', $msg)) {
if ($post->post_excerpt!="")
$excerpt = strip_tags(strip_shortcodes(apply_filters('the_content', nxs_doQTrans($post->post_excerpt, $lng))));
else
$excerpt = nsTrnc(strip_tags(strip_shortcodes(apply_filters('the_content', nxs_doQTrans($post->post_content, $lng)))), 300, " ", "...");
$msg = str_ireplace("%EXCERPT%", $excerpt, $msg);
}
My problem is that breaks – – and new lines are not stripped from $post->post_content, when the excerpt is empty – has not been explicitly filled in the post edit page. And this is because in your plugin, you are not using get_the_excerpt() to get the content of the post excerpt, but you’re getting it through $post->post_content, which is a problem since all functions attached to the filter/action ‘get_the_excerpt’ or ‘the_excerpt’ get ignored because of that.
In my theme, I have a specific function applied to ‘get_the_excerpt’ to reformat the content of the excerpt according to my needs, but SNAP ignores it and uses its own copy of the post excerpt.
Try executing the following code, to see that new lines and breaks aren’t stripped from %EXCERPT%:
var_dump ( nxs_doQTrans ( get_the_excerpt(), '' ) );
var_dump ( nxs_doQTrans ( $post->post_content, '' ) );
I’m not sure if this is a feature or a bug… I’m just trying to find a way to continue using %EXCERPT%, but make it use get_the_excerpt() instead of $post->post_content, when the excerpt is empty.
Btw, SNAP has been a life-saver for me and would very much like to continue using it where possible.
UPDATE: I oversaw that HTML tags are actually stripped in nsTrnc() and now I am aware of that. However, the problem with the breaks and empty lines still remains.