函数原型
get_author_template(): string
函数描述
Retrieves path of author template in current or parent template.
是否弃用
未弃用
函数参数
无
函数返回值
string Full path to author template file.
函数位置
File: wp-includes/template.php.
函数源码
function get_author_template() {
$author = get_queried_object();
$templates = array();
if ( $author instanceof WP_User ) {
$templates[] = "author-{$author->user_nicename}.php";
$templates[] = "author-{$author->ID}.php";
}
$templates[] = 'author.php';
return get_query_template( 'author', $templates );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

