wppaste
WordPress

apply_filters( 'comment_email', string $comment_author_email, WP_Comment $comment )

Since
1.2.0, 4.1.0
Filters the comment author's email for display.

Description

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

Compatibility

WordPress
since 4.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$comment_author_emailstring
The comment author's email address.
$commentWP_Comment
The comment object.

Where this hook fires · 2

  • wp-admin/includes/class-wp-comments-list-table.php:1010WP_Comments_List_Table::column_author()
  • wp-includes/comment-template.php:203get_comment_author_email_link()

Source code

<?php	 * @since 1.2.0	 * @since 4.1.0 The `$comment` parameter was added.	 *	 * @param string     $comment_author_email The comment author's email address.	 * @param WP_Comment $comment              The comment object.	 */	$comment_author_email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); 	if ( ( ! empty( $comment_author_email ) ) && ( '@' !== $comment_author_email ) ) {		$display = ( '' !== $link_text ) ? $link_text : $comment_author_email; 		$comment_author_email_link = $before . sprintf(			'<a href="%1$s">%2$s</a>',

Changelog

Introduced in 1.2.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.1.0
The $comment parameter was added.from the docblock
1.2.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.