Reputation
947
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
1 14 34
Impact
~91k people reached

  • 0 posts edited
  • 0 helpful flags
  • 105 votes cast
Mar
13
awarded  Popular Question
Feb
22
awarded  Famous Question
Feb
2
awarded  Enlightened
Feb
2
awarded  Nice Answer
Jan
14
awarded  Popular Question
Oct
15
awarded  Popular Question
Aug
28
awarded  Popular Question
Jun
18
awarded  Nice Answer
Mar
14
awarded  Notable Question
Mar
6
awarded  Yearling
Jan
9
awarded  Popular Question
Jan
3
awarded  Notable Question
Dec
19
awarded  Nice Answer
Sep
17
awarded  Popular Question
Jul
25
comment Allow roles below admin to add subscribers only
FYI, I found that you have to have the following capabilities for this solution to work: create_users, edit_users and list_users. See a full explanation in my other comments. I hope that helps.
Jul
25
comment Allow roles below admin to add subscribers only
So, to recap, for this solution to work, a user have to have the following capabilities create_users, edit_users and list_users, to be able to create only users of other specific roles - where a role is selected from a drop-down menu on 'Add New User' admin screen. I hope that helps! :)
Jul
25
comment Allow roles below admin to add subscribers only
Ok, I've dug into the WP code for creating a user and figured out why it doesn't work. A user have to have edit_users capability to create a user with a role that's been selected from the drop-down menu. Otherwise, without edit_users capability a selected role from the drop-down is ignored and a default role is assigned to the new user (which is usually 'Subscriber' role, unless it was changed to something else). This is for standard non-multisite setup, multisite might need more capabilities for it to work.
Jul
24
asked What's the difference between Role and Meta capabilities; When to use map_meta_cap() filter
Jul
23
accepted How to correctly escape query variables to be used in WP_Query
Jul
22
comment Allow roles below admin to add subscribers only
I've got similar situation. I've added the following capabilities create_users and list_users. I've also added editable_roles filter, which displays a specific role correctly. However, when I create a new user it's always a 'subscriber' and not a custom role. Has anyone came across this issue?