-
AuthorPosts
-
February 22, 2017 at 10:57 pm #750733
I am using this plugin:
http://codespacing.com/wordpress-plugins/progress-map-list-and-filter-wordpress-plugin/I am unable to get the plugin to work as I wish due to a conflict between the google maps api calls of the plugin as well as those of the enfold theme.
I have exhausted Google search seeking a solution to this issue…none of the solutions seem to work:
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=enfold+disable+google+maps+apisEven when I add a suggested line of code to my child theme’s functions file, it still does not disable the front end. I know because I test it manually by deleting the google api key from the enfold theme and every map stops working.
My ideal solution: disable all google maps api calls from both the frontend and the backend by the enfold theme, using a function in the child theme functions.php file.
February 23, 2017 at 8:03 pm #751033I managed to eliminate one or two js conflicts but I have not been able to entirely eliminate the API calls by Enfold (at least on the frontend).
I continue to test this by removing the google maps API key from the enfold optons menu (listed in the private content area)
Current code in the child functions file:
add_filter(‘avia-google-maps-api’, ‘__return_false’, 10, 2);
add_filter( ‘avf_load_google_map_api’, ‘__return_false’ );/* remove google map api calls */
add_filter(‘avf_load_google_map_api’, ‘disable_google_map_api’, 10, 1);
function disable_google_map_api($load_google_map_api) {
$load_google_map_api = false;
return $load_google_map_api;
}- This reply was modified 7 years, 10 months ago by domainarchitect.
February 25, 2017 at 3:17 am #751682February 25, 2017 at 9:49 pm #751838February 26, 2017 at 8:38 pm #752026Hey!
Please contact the Plugin developer to help you, if you need that.
We can not offer third party compatibility.Thank yu for your understanding
Cheers!
BasilisFebruary 27, 2017 at 2:14 am #752104I did not ask you to provide any third party compatibility.
I specifically requested code to disable all google maps api calls on the front end. I have found plenty of your support staff offering it in other threads, but that code was not working for me as evidenced when the maps would stop working when I would removed the map key from enfold. In theory, if totally disabled, then the maps should not work regardless of whether there is a google map key in enfold or not.
March 1, 2017 at 7:34 pm #753903Support? Please help
I need to know how to disable all google maps api functionality from the enfold theme.
March 2, 2017 at 9:06 am #754186Hi,
Can you try to remove these codes in functions.php:
add_filter(‘avia-google-maps-api’, ‘__return_false’, 10, 2); add_filter( ‘avf_load_google_map_api’, ‘__return_false’ ); /* remove google map api calls */ add_filter(‘avf_load_google_map_api’, ‘disable_google_map_api’, 10, 1); function disable_google_map_api($load_google_map_api) { $load_google_map_api = false; return $load_google_map_api; }
and replace it with:
add_filter( 'avf_load_google_map_api', '__return_false' );
you will notice it’s the same with:
add_filter( ‘avf_load_google_map_api’, ‘__return_false’ );
however I have encountered some issues where the single quote ‘ is changed for some reason that’s why the code isn’t working.
Best regards,
NikkoMarch 2, 2017 at 9:33 am #754205I changed what you wanted me to change, then removed this API code (see private content) from the ENFOLD –> Google Services area:
I am still getting a conflict. Can you tell me what the code above actually does?
- This reply was modified 7 years, 9 months ago by domainarchitect.
March 5, 2017 at 6:56 pm #755989Any ideas?
March 6, 2017 at 8:31 pm #756578yes, I run into the same kind of problem – in my case a conflict between Enfold and Meta-Box Map Field in the admin backend – only in the backend, the frontend does not have this issue.
#1 open this file in your theme folder: wp-content/themes/enfold/framework/php/class-framework-widgets.php
#2 at around line 1311 you find this: wp_register_script( ‘avia-google-maps-api’, $api_url, array(‘jquery’), NULL, true);
#3 replace this line with: // wp_register_script( ‘avia-google-maps-api’, $api_url, array(‘jquery’), NULL, true);
(out commented)this will prevent Enfold from adding the javascript maps.google.js to the code when you are logged in.
[SOLVED]
@ENFOLD: check the handler for conflicts with plugins using google.map calls and update the versioning of this javascript call. You are using v3.27 for Enfold 3.8. The current googlemap.js is >4.7.!March 6, 2017 at 9:41 pm #756598Hi!
Let us know if that solution does work out for you.
Thank you very much for sharingBest regards,
BasilisMarch 7, 2017 at 4:46 am #756718it is not a very good solution since it disables a core function of ENFOLD and these changes will be lost on a theme update. A far better approach would be a revise of google map (admin) functionalities by ENFOLD. Since popularity of the theme is growing there are more people out there using ENFOLD as base theme for customization – so am I one of those.
March 13, 2017 at 9:02 am #759871Hey!
@guido: The filter above should do the same thing like your modification. It will disable theme’s default map api.
add_filter( 'avf_load_google_map_api', '__return_false' );
If this is not working, use this:
add_action('after_setup_theme', 'ava_disable_gmap'); function ava_disable_gmap() { add_filter('avf_load_google_map_api', function($load_google_map_api) { $load_google_map_api = false; return $load_google_map_api; },10,1); add_filter('avia_google_maps_widget_load_api', function($load_google_map_api) { $load_google_map_api = false; return $load_google_map_api; },10,1); }
Regards,
IsmaelMarch 20, 2017 at 7:37 am #763516I really wish I could say that either of the codes you shared work. Unfortunately, I need more help. I do not think this is working. I am including details in the private content area.
In a nutshell, I implemented your code and tested it by removing the API key for google api in the enfold admin panel. Doing that stops my maps from working.
March 20, 2017 at 9:22 pm #763806sure, without the js. lib the google map is not working. But if you embed the google maps.js api on your own in your wp installation, it should work.
March 20, 2017 at 9:26 pm #763808Is there truly a way to disable Enfold’s google map api calls using the filters provided above? Thus far, I can’t get them to work.
I believe you found a way to make it work by modifying files that would get overwritten in a theme update and that as you pointed out is not an ideal solution.
I continue to post here to get some insights from Kriesi support on this issue.
March 20, 2017 at 9:38 pm #763813I did not test the solution provided by ENFOLD support which is nothing else then switch off the API completely with also effects the frontend.
The “solution” I proposed was a simple hack to avoid the backend problem (if you a plugin which also uses the maps for backend processes) but leaves the frontend untouched. It will get overwritten if you install an update of the theme though.March 20, 2017 at 9:41 pm #763814I may need to explore your hack.
The plugin I use makes calls from both the backend and the frontend.
March 24, 2017 at 6:09 am #765894Hi,
In a nutshell, I implemented your code and tested it by removing the API key for google api in the enfold admin panel. Doing that stops my maps from working.
Isn’t that the purpose of the filter? It will disable the google map api hence disabling the google map element and removing the conflict from another source such as a plugin.
Best regards,
IsmaelMarch 31, 2017 at 2:09 am #769700Hi Ismael,
Thank you, but the other map solution should takeover and work at the point you disable enfold. Any ideas?March 31, 2017 at 6:35 am #769730Hi!
I’m sorry but what “other map solution”? The purpose of the filter that we provided above is to disable the theme’s google map api. Please note that the theme’s map element is not going to work after adding the filter. Are you still planning to use the theme’s map element after installing another map plugin?
Regards,
IsmaelMarch 31, 2017 at 6:51 am #769735No. I am not.
My point that I am trying to make is that the map plugin is working. I am receiving these conflicts here and there.
I believe your code disabled the ENFOLD google map api completely, then it should be off such that when you remove the api key from the enfold admin interface it should have no impact on the display of the maps. If there was a negative impact, it should occur when the you disable the ENFOLD google map api (and not when you remove google map api key).
Does that make sense? Or am I misunderstanding something?
March 31, 2017 at 8:04 am #769765Hey!
The google map api key that you added in the theme options will be rendered useless or disabled once you added the filter. Does the plugin require you to add a google map api key? I’m sure it has its own option for that.
Regards,
IsmaelMarch 31, 2017 at 2:51 pm #769974to get googlemap working you have to include the google map api.js ONCE only. So just make sure, that’s the case , by looking in your sourcecode (both admin-logged in and as frontend user) to make sure there is always only one <script>…. </script> with the google map .js file.
When ENFOLD map api is disabled, the js file has to included by your plugin or you use WP enqueue script in function.php to include it by yourself (which I would recommend to do).March 31, 2017 at 4:52 pm #770082I understand that.
Currently, both Enfold and my map plugin use the Google map .js file.
If Enfold google map api and .js files are completely disabled, then I should be able to remove the map API key from the Enfold backend without consequence? Meaning, the frontend should not be affected. However, this is not the case.The question is whether the call for the .js file is completely disabled with that code because from my experience thus far it doesnt appear to be.
March 31, 2017 at 6:26 pm #770121If you disable the Enfold Google Maps Api function the api key you put in the Enfold-Admin section is useless or has no effect. You can leave it there or not it has no effect. Enfold is not calling anymore the google.maps.js script.
You can check:
1) Browser Console -> is google maps api called or not?
2) Source: Search for the script
If you find the script 1x it should be ok, if you find it twice then you have not disabled the Enfold Map API.March 31, 2017 at 6:28 pm #770123Do you agree that the Enfold google js is not disabled if I can remove the key and it impacts the site?
March 31, 2017 at 6:51 pm #770132yes, then its not disabled.
April 3, 2017 at 3:38 am #770848Hi!
Do you agree that the Enfold google js is not disabled if I can remove the key and it impacts the site?
What happens if you remove the google api key from the theme options? Please provide a link to the page with the issue. Please note that every google map api requires a key so the map plugin that you’re using should have that option somewhere. If not, please contact the plugin author for more info.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.