문제

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

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top