检索当前帖子的作者。
原型
get_the_author( string $deprecated = '' )
参数
$deprecated
(string)
(Optional)
已过时。
返回值
(string|null)
作者的显示名称。
源文件
路径:wp-includes/author-template.php
<?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 $authordata->display_name The author's display name.
*/
return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/get_the_author/