comment_email хук-фильтрWP 1.2.0

Filters the comment author's email for display.

Care should be taken to protect the email address and assure that email harvesters do not capture your commenter's email address.

Использование

add_filter( 'comment_email', 'wp_kama_comment_email_filter', 10, 2 );

/**
 * Function for `comment_email` filter-hook.
 * 
 * @param string     $comment_author_email The comment author's email address.
 * @param WP_Comment $comment              The comment object.
 *
 * @return string
 */
function wp_kama_comment_email_filter( $comment_author_email, $comment ){

	// filter...
	return $comment_author_email;
}
$comment_author_email(строка)
The comment author's email address.
$comment(WP_Comment)
The comment object.

Список изменений

С версии 1.2.0 Введена.
С версии 4.1.0 The $comment parameter was added.

Где вызывается хук

get_comment_author_email_link()
comment_email
WP_Comments_List_Table::column_author()
comment_email
wp-includes/comment-template.php 194
$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
wp-admin/includes/class-wp-comments-list-table.php 958
$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );

Где используется хук в WordPress

wp-includes/default-filters.php 293
add_filter( 'comment_email', 'antispambot' );