Automattic\WooCommerce\Blocks
BlockPatterns::get_pattern_cache
Gets block pattern cache.
Method of the class: BlockPatterns{}
No Hooks.
Returns
Array|false. Returns an array of patterns if cache is found, otherwise false.
Usage
// private - for code of main (parent) class only $result = $this->get_pattern_cache();
BlockPatterns::get_pattern_cache() BlockPatterns::get pattern cache code WC 10.7.0
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;
}