WP_REST_Abilities_V1_Categories_Controller::get_item_schema(): array<string,

In this article

Retrieves the ability category’s schema, conforming to JSON Schema.

Return

array<string, mixed> Item schema data.

Source

public function get_item_schema(): array {
	$schema = array(
		'$schema'    => 'http://json-schema.org/draft-04/schema#',
		'title'      => 'ability-category',
		'type'       => 'object',
		'properties' => array(
			'slug'        => array(
				'description' => __( 'Unique identifier for the ability category.' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit', 'embed' ),
				'readonly'    => true,
			),
			'label'       => array(
				'description' => __( 'Display label for the category.' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit', 'embed' ),
				'readonly'    => true,
			),
			'description' => array(
				'description' => __( 'Description of the category.' ),
				'type'        => 'string',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
			'meta'        => array(
				'description' => __( 'Meta information about the category.' ),
				'type'        => 'object',
				'context'     => array( 'view', 'edit' ),
				'readonly'    => true,
			),
		),
	);

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

Changelog

VersionDescription
6.9.0Introduced.

User Contributed Notes

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