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

Built from https://develop.svn.wordpress.org/trunk@49843


git-svn-id: http://core.svn.wordpress.org/trunk@49562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2020-12-20 14:37:04 +00:00
parent 0fe844c9c9
commit 5007f1ce13
2 changed files with 3 additions and 3 deletions

View File

@ -597,8 +597,8 @@ class WP {
$GLOBALS['single'] = 1;
}
if ( $wp_query->is_author() && isset( $wp_query->post ) ) {
$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
if ( $wp_query->is_author() ) {
$GLOBALS['authordata'] = get_userdata( get_queried_object_id() );
}
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-49842';
$wp_version = '5.7-alpha-49843';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.