diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 0b07d53d6942c..e04cbb43117b2 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -714,11 +714,6 @@ function wp_allow_comment( $commentdata, $wp_error = false ) { $dupe_id = $wpdb->get_var( $dupe ); - // Allow duplicate notes for resolution purposes. - if ( isset( $commentdata['comment_type'] ) && 'note' === $commentdata['comment_type'] ) { - $dupe_id = false; - } - /** * Filters the ID, if any, of the duplicate comment found when creating a new comment. * diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 4ab82ff7f0e0f..7fe79b57c1b9b 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -714,7 +714,11 @@ public function create_item( $request ) { ); } - $prepared_comment['comment_approved'] = wp_allow_comment( $prepared_comment, true ); + // Don't check for duplicates or flooding for notes. + $prepared_comment['comment_approved'] = + 'note' === $prepared_comment['comment_type'] ? + '1' : + wp_allow_comment( $prepared_comment, true ); if ( is_wp_error( $prepared_comment['comment_approved'] ) ) { $error_code = $prepared_comment['comment_approved']->get_error_code();