From 2710d12fc46ca428c31a0cfddc36eda0f0e68e9c Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Mon, 4 Apr 2016 14:13:29 -0500 Subject: [PATCH] Fixed reviews type --- includes/api/class-wc-rest-product-reviews-controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/api/class-wc-rest-product-reviews-controller.php b/includes/api/class-wc-rest-product-reviews-controller.php index 0fe1a27e3ee..118e8b01875 100644 --- a/includes/api/class-wc-rest-product-reviews-controller.php +++ b/includes/api/class-wc-rest-product-reviews-controller.php @@ -155,7 +155,7 @@ class WC_REST_Product_Reviews_Controller extends WP_REST_Controller { 'id' => (int) $review->comment_ID, 'date_created' => wc_rest_prepare_date_response( $review->comment_date_gmt ), 'review' => $review->comment_content, - 'rating' => get_comment_meta( $review->comment_ID, 'rating', true ), + 'rating' => (int) get_comment_meta( $review->comment_ID, 'rating', true ), 'reviewer_name' => $review->comment_author, 'reviewer_email' => $review->comment_author_email, 'verified' => wc_review_is_from_verified_owner( $review->comment_ID ), @@ -171,7 +171,7 @@ class WC_REST_Product_Reviews_Controller extends WP_REST_Controller { $response->add_links( $this->prepare_links( $review, $request ) ); /** - * Filter webhook delivery object returned from the REST API. + * Filter product reviews object returned from the REST API. * * @param WP_REST_Response $response The response object. * @param WP_Comment $review Product review object used to create response. @@ -230,7 +230,7 @@ class WC_REST_Product_Reviews_Controller extends WP_REST_Controller { ), 'rating' => array( 'description' => __( 'Review rating (0 to 5).', 'woocommerce' ), - 'type' => 'string', + 'type' => 'integer', 'context' => array( 'view' ), 'readonly' => true, ),