WC_REST_Shipping_Zone_Locations_V2_Controller::get_item_schema
Get the Shipping Zone Locations schema, conforming to JSON Schema
Method of the class: WC_REST_Shipping_Zone_Locations_V2_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_Shipping_Zone_Locations_V2_Controller = new WC_REST_Shipping_Zone_Locations_V2_Controller(); $WC_REST_Shipping_Zone_Locations_V2_Controller->get_item_schema();
WC_REST_Shipping_Zone_Locations_V2_Controller::get_item_schema() WC REST Shipping Zone Locations V2 Controller::get item schema code WC 10.3.6
public function get_item_schema() {
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'shipping_zone_location',
'type' => 'object',
'properties' => array(
'code' => array(
'description' => __( 'Shipping zone location code.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'type' => array(
'description' => __( 'Shipping zone location type.', 'woocommerce' ),
'type' => 'string',
'default' => 'country',
'enum' => array(
'postcode',
'state',
'country',
'continent',
),
'context' => array( 'view', 'edit' ),
),
),
);
return $this->add_additional_fields_schema( $schema );
}