Tagged: wysiwyg editor
Possible to add tool bar options to the WYSIWYG editor in Enfold (specifically the Text Field) module? and if so can you point me in the right direction on how to do it?
Hey integritive,
Thanks for your question, the Advanced Layout Builder (ALB) text element uses the WordPress TinyMCE editor, so you could use a plugin like Advanced Editor Tools aka: TinyMCE Advanced to add items to the toolbar
or perhaps other plugins will also add items, but we don’t have a specific way to do this only of the ALB.
If you don’t want to use a plugin, perhaps you cound use the TinyMCE documentation to create your own items.
Best regards,
Mike
one hook that might help is : tiny_mce_before_init
what do you like to have added?
thanks! — at this point only font size, but I’m sure the client will want more
i would follow Mike – and try the plugin. But here is the way i mentioned.
this to your child theme functions.php:
function wp_tinymce_more_buttons( $buttons ) {
if ( ! in_array( "fontsizeselect", $buttons ) ) { $buttons[] = 'fontsizeselect'; }
if ( ! in_array( "backcolor", $buttons ) ) { $buttons[] = 'backcolor'; }
if ( ! in_array( "alignjustify", $buttons ) ) { $buttons[] = 'alignjustify'; }
if ( ! in_array( "underline", $buttons ) ) { $buttons[] = 'underline'; }
return $buttons;
}
add_filter( 'mce_buttons_2', 'wp_tinymce_more_buttons', 99999 );
// if you choose here mce_buttons_3 - then it will be in another buttons-row
function add_font_size_to_tinymce( $initArray ){
$initArray['fontsize_formats'] = "9px 10px 12px 13px 14px 16px 18px 21px 24px 28px 32px 36px";
return $initArray;
}
add_filter( 'tiny_mce_before_init', 'add_font_size_to_tinymce' );