Support Forum
Hi everyone,
i am using MB Block, in which i have field type WYSIWYG. As i found out it is rendered as TinyMCE. I want to add there new addon for create tables in this wysiwyg editor, so i found an option for TinyMCE. Problem is that classic wysiwyg editor in posts (which is also TinyMCE) take this customization correctly and add new button for create tables, but same wysiwyg editor rendered by MetaBox doesn't have these changes.
Hi,
Can you please share some screenshots of the issue on your site? Is the button create tables supported by a third-party plugin?
The field wysiwyg
mimics the classic editor of WordPress but not the core of WP itself so it might not work with a third-party plugin.
Hi,
it is not because of third-party plugin support. For example if i add this hook:
add_filter('mce_buttons_2', 'custom_mce_buttons');
function custom_mce_buttons($buttons) {
$buttons[] = 'subscript';
$buttons[] = 'superscript';
return $buttons;
}
it works in classic editor when i add new page (see attached file): https://prnt.sc/NlqhFy3pKCgQ
but when i add some MB Block with wysiwyg editor this buttons are not there (see attached file): https://prnt.sc/vVKqRbUpLv1N
Hi,
You can use the editor options to add the buttons to the WYSIWYG
field in the block. Please read more on the documentation https://docs.metabox.io/fields/wysiwyg/
https://codex.wordpress.org/TinyMCE
'options' => [
'tinymce' => [
'toolbar2' => 'subscript' //here
],
],
If you are using the builder, please check this screenshot https://monosnap.com/file/U6cEl3lxwtMBWrw8jpV4fPAhwGDEYs
Thank you. And i want to ask you, if i set options plugin to use table and insert plugin js file into wp-includes/js/tinymce/plugins/table ... it loads the plugin but it throws an error Failed to initialize plugin: table TypeError: r is not a constructor. I know that this issue is not from Metabox, i just ask if you have some correct example of use table plugin.
Hi,
Please do not touch or change anything in two WordPress folders wp-admin
and wp-includes
, all the customization will be lost after updating a new version of WordPress. If you want to customize TinyMCE, please use some supported hooks (like your code above) or a third-party plugin that supports TinyMCE's additional features.