Automattic\WooCommerce\Internal\Caches

ProductTransientsDeferrer::stop_deferringpublicWC 1.0

Stop deferring product transient deletions.

When the outermost deferral ends, all collected product IDs are flushed.

Method of the class: ProductTransientsDeferrer{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ProductTransientsDeferrer = new ProductTransientsDeferrer();
$ProductTransientsDeferrer->stop_deferring(): void;

ProductTransientsDeferrer::stop_deferring() code WC 11.0.1

public function stop_deferring(): void {
	if ( 0 === $this->deferral_level ) {
		return;
	}

	--$this->deferral_level;
	if ( 0 === $this->deferral_level ) {
		remove_action( 'shutdown', array( $this, 'handle_shutdown' ), self::SHUTDOWN_HOOK_PRIORITY );
		$this->flush();
	}
}