woocommerce_rest_product_review_collection_params filter-hookWC 3.5.0

Filter collection parameters for the reviews controller.

This filter registers the collection parameter, but does not map the collection parameter to an internal WP_Comment_Query parameter. Use the wc_rest_review_query filter to set WP_Comment_Query parameters.

Usage

add_filter( 'woocommerce_rest_product_review_collection_params', 'wp_kama_woocommerce_rest_product_review_collection_params_filter' );

/**
 * Function for `woocommerce_rest_product_review_collection_params` filter-hook.
 * 
 * @param array $params JSON Schema-formatted collection parameters.
 *
 * @return array
 */
function wp_kama_woocommerce_rest_product_review_collection_params_filter( $params ){

	// filter...
	return $params;
}
$params(array)
JSON Schema-formatted collection parameters.

Changelog

Since 3.5.0 Introduced.

Where the hook is called

WC_REST_Product_Reviews_Controller::get_collection_params()
woocommerce_rest_product_review_collection_params
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-product-reviews-controller.php 1040
return apply_filters( 'woocommerce_rest_product_review_collection_params', $params );

Where the hook is used in WooCommerce

Usage not found.