I been trying to remove Visual Editor from a specific page only. I managed to remove Visual editor from all pages using this code
add_filter( 'user_can_richedit', 'patrick_user_can_richedit');
function patrick_user_can_richedit($c) {
global $post_type;
if ('page' == $post_type)
return false;
return $c;
}
Is there any way I can remove the visual editor from only one page? Im using WordPress
Geez … how many forums are you gonna post this question on? lol … That was the same solution I posted on the .org forums … but …
I told you the better solution was to not tinker with the core WP files, and just use a plugin like this: Disable WYSIWYG on Specific Pages or Posts
This way, you’re not tinkering with the core WP files, and when you update your WP, you won’t lose all your changes … so you don’t have to keep a personal changelog handy.
Remember the rule: “When in doubt, don’t” … if you’re thinking of changing all your php files, and you’re unsure as to whether you should or not, don’t.
This worked for me
You can use some Plugin to add custom field (Advanced Custom Fields is the best), then use it in the following code:
I added custom checkbox, take it from get_field(‘sw_off_visual_editor’);, then test it $sw_off_visual_editor[0] == 1.
To REMOVE only the [Visual] Tab, and force HTML/TEXT, this will work. You can add other page_id to the if command to target other pages.