It's possible to hide body copy box for a custom post type?

I'm using Wordpress Types for create and manage Custom Post Types (CPT) at my blog and it works perfectly. I have created a CPT called Espacio Publicitario and I added also some custom fields (see image below). I need to hide body copy box since on this CPT is useless, can I do that? How? It will be hide just for this CPT not for the rest of the post, pages and so on

Topic plugin-types wp-admin custom-field custom-post-types Wordpress

Category Web


Yes, you can easily do it at the time of creating custom post type by using the register_post_type( $post_type, $args )
function. Don't use the 'editor' in supports parameter.

register_post_type('posttype name',$args);  
$args = array(  
        'labels' => $labels,  
        'public' => true,  
        'publicly_queryable' => true,  
        'show_ui' => true,   
        'show_in_menu' => true,   
        'query_var' => true,  
        'rewrite' => true,   
        'capability_type' => 'post',  
        'has_archive' => true,   
        'hierarchical' => false,  
        // on the supports param here you see no 'editor'  
        'supports' => array('title','author','thumbnail','excerpt','comments')    
    ); 

There is a built in WordPress function for this, remove_post_type_support http://codex.wordpress.org/Function_Reference/remove_post_type_support .

In your case you could use something like

add_action( 'init', 'my_custom_init' );
function my_custom_init() {
    remove_post_type_support( 'custom_post_type_name', 'editor' );
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.