WordPress.org

Forums

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

  1. rajbeer25
    Member
    Posted 3 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
    Member
    Posted 3 years ago #

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

    http://ditio.net/2010/08/15/adding-custom-buttons-to-wordpress-tinymce/

Topic Closed

This topic has been closed to new replies.

About this Topic