The new rich text widget that came with the 4.8 update seems to add a filter to widget's content before outputting the data (probably the_content
).
I just noticed that if i use a shortcode in the new text widget, it will mess the entire thing ( for example, it will replace the X
letter with ×
which is the HTML entity equivalent for ×
mark, add random <p>
, etc.). The filter is added to the wp_options
table under widget_text
, like this:
a:2:{
i:2;
a:3:{
s:5:"title";
s:6:"Sample";
s:4:"text";
s:14:"[shortcode-here]";
s:6:"filter";
s:7:"content";
}
s:12:"_multiwidget";
i:1;
}
Now if i replace the 5th and 6th values with this:
s:1:" ";
s:1:" ";
The filter is applied no more. If you already have a text widget added before updating to 4.8, there won't be a problem. But the moment you click Save
on the widget after you update to 4.8, the problem appears.
I don't want to disable the filter entirely, since there might be other text widgets on the page.
Is it possible to detect the shortcodes and turn off the filter for them?