Home Forums General Issues Custom Scripts Reply To: Custom Scripts

  • Hi @mdurchholz

    Yes, it would affect all WYSIWYG editor. If you want to do it only for certain field, you can use the acf/load_value filter instead. It should be like this:

    function my_acf_load_value( $value, $post_id, $field ) {
        remove_filter('acf_the_content', 'wpautop' );
        return $value;
    // acf/load_value/name={$field_name} - filter for a specific value load based on it's field name
    add_filter('acf/load_value/name=wysiwyg_editor', 'my_acf_load_value', 10, 3);

    I believe the text area field won’t convert special chars like <>. I’ve just tested it on my installation and it executed the script correctly. Maybe it has something to do with your theme, plugins or database encodings.

    To check if it’s your theme or plugins fault, could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.

    To check if it’s your database encodings fault, you need to get in touch with your hosting provider.

    I hope this makes sense 🙂