Pressing the "Clear Formatting" toolbar button removes styles like bold and italics just fine, but it leaves lists and headings (h1, h2, etc.) as-is. Is there a way to include all elements when clearing the formatting of the content? I've searched and searched but can't seem to find any results pertaining to what I want to do.
I'm mostly using an Advanced Custom Fields WYSIWYG field, but I've tried with WordPress' default Classic Editor as well. I found a single post that showed using the removeformat_selector
attribute in TinyMCE's initialization, but that doesn't work. This is what I tried: (using ACF's approach to TinyMCE's init customization)
add_action( 'acf/input/admin_footer', function() {
?>
<script type="text/javascript">
( function( $ ) {
acf.add_filter( 'wysiwyg_tinymce_settings', function( mceInit, id, field ) {
mceInit['removeformat_selector'] = 'ul,li,b,strong,em,i,span,h1,h2,h3,h4,h5,h6,blockquote,pre,code';
return mceInit;
} );
} )( jQuery );
</script>
<?php
} );