Title: get_users with custom role?
Last modified: August 20, 2016

---

# get_users with custom role?

 *  [electrolund](https://wordpress.org/support/users/electrolund/)
 * (@electrolund)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/get_users-with-custom-role/)
 * Hello, I’m testing this plugin with my site. I’m attempting to retrieve a list
   of users in a newly created role called “approved_authors”. I did this by:
 * `$approved_authors = get_users('role=Approved-author');`
 * But this string does not contain the data that I expect. Are the custom role 
   handles not usable to get_users?
 * [http://wordpress.org/extend/plugins/advanced-access-manager/](http://wordpress.org/extend/plugins/advanced-access-manager/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [vasyl_m](https://wordpress.org/support/users/vasyl_m/)
 * (@vasyl_m)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/get_users-with-custom-role/#post-3566451)
 * Hi **electrolund**,
    I’m not sure that you are using the get_users function correctly.
   As far as I know, this function expects an array as a first parameter, not a 
   string.
 *  Regards,
    Vasyl
 *  Thread Starter [electrolund](https://wordpress.org/support/users/electrolund/)
 * (@electrolund)
 * [13 years ago](https://wordpress.org/support/topic/get_users-with-custom-role/#post-3566471)
 * Thanks for the reply, Vasyl! According to the codex, one of the valid args of
   get_users is ‘role’
 * > role – Limit the returned authors to the role specified.
 * Example code on the [function page](http://codex.wordpress.org/Function_Reference/get_users):
 * `$blogusers = get_users('blog_id=1&orderby=nicename&role=subscriber');`
 * So it would be soooooo nice if your plugin could export the custom user role 
   names. I hope that makes sense.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘get_users with custom role?’ is closed to new replies.

 * ![](https://ps.w.org/advanced-access-manager/assets/icon-256x256.png?rev=3447421)
 * [Advanced Access Manager – Access Governance for WordPress](https://wordpress.org/plugins/advanced-access-manager/)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-access-manager/reviews/)

## Tags

 * [get_users](https://wordpress.org/support/topic-tag/get_users/)

 * 2 replies
 * 2 participants
 * Last reply from: [electrolund](https://wordpress.org/support/users/electrolund/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/get_users-with-custom-role/#post-3566471)
 * Status: not resolved