我在Wordpress中有自定义角色......
add_role('teacher_assistant', 'Teacher Assistant', array(
'read' => true,
'edit_posts' => true,
'delete_posts' => true,
'edit_others_posts' => true,
'edit_others_pages' => true,
'edit_published_posts' =>true,
'edit_pages' =>true,
'read_private_posts' => true,
'moderate_comments' => true,
));
......除了一个小问题外,它的工作正常。当我想将帖子的作者更改为其他人时,任何具有“教师助理”角色的人都不会出现在作者的选择列表中。似乎只有管理员可以选择。
有谁知道这里发生了什么以及如何解决它(没有插件)?
提前致谢。
答案 0 :(得分:0)
据我所知,如果新的所需作者具有作者或更高的角色,您只能更改帖子的作者。
您遇到的解决方案显然会有效,但会设置教师助理角色Contributor。这是你想要的吗?因为他们对订户有更多的权力。
答案 1 :(得分:-1)
我刚刚找到了一个有效的解决方案:
$ teacher_assistant = get_role('teacher_assistant'); $ teacher_assistant-> add_cap( 'LEVEL_1');