WP_REST_Font_Collections_Controller::get_item_schema(): array

In this article

Retrieves the font collection’s schema, conforming to JSON Schema.

Return

array Item schema data.

Source

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'      => 'font-collection',
		'type'       => 'object',
		'properties' => array(
			'slug'          => array(
				'description' => __( 'Unique identifier for the font collection.' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit', 'embed' ),
				'readonly'    => true,
			),
			'name'          => array(
				'description' => __( 'The name for the font collection.' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit', 'embed' ),
			),
			'description'   => array(
				'description' => __( 'The description for the font collection.' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit', 'embed' ),
			),
			'font_families' => array(
				'description' => __( 'The font families for the font collection.' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit', 'embed' ),
			),
			'categories'    => array(
				'description' => __( 'The categories for the font collection.' ),
				'type'        => 'array',
				'context'     => array( 'view', 'edit', 'embed' ),
			),
		),
	);

	$this->schema = $schema;

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

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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