WP_REST_Themes_Controller::get_item_schema()

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


Description Description


Return Return

(array) Item schema data.


Top ↑

Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.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(
				'theme_supports' => array(
					'description' => __( 'Features supported by this theme.' ),
					'type'        => 'array',
					'readonly'    => true,
					'properties'  => array(
						'formats'           => array(
							'description' => __( 'Post formats supported.' ),
							'type'        => 'array',
							'readonly'    => true,
						),
						'post-thumbnails'   => array(
							'description' => __( 'Whether the theme supports post thumbnails.' ),
							'type'        => array( 'array', 'bool' ),
							'readonly'    => true,
						),
						'responsive-embeds' => array(
							'description' => __( 'Whether the theme supports responsive embedded content.' ),
							'type'        => 'bool',
							'readonly'    => true,
						),
					),
				),
			),
		);

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

Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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