Make WordPress Core

Changeset 17013


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

Make WP_User_Query return regular objects by default. Fixes #15854

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-users-list-table.php

    r16992 r17013  
    2828            'offset' => ( $paged-1 ) * $users_per_page,
    2929            'search' => $usersearch,
    30             'blog_id' => 0
     30            'blog_id' => 0,
     31            'fields' => 'all_with_meta'
    3132        );
    3233
  • trunk/wp-admin/includes/class-wp-users-list-table.php

    r16992 r17013  
    4848            'offset' => ( $paged-1 ) * $users_per_page,
    4949            'role' => $role,
    50             'search' => $usersearch
     50            'search' => $usersearch,
     51            'fields' => 'all_with_meta'
    5152        );
    5253
  • 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.