function get_shipping_phone_from_order($fields, $address_type, $order)
{
if ('shipping' === $address_type) {
$shipping_phone = get_post_meta($order->id, '_shipping_phone', true);
if (!$shipping_phone) {
$billing_address = $order->get_address('billing');
$shipping_phone = $billing_address['phone'];
}
$fields['phone'] = $shipping_phone;
}
return $fields;
}