so I've used this as a template to add custom metadata keys to my wordpress site, however, i'm realizing that it's overriding other metadata keys for things like shipping and making them come up blank.
for example:
add_filter('woocommerce_order_item_display_meta_key', 'filter_wc_order_item-display_meta_keys', 20, 3);
function filter_wc_order_item_display_meta_keys($resizeid, $meta, $item) {
if( $meta->key === '_resize_id' && is_admin() )
$display_key = __("Resize Id", "woocommerce");
}
works correctly to rename the keys for my custom item metadata, but the shipping for UPS Ground that's in the order page in admin has no keys anymore (copied/pasted since I can't attach an image):
UPS Ground
: Custom (32x43x20/150): Angled Roll Side Tray x 33
: 03
Save time with automated shipping fulfillment, generate and download the print-ready shipping labels and track parcels directly in your store
I've tried nesting all of the intended key renaming if statements inside of an outer if($item->get_type === "line_item"){
statement, but it still affects the shipping keys, even though they have a type of "shipping".
If i disable this function, then the shipping keys come up correctly.
Has anyone else come up against this issue and figured out a way to fix it so that only the keys that I want (line_item type metadata) has the custom display keys, but all other metadata isn't affected?