REST_Form_Categories_Controller::get_item_schema()

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

Description

Return

(array) Model schema data.

Source

File: src/db-objects/form-categories/rest-form-categories-controller.php

	public function get_item_schema() {
		$schema = parent::get_item_schema();

		$schema['properties']['description'] = array(
			'description' => __( 'Description for the form category.', 'torro-forms' ),
			'type'        => 'string',
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		$schema['properties']['parent'] = array(
			'description' => __( 'ID of the parent of the form category, if any.', 'torro-forms' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit', 'embed' ),
			'arg_options' => array(
				'minimum' => 0,
				'default' => 0,
			),
		);

		$schema['properties']['count'] = array(
			'description' => __( 'Number of forms associated with the form category.', 'torro-forms' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit', 'embed' ),
			'readonly'    => true,
		);

		return $schema;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.