Christian,
The filter provided as a workaround is not really required (and looks suspiciously like my adjustment to cs_noemptyp in the original thread - I didn’t go this route as I assumed the code would need to target all shortcodes and may need to include any 3rd party ones if used at the beginning of the paragraph) - I would just like the issue resolved officially. I am not using Cornerstone for these sections but do want to build out my pages with it so I don’t want to poke things my side and end up breaking Cornerstone.
If (as I believe) this behaviour is the result of cs_noemptyp - I did find a ‘solution’
If you comment out the following part of that function in helpers.php:
$content = strtr( $content, $array );
and instead use:
$content = shortcode_unautop( $content);
The Shortcodes are no longer broken! - I discovered this by first changing it to:
$content = $content;
Which returns the content with empty p tags around the shortcodes!!!
The only remaining issue is the additional p at the beginning of the first column and the end of the second on the articles using columnize (blog posts seem fine and no sign of any empty p’s here). I used the following in functions.php to remove them…
add_filter('the_content', 'remove_empty_p', 20, 1);
function remove_empty_p( $content ){
$content = force_balance_tags( $content );
$content = preg_replace( '#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content );
$content = preg_replace( '~\s?<p>(\s| )+</p>\s?~', '', $content );
return $content;
}
But as I’m not entirely sure why this function exists (i.e. your reasoning for doing it this way) I don’t know if this is the answer… or what effect it has on Cornerstone etc.
Anyway, I look forward to an official PERMANENT fix - I have not as yet migrated the content from the old site so will put that on hold for the time being.
Thanks for acknowledging/confirming that this issue does exist and I’m not going mad!