函数原型
get_author_name( int $auth_id = false ): string
函数描述
Retrieve the specified author’s preferred display name.
是否弃用
Warning: This function has been deprecated. Use get_the_author_meta() instead.
函数参数
-
$auth_id
int
Optional - The ID of the author.
Default:
false
函数返回值
string The author’s display name.
函数位置
File: wp-includes/deprecated.php.
函数源码
function get_author_name( $auth_id = false ) {
_deprecated_function( __FUNCTION__, '2.8.0', 'get_the_author_meta(\'display_name\')' );
return get_the_author_meta('display_name', $auth_id);
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.8.0 | Use get_the_author_meta() |
| 1.0.0 | Introduced. |

