Automattic\WooCommerce\Caches

OrderCacheController::temporarily_disable_orders_cache_usagepublicWC 1.0

Temporarily disable the order cache if it's enabled.

This is a purely in-memory operation: a variable is created with the value of the current enable status for the feature, and this variable is checked by orders_cache_usage_is_enabled. In the next request the feature will be again enabled or not depending on how the feature is set.

Method of the class: OrderCacheController{}

No Hooks.

Returns

null. Nothing (null).

Usage

$OrderCacheController = new OrderCacheController();
$OrderCacheController->temporarily_disable_orders_cache_usage(): void;

OrderCacheController::temporarily_disable_orders_cache_usage() code WC 10.6.2

public function temporarily_disable_orders_cache_usage(): void {
	if ( $this->orders_cache_usage_is_temporarly_disabled() ) {
		return;
	}

	$this->orders_cache_usage_backup = $this->orders_cache_usage_is_enabled();
}