Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, I assume you found the tutorial here or something similar:

    function myplugin_tinymce_buttons($buttons)
     {
          //Remove the text color selector
          $remove = 'forecolor';
    
          //Find the array key and then unset
          if ( ( $key = array_search($remove,$buttons) ) !== false )
    		unset($buttons[$key]);
    
          return $buttons;
     }
    add_filter('mce_buttons_2','myplugin_tinymce_buttons');

    Change ‘forecolor’ to ‘wpUserAvatar’ and wrap the add_filter in an init function (also the button is in the primary toolbar, so no _2):

    function wp_user_avatar_remove_tinymce(){
      add_filter('mce_buttons', 'myplugin_tinymce_buttons');
    }
    add_action('init','wp_user_avatar_remove_tinymce');

    Also, to clarify, this code goes in the functions.php file in your theme.

    I’ve included an option in version 1.4 that allows you toggle off the TinyMCE button in your admin settings.

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

The topic ‘remove wp user avatar from TinyMCE bar’ is closed to new replies.