From 73e1cdfa164f644627867790f3fb90e6bb2acc56 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 2 Aug 2019 03:08:06 +0000 Subject: [PATCH] Twenty Thirteen: Make `twentythirteen_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@45721 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentythirteen/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-content/themes/twentythirteen/functions.php b/src/wp-content/themes/twentythirteen/functions.php index 036fccac7c..a6ec2a7533 100644 --- a/src/wp-content/themes/twentythirteen/functions.php +++ b/src/wp-content/themes/twentythirteen/functions.php @@ -797,13 +797,14 @@ 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' ) ); + // 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', 'twentythirteen_author_bio_template' ); +add_filter( 'author_template', 'twentythirteen_author_bio_template' ); if ( ! function_exists( 'wp_body_open' ) ) : /**