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
This commit is contained in:
Sergey Biryukov 2019-08-02 03:08:06 +00:00
parent ce00f0b0f4
commit 73e1cdfa16

View File

@ -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' ) ) :
/**