WP_Theme_JSON::get_patterns()publicWP 6.0.0

Returns the current theme's wanted patterns(slugs) to be registered from Pattern Directory.

{} Это метод класса: WP_Theme_JSON{}

Хуков нет.

Возвращает

Строку[].

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

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

Список изменений

С версии 6.0.0 Введена.

Код WP_Theme_JSON::get_patterns() WP 6.0.2

public function get_patterns() {
	if ( isset( $this->theme_json['patterns'] ) && is_array( $this->theme_json['patterns'] ) ) {
		return $this->theme_json['patterns'];
	}
	return array();
}