📌  相关文章
📜  wordpress 自定义帖子类型禁用添加新 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:43.874000             🧑  作者: Mango

代码示例1
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
));