Merge pull request #23138 from woocommerce/fix/23103

REST API: Adds future status to list of allowed statuses
This commit is contained in:
Timmy Crawford 2019-03-27 13:19:32 -07:00 committed by GitHub
commit 9601bc64d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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(

View File

@ -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',
);

View File

@ -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',
);