wp_new_comment_notify_moderator

The timeline below displays how wordpress function wp_new_comment_notify_moderator has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Sends a comment moderation notification to the comment moderator.
 *
 * @since 4.4.0
 *
 * @param int $comment_id ID of the comment.
 * @return bool True on success, false on failure.
 */
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/pluggable.php */
    $maybe_notify = apply_filters('notify_moderator', $maybe_notify, $comment_id);
    if (!$maybe_notify) {
        return false;
    }
    return wp_notify_moderator($comment_id);
}

WordPress Version: 6.1

/**
 * Sends a comment moderation notification to the comment moderator.
 *
 * @since 4.4.0
 *
 * @param int $comment_ID ID of the comment.
 * @return bool True on success, false on failure.
 */
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);
}

WordPress Version: 4.4

/**
 * Send a comment moderation notification to the comment moderator.
 *
 * @since 4.4.0
 *
 * @param int $comment_ID ID of the comment.
 * @return bool True on success, false on failure.
 */
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);
}