Make WordPress Core

Ticket #17582: found_users_query.17582.diff

File found_users_query.17582.diff, 769 bytes (added by scribu, 14 years ago)
  • wp-includes/user.php

     
    545545                        $this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
    546546                }
    547547
    548                 if ( $this->query_vars['count_total'] )
    549                         $this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where");
     548                if ( $this->query_vars['count_total'] ) {
     549                        $found_users_query = apply_filters( 'found_users_query', "SELECT COUNT(*) $this->query_from $this->query_where", $this );
     550                        $this->total_users = $wpdb->get_var( $found_users_query );
     551                }
    550552
    551553                if ( !$this->results )
    552554                        return;