Can I remove the Rich Text box editor for a specific post?

A few months ago I asked a similar question:
Is it possible to remove the main rich Text box editor? and got the following answer:

function remove_pages_editor(){
    remove_post_type_support( 'page', 'editor' );
}   
add_action( 'init', 'remove_pages_editor' );

This code removes the editor from all pages. Can I remove if from specific pages (by post-ID) somehow? Thanks!

Related posts

Leave a Reply

1 comment

  1. There is an add_meta_boxes function that fires that you can hook into – it fires whenever the edit post page is rendered.

    At that point, you can get the ID of the post being edited using get_the_ID(). You can then compare it to the ID for which you want to remove the post editor:

    function remove_pages_editor(){
        if(get_the_ID() == 23) {
            remove_post_type_support( 'post', 'editor' );
        } // end if
    } // end remove_pages_editor
    add_action( 'add_meta_boxes', 'remove_pages_editor' );