0 votes
1 view
in Web Technology by (47.8k points)

Is there any way to disable the option of adding a new post under a Custom Post Type in WordPress (3.0)? I've looked into labels and arguments but can't find anything that would resemble such a feature.

1 Answer

0 votes
by (107k points)

If you want to disable the option of adding a new post under a Custom Post Type in WordPress (3.0) then there is a meta capability create_posts that is used by WordPress to check before inserting the various 'Add New' buttons and links but this is not documented. You can see the code below:-

register_post_type( 'custom_post_type_name', array(

  'capability_type' => 'post',

  'capabilities' => array(

     'create_posts' => 'do_not_allow',), 

     'map_meta_cap' => true, 

    ));

Related questions

0 votes
1 answer
asked Aug 6, 2019 in Web Technology by Sammy (47.8k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...