Eliot,
thanks about acf_the_content!
About TinyMCE: fixed after I’ve added as admin script:
acf.add_filter(‘wysiwyg_tinymce_settings’, function( mceInit, id, field ){
// is true before
mceInit[‘wpautop’] = false;
return mceInit;
});
Thanks!
Can anybody help? Support doesn’t reply, too.
For stopping removing <p> tags inside WordPress TinyMCE (classic) editor (during switch Visual and Text editor’s tabs),
I add to ${THEME_FOLDER}/functions.php:
remove_filter( ‘the_content’, ‘wpautop’ );
remove_filter( ‘the_excerpt’, ‘wpautop’ );
remove_filter( ‘term_decription’, ‘wpautop’ );function config_tinymce( $config ) {
$config[‘wpautop’] = false;
return $config;
}
add_filter( ‘tiny_mce_before_init’, ‘config_tinymce’, 10 );
But this doesn’t work for ACF’s fields editors.
Help, please? Thanks!
———————
Spoiler:
function acf_wysiwyg_remove_wpautop() {
remove_filter( ‘acf_the_content’, ‘wpautop’ );
}
add_action( ‘acf/init’, ‘acf_wysiwyg_remove_wpautop’);
with
remove_filter( ‘acf_the_content’, ‘wpautop’ );
don’t work.
I think, we need something like (analogue of)
function config_tinymce( $config ) {
$config[‘wpautop’] = false;
return $config;
}
add_filter( ‘tiny_mce_before_init’, ‘config_tinymce’, 10 );
Ok, you’re right. At last, “” isn’t a value for text field.
But, then, we need a tri-state field 😀
John, thanks for reply!
But… False is also a value, no?
The field is required. It is expected to have a value. False is also a value.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.