WordPress.org

Make WordPress Core

Changeset 45720


Ignore:
Timestamp:
08/02/2019 03:07:58 AM (3 months ago)
Author:
SergeyBiryukov
Message:

Twenty Fifteen: Make twentyfifteen_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/twentyfifteen/functions.php

    r45718 r45720  
    550550        $author = get_queried_object();
    551551        if ( $author instanceof WP_User && 'bio' === $author->user_nicename ) {
    552             return locate_template( array( 'archive.php', 'index.php' ) );
     552            // Use author templates if exist, fall back to template hierarchy otherwise.
     553            return locate_template( array( "author-{$author->ID}.php", 'author.php' ) );
    553554        }
    554555    }
     
    556557    return $template;
    557558}
    558 add_filter( 'template_include', 'twentyfifteen_author_bio_template' );
     559add_filter( 'author_template', 'twentyfifteen_author_bio_template' );
    559560
    560561
Note: See TracChangeset for help on using the changeset viewer.