WC_REST_Data_Controller::get_item_schema()
Get the data index schema, conforming to JSON Schema.
Method of the class: WC_REST_Data_Controller{}
No Hooks.
Return
Array
.
Usage
$WC_REST_Data_Controller = new WC_REST_Data_Controller(); $WC_REST_Data_Controller->get_item_schema();
Changelog
Since 3.5.0 | Introduced. |
WC_REST_Data_Controller::get_item_schema() WC REST Data Controller::get item schema code WC 9.5.1
public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'data_index', 'type' => 'object', 'properties' => array( 'slug' => array( 'description' => __( 'Data resource ID.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'Data resource description.', 'woocommerce' ), 'type' => 'string', 'context' => array( 'view' ), 'readonly' => true, ), ), ); return $this->add_additional_fields_schema( $schema ); }