How To Remove Tinymce Editor Buttons From Javascript?
I am using TinyMCE4.3.10 (as part of Wordpress 4.5.4). I create a custom tinymce editor using the code: tinyMCE.execCommand('mceAddEditor', false, captionId); tinyMCE.execCommand(
Solution 1:
You use tinymce.init({})
to invoke the editor with specific settings. If the ID of the <textarea>
in question is contained in the variable captionId
I would do this:
tinymce.init({
selector: "#" + captionId, //needs to be a string of the CSS selector for the ID
.
.
.
});
This will target only that <textarea>
for initialization. If you want to limit what options appear on the toolbar you can do so with the toolbar
configuration option:
tinymce.init({
selector: "#" + captionId,
toolbar: [
"table | insertfile undo redo | styleselect | bold italic",
"removeformat | fontsizeselect | forecolor backcolor"a11ycheck
],
.
.
});
https://www.tinymce.com/docs/configure/editor-appearance/#toolbar
Post a Comment for "How To Remove Tinymce Editor Buttons From Javascript?"