Support specific author templates by id or user_nicename. Fixes #12064 props nacin.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1d30c846c6
commit
e1ec3c052e
|
@ -710,7 +710,19 @@ function get_archive_template() {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_author_template() {
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue