Support `orderby => meta_value` in `WP_User_Query`. Adds unit test.

Props wpsmith.
Fixes #21581.


Built from https://develop.svn.wordpress.org/trunk@25331


git-svn-id: http://core.svn.wordpress.org/trunk@25293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2013-09-10 23:10:09 +00:00
parent 988caeb9a7
commit dbec80b469
1 changed files with 2 additions and 0 deletions

View File

@ -435,6 +435,8 @@ class WP_User_Query {
$orderby = 'post_count';
} elseif ( 'ID' == $qv['orderby'] || 'id' == $qv['orderby'] ) {
$orderby = 'ID';
} elseif ( 'meta_value' == $qv['orderby'] ) {
$orderby = "$wpdb->usermeta.meta_value";
} else {
$orderby = 'user_login';
}