Filter hook 'comment_notification_subject'

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

View Source

comment_notification_subject

Filter Hook
Description
Filters the comment notification email subject.

Hook Information

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

Hook Parameters

Type Name Description
string $subject The comment notification email subject.
string $comment_id Comment ID as a numeric string.

Usage Examples

Basic Usage
<?php
// Hook into comment_notification_subject
add_filter('comment_notification_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:1875 - How this hook is used in WordPress core
<?php
1870  			 * @since 1.5.2
1871  			 *
1872  			 * @param string $subject    The comment notification email subject.
1873  			 * @param string $comment_id Comment ID as a numeric string.
1874  			 */
1875  			$subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID );
1876  
1877  			wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
1878  
1879  			if ( $switched_locale ) {
1880  				restore_previous_locale();

PHP Documentation

<?php
/**
			 * Filters the comment notification email subject.
			 *
			 * @since 1.5.2
			 *
			 * @param string $subject    The comment notification email subject.
			 * @param string $comment_id Comment ID as a numeric string.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.