Home › Forums › Backend Issues (wp-admin) › Avoiding admin editors tags strip › Reply To: Avoiding admin editors tags strip
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 );
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.