[wp-trac] [WordPress Trac] #20010: get_user does not returns specific roles

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 10 15:13:31 UTC 2012


#20010: get_user does not returns specific roles
--------------------------+-----------------------------
 Reporter:  dejudicibus   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Users         |    Version:  3.3.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If I use get_users to return only the 'authors' by using the following
 code:


 {{{
 $user_options = array(
   'orderby' => 'display_name',
   'order'   => 'ASC',
   'role'    => 'author',
   'who'     => 'authors'
 );
 $all_authors = get_users($users_options);
 foreach ($all_authors as $author) {
  if ($author->ID > 1) {
    /* do something */
  }
 }
 }}}

 I get back all users but admin, that is, also subscribers.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20010>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list