Is there a way to remove the wptexturize filter from the ACF WYSIWYG field type? I know I can do it for the_content() by using the following function but it doesn’t seem to work for ACF?
remove_filter ('acf_the_content', 'wptexturize');
Any help would be greatly appreciated! Cheers.
I have a feeling that currently, there is no way to remove the ACF filter. I’ll add this to the to-do and have it fixed in the next version.
For now, you can load the value without any formatting like so:
get_field('field_name', $post_id = false, $format = false);
Hope that helps
Cheers for the quick reply!
I tried that but unfortunately it didn’t work… for now i’ve ended up just commenting out the filter from wysiwyg.php.
the field i’m using is a sub / repeater field so maybe thats why?
This is what I tried:
echo get_sub_field('content', $post_id = false, $format = false);
Just wanted to follow up and let you know I have made some changes to the WYSIWYG field in hope that it will solve your original issue.
All the add_filter functions for acf_the_content have been moved to the root of the wysiwyg field file, so you should be able to unhook them in your functions.php file.
Good man! – I will test it out when I’m back on that project… cheers for that – appreciate the response.
I tried to unhook the filter as rockethouse suggested at the beginning of the conversation and it doesn’t seem to work for me. It should be as easy as putting this: remove_filter( ‘acf_the_content’, ‘wpautop’ ); in my functions.php, isn’t?
No joy though 🙁
Thanks for all your work.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2019 Advanced Custom Fields. Subscribe