Automattic\WooCommerce\Internal\Caches

ProductTransientsDeferrer::flushprivateWC 1.0

Delete transients for all collected product IDs and reset the collection.

Method of the class: ProductTransientsDeferrer{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->flush(): void;

ProductTransientsDeferrer::flush() code WC 11.0.0

private function flush(): void {
	if ( empty( $this->deferred_product_ids ) ) {
		return;
	}

	$product_ids                = array_keys( $this->deferred_product_ids );
	$this->deferred_product_ids = array();
	$this->product_util->delete_product_transients_for_products( $product_ids );
}