WordPress Editor Image for Shortcode WordPress Editor Image for Shortcode wordpress wordpress

WordPress Editor Image for Shortcode


Alright, found the answer thanks to Dan's hint. Here's how to do it:

First (as Dan suggested) take a look at how they add the Gallery plugin to Tiny MCE. There's actually an uncompressed js file that will give you the overview you need, find it in:

/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js

This goes over the basics on adding this type of plugin to TinyMCE (more info here). To get WP to load the .js file with your TinyMCE plugin, see this helpful guide.

Basically here's the code:

if ( get_user_option('rich_editing') == 'true') {    add_filter("mce_external_plugins", "add_jolokia_tinymce_plugin");//Applying the filter if you're using the rich text editor}function add_jolokia_tinymce_plugin($plugin_array) {    $plugin_array['example'] =  '/path/to/example.js';    return $plugin_array;}

Add this to a plugin or function.php in a theme And you're good!