Title: Insert table button in wp_editor()
Last modified: August 20, 2016

---

# Insert table button in wp_editor()

 *  Resolved [Deryck](https://wordpress.org/support/users/deryck/)
 * (@deryck)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/insert-table-button-in-wp_editor/)
 * Hi,
 * The TablePress plugin enable the insert table button in all page/post/custom-
   post editor pages. I want to know how I can do that on a wp_editor() generated
   tinyMCE. I have tried with a lot of parameters and nothing works.
 * Help please!
 * Thanks in advance.
 * [http://wordpress.org/extend/plugins/tablepress/](http://wordpress.org/extend/plugins/tablepress/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/insert-table-button-in-wp_editor/#post-3428532)
 * Hi,
 * thanks for your question.
 * That’s indeed tricky. I’m not sure what your desired use case for this is, but
   it should be possible, by executing the `add_editor_buttons` function from the
   TablePress admin controller on the page where you are inserting your own editor.
 * That should be possible with something like this:
 *     ```
       if ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) )
       	add_action( "load-{$editor_page}", array( TablePress::$controller, 'add_editor_buttons' ) );
       ```
   
 * You’ll only have to find the correct value for `$editor_page`. In TablePress,
   that’s either `post.php` or `post-new.php`. In your plugin, this is probably 
   the admin menu hook, i.e. the return value of something like `add_submenu_page()`
   or `add_submenu_page()`, depending on how you add your plugin to the WordPress
   menu.
 * Regards,
    Tobias
 *  Thread Starter [Deryck](https://wordpress.org/support/users/deryck/)
 * (@deryck)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/insert-table-button-in-wp_editor/#post-3428534)
 * Thanks a lot Tobias.
 * The page is [http://localhost:8888/the_project/wp-admin/themes.php?page=options-framework](http://localhost:8888/the_project/wp-admin/themes.php?page=options-framework).
 * Should be then load-options-framework the $editor_page value?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/insert-table-button-in-wp_editor/#post-3428550)
 * Hi,
 * I don’t think that it is that easy.
    You should use the return value from `add_theme_page()`
   or whatever function you are using there, like
 *     ```
       $editor_page = add_theme_page(...);
       ```
   
 * Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Insert table button in wp_editor()’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [tinymce](https://wordpress.org/support/topic-tag/tinymce/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/insert-table-button-in-wp_editor/#post-3428550)
 * Status: resolved