显示指向当前评论作者的html电子邮件链接。
原型
comment_author_email_link( string $linktext = '', string $before = '', string $after = '', int|WP_Comment $comment = null )
描述
应注意保护电子邮件地址,并确保电子邮件收集者不会捕获你的评论者的电子邮件地址。大多数人认为他们的电子邮件地址不会以原始形式出现在网站上。这样做将使任何人,包括那些人们不想获得电子邮件地址并使用它自己的方式好坏的人。
参数
$linktext
(string)
(Optional)
要显示的文本而不是评论作者的电子邮件地址。
$before
(string)
(Optional)
在电子邮件链接之前显示的文本或HTML。
$after
(string)
(Optional)
电子邮件链接后显示的文本或HTML。
$comment
(int|WP_Comment)
(Optional)
注释ID或WP_Comment对象。默认是当前评论。
源文件
路径:wp-includes/comment-template.php
<?php
...
function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) {
if ( $link = get_comment_author_email_link( $linktext, $before, $after, $comment ) ) {
echo $link;
}
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/comment_author_email_link/