Make WordPress Core

Ticket #45105: 45105.1.diff

File 45105.1.diff, 869 bytes (added by ianbelanger, 6 years ago)
  • src/wp-includes/author-template.php

     
    442442                $author_count[ $row->post_author ] = $row->count;
    443443        }
    444444        foreach ( $authors as $author_id ) {
    445                 $author = get_userdata( $author_id );
     445                $posts = isset( $author_count[ $author_id ] ) ? $author_count[ $author_id ] : 0;
    446446
    447                 if ( $args['exclude_admin'] && 'admin' == $author->display_name ) {
     447                if ( ! $posts && $args['hide_empty'] ) {
    448448                        continue;
    449449                }
    450450
    451                 $posts = isset( $author_count[ $author->ID ] ) ? $author_count[ $author->ID ] : 0;
     451                $author = get_userdata( $author_id );
    452452
    453                 if ( ! $posts && $args['hide_empty'] ) {
     453                if ( $args['exclude_admin'] && 'admin' == $author->display_name ) {
    454454                        continue;
    455455                }
    456456