From 7b26cd223f54a970a19e1abcf7d4a5ab59a25680 Mon Sep 17 00:00:00 2001 From: scribu Date: Sun, 5 Sep 2010 15:30:10 +0000 Subject: [PATCH] Fix meta query in WP_User_Query. See #14572 git-svn-id: http://svn.automattic.com/wordpress/trunk@15570 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 605be5b4b3..8b2746aadb 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -461,11 +461,11 @@ class WP_User_Query { $meta_queries[] = $cap_meta_query; } - $meta_queries[] = array( - 'meta_key' => @$qv['meta_key'], - 'meta_value' => @$qv['meta_key'], - 'meta_compare' => @$qv['meta_key'], - ); + $meta_query = array(); + foreach ( array( 'meta_key', 'meta_value', 'meta_compare' ) as $key ) + if ( isset( $qv[ $key ] ) ) + $meta_query[ $key ] = $qv[ $key ]; + $meta_queries[] = $meta_query; $meta_query_sql = _wp_meta_sql( $meta_queries, 'user_id', $wpdb->usermeta ); @@ -576,7 +576,7 @@ function get_users_of_blog( $id = '' ) { if ( empty($id) ) $id = (int) $blog_id; - + return get_users( array( 'blog_id' => $id ) ); }