当前浏览:首页 / WordPress函数 / comment_author_url_link()

comment_author_url_link( string $linktext = '', string $before = '', string $after = '', int|WP_Comment $comment )

显示当前评论作者的URL的HTML链接

author 作者more...

comment 评论more...

linkmore...

urlmore...


参数

$linktext

(string)(可选) 显示文本,而不是评论作者的电子邮件地址。

默认值: ''

$before

(string)(可选) 要在电子邮件链接之前显示的文本或HTML。

默认值: ''

$after

(string)(可选) 在电子邮件链接后显示的文本或HTML。

默认值: ''

$comment

(int|WP_Comment)(可选) 评论ID或WP_Comment对象。默认值为当前评论。



源码

查看源码 官方文档


更新日志

版本描述
4.6.0添加了$comment参数。
0.71开始引入

使用示例

  • 示例1

    默认用法

    web site: <?php comment_author_url_link(); ?><br />
    
  • 示例2

    链接文本和样式

    将评论作者的URL显示为文本字符串“访问评论作者的网站”,并在链接前后添加项目符号以设置其样式。

    <?php comment_author_url_link('Visit Site of Comment Author', ' &bull; ', ' &bull; '); ?>
    

    • Visit Site of Comment Author •