WordPress.org

Make WordPress Core

Ticket #45105: 45105.diff

File 45105.diff, 896 bytes (added by billerickson, 3 years ago)
  • src/wp-includes/author-template.php

    diff --git a/src/wp-includes/author-template.php b/src/wp-includes/author-template.php
    index 43945cde8a..cef8cc9453 100644
    a b function wp_list_authors( $args = '' ) { 
    440440                $author_count[ $row->post_author ] = $row->count;
    441441        }
    442442        foreach ( $authors as $author_id ) {
    443                 $author = get_userdata( $author_id );
     443                $posts = isset( $author_count[ $author->ID ] ) ? $author_count[ $author->ID ] : 0;
    444444
    445                 if ( $args['exclude_admin'] && 'admin' == $author->display_name ) {
     445                if ( ! $posts && $args['hide_empty'] ) {
    446446                        continue;
    447447                }
    448448
    449                 $posts = isset( $author_count[ $author->ID ] ) ? $author_count[ $author->ID ] : 0;
     449                $author = get_userdata( $author_id );
    450450
    451                 if ( ! $posts && $args['hide_empty'] ) {
     451                if ( $args['exclude_admin'] && 'admin' == $author->display_name ) {
    452452                        continue;
    453453                }
    454454