WC_REST_Orders_V2_Controller::get_collection_params
Get the query params for collections.
Method of the class: WC_REST_Orders_V2_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_Orders_V2_Controller = new WC_REST_Orders_V2_Controller(); $WC_REST_Orders_V2_Controller->get_collection_params();
WC_REST_Orders_V2_Controller::get_collection_params() WC REST Orders V2 Controller::get collection params code WC 10.3.6
public function get_collection_params() {
$params = parent::get_collection_params();
$params['status'] = array(
'default' => 'any',
'description' => __( 'Limit result set to orders assigned a specific status.', 'woocommerce' ),
'type' => 'string',
'enum' => array_merge( array( 'any', OrderStatus::TRASH ), $this->get_order_statuses() ),
'sanitize_callback' => 'sanitize_key',
'validate_callback' => 'rest_validate_request_arg',
);
$params['customer'] = array(
'description' => __( 'Limit result set to orders assigned a specific customer.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['product'] = array(
'description' => __( 'Limit result set to orders assigned a specific product.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['dp'] = array(
'default' => wc_get_price_decimals(),
'description' => __( 'Number of decimal points to use in each resource.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order_item_display_meta'] = array(
'default' => false,
'description' => __( 'Only show meta which is meant to be displayed for an order.', 'woocommerce' ),
'type' => 'boolean',
'sanitize_callback' => 'rest_sanitize_boolean',
'validate_callback' => 'rest_validate_request_arg',
);
$params['include_meta'] = array(
'default' => array(),
'description' => __( 'Limit meta_data to specific keys.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'string',
),
'sanitize_callback' => 'wp_parse_list',
);
$params['exclude_meta'] = array(
'default' => array(),
'description' => __( 'Ensure meta_data excludes specific keys.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'string',
),
'sanitize_callback' => 'wp_parse_list',
);
return $params;
}