get_the_author()
get_the_author( string $deprecated = ” ) 检索当前文章的作者。Retr…
get_the_author( string $deprecated = ” )
检索当前文章的作者。
Retrieve the author of the current post.
目录锚点:#参数#返回#源码#笔记
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $deprecated | (string) | 可选 | 已弃用。 |
返回(Return)
(string|null)作者的显示名称。
源码(Source)
/**
* Retrieve the author of the current post.
*
* @since 1.5.0
*
* @global object $authordata The current author's DB object.
*
* @param string $deprecated Deprecated.
* @return string|null The author's display name.
*/
function get_the_author($deprecated = '') {
global $authordata;
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.1' );
/**
* Filter 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);
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.5.0 | wp-includes/author-template.php:23 | 6 | 3 |
笔记(Notes)
获取作者的“公共”名称
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!