Filter hook 'comment_moderation_subject'

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

View Source

comment_moderation_subject

Filter Hook
Description
Filters the comment moderation email subject.

Hook Information

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

Hook Parameters

Type Name Description
string $subject Subject of the comment moderation email.
int $comment_id Comment ID.

Usage Examples

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

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

Source Code Context

wp-includes/pluggable.php:2067 - How this hook is used in WordPress core
<?php
2062  			 * @since 1.5.2
2063  			 *
2064  			 * @param string $subject    Subject of the comment moderation email.
2065  			 * @param int    $comment_id Comment ID.
2066  			 */
2067  			$subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );
2068  
2069  			wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
2070  
2071  			if ( $switched_locale ) {
2072  				restore_previous_locale();

PHP Documentation

<?php
/**
			 * Filters the comment moderation email subject.
			 *
			 * @since 1.5.2
			 *
			 * @param string $subject    Subject of 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.