Merge pull request #14436 from woocommerce/fix/14398
Fixes the shipping address map URL
This commit is contained in:
commit
9187f3cbb3
|
@ -765,7 +765,16 @@ class WC_Order extends WC_Abstract_Order {
|
|||
* @return string
|
||||
*/
|
||||
public function get_shipping_address_map_url() {
|
||||
$address = apply_filters( 'woocommerce_shipping_address_map_url_parts', $this->get_address( 'shipping' ), $this );
|
||||
$address = $this->get_address( 'shipping' );
|
||||
|
||||
foreach ( array( 'first_name', 'last_name', 'company' ) as $key ) {
|
||||
if ( isset( $address[ $key ] ) ) {
|
||||
unset( $address[ $key ] );
|
||||
}
|
||||
}
|
||||
|
||||
$address = apply_filters( 'woocommerce_shipping_address_map_url_parts', $address, $this );
|
||||
|
||||
return apply_filters( 'woocommerce_shipping_address_map_url', 'https://maps.google.com/maps?&q=' . urlencode( implode( ', ', $address ) ) . '&z=16', $this );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue