How to make TinyMCE formats button show up in Divi Visual Builder?

Viewed 14

When using Divi in 'Classic Editor mode' I'm able to add the TinyMCE Formats Button to the text editor toolbar by some code in my child-theme functions-file.

I found the code on Wordpress Codex (https://codex.wordpress.org/TinyMCE_Custom_Styles):

// Callback function to insert 'styleselect' into the $buttons array
function my_mce_buttons_2( $buttons ) {
    array_unshift( $buttons, 'styleselect' );
    return $buttons;
}
// Register our callback to the appropriate filter
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );

When using 'The Latest Divi Builder Experience' – Divi's Visual Builder, the button does no longer show up in the text editor toolbar. The text editor in the Visual Builder only have one row of buttons, so I have also tried to add the filter to the first row 'mce_buttons' not 'mce_buttons_2' – but with no luck.

I believe the issue might be that the Visual Builder is loading the TinyMCE script in a different way as it is a front-end editor.

Does somebody have the correct code for loading this native, but hidden, TinyMCE button in Divi Visual Builder?

0 Answers
Related