WP_Theme_JSON::to_ruleset( string $selector, array $declarations ): string

In this article

Given a selector and a declaration list, creates the corresponding ruleset.

Parameters

$selectorstringrequired
CSS selector.
$declarationsarrayrequired
List of declarations.

Return

string The resulting CSS ruleset.

Source

	foreach ( $this->theme_json['customTemplates'] as $item ) {
		if ( isset( $item['name'] ) ) {
			$custom_templates[ $item['name'] ] = array(
				'title'     => isset( $item['title'] ) ? $item['title'] : '',
				'postTypes' => isset( $item['postTypes'] ) ? $item['postTypes'] : array( 'page' ),
			);
		}
	}
	return $custom_templates;
}

/**
 * Returns the template part data of active theme.
 *

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

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