Support » Fixing WordPress » Can’t Add Table Button to TinyMCE Editor

  • I’m trying to add a table button to a TinyMCE editor implemented on a custom option page with the wp_editor() function, but I’m having trouble initiating the table plugin. This error box shows up every time:

    Failed to initialize plugin: table

    And here are the functions/filters I’m using:

    
    function tinymce_add_table_btn($btns) {
    	array_push($btns,"table");
    	return $btns;
    }
    function tinymce_add_table_plugin($plugins) {
    	$plugins["table"] = "path/to/plugin.min.js";
    	return $plugins;
    }
    function tinymce_mod() {
    	add_filter("mce_buttons","tinymce_add_table_btn");
    	add_filter("mce_external_plugins","tinymce_add_table_plugin");
    }
    add_action("admin_init","tinymce_mod",99);
    

    I took the table plugin directly from the self-hosted TinyMCE release (v5.7.0), and WordPress has no problem detecting it; however, the JavaScript console spits these errors out:

    Failed to initialize plugin: table TypeError: e.ui is undefined
    Uncaught TypeError: xf.browser is undefined

    I followed this article for my code, and it shouldn’t require anything extra. Help would be appreciated!

    [ Please do not bump. ]

    • This topic was modified 2 months, 3 weeks ago by Jan Dembowski.
  • You must be logged in to reply to this topic.