WP_REST_Icons_Controller::get_item_schemapublicWP 1.0

Retrieves the icon schema, conforming to JSON Schema.

Method of the class: WP_REST_Icons_Controller{}

No Hooks.

Returns

Array. Item schema data.

Usage

$WP_REST_Icons_Controller = new WP_REST_Icons_Controller();
$WP_REST_Icons_Controller->get_item_schema();

WP_REST_Icons_Controller::get_item_schema() code WP 7.0

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'      => 'icon',
		'type'       => 'object',
		'properties' => array(
			'name'    => array(
				'description' => __( 'The icon name.' ),
				'type'        => 'string',
				'readonly'    => true,
				'context'     => array( 'view', 'edit', 'embed' ),
			),
			'label'   => array(
				'description' => __( 'The icon label.' ),
				'type'        => 'string',
				'readonly'    => true,
				'context'     => array( 'view', 'edit', 'embed' ),
			),
			'content' => array(
				'description' => __( 'The icon content (SVG markup).' ),
				'type'        => 'string',
				'readonly'    => true,
				'context'     => array( 'view', 'edit', 'embed' ),
			),
		),
	);

	$this->schema = $schema;

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