mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Avoid a sanitize_key() call on ID, as this causes it to be lowercased. wp_dropdown_users() requires user_login as a fallback; specify it for get_users(). see #21767.
git-svn-id: http://core.svn.wordpress.org/trunk@24719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3b4f3dea29
commit
de7375b5d1
@ -392,8 +392,10 @@ class WP_User_Query {
|
||||
$qv['fields'] = array_unique( $qv['fields'] );
|
||||
|
||||
$this->query_fields = array();
|
||||
foreach ( $qv['fields'] as $field )
|
||||
$this->query_fields[] = $wpdb->users . '.' . sanitize_key( $field );
|
||||
foreach ( $qv['fields'] as $field ) {
|
||||
$field = 'ID' === $field ? 'ID' : sanitize_key( $field );
|
||||
$this->query_fields[] = "$wpdb->users.$field";
|
||||
}
|
||||
$this->query_fields = implode( ',', $this->query_fields );
|
||||
} elseif ( 'all' == $qv['fields'] ) {
|
||||
$this->query_fields = "$wpdb->users.*";
|
||||
@ -1029,7 +1031,7 @@ function wp_dropdown_users( $args = '' ) {
|
||||
extract( $r, EXTR_SKIP );
|
||||
|
||||
$query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who' ) );
|
||||
$query_args['fields'] = array( 'ID', $show );
|
||||
$query_args['fields'] = array( 'ID', 'user_login', $show );
|
||||
$users = get_users( $query_args );
|
||||
|
||||
$output = '';
|
||||
|
Loading…
Reference in New Issue
Block a user