Automattic\WooCommerce\Blocks\Domain\Services

Hydration::restore_cached_store_notices │ protected │ WC 1.0

Restore notices into current session from cache, only if a snapshot was taken this cycle.

Method of the class: Hydration{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->restore_cached_store_notices();

Hydration::restore_cached_store_notices() code WC 11.1.2

protected function restore_cached_store_notices() {
	if ( ! did_action( 'woocommerce_init' ) || null === WC()->session || ! is_array( $this->cached_store_notices ) ) {
		return;
	}

	wc_set_notices( $this->cached_store_notices );
	$this->cached_store_notices = null;
}