diff --git a/includes/server/activities/create.php b/includes/server/activities/create.php index 4067eb9..049d6e6 100644 --- a/includes/server/activities/create.php +++ b/includes/server/activities/create.php @@ -149,6 +149,9 @@ function sync_comments( $activity ) { if ( ! $parent_comment ) { return; } + if ( ! \comments_open( $parent_comment->comment_post_ID ) ) { + return; + } $comment = make_comment_from_object( $object, $parent_comment->comment_post_ID, $parent_comment_id ); $comment_id = \wp_new_comment( $comment ); link_new_comment( $comment_id, $object_id ); @@ -163,6 +166,9 @@ function sync_comments( $activity ) { if ( $post_id === 0 ) { return; } + if ( ! \comments_open( $post_id ) ) { + return; + } $comment = make_comment_from_object( $object, $post_id, $parent_comment_id ); $comment_id = \wp_new_comment( $comment ); link_new_comment( $comment_id, $object_id );