Open lmeyer opened 5 years ago
Hi @lmeyer ,
The "text color selection" is not part of the default editor. Is it added by a 3rd-party plugin? If so, it's the plugin's responsibility to make it works for all editors. Meta Box doesn't handle the changes in the editor's button at all.
Hi, I think I can help with this bug. I also had this problem, and it is often related to the fact that TinyMCE editor was changed (adding or removing buttons) by another plugin or function.
But to solve it, you just have to re-declare the TinyMCE buttons in your own metabox function, here is an edition:
function gdl_options_meta_boxes( $meta_boxes )
{
$meta_boxes[] = array(
'id' => 'private',
'title' => __( 'Contenu pour les articles privées', 'gdl' ),
'settings_pages' => 'gdl-settings',
'fields' => array(
array(
'name' => __( 'Contenu', 'gdl' ),
'id' => 'gdl_private_content',
'type' => 'wysiwyg',
'tinymce' => array (
'toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright, fullscreen',
'toolbar2' => 'strikethrough, forecolor, pastetext, removeformat, charmap, link, unlink, redo, undo, wp_help, styleselect',
'plugins' => 'charmap, colorpicker, hr, lists, media, paste, tabfocus, textcolor, fullscreen, wordpress, wpautoresize, wpeditimage, wpemoji, wpgallery, wplink, wpdialogs, wptextpattern, wpview'
),
),
),
);
return $meta_boxes;
}
Hello,
Issue Overview
When using wysiwyg in MB Settings page, some buttons like "text color selection" are missing in the wysiwyg.
I think it's because tinyMCE is not already fully initialized by wordpress before it displays it on the post edition page. As the default editor is not displayed in the settings page, buttons are missing.
I'm using latest version of plugins.
Steps to Reproduce (for bugs)
Expected Behavior
Same buttons than the default wysiwyg editor shown in post edition.
Current Behavior
Not all buttons
Related Issues and/or PRs
It's maybe linked to #913.