wc_object_cache_get_engine хук-фильтрWC 6.8.0

Filters the underlying cache engine to be used by an instance of ObjectCache.

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

add_filter( 'wc_object_cache_get_engine', 'wp_kama_wc_object_cache_get_engine_filter', 10, 2 );

/**
 * Function for `wc_object_cache_get_engine` filter-hook.
 * 
 * @param CacheEngine $engine         The cache engine to be used by default.
 * @param ObjectCache $cache_instance The instance of ObjectCache that will use the cache engine.
 *
 * @return CacheEngine
 */
function wp_kama_wc_object_cache_get_engine_filter( $engine, $cache_instance ){

	// filter...
	return $engine;
}
$engine(CacheEngine)
The cache engine to be used by default.
$cache_instance(ObjectCache)
The instance of ObjectCache that will use the cache engine.

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

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

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

ObjectCache::get_cache_engine()
wc_object_cache_get_engine
woocommerce/src/Caching/ObjectCache.php 126
$this->cache_engine = apply_filters( 'wc_object_cache_get_engine', $engine, $this );

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

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