[REST API] Fixed product reviews schema and content
This commit is contained in:
parent
d987fb95b9
commit
17a80c863e
|
@ -743,7 +743,7 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $request['review'] ) ) {
|
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'] ) ) {
|
if ( isset( $request['product_id'] ) ) {
|
||||||
|
@ -847,11 +847,11 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller {
|
||||||
),
|
),
|
||||||
'product_id' => array(
|
'product_id' => array(
|
||||||
'description' => __( 'Unique identifier for the product that the review belongs to.', 'woocommerce' ),
|
'description' => __( 'Unique identifier for the product that the review belongs to.', 'woocommerce' ),
|
||||||
'type' => 'string',
|
'type' => 'integer',
|
||||||
'context' => array( 'view', 'edit' ),
|
'context' => array( 'view', 'edit' ),
|
||||||
),
|
),
|
||||||
'status' => array(
|
'status' => array(
|
||||||
'description' => __( 'Status of the review', 'woocommerce' ),
|
'description' => __( 'Status of the review.', 'woocommerce' ),
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => 'approved',
|
'default' => 'approved',
|
||||||
'enum' => array( 'approved', 'hold', 'spam', 'unspam', 'trash', 'untrash' ),
|
'enum' => array( 'approved', 'hold', 'spam', 'unspam', 'trash', 'untrash' ),
|
||||||
|
|
Loading…
Reference in New Issue