WP_REST_Settings_Controller::get_item_schema()

Retrieves the site setting schema, conforming to JSON Schema.


Return

(array) Item schema data.


Source

File: wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php

	public function get_item_schema() {
		$options = $this->get_registered_options();

		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'settings',
			'type'       => 'object',
			'properties' => array(),
		);

		foreach ( $options as $option_name => $option ) {
			$schema['properties'][ $option_name ] = $option['schema'];
			$schema['properties'][ $option_name ]['arg_options'] = array(
				'sanitize_callback' => array( $this, 'sanitize_callback' ),
			);
		}

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


Changelog

Changelog
Version Description
WP-4.7.0 Introduced.