Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix the stock_status query param for collections of products
Browse files Browse the repository at this point in the history
  • Loading branch information
ralucaStan committed Feb 17, 2021
1 parent afed80d commit 99c01b0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/StoreApi/Routes/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,15 @@ public function get_collection_params() {
);

$params['stock_status'] = array(
'description' => __( 'Limit result set to products with specified stock status.', 'woo-gutenberg-products-block' ),
'type' => 'array',
'items' => array(
'type' => 'string',
'description' => __( 'Limit result set to products with specified stock status.', 'woo-gutenberg-products-block' ),
'type' => 'array',
'items' => array(
'type' => 'string',
'enum' => array_keys( wc_get_product_stock_status_options() ),
'sanitize_callback' => 'sanitize_text_field',
'validate_callback' => 'rest_validate_request_arg',
),
'default' => [],
'sanitize_callback' => 'sanitize_text_field',
'validate_callback' => 'rest_validate_request_arg',

'default' => [],
);

$params['attributes'] = array(
Expand Down

0 comments on commit 99c01b0

Please sign in to comment.