Automattic\WooCommerce\Blocks\Patterns
PTKPatternsStore::get_patterns
Get the patterns from the Patterns Toolkit cache.
Method of the class: PTKPatternsStore{}
No Hooks.
Returns
Array.
Usage
$PTKPatternsStore = new PTKPatternsStore(); $PTKPatternsStore->get_patterns();
PTKPatternsStore::get_patterns() PTKPatternsStore::get patterns code WC 10.8.1
public function get_patterns() {
$patterns = get_option( self::OPTION_NAME );
// If the current data doesn't exist or is invalid, schedule fetching the patterns from the PTK.
if ( false === $patterns || ! $this->ptk_client->is_valid_schema( $patterns ) ) {
$this->schedule_fetch_patterns();
return array();
}
return $patterns;
}