Merge pull request #29218 from wywarren/fix/27553
Fix for issue #27553 - REST API v3 not supporting settings type `order` and `class` for settings type on shipping zone methods
This commit is contained in:
commit
ee90c02f63
|
@ -24,4 +24,20 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zone_Met
|
|||
* @var string
|
||||
*/
|
||||
protected $namespace = 'wc/v3';
|
||||
|
||||
/**
|
||||
* Get the settings schema, conforming to JSON Schema.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_item_schema() {
|
||||
// Get parent schema to append additional supported settings types for shipping zone method.
|
||||
$schema = parent::get_item_schema();
|
||||
|
||||
// Append additional settings supported types (class, order).
|
||||
$schema['properties']['settings']['properties']['type']['enum'][] = 'class';
|
||||
$schema['properties']['settings']['properties']['type']['enum'][] = 'order';
|
||||
|
||||
return $this->add_additional_fields_schema( $schema );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue