WP_REST_Font_Collections_Controller::get_item_schema
Retrieves the font collection's schema, conforming to JSON Schema.
Method of the class: WP_REST_Font_Collections_Controller{}
No Hooks.
Returns
Array. Item schema data.
Usage
$WP_REST_Font_Collections_Controller = new WP_REST_Font_Collections_Controller(); $WP_REST_Font_Collections_Controller->get_item_schema();
Changelog
| Since 6.5.0 | Introduced. |
WP_REST_Font_Collections_Controller::get_item_schema() WP REST Font Collections Controller::get item schema code WP 6.9
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 );
}