wp_localize_script with mce_external_plugins in wordpress

I am not sure if it is possible or not. Can i use wp_localize_script with mce_external_plugins filter? I want to send a variable to the tinymce plugin script. For Example: add_filter( “mce_external_plugins”, array( &$this, ‘add_test_plugin’ ) ); public function add_test_plugin( $plugin_array ){ global $pagenow; if( is_admin() && $pagenow == “post.php” || $pagenow == “post-new.php” ){ … Read more

Tinymce – How to hook before or after live shortcodes rendering?

When the edit post page loads in WordPress admin, I launch a js process which alters the TinyMCE editor’s contents. Recently I’ve come across the WordPress live shortcode previews which break my code, because they too alter TinyMCE editor’s contents. This enhanced shortcodes uses the wp.mce.views api recently introduced and refactored on WP 4.2. Here … Read more

How i can i add a split button or list box to the WordPress TinyMCE instance

I have added a custom button to the tinymce to insert my shortcodes, but I have so many and I want to make a splitbutton instead and I can’t figure how. Anyone can help. Here’s the code that I’ve used to create the normal button: in functions.php : /** Hook into WordPress */ add_action(‘init’, ‘onehalf_button’); … Read more

Any alternate TinyMCE4 themes / subthemes?

TinyMCE4 in WordPress 3.9 has some cool changes, but it seems to have only one “theme” included. Is there any way to make a sub-theme of the theme defined by CSS, and theme.js in wp-includes/js/tinymce/themes/modern ? Or a way to dequeue and enqueue a custom theme from somewhere else? Where can I find these MCE4 … Read more

Adding Custom Text Patterns in the WP 4.5 Visual Editor

4.5 is out and with it new Text Patterns. I would like to know how to go about adding my own custom patterns. Taking a look at wp-includes/js/tinymce/plugins/wptextpattern/plugin.js it seems pretty straight forward. var spacePatterns = [ { regExp: /^[*-]\s/, cmd: ‘InsertUnorderedList’ }, { regExp: /^1[.)]\s/, cmd: ‘InsertOrderedList’ } ]; var enterPatterns = [ { … Read more