Dynamically adding WYSIWYG to metaboxes

I’ve created a custom metabox area and need to add the option of multiple metaboxes. So far I found this guide https://jeremyhixon.com/repeating-wordpress-editor/ which works absolutely perfect up until one point. When you click to add a new metabox it dynamically adds the textarea and turns it into a tinyMCE using tinymce.init({ selector: ‘#’ + contentID … Read more

how to load tinymce external plugin

I’m trying to load external tinymce plugins but no luck so far. I know WordPress offers mce_external_plugins filter but it seems not make any difference. I have advlist tinymce plugin inside custom path, and instead of adding it directly inside wp-includes/js/tinymce/plugins directory I’d like WordPress to load it in my custom/path/to/advlist/plugin.min.js I’ve tested: function custom_tinymce_plugins($plugins) … Read more

How to add custom JS to tinymce in wordpress

So I want to enhance the functionality of the TinyMCE editor in WordPress by adding custom JS script and CSS to it. I was able to add custom CSS to it by using this method: function plugin_mce_css($stylesheet) { $stylesheet .= ‘,’; $stylesheet .= plugins_url (‘editor.css’, __FILE__); return $stylesheet; } add_action( ‘mce_css’, ‘plugin_mce_css’ ); Using that, … Read more

TinyMce in WordPress – Getting the “fullscreen” button to stay on the right when customising button layout

I’m using TinyMce inside WordPress and I have customised the button layout like so: add_filter( ‘tiny_mce_before_init’, ‘blm_format_tiny_mce’ ); add_filter( ‘mce_buttons’, ‘blm_extended_editor_mce_buttons’, 0 ); add_filter( ‘mce_buttons_2’, ‘blm_extended_editor_mce_buttons_2’, 0 ); function blm_format_tiny_mce( $in ) { $in[‘remove_linebreaks’] = true; $in[‘convert_newlines_to_brs’] = false; $in[‘keep_styles’] = true; $in[‘tabfocus_elements’] = ‘publish’; $in[‘paste_remove_styles’] = false; $in[‘paste_remove_spans’] = true; $in[‘paste_strip_class_attributes’] = ‘mso’; $in[‘paste_text_linebreaktype’] … Read more