I’m trying to write a plugin to disable the WordPress WSYIWYG editor for all users.
I wrote some code to remove the tinymce directory, but this breaks the editor- you can’t write anything or use the HTML tab.
$dirName = ABSPATH . '/wp-includes/js/tinymce';
if (is_dir($dirName)) {
rename("$dirName", $dirName."_DISABLED");
}
I’m trying to emulate what happens when you select the “Disable the visual editor when writing” checkbox in the user settings tab, but for all users all the time.
If you want to go with a very frontal solution, you could emulate that by updating a few rows directly in the database, like that :
Or else, if you want to use WordPress functions, you could use update_user_meta. Here is the doc: http://codex.wordpress.org/Function_Reference/update_user_meta