注册自定义帖子类型时,请显式设置功能类型;
register_post_type( \'my_type\', array(
\'capability_type\' => \'my_type\',
// other args
) );
现在,默认情况下,只有超级管理员才能添加/编辑/删除它们,直到您授予其他角色相关的功能(例如,正如@tnorthcutt所建议的,使用
Members Plugin).
[edit_post] => edit_my_type
[read_post] => read_my_type
[delete_post] => delete_my_type
[edit_posts] => edit_my_type
[edit_others_posts] => edit_others_my_type
[publish_posts] => publish_my_type
[read_private_posts] => read_private_my_type