diff --git a/wp-includes/user.php b/wp-includes/user.php index 73a5fab469..e74f87d5e7 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -855,7 +855,13 @@ function count_users( $strategy = 'time', $site_id = null ) { $result = array(); if ( 'time' == $strategy ) { - $avail_roles = wp_roles()->get_names(); + if ( is_multisite() && $site_id != get_current_blog_id() ) { + switch_to_blog( $site_id ); + $avail_roles = wp_roles()->get_names(); + restore_current_blog(); + } else { + $avail_roles = wp_roles()->get_names(); + } // Build a CPU-intensive query that will return concise information. $select_count = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index bd25b76da0..f2911a878b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41652'; +$wp_version = '4.9-alpha-41653'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.