From fcd9d28f10287ceaa3a12d4c3116b55789f55282 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 15 Apr 2010 21:24:52 +0000 Subject: [PATCH] Make sure is instantiated. see #12997 git-svn-id: http://svn.automattic.com/wordpress/trunk@14094 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index b771c9cf4..3227d51d8 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -418,7 +418,12 @@ function count_users($strategy = 'time') { $blog_prefix = $wpdb->get_blog_prefix($id); $result = array(); - if ('time' == $strategy) { + if ( 'time' == $strategy ) { + global $wp_roles; + + if ( ! isset( $wp_roles ) ) + $wp_roles = new WP_Roles(); + $avail_roles = $wp_roles->get_names(); // Build a CPU-intensive query that will return concise information.