显示当前全球$评论作者的电子邮件。
原型
comment_author_email( int|WP_Comment $comment_ID )
描述
应注意保护电子邮件地址,并确保电子邮件收集者不会捕获你的评论者的电子邮件地址。大多数人认为他们的电子邮件地址不会以原始形式出现在网站上。这样做将使任何人,包括那些人们不想获得电子邮件地址并使用它自己的方式好坏的人。
参数
$comment_ID
(int|WP_Comment)
(Optional)
WP_Comment或要为其打印作者电子邮件的评论的ID。默认当前评论。
源文件
路径:wp-includes/comment-template.php
<?php
...
function comment_author_email( $comment_ID = 0 ) {
$comment = get_comment( $comment_ID );
$author_email = get_comment_author_email( $comment );
/**
* Filters the comment author's email for display.
*
* @since 1.2.0
* @since 4.1.0 The `$comment_ID` parameter was added.
*
* @param string $author_email The comment author's email address.
* @param int $comment_ID The comment ID.
*/
echo apply_filters( 'author_email', $author_email, $comment->comment_ID );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/comment_author_email/