Skip to content

Commit 1f16c40

Browse files
By default, only notify for approved comments and notes
1 parent 60a0681 commit 1f16c40

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/wp-includes/comment.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,6 +2429,13 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24292429

24302430
$maybe_notify = $is_note ? get_option( 'wp_notes_notify' ) : get_option( 'comments_notify' );
24312431

2432+
// By default, only notify for approved comments and notes.
2433+
if (
2434+
! isset( $comment->comment_approved ) ||
2435+
( '1' !== $comment->comment_approved && ! $is_note ) ) {
2436+
$maybe_notify = false;
2437+
}
2438+
24322439
/**
24332440
* Filters whether to send the post author new comment notification emails,
24342441
* overriding the site setting.
@@ -2448,13 +2455,6 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24482455
return false;
24492456
}
24502457

2451-
// Send notifications for approved comments and all notes.
2452-
if (
2453-
! isset( $comment->comment_approved ) ||
2454-
( '1' !== $comment->comment_approved && ! $is_note ) ) {
2455-
return false;
2456-
}
2457-
24582458
return wp_notify_postauthor( $comment_id );
24592459
}
24602460

0 commit comments

Comments
 (0)