WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/02/2019 03:08:06 AM (4 months ago)
Author:
SergeyBiryukov
Message:

Twenty Thirteen: Make twentythirteen_author_bio_template() use author templates if exist, fall back to regular template hierarchy otherwise.

See #32096.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r45719 r45721  
    798798        $author = get_queried_object();
    799799        if ( $author instanceof WP_User && 'bio' === $author->user_nicename ) {
    800             return locate_template( array( 'archive.php', 'index.php' ) );
     800            // Use author templates if exist, fall back to template hierarchy otherwise.
     801            return locate_template( array( "author-{$author->ID}.php", 'author.php' ) );
    801802        }
    802803    }
     
    804805    return $template;
    805806}
    806 add_filter( 'template_include', 'twentythirteen_author_bio_template' );
     807add_filter( 'author_template', 'twentythirteen_author_bio_template' );
    807808
    808809if ( ! function_exists( 'wp_body_open' ) ) :
Note: See TracChangeset for help on using the changeset viewer.