Skip to content

Commit

Permalink
Skip geolocation call if no fields have values.
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Oct 2, 2024
1 parent fde03bf commit 0d5f8d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/my-calendar-locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,9 @@ function mc_get_location_coordinates( $location_id = false, $address = array() )
$zip = ( isset( $address['zip'] ) ) ? $address['zip'] : '';
$country = ( isset( $address['country'] ) ) ? $address['country'] : '';
}
if ( ! $street && ! $street2 && ! $city && ! $zip && ! $country ) {
return array();
}

$coordinates = Geolocation::get_coordinates( $street, $street2, $city, $zip, $country );

Expand Down

0 comments on commit 0d5f8d5

Please sign in to comment.