[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:39:24 UTC 2012
#22921: Allow get_users() to return array of values via 'fields' parameter
-------------------------------------+-------------------------
Reporter: chipbennett | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Users
Version: 3.5 | Severity: normal
Keywords: has-patch needs-testing |
-------------------------------------+-------------------------
Currently, the `'fields'` parameter in the arguments array for
`get_users()` only accepts either an array of user data fields, or the
string `'all'`. Both of these options cause `get_users()` to return an
array of object comprised of the specified user data. Passing any other
string value to `'fields'` causes `get_users()` to return an array of user
IDs.
Per the Codex:
> Array of objects, '''except when fields specifies a single field to be
returned, then an array of values is returned'''. If fields is set to
all_with_meta, it will return an array of WP_User objects.
This statement appears to be untrue, but would be incredibly useful if it
were true.
Patch adds this functionality to `get_users()`.
Potentially related: #18581
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22921>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list