TinyMCE define valid HTML for the updated text widget
-
I’m very pleased with the new function that does enable the user to use the visual & text editor for the text widget.
I want to filter the settings which are used within the TinyMCE editor of the new text widget. For the TinyMCE editor which is used within the post/page editor I can use the filter
before_wp_tiny_mce
.When switching from Visual editor to Text editor WordPress formats HTML I added the following key
extended_valid_elements
with the valuespan[*], div[*], meta[*]
to the settings of the TinyMCE editor.add_filter( 'tiny_mce_before_init', function( $settings ) { $settings['extended_valid_elements'] = 'span[*], div[*], meta[*]'; return $settings; } );
otherwise
<span>test</span>
will becometest
after switching from the text editor to the visual editor.Is there a filter to add the settings used in the TinyMCE editor which is used in the new text widget?
Note: The option in the WordPress user profile to disable the visual editor doesn’t work for the widget text editor.
- The topic ‘TinyMCE define valid HTML for the updated text widget’ is closed to new replies.