817 reputation
1328
bio website dashaluna.com
location Brighton, United Kingdom
age
visits member for 4 years, 6 months
seen Apr 22 at 9:03

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?
Jul
21
awarded  Popular Question
Jul
2
awarded  Curious
Apr
17
revised Is it worth checking if class_exists when developing a plugin and how to do it?
Added a reason why the checks are required
Apr
15
asked Is it worth checking if class_exists when developing a plugin and how to do it?
Apr
1
comment WordPress function that makes HTML safe to be sent via AJAX request
Could you recommend a tutorial that explains in more details about json_encode and how to use it in context of ajax and WP? I'm getting confused with things that I found and there isn't a really good example and explanation on how to return an HTML snippet back to JS script.
Feb
26
answered Connect Users and Taxonomies
Feb
4
comment How to use create_term, edit_term, delete_term actions?
@Milo, you mentioned that "Note that you also can't output anything to the browser, that will cause it to fail." I was also trying to echo something to be able to check the input/output. Usually, you can do that in action hooks. I was wondering if you could explain further why you can't echo anything on the screen here. Many thanks.
Jan
31
accepted Sign in with social media accounts without creating a WP account