1

In last version of TinyMCE there was simply code to hide buttons in visual editor (Remove Specific Buttons from WP Editor TinyMCE). But with WordPress 3.9 TinyMCE 4.0 have other API.

Someone know how to do it now?

2 Answers 2

0
function delete_button($buttons) {  
   unset($buttons[6]);
   unset($buttons[7]);
   unset($buttons[8]);
   unset($buttons[9]);
   unset($buttons[12]);
   unset($buttons[14]);
   return $buttons;
}

add_filter('mce_buttons', 'delete_button');

print_r($buttons) to read specific buttons numbers.

1
0

If I understood the question correctly, you can use something like this to remove the default buttons from the WP tinyMCE.

// Remove TinyMCE Default Button

function myplugin_tinymce_buttons( $buttons ) {
      //Remove the text color selector
      $remove = 'blockquote'; //default blockquote button

      //Find the array key and then unset
      if ( ( $key = array_search( $remove, $buttons ) ) !== false )
        unset( $buttons[$key] );

      return $buttons;
 }
add_filter( 'mce_buttons', 'myplugin_tinymce_buttons' );

to know what is the name of the element you need to use your browser dev tools. Simply highlight the element and see the class. It will be also the name. For example: where to see the name of the element

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.