Automattic\WooCommerce\Blocks

BlockPatterns::get_pattern_cacheprivateWC 1.0

Gets block pattern cache.

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

Хуков нет.

Возвращает

Массив|false. Returns an array of patterns if cache is found, otherwise false.

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

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

Код BlockPatterns::get_pattern_cache() WC 9.9.5

private function get_pattern_cache() {
	$pattern_data = get_site_transient( 'woocommerce_blocks_patterns' );

	if ( is_array( $pattern_data ) && WOOCOMMERCE_VERSION === $pattern_data['version'] ) {
		return $pattern_data['patterns'];
	}

	return false;
}