Filter hook 'comment_moderation_headers'

in WP Core File wp-includes/pluggable.php at line 1966

View Source

comment_moderation_headers

Filter Hook
Description
Filters the comment moderation email headers.

Hook Information

File Location wp-includes/pluggable.php View on GitHub
Hook Type Filter
Line Number 1966

Hook Parameters

Type Name Description
string $message_headers Headers for the comment moderation email.
int $comment_id Comment ID.

Usage Examples

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

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

Source Code Context

wp-includes/pluggable.php:1966 - How this hook is used in WordPress core
<?php
1961  		 * @since 2.8.0
1962  		 *
1963  		 * @param string $message_headers Headers for the comment moderation email.
1964  		 * @param int    $comment_id      Comment ID.
1965  		 */
1966  		$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );
1967  
1968  		foreach ( $emails as $email ) {
1969  			$user = get_user_by( 'email', $email );
1970  
1971  			if ( $user ) {

PHP Documentation

<?php
/**
		 * Filters the comment moderation email headers.
		 *
		 * @since 2.8.0
		 *
		 * @param string $message_headers Headers for the comment moderation email.
		 * @param int    $comment_id      Comment ID.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.