我已经创建了一个自定义帖子类型“book”。所有书籍帖子类型都是公共的,因此我想删除一些功能,如“delete\\u private\\u books”、“read\\u private\\u books”等。我如何实现这一点,因为当我激活成员插件时,它会显示所有默认功能,包括上述与我的自定义帖子类型无关的功能。
我已经注册了我的post type book并为其添加了功能。
$labels = array(
\'name\' => _x( \'Books\', \'post type general name\' ),
\'singular_name\' => _x( \'Book\', \'post type singular name\' ),
\'menu_name\' => _x( \'Book\', \'admin menu\' ),
\'name_admin_bar\' => _x( \'Book\', \'add new on admin bar\' ),
\'add_new\' => _x( \'Add New\', \'Book\' ),
\'add_new_item\' => __( \'Add New Book\' ),
\'new_item\' => __( \'New Books\' ),
\'edit_item\' => __( \'Edit Books\' ),
\'view_item\' => __( \'View Books\' ),
\'all_items\' => __( \'Books\' ),
\'search_items\' => __( \'Search Books\' ),
\'parent_item_colon\' => __( \'Parent text:\' ),
\'not_found\' => __( \'No Books found.\' ),
\'not_found_in_trash\' => __( \'No Books found in Trash.\' )
);
$capabilities = array(
\'edit_post\' => \'edit_books\',
\'read_post\' => \'read_books\',
\'delete_post\' => \'delete_books\',
\'edit_posts\' => \'edit_books\',
\'edit_others_posts\' => \'edit_others_books\',
\'publish_posts\' => \'publish_books\',
\'read_private_posts\' => \'read_private_books\',
\'create_posts\' => \'edit_books\',
\'delete_posts\' => \'delete_books\',
\'delete_private_posts\' => \'delete_private_books\',
\'delete_published_posts\' => \'delete_published_books\',
\'delete_others_posts\' => \'delete_others_books\',
\'edit_private_posts\' => \'edit_private_books\',
\'edit_published_posts\' => \'edit_published_books\',
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'show_in_menu\' => false,
\'query_var\' => true,
\'rewrite\' => array(\'slug\' => \'books\'),
\'capability_type\' => \'books\',
\'has_archive\' => true,
\'hierarchical\' => false,
\'menu_position\' => \'\',
\'supports\' => false,
\'map_meta_cap\' => null,
\'capabilities\' => $capabilities,
);
register_post_type( \'wp-type-books\', $args );