File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2474,13 +2474,16 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24742474 $ comment = get_comment ( $ comment_id );
24752475 $ is_note = ( $ comment && 'note ' === $ comment ->comment_type );
24762476
2477- $ maybe_notify = $ is_note ? get_option ( 'wp_notes_notify ' , 1 ) : get_option ( 'comments_notify ' );
2478-
24792477 // By default, only notify for approved comments and notes.
24802478 if (
24812479 ! isset ( $ comment ->comment_approved ) ||
2482- ( '1 ' !== $ comment ->comment_approved && ! $ is_note ) ) {
2483- $ maybe_notify = false ;
2480+ ( '1 ' !== $ comment ->comment_approved && ! $ is_note )
2481+ ) {
2482+ $ maybe_notify = false ;
2483+ } else if ( $ is_note ) {
2484+ $ maybe_notify = get_option ( 'wp_notes_notify ' , 1 );
2485+ } else {
2486+ $ maybe_notify = get_option ( 'comments_notify ' );
24842487 }
24852488
24862489 /**
@@ -2489,7 +2492,7 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24892492 * all notes and for approved comments.
24902493 *
24912494 * @since 4.4.0
2492- * @since 6.9.0 Comment approval status is checked before this filter.
2495+ * @since 6.9.0 Comment approval status is checked before this filter.
24932496 *
24942497 * @param bool $maybe_notify Whether to notify the post author about the new comment.
24952498 * @param int $comment_id The ID of the comment for the notification.
You can’t perform that action at this time.
0 commit comments