$meta = $order->get_meta_data();
print_r($meta);
Array
(
[0] => WC_Meta_Data Object
(
[current_data:protected] => Array
(
[id] => 8126
[key] => _billing_checkbox
[value] =>
)
[data:protected] => Array
(
[id] => 8126
[key] => _billing_checkbox
[value] =>
)
)
[1] => WC_Meta_Data Object
(
[current_data:protected] => Array
(
[id] => 8127
[key] => _billing_address_3
[value] => Kiev
)
[data:protected] => Array
(
[id] => 8127
[key] => _billing_address_3
[value] => Kiev
)
)
[2] => WC_Meta_Data Object
(
[current_data:protected] => Array
(
[id] => 8128
[key] => _billing_address_4
[value] => 235
)
[data:protected] => Array
(
[id] => 8128
[key] => _billing_address_4
[value] => 235
)
)
[3] => WC_Meta_Data Object
(
[current_data:protected] => Array
(
[id] => 8129
[key] => _billing_address_5
[value] => 04114
)
[data:protected] => Array
(
[id] => 8129
[key] => _billing_address_5
[value] => 04114
)
)
[4] => WC_Meta_Data Object
(
[current_data:protected] => Array
(
[id] => 8130
[key] => _billing_address_6
[value] => 04114
)
[data:protected] => Array
(
[id] => 8130
[key] => _billing_address_6
[value] => 04114
)
)
[5] => WC_Meta_Data Object
(
[current_data:protected] => Array
(
[id] => 8131
[key] => _billing_checkbox2
[value] =>
)
[data:protected] => Array
(
[id] => 8131
[key] => _billing_checkbox2
[value] =>
)
)
[6] => WC_Meta_Data Object
(
[current_data:protected] => Array
(
[id] => 8132
[key] => _billing_payment
[value] =>
)
[data:protected] => Array
(
[id] => 8132
[key] => _billing_payment
[value] =>
)
)
)
/**
* Return data changes only.
*
* @return array
*/
public function get_changes() {
$changes = array();
foreach ( $this->current_data as $id => $value ) {
if ( ! array_key_exists( $id, $this->data ) || $value !== $this->data[ $id ] ) {
$changes[ $id ] = $value;
}
}
return $changes;
}