From 97f28973da6e15e45a787ddb5b00033c160a117f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 2 Aug 2019 02:33:57 +0000 Subject: [PATCH] Twenty Fifteen: Prevent `author-bio.php` partial template from interfering with rendering an author archive of a user with the `bio` username. Props rclations, ianbelanger, lordlod, SergeyBiryukov. See #32096. Built from https://develop.svn.wordpress.org/trunk@45718 git-svn-id: http://core.svn.wordpress.org/trunk@45529 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfifteen/functions.php | 21 +++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/twentyfifteen/functions.php b/wp-content/themes/twentyfifteen/functions.php index 48ad929b5a..d47db9eb50 100644 --- a/wp-content/themes/twentyfifteen/functions.php +++ b/wp-content/themes/twentyfifteen/functions.php @@ -536,6 +536,27 @@ function twentyfifteen_widget_tag_cloud_args( $args ) { } add_filter( 'widget_tag_cloud_args', 'twentyfifteen_widget_tag_cloud_args' ); +/** + * Prevents `author-bio.php` partial template from interfering with rendering + * an author archive of a user with the `bio` username. + * + * @since Twenty Fifteen 2.6 + * + * @param string $template Template file. + * @return string Replacement template file. + */ +function twentyfifteen_author_bio_template( $template ) { + if ( is_author() ) { + $author = get_queried_object(); + if ( $author instanceof WP_User && 'bio' === $author->user_nicename ) { + return locate_template( array( 'archive.php', 'index.php' ) ); + } + } + + return $template; +} +add_filter( 'template_include', 'twentyfifteen_author_bio_template' ); + /** * Implement the Custom Header feature. diff --git a/wp-includes/version.php b/wp-includes/version.php index 2adb9f156d..41fcab97be 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45717'; +$wp_version = '5.3-alpha-45718'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.