Automattic\WooCommerce\Blocks

AssetsController::get_block_asset_resource_hints_cacheprivateWC 1.0

Get the block asset resource hints in the cache or null if not found.

Method of the class: AssetsController{}

No Hooks.

Returns

Array|null. Array of resource hints.

Usage

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

AssetsController::get_block_asset_resource_hints_cache() code WC 9.9.4

private function get_block_asset_resource_hints_cache() {
	if ( wp_is_development_mode( 'plugin' ) ) {
		return null;
	}

	$cache = get_site_transient( 'woocommerce_block_asset_resource_hints' );

	$current_version = array(
		'woocommerce' => WOOCOMMERCE_VERSION,
		'wordpress'   => get_bloginfo( 'version' ),
	);

	if ( isset( $cache['version'] ) && $cache['version'] === $current_version ) {
		return $cache['files'];
	}

	return null;
}