wp_new_comment_notify_moderator() WordPress Function

wp_new_comment_notify_moderator() is a function that notifies the administrator of new comments that need to be moderated. This function is triggered when a comment is posted and the comment moderation setting is enabled.

wp_new_comment_notify_moderator( int $comment_ID ) #

Sends a comment moderation notification to the comment moderator.


Parameters

$comment_ID

(int)(Required)ID of the comment.


Top ↑

Return

(bool) True on success, false on failure.


Top ↑

Source

File: wp-includes/comment.php

function wp_new_comment_notify_moderator( $comment_ID ) {
	$comment = get_comment( $comment_ID );

	// Only send notifications for pending comments.
	$maybe_notify = ( '0' == $comment->comment_approved );

	/** This filter is documented in wp-includes/comment.php */
	$maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_ID );

	if ( ! $maybe_notify ) {
		return false;
	}

	return wp_notify_moderator( $comment_ID );
}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More