Want to add new custom button in wordpress editor toolbar (2 posts)

  1. rajbeer25
    Posted 4 years ago #

    I am trying to create a new plugin for wordpress.

    At a very high level my requirement is

    1 Add a custom button ( let's call it MyButton) in tinyMCE editor toolbar.
    2 Click on the button should open a new popup div/window.

    I tried this code,But unable to add my custom button.

    function add_more_buttons($buttons) {
      $buttons[] = 'hr';
      $buttons[] = 'del';
      $buttons[] = 'cut';
      $buttons[] = 'sup';
      $buttons[] = 'MyButton'; // Want to add my custom button
     return $buttons;
    add_filter("mce_buttons_2", "add_more_buttons");

    Anyone having any idea???

  2. luckdragon
    Posted 4 years ago #

    here's a url that should help answer your question, it's pretty detailed, and even has a downloadable example.


Topic Closed

This topic has been closed to new replies.

About this Topic