Make WordPress Core


Ignore:
Timestamp:
12/17/2010 12:38:15 AM (16 years ago)
Author:
scribu
Message:

Make WP_User_Query return regular objects by default. Fixes #15854

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r16995 r17013  
    415415                                $this->query_fields[] = $wpdb->users . '.' . esc_sql( $field );
    416416                        $this->query_fields = implode( ',', $this->query_fields );
     417                } elseif ( 'all' == $qv['fields'] ) {
     418                        $this->query_fields = "$wpdb->users.*";
    417419                } else {
    418420                        $this->query_fields = "$wpdb->users.ID";
    … …  
    523525                global $wpdb;
    524526
    525                 if ( is_array( $this->query_vars['fields'] ) ) {
     527                if ( is_array( $this->query_vars['fields'] ) || 'all' == $this->query_vars['fields'] ) {
    526528                        $this->results = $wpdb->get_results("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
    527529                } else {
    … …  
    535537                        $this->total_users = $wpdb->get_var("SELECT COUNT($wpdb->users.ID) $this->query_from $this->query_where $this->query_orderby $this->query_limit");
    536538
    537                 if ( 'all' == $this->query_vars['fields'] ) {
    538                         cache_users($this->results);
     539                if ( 'all_with_meta' == $this->query_vars['fields'] ) {
     540                        cache_users( $this->results );
    539541
    540542                        $r = array();
Note: See TracChangeset for help on using the changeset viewer.