Support

Account

Home Forums ACF PRO Turn off smart / curly quotes?

Solving

Turn off smart / curly quotes?

  • There is a thread discussing how to turn on smart quotes here: https://support.advancedcustomfields.com/forums/topic/smart-quotes/

    However, I’m finding that my straight quotes are getting turned into curly quotes automatically.

    Is there a way to prevent this behaviour? I’m finding this to be occurring in a WYSIWYG field (to be precise, in a repeater though I don’t think it would make a difference).

    Looking in the database, I can see the quotes are straight quotes and not curly.

  • Hm, ok, I found a solution in completely turning of wptexturize sitewide with:

    add_filter( 'run_wptexturize', '__return_false' );

    which works but seems a bit heavy handed. In trying to find a way to target the WYSIWYG sub-field more precisely, I found this thread:

    https://support.advancedcustomfields.com/forums/topic/remove-wysiwyg-wptexturize-filter/

    Which suggests:

    remove_filter ('acf_the_content', 'wptexturize');

    Which isn’t working for me, I assume potentially because it is a repeater/subfield?

    I’m also actually accessing the repeater by simply getting the entire repeater as a variable and accessing the text directly via the array, so I’m even more confused that the text is being filtered. (get_sub_field or the_sub_field result in the same curly quotes, however)

  • Hi @waffl

    Could you please try the following code in your functions.php file?

    function my_acf_remove_curly_quotes() {
        remove_filter ('acf_the_content', 'wptexturize');
    }
    add_action('acf/init', 'my_acf_remove_curly_quotes');

    Hope this helps 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.