Filter hook 'author_email'

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

View Source

author_email

Filter Hook
Description
Filters the comment author's email for display.

Hook Information

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

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.

Usage Examples

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

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

Source Code Context

wp-includes/comment-template.php:140 - How this hook is used in WordPress core
<?php
 135  	 * @since 4.1.0 The `$comment_id` parameter was added.
 136  	 *
 137  	 * @param string $comment_author_email The comment author's email address.
 138  	 * @param string $comment_id           The comment ID as a numeric string.
 139  	 */
 140  	echo apply_filters( 'author_email', $comment_author_email, $comment->comment_ID );
 141  }
 142  
 143  /**
 144   * Displays the HTML email link to the author of the current comment.
 145   *

PHP Documentation

<?php
/**
	 * Filters the comment author's email for display.
	 *
	 * @since 1.2.0
	 * @since 4.1.0 The `$comment_id` parameter was added.
	 *
	 * @param string $comment_author_email The comment author's email address.
	 * @param string $comment_id           The comment ID as a numeric string.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.