Make WordPress Core

Ticket #15888: 15888.diff

File 15888.diff, 994 bytes (added by scribu, 14 years ago)
  • wp-includes/author-template.php

     
    284284
    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();
    290292        foreach ( (array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row )
    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 )
    296299                        continue;