REST_Forms_Controller::get_item_schema()

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

Description

Return

(array) Model schema data.

Source

File: src/db-objects/forms/rest-forms-controller.php

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

		$schema['properties']['status'] = array(
			'description' => __( 'Status of the form.', 'torro-forms' ),
			'type'        => 'string',
			'enum'        => array_keys( get_post_stati( array(
				'internal' => false,
			) ) ),
			'context'     => array( 'edit' ),
		);

		$schema['properties']['timestamp'] = array(
			'description' => __( 'UNIX timestamp for when the form was created.', 'torro-forms' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		$schema['properties']['timestamp_modified'] = array(
			'description' => __( 'UNIX timestamp for when the form was last modified.', 'torro-forms' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		return $schema;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.