是否可以在admin中的帖子列表显示屏上删除特定帖子类型中对“编辑”或“添加”的所有引用?
因此,基本上我需要的是,对于这种帖子类型,定义的所有角色,无论它们是什么,都只能查看这些帖子的列表,除了丢弃它们之外,不能对它们做任何事情。因此,这意味着删除“添加新的myposttype”按钮,以及列表帖子屏幕每个条目下的“编辑|快速编辑”链接。
在我的自定义帖子类型中,以下是我的功能相关设置:
\'capability_type\' => array(\'food_item\',\'food_items\'),
\'map_meta_cap\' => true,
\'capabilities\' => array(
\'publish_posts\' => \'publish_food_items\',
\'edit_posts\' => \'edit_food_items\',
\'edit_others_posts\' => \'edit_others_food_items\',
\'delete_posts\' => \'delete_food_items\',
\'delete_others_posts\' => \'delete_others_food_items\',
\'read_private_posts\' => \'read_private_food_items\',
\'edit_post\' => \'edit_food_item\',
\'delete_post\' => \'delete_food_item\',
\'read_post\' => \'read_food_item\'
在我的plugin init函数中,我添加了以下内容: global $wp_roles;
$wp_roles->add_cap( \'administrator\', \'edit_food_item\' );
$wp_roles->add_cap( \'administrator\', \'edit_food_items\' );
此时,管理员根本看不到菜单中的食物条目。