From 5007f1ce1323798c355d85fd83670487341058b7 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 20 Dec 2020 14:37:04 +0000 Subject: [PATCH] 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 `` 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 --- wp-includes/class-wp.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index 08976d6d1b..9e163ab633 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -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() ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index e411a65504..ff1704784b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.