Automattic\WooCommerce\Caches

OrderCountCacheService::flush_cache │ public │ WC 11.2.0

Flush the order count cache for all order types.

Method of the class: OrderCountCacheService{}

No Hooks.

Returns

void. Nothing (null).

Usage

$OrderCountCacheService = new OrderCountCacheService();
$OrderCountCacheService->flush_cache();

Changelog

Since 11.2.0 Introduced.

OrderCountCacheService::flush_cache() code WC 11.2.1

public function flush_cache() {
	foreach ( wc_get_order_types( 'order-count' ) as $order_type ) {
		$this->order_count_cache->flush( $order_type );
	}
}