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{}

No Hooks.

Return

String[].

Usage

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

Changelog

Since 6.0.0 Introduced.

Code of WP_Theme_JSON::get_patterns() WP 6.1.1

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