WordPress at Your Fingertips
function is not described


Orders::get_collection_params() public WC 1.0

Get the query params for collections.

{} It's a method of the class: Orders{}

No Hooks.




$Orders = new Orders();

Code of Orders::get_collection_params() WC 6.1.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;