Home / admin / Disable the visual editor for posts and pages
  • http://www.cliffpaulick.com Cliff Paulick

    How do you make the editor totally gone (e.g. display:none; ) for certain post types? For example, all content will be by filling out custom fields. Thanks, Kevin.

    • http://wpsnipp.com Kevin Chard

       Hi Cliff, This is a sample custom post type


      function sample_post_type() {
          register_post_type( 'sample_cpt',
              array(
                  'labels' => array(
                      'name' => __( 'Sample' ),
                      'singular_name' => __( 'Sample' ),
                  ),
              'public' => true,
              'menu_position' => 5,
              'rewrite' => array('slug' => 'sample'),
              'supports' => array('title','thumbnail','editor'),    // supports options

              )
          );
      }
      add_action( 'init', 'sample_post_type' );

      The following can be added,

      ‘title’
      ‘editor’ (content)
      ‘author’
      ‘thumbnail’ (featured image, current theme must also support)
      ‘excerpt’
      ‘trackbacks’
      ‘custom-fields’
      ‘comments’ (also will see comment count balloon on edit screen)
      ‘revisions’ (will store revisions)
      ‘page-attributes’ (menu order, hierarchical must be true to show Parent option)
      ‘post-formats’ add post formats, 

      http://codex.wordpress.org/Function_Reference/register_post_type

      So if you remove the option editor from that array above it will not display the editor, then add excerpt or what ever other options you would like.