A WordPress-centric search engine for devs and theme authors



wp_new_comment_notify_moderator ›

Since4.4.0
Deprecatedn/a
wp_new_comment_notify_moderator ( $comment_ID )
Parameters:
  • (int) $comment_ID ID of the comment.
    Required: Yes
Returns:
  • (bool) True on success, false on failure.
Defined at:
Codex:

Send a comment moderation notification to the comment moderator.



Source

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 );
}