-
AuthorPosts
-
February 14, 2022 at 4:05 pm #1340521
Hello,
I tried to get rid of the google maps tags in the backend, using the following lines in my funcitons.php:
add_filter('avf_load_google_map_api', '__return_false'); add_filter('avf_load_google_map_api_prohibited', '__return_true');
Both, or either one of them did not work. We are using WordPress version 5.9 and Enfold version 4.8.6.2.
Tags I want to get rid of:
https://maps.googleapis.com/maps-api-v3/api/js/45/8b/intl/de_all/common.js
https://maps.googleapis.com/maps-api-v3/api/js/45/8b/intl/de_all/util.jsThanks in advance and best Regards,
Leonie
February 14, 2022 at 11:44 pm #1340604Hey InTraHealth-Envold,
Thank you for the inquiry.
What do you mean by “google maps tags”? Please provide a screenshot using imgur or dropbox. The filters above should have prevented the default Google map scripts from loading. Are you using a different plugin for the maps?
You should also update the theme to the latest version, 4.8.9.1, and temporarily disable the Performance > File Compression settings afterwards.
Best regards,
IsmaelFebruary 15, 2022 at 12:35 am #1340610Maybe you deactivate everywhere the maps api ( do not enter API KEy on Enfold Options ) – and then you load the script asynchronously on the required pages before function initMap() not using the Google Maps ALB Element but a Codeblock-Element to place your map.
f.e.:<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR-KEY-COMES-HERE&callback=initMap" type="text/javascript"> </script>
see more info here: Google Maps
_____________________Easier Way for Enfold normal users :
PS: i see first time the filter: avf_skip_enqueue_scripts_backend_gmaps – what about that skip_loadingadd_filter("avf_skip_enqueue_scripts_backend_gmaps", function( ) { return "skip_loading"; }, 10, 1);
don’t know if there is a function argument necessary – guess it will run this way too.
Guess filter : avf_load_google_map_api_prohibited is still working but deprecated.February 15, 2022 at 9:42 am #1340656by the way – there is an analogon usage for recaptcha from Google – filter is called: avf_skip_enqueue_scripts_backend_grecaptcha
add_filter("avf_skip_enqueue_scripts_backend_grecaptcha", function( ) { return "skip_loading"; }, 10, 1);
February 15, 2022 at 12:29 pm #1340677February 17, 2022 at 12:14 pm #1341102February 18, 2022 at 6:02 am #1341276 -
AuthorPosts
- The topic ‘Google Maps API tag in Backend’ is closed to new replies.