create_users capabilities on a role on multisite

I'm having some issues regarding a user's capability on a multisite. So, I have a network of sites and on each

I'm having some issues regarding a user's capability on a multisite. So, I have a network of sites and on each site I want a role (Local Admin) to be able to create users.

I've added the capabilities to that role and added a user to that role. When I log in as the user and dump their the returned data from get_userdata function I see the correct role and create_users is set to true. However when I use current_user_can( 'create_users', wp_get_current_user() ) I get false.

What am I missing? Are there any specific capabilities I need to add because I'm using multisite? Any help appreciated!

Thanks.

I'm having some issues regarding a user's capability on a multisite. So, I have a network of sites and on each site I want a role (Local Admin) to be able to create users.

I've added the capabilities to that role and added a user to that role. When I log in as the user and dump their the returned data from get_userdata function I see the correct role and create_users is set to true. However when I use current_user_can( 'create_users', wp_get_current_user() ) I get false.

What am I missing? Are there any specific capabilities I need to add because I'm using multisite? Any help appreciated!

Thanks.

Share Improve this question asked Oct 14, 2016 at 11:22 sjhudasjhuda 113 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 5

I ran into the same problem. It's easily solved by going into the Network Admin > Settings page. Look for the label "Add New Users" and make sure this option is checked: Allow site administrators to add new users to their site via the "Users → Add New" page.

Once you do this, the local admin will be able to add users. This is assuming they also have the capabilities list_users and create_users. I recommend this full list of related user capabilities be given:

  • list_users
  • create_users
  • promote_users
  • edit_users
  • remove_users
  • delete_users

According to the Codex article on Roles and Capabilities, the Administrator of any site within Multisite would have the ability to create users.

With that said, why not add users as Admins instead of creating a new role and adding capabilities?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744845206a4596792.html

相关推荐

  • create_users capabilities on a role on multisite

    I'm having some issues regarding a user's capability on a multisite. So, I have a network of sites and on each

    2天前
    70

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信