WC_REST_Data_Continents_Controller::get_item_schema() │ public │ WC 3.5.0
Get the location schema, conforming to JSON Schema.
Method of the class: WC_REST_Data_Continents_Controller{}
No Hooks.
Return
Array
.
Usage
$WC_REST_Data_Continents_Controller = new WC_REST_Data_Continents_Controller(); $WC_REST_Data_Continents_Controller->get_item_schema();
Changelog
Since 3.5.0 | Introduced. |
WC_REST_Data_Continents_Controller::get_item_schema() WC REST Data Continents Controller::get item schema code WC 9.8.1
public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'data_continents', 'type' => 'object', 'properties' => array( 'code' => array( 'type' => 'string', 'description' => __( '2 character continent code.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'name' => array( 'type' => 'string', 'description' => __( 'Full name of continent.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'countries' => array( 'type' => 'array', 'description' => __( 'List of countries on this continent.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, 'items' => array( 'type' => 'object', 'context' => array( 'view' ), 'readonly' => true, 'properties' => array( 'code' => array( 'type' => 'string', 'description' => __( 'ISO3166 alpha-2 country code.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'currency_code' => array( 'type' => 'string', 'description' => __( 'Default ISO4127 alpha-3 currency code for the country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'currency_pos' => array( 'type' => 'string', 'description' => __( 'Currency symbol position for this country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'decimal_sep' => array( 'type' => 'string', 'description' => __( 'Decimal separator for displayed prices for this country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'dimension_unit' => array( 'type' => 'string', 'description' => __( 'The unit lengths are defined in for this country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'name' => array( 'type' => 'string', 'description' => __( 'Full name of country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'num_decimals' => array( 'type' => 'integer', 'description' => __( 'Number of decimal points shown in displayed prices for this country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'states' => array( 'type' => 'array', 'description' => __( 'List of states in this country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, 'items' => array( 'type' => 'object', 'context' => array( 'view' ), 'readonly' => true, 'properties' => array( 'code' => array( 'type' => 'string', 'description' => __( 'State code.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'name' => array( 'type' => 'string', 'description' => __( 'Full name of state.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), ), ), ), 'thousand_sep' => array( 'type' => 'string', 'description' => __( 'Thousands separator for displayed prices in this country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), 'weight_unit' => array( 'type' => 'string', 'description' => __( 'The unit weights are defined in for this country.', 'woocommerce' ), 'context' => array( 'view' ), 'readonly' => true, ), ), ), ), ), ); return $this->add_additional_fields_schema( $schema ); }