Filter hook 'comment_notification_text'

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

View Source

comment_notification_text

Filter Hook
Description
Filters the comment notification email text.

Hook Information

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

Hook Parameters

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

Usage Examples

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

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

Source Code Context

wp-includes/pluggable.php:1865 - How this hook is used in WordPress core
<?php
1860  			 * @since 1.5.2
1861  			 *
1862  			 * @param string $notify_message The comment notification email text.
1863  			 * @param string $comment_id     Comment ID as a numeric string.
1864  			 */
1865  			$notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID );
1866  
1867  			/**
1868  			 * Filters the comment notification email subject.
1869  			 *
1870  			 * @since 1.5.2

PHP Documentation

<?php
/**
			 * Filters the comment notification email text.
			 *
			 * @since 1.5.2
			 *
			 * @param string $notify_message The comment notification email text.
			 * @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.