Improved logic of WC_Order::get_shipping_address_map_url()
See comments in #14436
This commit is contained in:
parent
e208e35e33
commit
3b7a41ea53
|
@ -767,11 +767,8 @@ class WC_Order extends WC_Abstract_Order {
|
||||||
public function get_shipping_address_map_url() {
|
public function get_shipping_address_map_url() {
|
||||||
$address = $this->get_address( 'shipping' );
|
$address = $this->get_address( 'shipping' );
|
||||||
|
|
||||||
foreach ( array( 'first_name', 'last_name', 'company' ) as $key ) {
|
// Remove name and company before generate the Google Maps URL.
|
||||||
if ( isset( $address[ $key ] ) ) {
|
unset( $address['first_name'], $address['last_name'], $address['company'] );
|
||||||
unset( $address[ $key ] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$address = apply_filters( 'woocommerce_shipping_address_map_url_parts', $address, $this );
|
$address = apply_filters( 'woocommerce_shipping_address_map_url_parts', $address, $this );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue