Skip to content

Commit b823913

Browse files
Apply suggestion from @westonruter
Co-authored-by: Weston Ruter <[email protected]>
1 parent f276d53 commit b823913

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/wp-includes/comment.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,13 +2427,16 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24272427
$comment = get_comment( $comment_id );
24282428
$is_note = ( $comment && 'note' === $comment->comment_type );
24292429

2430-
$maybe_notify = $is_note ? get_option( 'wp_notes_notify' ) : get_option( 'comments_notify' );
2431-
24322430
// By default, only notify for approved comments and notes.
24332431
if (
24342432
! isset( $comment->comment_approved ) ||
2435-
( '1' !== $comment->comment_approved && ! $is_note ) ) {
2436-
$maybe_notify = false;
2433+
( '1' !== $comment->comment_approved && ! $is_note )
2434+
) {
2435+
$maybe_notify = false;
2436+
} else if ( $is_note ) {
2437+
$maybe_notify = get_option( 'wp_notes_notify' );
2438+
} else {
2439+
$maybe_notify = get_option( 'comments_notify' )
24372440
}
24382441

24392442
/**

0 commit comments

Comments
 (0)