Schema: Make display_key and *_value available for v3 and v2
This is just the schema and the actual functionality isn't implemented yet.
This commit is contained in:
parent
5ab863e649
commit
35ed2df4fb
|
@ -1285,6 +1285,16 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller {
|
|||
'type' => 'mixed',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'display_key' => array(
|
||||
'description' => __( 'Meta key for UI display.', 'woocommerce-rest-api' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'display_value' => array(
|
||||
'description' => __( 'Meta value for UI display.', 'woocommerce-rest-api' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -244,18 +244,6 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller {
|
|||
|
||||
$schema['properties']['coupon_lines']['items']['properties']['discount']['readonly'] = true;
|
||||
|
||||
$meta_data_item_properties_ref = &$schema['properties']['line_items']['items']['properties']['meta_data']['items']['properties'];
|
||||
$meta_data_item_properties_ref['display_key'] = array(
|
||||
'description' => __( 'Meta key for UI display.', 'woocommerce-rest-api' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
);
|
||||
$meta_data_item_properties_ref['display_value'] = array(
|
||||
'description' => __( 'Meta value for UI display.', 'woocommerce-rest-api' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
);
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue