Automattic\WooCommerce\Caching

ObjectCache::flush()publicWC 1.0

Remove all the objects from the cache. This is done by forcing the generation of a new cache key prefix and leaving the old cached objects to expire.

{} Это метод класса: ObjectCache{}

Возвращает

null. Ничего.

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

$ObjectCache = new ObjectCache();
$ObjectCache->flush(): void;

Код ObjectCache::flush() WC 6.9.4

public function flush(): void {
	delete_option( $this->cache_key_prefix_option_name );
	$this->cache_key_prefix = null;

	/**
	 * Action triggered by an instance of ObjectCache after it flushes all the cached objects.
	 *
	 * @since 6.8.0
	 *
	 * @param ObjectCache $cache_instance The instance of ObjectCache whose 'flush` method has been called.
	 * @param CacheEngine $engine The cache engine in use.
	 */
	do_action( "woocommerce_after_flushing_{$this->object_type}_cache", $this, $this->get_cache_engine() );
}