函数原型
get_the_author( string $deprecated = ” ): string|null
函数描述
Retrieves the author of the current post.
是否弃用
未弃用
函数参数
-
$deprecated
string
Optional - Deprecated.
Default:
''
函数返回值
string|null The author’s display name.
函数位置
File: wp-includes/author-template.php.
函数源码
function get_the_author( $deprecated = '' ) {
global $authordata;
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '2.1.0' );
}
/**
* Filters the display name of the current post's author.
*
* @since 2.9.0
*
* @param string|null $display_name The author's display name.
*/
return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

