Filter hook 'notify_moderator'

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

View Source

notify_moderator

Filter Hook
Description
Filters whether to send the site moderator email notifications, overriding the site setting.

Hook Information

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

Hook Parameters

Type Name Description
bool $maybe_notify Whether to notify blog moderator.
int $comment_id The ID of the comment for the notification.

Usage Examples

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

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

Source Code Context

wp-includes/pluggable.php:1915 - How this hook is used in WordPress core
<?php
1910  		 * @since 4.4.0
1911  		 *
1912  		 * @param bool $maybe_notify Whether to notify blog moderator.
1913  		 * @param int  $comment_id   The ID of the comment for the notification.
1914  		 */
1915  		$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id );
1916  
1917  		if ( ! $maybe_notify ) {
1918  			return true;
1919  		}
1920  

PHP Documentation

<?php
/**
		 * Filters whether to send the site moderator email notifications, overriding the site setting.
		 *
		 * @since 4.4.0
		 *
		 * @param bool $maybe_notify Whether to notify blog moderator.
		 * @param int  $comment_id   The ID of the comment for the notification.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.