Orders V3 Schema: Add display_key and display_value for meta props

This commit is contained in:
Shiki 2020-07-20 15:14:41 -06:00 committed by vedanshujain
parent 16faf915e0
commit d8ac282c80
1 changed files with 12 additions and 0 deletions

View File

@ -244,6 +244,18 @@ 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;
}