Merge pull request #18242 from lipemat/fix/date-args-wpcli-wc-product_review

Fix --date_created and --date_created_gmt args for wc product_review
This commit is contained in:
Claudiu Lodromanean 2017-12-20 10:07:18 -08:00 committed by GitHub
commit 59ccb00e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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 );
}