最新公告
  • 欢迎您光临知事网软件APP资源下载站,一个优质的手机App应用商店和网站源码基地。欢迎加入永久SVIP
  • WordPress函数get_the_author()用法 获取当前文章作者名称

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

    描述:

    获取当前文章的作者名称

    用法:

    <?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()用法 获取当前文章作者名称

    发表评论

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

    [!--temp.right--]
    请选择支付方式
    ×
    余额支付
    ×
    微信扫码支付 0 元