[wp-trac] [WordPress Trac] #28064: Can't sort list of Users by Name
WordPress Trac
noreply at wordpress.org
Wed Apr 30 12:35:00 UTC 2014
#28064: Can't sort list of Users by Name
--------------------------+------------------------------
Reporter: bobonwhidbey | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version: 3.1
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Changes (by jesin):
* version: 3.9 => 3.1
Comment:
I was able to reproduce this issue.
[[Image(http://i.imgur.com/UanznGO.png)]]
When users are sorted by the Name column the following arguments are
passed to `WP_User_Query`.
{{{
$args = array(
'number' => 20,
'offset' => 0,
'role' => '',
'search' => '',
'fields' => 'all_with_meta',
'orderby' => 'name',
'order' => desc
);
}}}
Here `'orderby' => 'name'` is the same as `username`.
I have [[http://pastebin.com/unj2Ww5G | a patch]] that sets the `orderby`
to `meta_value` and `meta_key` to `first_name` but if the **First Name**
field is empty and the Last Name filled this bug appears again.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28064#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list