From 17ba0ec01200edfb6ffaf5a738d2eef223817ce3 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Thu, 19 Nov 2015 00:05:37 +0000 Subject: [PATCH] Template: Get the author name directly from `$authordata`. Since [25574] `$authordata` gets set up in `WP::register_globals()` - no need to take a detour over the queried object. Props greenshady for initial patch. Fixes #34516. git-svn-id: https://develop.svn.wordpress.org/trunk@35700 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index da19b813f4..beae029b13 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -872,8 +872,8 @@ function wp_get_document_title() { $title['title'] = sprintf( __( 'Search Results for “%s”' ), get_search_query() ); // If on an author archive, use the author's display name. - } elseif ( is_author() && $author = get_queried_object() ) { - $title['title'] = $author->display_name; + } elseif ( is_author() ) { + $title['title'] = get_the_author(); // If on a post type archive, use the post type archive title. } elseif ( is_post_type_archive() ) {