Created
April 1, 2024 05:12
-
-
Save pramodjodhani/b50d07f0f2ff0987006ca7e5b3531529 to your computer and use it in GitHub Desktop.
Iconic WDS GCal - do not include first name and last name in the event address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Iconic WDS GCal - do not include the first and last name in the event address. | |
* | |
* @param string $location Location. | |
* @param array $order Order. | |
* | |
* @return string | |
*/ | |
function iconic_wds_gcal_change_location( $location, $order ) { | |
$address = $order->get_address( 'shipping' ); | |
if ( empty( $address ) || empty( $address['address_1'] ) ) { | |
return $order->get_formatted_shipping_address(); | |
} | |
return $address['address_1'] . ' ' . $address['address_2'] . ' ' . $address['city'] . ' ' . $address['state'] . ' ' . $address['postcode'] . ' ' . $address['country']; | |
} | |
add_filter( 'iconic_wds_gcal_event_location', 'iconic_wds_gcal_change_location', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @pramodjodhani
I have added the code, but the name is still showing on the map area. Can you assist me in resolving this issue?
Thank you