0

I recently asked a question the other day and got what I was looking for. Today I put that knowledge to practice, but I can't seem to figure how to remove the title and editor fields from the "edit" page.

Below shows the arguments I'm using with register_post_type. Logically, I think providing an empty array for "supports" would make it not support anything by default. Am I missing something?

        $v_args = array(
                'labels' => array (
                        'name' => 'Visitors',
                        'singular_name' => 'Visitor',
                        'add_new_item' => 'Register New Visitor',
                    ),
                'public' => true,
                'publicly_queryable' => false,
                'exclude_from_search' => true,
                'show_ui' => true,
                'hiearchical' => false,
                'supports' => array( ),
            );

Thanks,
-Zack

3

You were close .) This works:

'supports' => array( '' ),
  • 1
    I knew I was going to slap myself when the answer came. Thank you ;) – Zack Jan 10 '11 at 22:27
  • The trick is that you need to get past empty(). Just array() won't work, but array( '' ) will. – Jan Fabry Jan 14 '11 at 15:58
0

I think you need something in there. Title & Editor are the defaults when nothing is present, so adding something may remove those two (though I've never tested it), i.e.:

'author' 'thumbnail' 'excerpt' 'trackbacks' 'custom-fields' 'comments' 'revisions' 'page-attributes'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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