WordPress.org

Make WordPress Core

Ticket #14320: get_user_count.diff

File get_user_count.diff, 625 bytes (added by scribu, 5 years ago)
  • wp-includes/ms-functions.php

     
    163163 
    164164        $count_ts = get_site_option( 'user_count_ts' ); 
    165165        if ( time() - $count_ts > 3600 ) { 
    166                 $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'") ); 
     166                $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(ID) as c FROM $wpdb->users") ); 
    167167                update_site_option( 'user_count', $count ); 
    168168                update_site_option( 'user_count_ts', time() ); 
    169169        }