Advanced Access Manager
get_users with custom role? (3 posts)

  1. electrolund
    Posted 3 years ago #

    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?


  2. Vasyltech
    Plugin Author

    Posted 3 years ago #

    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.


  3. electrolund
    Posted 3 years ago #

    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:

    $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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Access Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic