TinyMCE Anchor Button not showing

I had the exact same problem and found the solution to this. The problem is that the anchor plugin for TinyMCE is not being included as part of the default WordPress install. So while WordPress says to include: $buttons[] = ‘anchor’; …that’s not going to work because the TinyMCE plugin for anchors isn’t there. If … Read more

wp_localize_script with mce_external_plugins in wordpress

If I understand correctly; you just need to make a Javascript variable available to testing.js. I think it would be just as useful to send the variable with jQuery, as that would be loaded prior to TinyMCE anyway: add_action(‘wp_enqueue_scripts’, ‘YOUR_NAME_scripts’); //back end function YOUR_NAME_scripts( $hook_suffix ) { global $blog_id; $params = array( ‘site_url’ => site_url(), … Read more

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

Well, yes, you can do that: //replace live edited content to display html editor.on(‘BeforeSetcontent’, function(event){ event.content = tinymce_to_html( event.content ); }); //Transform your html content to raw content editor.on(‘GetContent’, function(event){ event.content = html_to_tinymce( event.content ); }); Let’s explain that: Under the hood, tinymce use a plain-text editor to store content, use in forms, etc etc. … Read more

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

It should be pretty straight-forward, copy the relevant pieces of code from the page you linked to into your existing TinyMCE plugin, update a few strings… done!.. Start with this for your TinyMCE plugin JS and see how you get on.. // JavaScript Document (function() { // Creates a new plugin class and a custom … Read more

Any alternate TinyMCE4 themes / subthemes?

I’m not sure if this question is still relevant or not (so I’m posting for future reference for people), but there is a way to define a css file for the TinyMCE editor in your plugin by using the mce_css filter. For a quick example, I’ll take an excerpt from the WordPress documentation: function plugin_mce_css( … Read more

Adding Custom Text Patterns in the WP 4.5 Visual Editor

Here’s a way to test the core patch #33300.6 by Andew Ozz, through a test plugin in WP 4.5.2, to try out the text pattern filter. Demo Here’s a strikethrough example using ~ $init[‘wpsetextpattern_inline_patterns’] = ‘{ strong: { start: “*”, end: “*”, format: “bold” }, strong2: { start: “**”, end: “**”, format: “bold” }, em: … Read more