Merge pull request #23138 from woocommerce/fix/23103
REST API: Adds future status to list of allowed statuses
This commit is contained in:
commit
9601bc64d1
|
@ -751,7 +751,7 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller {
|
|||
'description' => __( 'Product status (post status).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'default' => 'publish',
|
||||
'enum' => array_keys( get_post_statuses() ),
|
||||
'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ),
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'featured' => array(
|
||||
|
|
|
@ -1781,7 +1781,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
'description' => __( 'Product status (post status).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'default' => 'publish',
|
||||
'enum' => array_keys( get_post_statuses() ),
|
||||
'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ),
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'featured' => array(
|
||||
|
@ -2588,7 +2588,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
'default' => 'any',
|
||||
'description' => __( 'Limit result set to products assigned a specific status.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'enum' => array_merge( array( 'any' ), array_keys( get_post_statuses() ) ),
|
||||
'enum' => array_merge( array( 'any', 'future' ), array_keys( get_post_statuses() ) ),
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
|
|
|
@ -1538,7 +1538,7 @@ class WC_REST_Products_V2_Controller extends WC_REST_Legacy_Products_Controller
|
|||
'description' => __( 'Product status (post status).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'default' => 'publish',
|
||||
'enum' => array_keys( get_post_statuses() ),
|
||||
'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ),
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'featured' => array(
|
||||
|
@ -2105,7 +2105,7 @@ class WC_REST_Products_V2_Controller extends WC_REST_Legacy_Products_Controller
|
|||
'default' => 'any',
|
||||
'description' => __( 'Limit result set to products assigned a specific status.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'enum' => array_merge( array( 'any' ), array_keys( get_post_statuses() ) ),
|
||||
'enum' => array_merge( array( 'any', 'future' ), array_keys( get_post_statuses() ) ),
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue