Hi,
I think the easier way to change the wysiwyg is using options
parameter. Using filter is the last method you should think about. Of course this will work. I'll demonstrate both methods here:
If you want to disable "Add Media" button, use this code:
array(
'type' => 'wysiwyg',
'name' => 'Editor',
'id' => 'test_editor',
'options' => array(
'media_buttons' => false,
),
),
If you want to disable the text mode), use this code:
array(
'type' => 'wysiwyg',
'name' => 'Editor',
'id' => 'test_editor',
'options' => array(
'media_buttons' => false,
'quicktags' => false,
),
),
If you want to disable visual mode, use this code:
array(
'type' => 'wysiwyg',
'name' => 'Editor',
'id' => 'test_editor',
'options' => array(
'media_buttons' => false,
'tinymce' => false,
),
),
Using filter is similar:
add_filter( 'rwmb_wysiwyg_settings', function ( $settings ) {
$settings['media_buttons'] = false;
// $settings['tinymce'] = false;
$settings['quicktags'] = false;
return $settings;
} );
Note that using filter affects all wysiwyg fields. That's why it's more preferable to use field settings instead.