From ce00f0b0f4246b6b8a61f617085d0e7161afdec8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 2 Aug 2019 03:07:58 +0000 Subject: [PATCH] Twenty Fifteen: Make `twentyfifteen_author_bio_template()` use author templates if exist, fall back to regular template hierarchy otherwise. See #32096. git-svn-id: https://develop.svn.wordpress.org/trunk@45720 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyfifteen/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-content/themes/twentyfifteen/functions.php b/src/wp-content/themes/twentyfifteen/functions.php index d47db9eb50..189a15cde9 100644 --- a/src/wp-content/themes/twentyfifteen/functions.php +++ b/src/wp-content/themes/twentyfifteen/functions.php @@ -549,13 +549,14 @@ 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' ) ); + // Use author templates if exist, fall back to template hierarchy otherwise. + return locate_template( array( "author-{$author->ID}.php", 'author.php' ) ); } } return $template; } -add_filter( 'template_include', 'twentyfifteen_author_bio_template' ); +add_filter( 'author_template', 'twentyfifteen_author_bio_template' ); /**