WordPress.org

Make WordPress Core

Changeset 17100


Ignore:
Timestamp:
12/21/2010 04:27:34 PM (7 years ago)
Author:
ryan
Message:

Retrieve only IDs and then do a user fetch loop so that all required user data is present. Props scribu. fixes #15888

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/author-template.php

    r16425 r17100  
    285285    $return = '';
    286286
    287     $authors = get_users( wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number' ) ) );
     287    $query_args = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number' ) );
     288    $query_args['fields'] = 'ids';
     289    $authors = get_users( $query_args );
    288290
    289291    $author_count = array();
     
    291293        $author_count[$row->post_author] = $row->count;
    292294
    293     foreach ( $authors as $author ) {
     295    foreach ( $authors as $author_id ) {
     296        $author = get_userdata( $author_id );
    294297
    295298        if ( $exclude_admin && 'admin' == $author->display_name )
Note: See TracChangeset for help on using the changeset viewer.