Skip to content

Instantly share code, notes, and snippets.

@pramodjodhani
Created April 1, 2024 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pramodjodhani/b50d07f0f2ff0987006ca7e5b3531529 to your computer and use it in GitHub Desktop.
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
<?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 );
@githubxiansaiful
Copy link

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?

image

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment