diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php index d42639456a7..3a367b98daf 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php @@ -266,8 +266,8 @@ class WC_Meta_Box_Order_Data { $field_name = 'billing_' . $key; - if ( $order->$field_name ) { - echo '

' . esc_html( $field['label'] ) . ': ' . make_clickable( esc_html( $order->$field_name ) ) . '

'; + if ( is_callable( array( $order, 'get_' . $field_name ) ) ) { + echo '

' . esc_html( $field['label'] ) . ': ' . make_clickable( esc_html( call_user_func( array( $order, 'get_' . $field_name ) ) ) ) . '

'; } } @@ -352,8 +352,8 @@ class WC_Meta_Box_Order_Data { $field_name = 'shipping_' . $key; - if ( ! empty( $order->$field_name ) ) { - echo '

' . esc_html( $field['label'] ) . ': ' . make_clickable( esc_html( $order->$field_name ) ) . '

'; + if ( is_callable( array( $order, 'get_' . $field_name ) ) ) { + echo '

' . esc_html( $field['label'] ) . ': ' . make_clickable( esc_html( call_user_func( array( $order, 'get_' . $field_name ) ) ) ) . '

'; } } }