Filter hook 'get_comment_author_email'

in WP Core File wp-includes/comment-template.php at line 108

View Source

get_comment_author_email

Filter Hook
Description
Filters the comment author's returned email address.

Hook Information

File Location wp-includes/comment-template.php View on GitHub
Hook Type Filter
Line Number 108

Hook Parameters

Type Name Description
string $comment_author_email The comment author's email address.
string $comment_id The comment ID as a numeric string.
WP_Comment $comment The comment object.

Usage Examples

Basic Usage
<?php
// Hook into get_comment_author_email
add_filter('get_comment_author_email', 'my_custom_filter', 10, 3);

function my_custom_filter($comment_author_email, $comment_id, $comment) {
    // Your custom filtering logic here
    return $comment_author_email;
}

Source Code Context

wp-includes/comment-template.php:108 - How this hook is used in WordPress core
<?php
 103  	 *
 104  	 * @param string     $comment_author_email The comment author's email address.
 105  	 * @param string     $comment_id           The comment ID as a numeric string.
 106  	 * @param WP_Comment $comment              The comment object.
 107  	 */
 108  	return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment );
 109  }
 110  
 111  /**
 112   * Displays the email of the author of the current global $comment.
 113   *

PHP Documentation

<?php
/**
	 * Filters the comment author's returned email address.
	 *
	 * @since 1.5.0
	 * @since 4.1.0 The `$comment_id` and `$comment` parameters were added.
	 *
	 * @param string     $comment_author_email The comment author's email address.
	 * @param string     $comment_id           The comment ID as a numeric string.
	 * @param WP_Comment $comment              The comment object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.