diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index 1dea56f14e..ab388f82c5 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -144,6 +144,8 @@ function wp_title($sep = '»', $display = true) { $p = get_query_var('p'); $name = get_query_var('name'); $category_name = get_query_var('category_name'); + $author = get_query_var('author'); + $author_name = get_query_var('author_name'); // If there's a category if ( !empty($cat) ) { @@ -162,6 +164,16 @@ function wp_title($sep = '»', $display = true) { $title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'"); } + // If there's an author + if ( !empty($author) ) { + $title = get_userdata($author); + $title = $title->display_name; + } + if ( !empty($author_name) ) { + // We do a direct query here because we don't cache by nicename. + $title = $wpdb->get_var("SELECT display_name FROM $wpdb->users WHERE user_nicename = '$author_name'"); + } + // If there's a month if ( !empty($m) ) { $my_year = substr($m, 0, 4); @@ -684,4 +696,4 @@ function rsd_link() { echo '\n"; } -?> \ No newline at end of file +?>