reverting wptexturize changes
-
Hello,
I’m maintaining a www.ads-software.com plugin that creates a custom shortcode.
As part of the shorcode, I disable the texturization of the shortcode input usingadd_filter( 'no_texturize_shortcodes', 'embedchessboard_no_texturize' );
My plugin breaks when the string"this"
is automatically changed to“this”
, with fancy quotes.Unfortunately, a bug was recently introduced that under some circumstances makes the no_texturize_shortcodes filter fails; this happens with block based themes.
The bug is tracked here https://github.com/WordPress/gutenberg/issues/37754 but after several months there’s no sign of a solution.I tried to implement a workaround in my plugin to revert the texturize changes, particularly replacing the funny quotes like
“this”
back into"this"
.
This however turned out to be more challenging than expected, simple replacements failing to work:
$pgnText = str_replace(array("“", "”"), "\"", $pgnText);
Any suggestions how to reliably undo the texturize changes to the quote chars?
Thanks in advance.
- The topic ‘reverting wptexturize changes’ is closed to new replies.