Support

Account

Home Forums General Issues Removing the \'acf_the_content\' filter Reply To: Removing the \'acf_the_content\' filter

  • Yes, there are reasons that ACF uses acf_the_content instead of the_content. There are some minor changes in the order that filters are added, but the main reason is that ACF does not run include all the filters for WYSIWYG fields that are included for the main content field because of bugs and other issues. For example it does not include “prepend_attachment” because this causes the attachment image to be prepended for every wysiwyg field. I’m sure there are others I’m not aware of.

    I suspect that the reason that the content is not formatted when getting it from the cache is that ACF allows you to get the content of a WYSIWYG field unformattted, so it is not formatted before it’s added to the cache in the way that the main content editor is. You can solve this problem by always getting the unformatted value and then applying acf_the_content to it.

    Instead of

    
    the_field('some-wysiwyg-field');
    

    do

    
    $content = get_field('some-wysiwyg-field', false, false);
    echo apply_filters('acf_the_content', $content);