Skip to content

Commit cdf5068

Browse files
Ensure $comment is WP_Comment
1 parent c67de29 commit cdf5068

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2466,7 +2466,7 @@ function wp_new_comment_notify_postauthor( $comment_id ) {
24662466
* @param WP_Comment $comment The comment object.
24672467
*/
24682468
function wp_new_comment_via_rest_notify_postauthor( $comment ) {
2469-
if ( 'note' === $comment->comment_type ) {
2469+
if ( $comment instanceof WP_Comment && 'note' === $comment->comment_type ) {
24702470
wp_new_comment_notify_postauthor( (int) $comment->comment_ID );
24712471
}
24722472
}

0 commit comments

Comments
 (0)