How to reverse effect of wpautop() and wptexturize() on multi-line shortcode
-
I have a short code with multi-line content.
Functions wpautop() and wptexturize() are applied to the shortcode content before my plugin gets a copy of it. The content of this shortcode:
[shortcode] His name is "Able." The ball's shape is spherical. [/shortcode]
Becomes:
<br /> His name is & #8220;Able.& #8221;<br /> The ball& #8217;s shape is spherical.<br />
(Sorry, had to put a space between & and # for entities code to publish.)
How do I reverse the effect of wpautop() and wptexturize()?
For the nonce, I’m putting the shortcode content into pre tags with the plugin stripping out the pre tags before using it.
The content of this shortcode:
[shortcode] <pre> His name is "Able." The ball's shape is spherical. </pre> [/shortcode]
Becomes:
His name is "Able." The ball's shape is spherical.
I don’t like the “use pre tag” solution. It seems so inelegant and there may be issues with it I have not yet encountered.
Does anyone know how to reverse the effects wpautop() and wptexturize() have on shortcode content?
Will
- The topic ‘How to reverse effect of wpautop() and wptexturize() on multi-line shortcode’ is closed to new replies.