woocommerce_rest_api_cache_hooks_hash_data хук-фильтрWC 10.5.0

Filter the data used to generate the hooks hash for REST API response caching.

Использование

add_filter( 'woocommerce_rest_api_cache_hooks_hash_data', 'wp_kama_woocommerce_rest_api_cache_hooks_hash_data_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_api_cache_hooks_hash_data` filter-hook.
 * 
 * @param array  $cache_hash_data Hook callbacks data used for hash generation.
 * @param array  $hook_names      Hook names being tracked.
 * @param object $controller      Controller instance.
 *
 * @return array
 */
function wp_kama_woocommerce_rest_api_cache_hooks_hash_data_filter( $cache_hash_data, $hook_names, $controller ){

	// filter...
	return $cache_hash_data;
}
$cache_hash_data(массив)
Hook callbacks data used for hash generation.
$hook_names(массив)
Hook names being tracked.
$controller(объект)
Controller instance.

Список изменений

С версии 10.5.0 Введена.

Где вызывается хук

В файле: /src/Internal/Traits/RestApiCache.php
woocommerce_rest_api_cache_hooks_hash_data
woocommerce/src/Internal/Traits/RestApiCache.php 980-985
$cache_hash_data = apply_filters(
	'woocommerce_rest_api_cache_hooks_hash_data',
	$cache_hash_data,
	$hook_names,
	$this
);

Где используется хук в WooCommerce

Использование не найдено.