From e2ea3f7f30619d4346df625ab889275ad7967a7b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 2 Aug 2019 02:34:52 +0000 Subject: [PATCH] Twenty Thirteen: 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. Fixes #32096. Built from https://develop.svn.wordpress.org/trunk@45719 git-svn-id: http://core.svn.wordpress.org/trunk@45530 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentythirteen/functions.php | 21 +++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 9c9049ecff..036fccac7c 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -784,6 +784,27 @@ function twentythirteen_widget_tag_cloud_args( $args ) { } add_filter( 'widget_tag_cloud_args', 'twentythirteen_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 Thirteen 3.0 + * + * @param string $template Template file. + * @return string Replacement template file. + */ +function twentythirteen_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', 'twentythirteen_author_bio_template' ); + if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. diff --git a/wp-includes/version.php b/wp-includes/version.php index 41fcab97be..f1c66b4d0d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45718'; +$wp_version = '5.3-alpha-45719'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.