Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    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

    (@deryck)

    Thanks a lot Tobias.

    The page is http://localhost:8888/the_project/wp-admin/themes.php?page=options-framework.

    Should be then load-options-framework the $editor_page value?

    Plugin Author TobiasBg

    (@tobiasbg)

    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.