Fix: Allow verified parameter to be set by REST API request (#50525)
* Rest API product review the verified parameter is not working * added changelog --------- Co-authored-by: 79mplus Admin <36501099+79mplus-admin@users.noreply.github.com>
This commit is contained in:
parent
27cc2028f9
commit
c8c8a6a56d
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Allow verified parameter to be set by REST API request
|
|
@ -472,6 +472,10 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller {
|
|||
|
||||
update_comment_meta( $review_id, 'rating', ! empty( $request['rating'] ) ? $request['rating'] : '0' );
|
||||
|
||||
if ( isset( $request['verified'] ) && ! empty( $request['verified'] ) ) {
|
||||
update_comment_meta( $review_id, 'verified', $request['verified'] );
|
||||
}
|
||||
|
||||
$review = get_comment( $review_id );
|
||||
|
||||
/**
|
||||
|
@ -586,6 +590,10 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller {
|
|||
update_comment_meta( $id, 'rating', $request['rating'] );
|
||||
}
|
||||
|
||||
if ( isset( $request['verified'] ) && ! empty( $request['verified'] ) ) {
|
||||
update_comment_meta( $id, 'verified', $request['verified'] );
|
||||
}
|
||||
|
||||
$review = get_comment( $id );
|
||||
|
||||
/** This action is documented in includes/api/class-wc-rest-product-reviews-controller.php */
|
||||
|
|
Loading…
Reference in New Issue