Prevent redundant wp_usermeta JOIN on single-site installs. See #14123

git-svn-id: http://svn.automattic.com/wordpress/trunk@16889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-12-13 11:41:00 +00:00
parent 244ad8dd17
commit 75478abd5c
1 changed files with 1 additions and 1 deletions

View File

@ -469,7 +469,7 @@ class WP_User_Query {
$role = trim( $qv['role'] );
$blog_id = absint( $qv['blog_id'] );
if ( $blog_id ) {
if ( $role || ( is_multisite() && $blog_id ) ) {
$cap_meta_query = array();
$cap_meta_query['key'] = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities';