Retrieves the revision’s schema, conforming to JSON Schema.
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$schema = parent::get_item_schema();
$parent_schema = $this->parent_controller->get_item_schema();
$schema['properties'] = array_merge( $schema['properties'], $parent_schema['properties'] );
unset(
$schema['properties']['guid'],
$schema['properties']['slug'],
$schema['properties']['meta'],
$schema['properties']['content'],
$schema['properties']['title']
);
$this->schema = $schema;
return $this->add_additional_fields_schema( $this->schema );
}
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_global_styles_revisions_controller/get_item_schema