File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments