WC_Helper_Updater::expire_updates_cache │ public static │ WC 11.3.0

Forces a fresh update check while keeping the cached products, so they are still served if that check fails.

Method of the class: WC_Helper_Updater{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = WC_Helper_Updater::expire_updates_cache(): void;

Changelog

Since 11.3.0 Introduced.

WC_Helper_Updater::expire_updates_cache() code WC 11.3.0

public static function expire_updates_cache(): void {
	$data = get_transient( '_woocommerce_helper_updates' );
	if ( is_array( $data ) && isset( $data['hash'] ) ) {
		$data['expired'] = true;
		set_transient( '_woocommerce_helper_updates', $data, WEEK_IN_SECONDS );
	}

	delete_transient( '_woocommerce_helper_updates_count' );
	delete_site_transient( 'update_plugins' );
	delete_site_transient( 'update_themes' );
}