Automattic\WooCommerce\Blocks
BlockPatterns::get_pattern_cache()
Gets block pattern cache.
Method of the class: BlockPatterns{}
No Hooks.
Return
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 9.6.1
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; }