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.

Ive created a custom post type and I want to hide the main textarea content in the publish/edit page.

Is it possible ?

Thanks!

share|improve this question
add comment

2 Answers 2

up vote 10 down vote accepted

Yes, remove the editor support from your custom post type.

You can do it in two ways.

  1. While registering your custom post type:

Example:

$args = array(
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true, 
    'show_in_menu' => true, 
    'capability_type' => 'post',
    'has_archive' => true, 
    'supports' => array('title','author','thumbnail','excerpt','comments')
); 
register_post_type('book',$args);

2.Using the remove_post_type support if the custom post type is not defined by your code (i.e some other plugin/theme has defined custom post type).

Example:

add_action('init', 'my_rem_editor_from_post_type');
function my_rem_editor_from_post_type() {
    remove_post_type_support( <POST TYPE>, 'editor' );
}
share|improve this answer
    
You can upload files using the media manager, or build your own custom meta box to handle the uploads. –  Hameedullah Khan May 24 '11 at 9:52
add comment

When registering your custom post type don't specify support for editor.

 $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,
    'menu_position' => null,
    // on the supports param here you see no 'editor'
    'supports' => array('title','author','thumbnail','excerpt','comments') 
  ); 
  register_post_type('book',$args);

More information See: Function Reference/register post type.

share|improve this answer
add comment

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.