WP_Theme_JSON::get_patterns() WordPress Method

The WP_Theme_JSON::get_patterns() method is used to get an array of patterns for the theme.

WP_Theme_JSON::get_patterns() #

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


Return

(string[])


Top ↑

Source

File: wp-includes/class-wp-theme-json.php

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

Top ↑

Changelog

Changelog
VersionDescription
6.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.