WordPress.org

Make WordPress Core

Ticket #15479: total.15479.diff

File total.15479.diff, 675 bytes (added by scribu, 7 years ago)
  • wp-includes/user.php

     
    534534                if ( !$this->results )
    535535                        return;
    536536
    537                 if ( $this->query_vars['count_total'] )
    538                         $this->total_users = $wpdb->get_var("SELECT COUNT($wpdb->users.ID) $this->query_from $this->query_where $this->query_orderby $this->query_limit");
     537                if ( $this->query_vars['count_total'] ) {
     538                        $this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where");
     539                }
    539540
    540541                if ( 'all_with_meta' == $this->query_vars['fields'] ) {
    541542                        cache_users( $this->results );