Title: WP_REST_Themes_Controller::get_item_schema
Published: December 6, 2018
Last modified: February 24, 2026

---

# WP_REST_Themes_Controller::get_item_schema(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#wp--skip-link--target)

Retrieves the theme’s schema, conforming to JSON Schema.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#return)󠁿

 array Item schema data.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#source)󠁿

    ```php
    public function get_item_schema() {
    	if ( $this->schema ) {
    		return $this->add_additional_fields_schema( $this->schema );
    	}

    	$schema = array(
    		'$schema'    => 'http://json-schema.org/draft-04/schema#',
    		'title'      => 'theme',
    		'type'       => 'object',
    		'properties' => array(
    			'stylesheet'                  => array(
    				'description' => __( 'The theme\'s stylesheet. This uniquely identifies the theme.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'stylesheet_uri'              => array(
    				'description' => __( 'The uri for the theme\'s stylesheet directory.' ),
    				'type'        => 'string',
    				'format'      => 'uri',
    				'readonly'    => true,
    			),
    			'template'                    => array(
    				'description' => __( 'The theme\'s template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\'s stylesheet.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'template_uri'                => array(
    				'description' => __( 'The uri for the theme\'s template directory. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\'s stylesheet directory.' ),
    				'type'        => 'string',
    				'format'      => 'uri',
    				'readonly'    => true,
    			),
    			'author'                      => array(
    				'description' => __( 'The theme author.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(
    					'raw'      => array(
    						'description' => __( 'The theme author\'s name, as found in the theme header.' ),
    						'type'        => 'string',
    					),
    					'rendered' => array(
    						'description' => __( 'HTML for the theme author, transformed for display.' ),
    						'type'        => 'string',
    					),
    				),
    			),
    			'author_uri'                  => array(
    				'description' => __( 'The website of the theme author.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(
    					'raw'      => array(
    						'description' => __( 'The website of the theme author, as found in the theme header.' ),
    						'type'        => 'string',
    						'format'      => 'uri',
    					),
    					'rendered' => array(
    						'description' => __( 'The website of the theme author, transformed for display.' ),
    						'type'        => 'string',
    						'format'      => 'uri',
    					),
    				),
    			),
    			'description'                 => array(
    				'description' => __( 'A description of the theme.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(
    					'raw'      => array(
    						'description' => __( 'The theme description, as found in the theme header.' ),
    						'type'        => 'string',
    					),
    					'rendered' => array(
    						'description' => __( 'The theme description, transformed for display.' ),
    						'type'        => 'string',
    					),
    				),
    			),
    			'is_block_theme'              => array(
    				'description' => __( 'Whether the theme is a block-based theme.' ),
    				'type'        => 'boolean',
    				'readonly'    => true,
    			),
    			'name'                        => array(
    				'description' => __( 'The name of the theme.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(
    					'raw'      => array(
    						'description' => __( 'The theme name, as found in the theme header.' ),
    						'type'        => 'string',
    					),
    					'rendered' => array(
    						'description' => __( 'The theme name, transformed for display.' ),
    						'type'        => 'string',
    					),
    				),
    			),
    			'requires_php'                => array(
    				'description' => __( 'The minimum PHP version required for the theme to work.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'requires_wp'                 => array(
    				'description' => __( 'The minimum WordPress version required for the theme to work.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'screenshot'                  => array(
    				'description' => __( 'The theme\'s screenshot URL.' ),
    				'type'        => 'string',
    				'format'      => 'uri',
    				'readonly'    => true,
    			),
    			'tags'                        => array(
    				'description' => __( 'Tags indicating styles and features of the theme.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(
    					'raw'      => array(
    						'description' => __( 'The theme tags, as found in the theme header.' ),
    						'type'        => 'array',
    						'items'       => array(
    							'type' => 'string',
    						),
    					),
    					'rendered' => array(
    						'description' => __( 'The theme tags, transformed for display.' ),
    						'type'        => 'string',
    					),
    				),
    			),
    			'textdomain'                  => array(
    				'description' => __( 'The theme\'s text domain.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'theme_supports'              => array(
    				'description' => __( 'Features supported by this theme.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(),
    			),
    			'theme_uri'                   => array(
    				'description' => __( 'The URI of the theme\'s webpage.' ),
    				'type'        => 'object',
    				'readonly'    => true,
    				'properties'  => array(
    					'raw'      => array(
    						'description' => __( 'The URI of the theme\'s webpage, as found in the theme header.' ),
    						'type'        => 'string',
    						'format'      => 'uri',
    					),
    					'rendered' => array(
    						'description' => __( 'The URI of the theme\'s webpage, transformed for display.' ),
    						'type'        => 'string',
    						'format'      => 'uri',
    					),
    				),
    			),
    			'version'                     => array(
    				'description' => __( 'The theme\'s current version.' ),
    				'type'        => 'string',
    				'readonly'    => true,
    			),
    			'status'                      => array(
    				'description' => __( 'A named status for the theme.' ),
    				'type'        => 'string',
    				'enum'        => array( 'inactive', 'active' ),
    			),
    			'default_template_types'      => array(
    				'description' => __( 'A list of default template types.' ),
    				'type'        => 'array',
    				'readonly'    => true,
    				'items'       => array(
    					'type'       => 'object',
    					'properties' => array(
    						'slug'        => array(
    							'type' => 'string',
    						),
    						'title'       => array(
    							'type' => 'string',
    						),
    						'description' => array(
    							'type' => 'string',
    						),
    					),
    				),
    			),
    			'default_template_part_areas' => array(
    				'description' => __( 'A list of allowed area values for template parts.' ),
    				'type'        => 'array',
    				'readonly'    => true,
    				'items'       => array(
    					'type'       => 'object',
    					'properties' => array(
    						'area'        => array(
    							'type' => 'string',
    						),
    						'label'       => array(
    							'type' => 'string',
    						),
    						'description' => array(
    							'type' => 'string',
    						),
    						'icon'        => array(
    							'type' => 'string',
    						),
    						'area_tag'    => array(
    							'type' => 'string',
    						),
    					),
    				),
    			),
    		),
    	);

    	foreach ( get_registered_theme_features() as $feature => $config ) {
    		if ( ! is_array( $config['show_in_rest'] ) ) {
    			continue;
    		}

    		$name = $config['show_in_rest']['name'];

    		$schema['properties']['theme_supports']['properties'][ $name ] = $config['show_in_rest']['schema'];
    	}

    	$this->schema = $schema;

    	return $this->add_additional_fields_schema( $this->schema );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php#L474)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php#L474-L705)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#related)󠁿

| Uses | Description | 
| [get_registered_theme_features()](https://developer.wordpress.org/reference/functions/get_registered_theme_features/)`wp-includes/theme.php` |

Gets the list of registered theme features.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_schema/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_themes_controller%2Fget_item_schema%2F)
before being able to contribute a note or feedback.