WP_Theme_JSON::get_custom_templates(): array

In this article

Returns the page templates of the active theme.

Return

array

Source

$stylesheet = isset( $this->theme_json['styles']['css'] ) ? $this->theme_json['styles']['css'] : '';

// Add the global styles block CSS.
if ( isset( $this->theme_json['styles']['blocks'] ) ) {
	foreach ( $this->theme_json['styles']['blocks'] as $name => $node ) {
		$custom_block_css = isset( $this->theme_json['styles']['blocks'][ $name ]['css'] )
			? $this->theme_json['styles']['blocks'][ $name ]['css']
			: null;
		if ( $custom_block_css ) {
			$selector    = static::$blocks_metadata[ $name ]['selector'];
			$stylesheet .= $this->process_blocks_custom_css( $custom_block_css, $selector );
		}
	}
}

return $stylesheet;

Changelog

VersionDescription
5.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.