We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c217dd commit 9adf0e5Copy full SHA for 9adf0e5
1 file changed
src/wp-includes/comment.php
@@ -2472,13 +2472,13 @@ function wp_new_comment_notify_moderator( $comment_id ) {
2472
*/
2473
function wp_new_comment_notify_postauthor( $comment_id ) {
2474
$comment = get_comment( $comment_id );
2475
+ if ( ! ( $comment instanceof WP_Comment ) ) {
2476
+ return false;
2477
+ }
2478
$is_note = ( $comment && 'note' === $comment->comment_type );
2479
2480
// By default, only notify for approved comments and notes.
- if (
- ! isset( $comment->comment_approved ) ||
- ( '1' !== $comment->comment_approved && ! $is_note )
2481
- ) {
+ if ( '1' !== $comment->comment_approved && ! $is_note ) {
2482
$maybe_notify = false;
2483
} else if ( $is_note ) {
2484
$maybe_notify = get_option( 'wp_notes_notify', 1 );
0 commit comments