(hook_prefix)collection_params filter-hookWC 10.2.0

Filter the collection params.

Usage

add_filter( '(hook_prefix)collection_params', 'wp_kama_hook_prefixcollection_params_filter', 10, 2 );

/**
 * Function for `(hook_prefix)collection_params` filter-hook.
 * 
 * @param array $params The collection params.
 * @param       $that   
 *
 * @return array
 */
function wp_kama_hook_prefixcollection_params_filter( $params, $that ){

	// filter...
	return $params;
}
$params(array)
The collection params.
$that
-

Changelog

Since 10.2.0 Introduced.

Where the hook is called

AbstractController::get_collection_params()
(hook_prefix)collection_params
woocommerce/src/Internal/RestApi/Routes/V4/AbstractController.php 107
return apply_filters( $this->get_hook_prefix() . 'collection_params', $params, $this );

Where the hook is used in WooCommerce

woocommerce/includes/class-wc-brands.php 74
add_filter( 'rest_product_collection_params', array( $this, 'rest_api_product_collection_params' ), 10, 2 );
woocommerce/src/Blocks/BlockTypes/ProductCollection/Controller.php 80
add_filter( 'rest_product_collection_params', array( $this, 'extend_rest_query_allowed_params' ), 10, 1 );
woocommerce/src/Blocks/BlockTypes/ProductQuery.php 86
add_filter( 'rest_product_collection_params', array( $this, 'extend_rest_query_allowed_params' ), 10, 1 );