WP_Theme_JSON::schema_in_root_and_per_origin()protected staticWP 6.5.0

Return the input schema at the root and per origin.

Method of the class: WP_Theme_JSON{}

No Hooks.

Return

Array. The schema at the root and per origin.

Example: schema_in_root_and_per_origin( array(

'fontFamily' => null,
'slug' => null,

) )

Returns: array( 'fontFamily' => null, 'slug' => null, 'default' => array(

'fontFamily' => null,
'slug' => null,

), 'blocks' => array(

'fontFamily' => null,
'slug' => null,

), 'theme' => array(

'fontFamily' => null,
'slug' => null,

), 'custom' => array(

'fontFamily' => null,
'slug' => null,

), )

Usage

$result = WP_Theme_JSON::schema_in_root_and_per_origin( $schema );
$schema(array) (required)
The base schema.

Changelog

Since 6.5.0 Introduced.

WP_Theme_JSON::schema_in_root_and_per_origin() code WP 6.7.1

protected static function schema_in_root_and_per_origin( $schema ) {
	$schema_in_root_and_per_origin = $schema;
	foreach ( static::VALID_ORIGINS as $origin ) {
		$schema_in_root_and_per_origin[ $origin ] = $schema;
	}
	return $schema_in_root_and_per_origin;
}