I read several articles about configuring the WordPress editor. For example, this snippet shows how to permanently set the editor to HTML or WYSIWYG for all contents.

I’m wondering if it’s possible to disable the WYSIWYG only when the user is creating a page, leaving it enabled for any other WordPress content type.

4 s
4

The best way to do this is by adding ‘user_can_richedit’ filter, like so:

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;
}

Hope it’s useful 😉

Leave a Reply

Your email address will not be published. Required fields are marked *