WC_Connect_Loader::get_shipping_phone_from_order PHP Method

get_shipping_phone_from_order() public method

public get_shipping_phone_from_order ( $fields, $address_type, $order )
        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;
        }
WC_Connect_Loader