Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How do I remove Editor in custom post type keeping the Add media button. When I used as following in custom post type declaration, it removes the Add Media button and I don't need editor in my post type.

'supports' => array( 'title', 'thumbnail' ),

Thanks

share|improve this question
2  
Why not just use the media uploader/flow directly? Maybe in a custom meta box. –  chrisguitarguy Jan 7 '13 at 17:32
    
Thanks for the tip. But is there a native way to do this? –  G45 Jan 8 '13 at 15:42

1 Answer 1

WordPress uses the function wp_editor() and there are no parameter that will disable the textarea (what i can see). So i think that you can just hide it with some css.

function wpse_78595_hide_editor() {
    global $current_screen;

    if( $current_screen->post_type == 'custom_post_type_name' ) {
        $css = '<style type="text/css">';
            $css .= '#wp-content-editor-container, #post-status-info, .wp-switch-editor { display: none; }';
        $css .= '</style>';

        echo $css;
    }
}
add_action('admin_footer', 'wpse_78595_hide_editor');
share|improve this answer
    
I had the same situation as the OP, and also found nothing, ended up using CSS as well. –  brasofilo Jan 8 '13 at 16:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.