From 8eb141fdcdd527c76193213fdfeb009dfe828370 Mon Sep 17 00:00:00 2001 From: ctr49 Date: Sat, 5 Dec 2020 18:47:25 +0100 Subject: [PATCH] make geocoding operations conditional --- gcal-import-worker.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gcal-import-worker.php b/gcal-import-worker.php index b5fa97f..0cac19d 100644 --- a/gcal-import-worker.php +++ b/gcal-import-worker.php @@ -176,10 +176,14 @@ function gcal_import_do_import($category, $link) { } // geocoden - $location = urldecode ($r['LOCATION']); - $my_latlon = gcal_import_geocode($location); - $file = dirname (__FILE__) . "/latlon-$hash.txt"; - file_put_contents ($file, var_export ($my_latlon, TRUE)); + $options = get_option('gcal_options'); + if ( $options['gcal_geocoding'] != "off" ) { + + $location = urldecode ($r['LOCATION']); + $my_latlon = gcal_import_geocode($location); + $file = dirname (__FILE__) . "/latlon-$hash.txt"; + file_put_contents ($file, var_export ($my_latlon, TRUE)); + } // create a default form // $post = get_default_post_to_edit ('termine', false);