use get_user_count() in get_sitestats()
git-svn-id: https://develop.svn.wordpress.org/trunk@15621 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
322e323b26
commit
98d1045606
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user