mce_external_plugins filter issue
-
Hello, found small issue in your plugin code:
//include plugin for tinyMCE to show sirv gallery shortcode in visual mode
add_filter('mce_external_plugins', 'sirv_tinyMCE_plugin_shortcode_view');
function sirv_tinyMCE_plugin_shortcode_view(){
return array('sirvgallery' => SIRV_PLUGIN_SUBDIR_URL_PATH . 'js/wp-sirv-shortcode-view.js');
}Your function replaces all existing TinyMCE plugins added before sirv plugin initialization. Instead, you should write it something like this:
//include plugin for tinyMCE to show sirv gallery shortcode in visual mode
add_filter('mce_external_plugins', 'sirv_tinyMCE_plugin_shortcode_view');
function sirv_tinyMCE_plugin_shortcode_view($plugins){
$plugins['sirvgallery'] = SIRV_PLUGIN_SUBDIR_URL_PATH . 'js/wp-sirv-shortcode-view.js';
return $plugins;
}So after this change your plugin will not delete all TinyMCE plugins included before your plugin.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.