WC_REST_Orders_Controller::get_collection_params
Get the query params for collections.
Method of the class: WC_REST_Orders_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_Orders_Controller = new WC_REST_Orders_Controller(); $WC_REST_Orders_Controller->get_collection_params();
WC_REST_Orders_Controller::get_collection_params() WC REST Orders Controller::get collection params code WC 10.4.3
public function get_collection_params() {
$params = parent::get_collection_params();
$params['status'] = array(
'default' => 'any',
'description' => __( 'Limit result set to orders which have specific statuses.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'string',
'enum' => array_merge( array( 'any', OrderStatus::TRASH ), $this->get_order_statuses() ),
),
'validate_callback' => 'rest_validate_request_arg',
);
$params['created_via'] = array(
'description' => __( 'Limit result set to orders created via specific sources (e.g. checkout, admin).', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'string',
),
'validate_callback' => 'rest_validate_request_arg',
'sanitize_callback' => 'wp_parse_list',
);
return $params;
}