How to add custom tinymce plugin to new text widget

I found the solution with help from Jacob Peattie and the article from https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-text-widget/ Here’s a quick walkthrough on what i did: I made a new js file container the code of my original button, but modified it to the event listener of the widget tinymce jQuery( document ).on( ‘tinymce-editor-setup’, function( event, editor ) { … Read more

Translate MCE button text/tooltip in custom plugin

Create js file button.js and add js directory and list-btn.png needed (function() { tinymce.create(“tinymce.plugins.listbuttons_button_plugin”, { //url argument holds the absolute url of our plugin directory init : function(ed, url) { //add new button ed.addButton(“listbuttons”, { title : “Add Related post shortcode”, cmd : “listbuttons_command”, image : “images/list-btn.png” }); ed.addCommand(“listbuttons_command”, function() { var return_text = “[related]”; … Read more

More than one TinyMCE (wp_editor) with different $settings[‘drag_drop_upload’] values breaks

Not sure if this is a bug, but the behaviour is correct, or at least apparently intentional. a) There is only one dragDropUpload setting in the tinyMCEPreInit object, instead of one flag per editor. b) looking at class-wp-editor.php:139: if ( $set[‘drag_drop_upload’] ) { self::$drag_drop_upload = true; } so, if the setting is set to true … Read more