WC_REST_Shipping_Methods_V2_Controller::get_item_schema
Get the shipping method schema, conforming to JSON Schema.
Method of the class: WC_REST_Shipping_Methods_V2_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_Shipping_Methods_V2_Controller = new WC_REST_Shipping_Methods_V2_Controller(); $WC_REST_Shipping_Methods_V2_Controller->get_item_schema();
WC_REST_Shipping_Methods_V2_Controller::get_item_schema() WC REST Shipping Methods 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_method',
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Method ID.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'title' => array(
'description' => __( 'Shipping method title.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'description' => array(
'description' => __( 'Shipping method description.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
),
);
return $this->add_additional_fields_schema( $schema );
}