diff --git a/includes/api/v1/class-wc-rest-product-reviews-controller.php b/includes/api/v1/class-wc-rest-product-reviews-controller.php index 12630df66f7..37237ae7992 100644 --- a/includes/api/v1/class-wc-rest-product-reviews-controller.php +++ b/includes/api/v1/class-wc-rest-product-reviews-controller.php @@ -475,6 +475,14 @@ class WC_REST_Product_Reviews_V1_Controller extends WC_REST_Controller { $prepared_review['comment_author_email'] = $request['email']; } + if ( isset( $request['date_created'] ) ) { + $prepared_review['comment_date'] = $request['date_created']; + } + + if ( isset( $request['date_created_gmt'] ) ) { + $prepared_review['comment_date_gmt'] = $request['date_created_gmt']; + } + return apply_filters( 'rest_preprocess_product_review', $prepared_review, $request ); }