• 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 using add_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.

    • This topic was modified 2 years, 2 months ago by pgn4web.
    • This topic was modified 2 years, 2 months ago by pgn4web.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pgn4web

    (@pgn4web)

    Did a bit more of research and it might be that there’s no possible workaround to be implemented in the plugin. It seems that the shortcode content is passed to the plugin before applying the texturize, so nothing for the plugin to revert.

    Dion

    (@diondesigns)

    You can completely disable the “texturize” anti-feature:

    add_filter('run_wptexturize', '__return_false'};

    I use something similar on all WP sites I manage.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘reverting wptexturize changes’ is closed to new replies.