I need to extend a tinymce.plugins.WordPress function from my tinymce.plugins.XYZ object. I need to extend _hideButtons within this core object:
(function() {
var DOM = tinymce.DOM;
tinymce.create('tinymce.plugins.WordPress', {
mceTout : 0,
_hideButtons : function() {
if ( !this.mceTout )
return;
if ( document.getElementById('wp_editbtns') )
tinymce.DOM.hide('wp_editbtns');
if ( document.getElementById('wp_gallerybtns') )
tinymce.DOM.hide('wp_gallerybtns');
clearTimeout(this.mceTout);
this.mceTout = 0;
};
});
tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress);
})();
here is the object that needs to do the extending:
(function() {
tinymce.create('tinymce.plugins.XYZ', {
/* here */
});
tinymce.PluginManager.add('youtube', tinymce.plugins.XYZ);
})();
Thank you for the help!
For reference: I am adding edit and delete buttons to a custom shortcode element (like wp gallery)
You don’t want to extend it. You just need to over write the function in question.