use get_user_count() in get_sitestats()

git-svn-id: http://svn.automattic.com/wordpress/trunk@15621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu 2010-09-15 20:13:31 +00:00
parent 95ccbb88cf
commit 91ab066e89
1 changed files with 1 additions and 9 deletions

View File

@ -11,16 +11,8 @@ function get_sitestats() {
global $wpdb; global $wpdb;
$stats['blogs'] = get_blog_count(); $stats['blogs'] = get_blog_count();
$stats['users'] = get_user_count();
$count_ts = get_site_option( 'user_count_ts' );
if ( time() - $count_ts > 3600 ) {
$count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users" );
update_site_option( 'user_count', $count );
update_site_option( 'user_count_ts', time() );
} else {
$count = get_site_option( 'user_count' );
}
$stats['users'] = $count;
return $stats; return $stats;
} }