将此添加到functions.php 请注意,您需要获取和编辑每个帖子类型(帖子、页面和附件)和分类法(类别和帖子标记)的功能。
您应该注意到,有比列出的功能更多的功能,但我不认为需要改变。因此,我建议您输出每个帖子类型的默认功能,并确定您需要更改哪些,以及应该更改哪些。
我还没有详细了解您需要设置什么样的权限,但我相信这个示例将使您只需要Editors 以上内容可以对帖子做任何事情。
有关的更多信息Roles and Capabilities, check out the Codex.
add_action(\'init\', \'my_change_post_object_cap\', 1);
function my_change_post_object_cap(){
$post = get_post_type_object(\'post\');
$post_cap = &$post->cap;
$post_cap->edit_post = \'edit_others_posts\';
$post_cap->read_post = \'edit_others_posts\';
$post_cap->delete_post = \'delete_others_posts\';
$post_cap->edit_posts = \'edit_others_posts\';
$post_cap->edit_others_posts = \'edit_others_posts\';
$post_cap->publish_posts = \'edit_others_posts\';
$post_cap->read = \'edit_others_posts\';
$post_cap->delete_posts = \'delete_others_posts\';
$post_cap->delete_published_posts = \'delete_others_posts\';
$post_cap->edit_published_posts = \'edit_others_posts\';
$post_cap->create_posts = \'edit_others_posts\';
$page = get_post_type_object(\'page\');
$page_cap = &$page->cap;
/** do the same as above, but for pages capabilities */
$attachment = get_post_type_object(\'attachment\');
$attachment_cap = &$attachment->cap;
/** do the same as above, but for attachment capabilities */
$category = get_taxonomy(\'category\');
$category_cap = $category->cap;
/** do the same as above, but for category capabilities */
$post_tag = get_taxonomy(\'post_tag\');
$post_tag_cap = $post_tag->cap;
/** do the same as above, but for post_tag capabilities */
}