6

Since upgrading to Wordpress 3.9 (which includes TinyMCE 4.x), I have problems customizing the editor, displayed via wp_editor()

In the example below, I want to disable the 'fullscreen' button, but this doesn't work.

 $settings = array(  'textarea_name' => 'description',
                 'quicktags' => false,
                 'media_buttons' => false,
                 'teeny' => true,
                 'tinymce'=> array(
                 'theme_advanced_disable' => 'fullscreen'
                       )
);
wp_editor( $content, 'description', $settings );

Unfortunately, the documentation for TinyMCE API 4.x isn't as helpful to me as the 3.8 one

1

2 Answers 2

14

Try this:

replace

'theme_advanced_disable' => 'fullscreen'

with

'toolbar1'=> 'bold,italic,underline,bullist,numlist,link,unlink,forecolor,undo,redo'

Also, remove 'teeny' => true,

1
  • 1
    I had to keep 'teeny' => true, in order for this to work
    – myol
    Jan 6, 2015 at 17:21
0

adding this filter below your code you can delete fullscreen button or another with teeny=>true, deleting items from $buttons array (fullscreen is 14 counting from left to right from 0 )

first remove from $settings

'tinymce'=> array(
             'theme_advanced_disable' => 'fullscreen'
)

and add filter

add_filter( "teeny_mce_buttons", "gk_comment_form_no_fullscreen");
function gk_comment_form_no_fullscreen($buttons) {
    unset($buttons[14]);
    return $buttons;
}
1
  • 1
    Please don't dump code barely, add some explanation how this code can help etc. Jan 9, 2015 at 18:28

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.