woocommerce_after_serializing_(object_type)_for_caching filter-hookWC 6.8.0

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

Usage

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(array)
The already serialized object data.
$object(array|object)
The object before serialization.
$id
-

Changelog

Since 6.8.0 Introduced.

Where the hook is called

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 );

Where the hook is used in WooCommerce

Usage not found.