Make WordPress Core


Ignore:
Timestamp:
12/20/2020 02:35:58 PM (6 years ago)
Author:
johnbillion
Message:

Query: Ensure the author archive title always shows the name of the queried author, regardless of whether there are results.

This brings the behaviour inline with the <title> element of the page which always shows the author name.

Props Tkama, subrataemfluence

Fixes #44183

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp.php

    r49095 r49843  
    598598                }
    599599
    600                 if ( $wp_query->is_author() && isset( $wp_query->post ) ) {
    601                         $GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
     600                if ( $wp_query->is_author() ) {
     601                        $GLOBALS['authordata'] = get_userdata( get_queried_object_id() );
    602602                }
    603603        }
Note: See TracChangeset for help on using the changeset viewer.