Adam,
Thanks for your prompt support. I have narrowed down the issued to be a piece of code I’m using. Specifically, it’s to add shortcodes into the editor.
This line (from shortcode editor plugin) creates the issue:
add_filter('widget_text', 'webtreats_formatter', 99);
The function called:
function webtreats_formatter($content) {
$new_content = '';
/* Matches the contents and the open and closing tags */
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
/* Matches just the contents */
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
/* Divide content into pieces */
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
/* Loop over pieces */
foreach ($pieces as $piece) {
/* Look for presence of the shortcode */
if (preg_match($pattern_contents, $piece, $matches)) {
/* Append to content (no formatting) */
$new_content .= $matches[1];
} else {
/* Format and append to content */
$new_content .= wptexturize(wpautop($piece));
}
}
return $new_content;
}
Just wanted to paste this incase you run across this in the future.