Wordpress tinyMCE keep adding <p>
tags when I saved my custom post types in visual mode opened!
I had searching for many solutions, but not working. Here is the solution that I found, but this is unable to stop wordpress from adding annoying <p>
tags from my html codes:
Javascript:
<script type="text/javascript">
tinyMCE.init({force_p_newlines : false});
</script>
PHP
function tinymce_remove_root_block_tag( $init ) {
$init['wpautop'] = false;
$init['force_p_newlines'] = false;
$init['forced_root_block'] = false;
return $init;
}
add_filter( 'tiny_mce_before_init', 'tinymce_remove_root_block_tag' );
I don't want any kind of solution which is using the_content
hook, because this is still letting <p>
tags inside wordpress text editor. Example:
remove_filter ("the_content", "wpautop");
What else should I use to stop tiniMCEtinyMCE from messing up html codes with its auto added <p>
tags?