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
This commit is contained in:
Peter Westwood 2010-01-31 21:32:39 +00:00
parent 35677e6860
commit 3a5f8c0ead

View File

@ -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 );
}
/**