Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Twenty Thirteen: Make twentythirteen_author_bio_template() use auth…
…or 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
  • Loading branch information
SergeyBiryukov committed Aug 2, 2019
1 parent ce00f0b commit 73e1cdf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wp-content/themes/twentythirteen/functions.php
Expand Up @@ -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' ) ) :
/**
Expand Down

0 comments on commit 73e1cdf

Please sign in to comment.