最新公告
  • 欢迎您光临站盟网(原知事网),一个优质的网站源码基地、精品网站模板和插件。欢迎加入永久SVIP
  • WordPress函数get_the_author()用法 获取当前文章作者名称

    正文概述 知事网   2020-09-11 11:09   564

    描述:

    获取当前文章的作者名称

    用法:

    <?php $author = get_the_author(); ?>

    参数:

    $deprecated
    
    (string) (可选) Deprecated.
    
    默认值: ''

    源文件:

    /**
    * 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);
    }

    站盟网 » WordPress函数get_the_author()用法 获取当前文章作者名称

    发表评论

    还没有评论,快来抢沙发吧!

    如需帝国cms功能定制以及二次开发请联系我们

    联系作者
    请选择支付方式
    ×
    支付宝支付
    微信支付
    余额支付
    ×
    微信扫码支付 0 元