Automattic\WooCommerce\Blocks

AssetsController::get_block_asset_resource_hints_cache()privateWC 1.0

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

Метод класса: AssetsController{}

Хуков нет.

Возвращает

Массив|null. Array of resource hints.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_block_asset_resource_hints_cache();

Код AssetsController::get_block_asset_resource_hints_cache() WC 9.7.1

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;
}