Automattic\WooCommerce\Admin\API

Orders::get_collection_params()publicWC 1.0

Get the query params for collections.

Method of the class: Orders{}

No Hooks.

Return

Array.

Usage

$Orders = new Orders();
$Orders->get_collection_params();

Orders::get_collection_params() code WC 8.7.0

public function get_collection_params() {
	$params = parent::get_collection_params();
	// This needs to remain a string to support extensions that filter Order Number.
	$params['number'] = array(
		'description'       => __( 'Limit result set to orders matching part of an order number.', 'woocommerce' ),
		'type'              => 'string',
		'validate_callback' => 'rest_validate_request_arg',
	);
	// Fix the default 'status' value until it can be patched in core.
	$params['status']['default'] = array( 'any' );

	// Analytics settings may affect the allowed status list.
	$params['status']['items']['enum'] = ReportsController::get_order_statuses();

	return $params;
}