Disable HTML (Text) Tab in Post Editor

I am attempting to disable the Text tab in the post editor but not having any luck.

enter image description here

The first thing I want to do is set the Visual editor to be the default but this code does not work (it is being called from a MU plugin):

apply_filters( 'wp_default_editor', 'tinymce' );

Next, I want to be able to completely hide the ‘Visual’ and ‘Text’ tabs but I don’t see and hooks I could use to accomplish this.I really don’t want to resort to CSS/JS to do it.

2 Answers
2

I was hunting for a way to do this, and no-one seems to mention the wp_editor_settings filter.
This worked for me:

function my_editor_settings($settings) {
$settings['quicktags'] = false;
return $settings;
}

add_filter('wp_editor_settings', 'my_editor_settings');

Leave a Comment