From 3a5f8c0ead9c31348b9e7b5d1fbf5d234785a0b5 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 31 Jan 2010 21:32:39 +0000 Subject: [PATCH] Support specific author templates by id or user_nicename. Fixes #12064 props nacin. git-svn-id: https://develop.svn.wordpress.org/trunk@12915 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index e44941a6c1..133f851738 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -710,7 +710,19 @@ function get_archive_template() { * @return string */ function get_author_template() { - return get_query_template('author'); + $author_id = absint( get_query_var( 'author' ) ); + $author = get_user_by( 'id', $author_id )->user_nicename; + + $templates = array(); + + if ( $author ) + $templates[] = "author-{$author}.php"; + if ( $author_id ) + $templates[] = "author-{$author_id}.php"; + $templates[] = 'author.php'; + + $template = locate_template( $templates ); + return apply_filters( 'author_template', $template ); } /**