woocommerce_after_serializing_(object_type)_for_caching хук-фильтрWC 6.8.0

Filters the serialized object that will be passed by an instance of ObjectCache to its cache engine to be cached.

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

add_filter( 'woocommerce_after_serializing_(object_type)_for_caching', 'wp_kama_woocommerce_after_serializing_object_type_for_caching_filter', 10, 3 );

/**
 * Function for `woocommerce_after_serializing_(object_type)_for_caching` filter-hook.
 * 
 * @param array        $data   The already serialized object data.
 * @param array|object $object The object before serialization.
 * @param              $id     
 *
 * @return array
 */
function wp_kama_woocommerce_after_serializing_object_type_for_caching_filter( $data, $object, $id ){

	// filter...
	return $data;
}
$data(массив)
The already serialized object data.
$object(массив|объект)
The object before serialization.
$id
-

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

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

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

ObjectCache::set()
woocommerce_after_serializing_(object_type)_for_caching
woocommerce/src/Caching/ObjectCache.php 213
$data = apply_filters( "woocommerce_after_serializing_{$this->object_type}_for_caching", $data, $object, $id );

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

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