Add user_nicename, nicename, ID to WP_User_Query orderby. props duck_, fixes #15816.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-12-15 17:18:04 +00:00
parent c9e1ab9bd9
commit e1ff72589d
1 changed files with 3 additions and 3 deletions

View File

@ -410,9 +410,9 @@ class WP_User_Query {
$this->query_where = " WHERE 1=1"; $this->query_where = " WHERE 1=1";
// sorting // sorting
if ( in_array( $qv['orderby'], array('email', 'url', 'registered') ) ) { if ( in_array( $qv['orderby'], array('nicename', 'email', 'url', 'registered') ) ) {
$orderby = 'user_' . $qv['orderby']; $orderby = 'user_' . $qv['orderby'];
} elseif ( in_array( $qv['orderby'], array('user_email', 'user_url', 'user_registered') ) ) { } elseif ( in_array( $qv['orderby'], array('user_nicename', 'user_email', 'user_url', 'user_registered') ) ) {
$orderby = $qv['orderby']; $orderby = $qv['orderby'];
} elseif ( 'name' == $qv['orderby'] || 'display_name' == $qv['orderby'] ) { } elseif ( 'name' == $qv['orderby'] || 'display_name' == $qv['orderby'] ) {
$orderby = 'display_name'; $orderby = 'display_name';
@ -426,7 +426,7 @@ class WP_User_Query {
) p ON ({$wpdb->users}.ID = p.post_author) ) p ON ({$wpdb->users}.ID = p.post_author)
"; ";
$orderby = 'post_count'; $orderby = 'post_count';
} elseif ( 'id' == $qv['orderby'] ) { } elseif ( 'ID' == $qv['orderby'] || 'id' == $qv['orderby'] ) {
$orderby = 'ID'; $orderby = 'ID';
} else { } else {
$orderby = 'user_login'; $orderby = 'user_login';