Automattic\WooCommerce\Blocks\Patterns

PTKPatternsStore::get_patternspublicWC 1.0

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