Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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.js

    Thanks in advance and best Regards,

    Leonie

    #1340604

    Hey 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,
    Ismael

    #1340610

    Maybe 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_loading

    add_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.

    #1340656

    by 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);
    #1340677

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1341102

    Hi,

    I used your suggestions @Guenni007 and those fixed it. Thank you!

    Best Regards
    Leonie

    #1341276

    Hi,

    Awesome! Glad to know that @Guenni’s recommendations above worked. Please do not hesitate to open another thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Google Maps API tag in Backend’ is closed to new replies.