Showing wp tiny mce's other buttons in a plugin

1 replies
Hi all,

I'm writing a wordpress plugin and have successfully added the WP Tiny MCE editor in my plugin's page. I would like the editor to show extra buttons like font-family and font-size. I tried the solution provided at How to display hidden buttons in TinyMCE for WordPress | WordPress | ilovecolors but this solution enabled the buttons not only in my plugin page but also in the Post/Page screens. Is there any way to enable these buttons only in my plugin page? Thanks
#buttons #mce #plugin #showing #tiny
  • Profile picture of the author angelie
    Found a solution, for anyone who might have the same issue, here's what I've done:

    Code:
    global $current_screen;
    if ("settings_page_your_plugin_name" == $current_screen->id){
      add_filter( 'mce_buttons', 'plugin_name_register_mceButtons' );
    }
    function plugin_name_register_mceButtons(){
      array_push($buttons, "fontselect,fontsizeselect");
      return $buttons;
    }
    {{ DiscussionBoard.errors[5140668].message }}

Trending Topics