Answers for "wordpress custom post type disable add new"

PHP
0

wordpress custom post type disable add new

register_post_type( 'custom_post_type_name', array(
  'capability_type' => 'post',
  'capabilities' => array(
    'create_posts' => false, // Removes support for the "Add New" function ( use 'do_not_allow' instead of false for multisite set ups )
  ),
  'map_meta_cap' => true, // Set to `false`, if users are not allowed to edit/delete existing posts
));
Posted by: Guest on September-21-2021

Code answers related to "wordpress custom post type disable add new"

Browse Popular Code Answers by Language