Skip to content

Commit

Permalink
[REST API] Fixed product reviews schema and content
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosanches committed Oct 18, 2018
1 parent d987fb9 commit 17a80c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/api/class-wc-rest-product-reviews-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ protected function prepare_item_for_database( $request ) {
}

if ( isset( $request['review'] ) ) {
$prepared_review['comment_content'] = $request['review'];
$prepared_review['comment_content'] = wp_filter_post_kses( $request['review'] );
}

if ( isset( $request['product_id'] ) ) {
Expand Down Expand Up @@ -847,11 +847,11 @@ public function get_item_schema() {
),
'product_id' => array(
'description' => __( 'Unique identifier for the product that the review belongs to.', 'woocommerce' ),
'type' => 'string',
'type' => 'integer',
'context' => array( 'view', 'edit' ),
),
'status' => array(
'description' => __( 'Status of the review', 'woocommerce' ),
'description' => __( 'Status of the review.', 'woocommerce' ),
'type' => 'string',
'default' => 'approved',
'enum' => array( 'approved', 'hold', 'spam', 'unspam', 'trash', 'untrash' ),
Expand Down

0 comments on commit 17a80c8

Please sign in to comment.