Automattic\WooCommerce\Blocks\Patterns

PTKPatternsStore::get_patternspublicWC 1.0

Get the patterns from the Patterns Toolkit cache.

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

Хуков нет.

Возвращает

Массив.

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

$PTKPatternsStore = new PTKPatternsStore();
$PTKPatternsStore->get_patterns();

Код PTKPatternsStore::get_patterns() WC 10.3.6

public function get_patterns() {
	$patterns = get_option( self::OPTION_NAME );

	// Only if the transient is not set, we 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;
}