[wp-trac] [WordPress Trac] #22921: Allow get_users() to return array of values via 'fields' parameter

WordPress Trac noreply at wordpress.org
Thu Dec 13 17:55:18 UTC 2012


#22921: Allow get_users() to return array of values via 'fields' parameter
-------------------------------------+------------------------------
 Reporter:  chipbennett              |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Users                    |     Version:  3.5
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------------------

Comment (by chipbennett):

 Return an array of user email addresses, such as:
 {{{
 $user_emails = get_users( array( 'fields' => 'user_email' ) );
 }}}

 This usage eliminates the step of looping through the array of objects
 otherwise returned, to pluck out the email addresses.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22921#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list