+ if ( ! empty( $prepared_args['comment_post_ID'] ) ) {
+ $post = get_post( $prepared_args['comment_post_ID'] );
+ if ( empty( $post ) ) {
+ return new WP_Error( 'rest_comment_invalid_post_id', __( 'Invalid post ID.' ), array( 'status' => 403 ) );
+ }
+ }
+