Automattic\WooCommerce\Internal\Admin\Reports

ProductSearchQuery::get_collection_param │ public static │ WC 11.2.0

Returns the REST collection parameter definition for the product search.

Method of the class: ProductSearchQuery{}

No Hooks.

Returns

array. Parameter definition.

Usage

$result = ProductSearchQuery::get_collection_param();

Changelog

Since 11.2.0 Introduced.

ProductSearchQuery::get_collection_param() code WC 11.3.0

public static function get_collection_param() {
	return array(
		'description'       => __( 'Limit result to products whose name or SKU matches any of the given terms.', 'woocommerce' ),
		'type'              => 'array',
		'sanitize_callback' => array( self::class, 'parse_terms' ),
		'validate_callback' => 'rest_validate_request_arg',
		'items'             => array(
			'type' => 'string',
		),
	);
}