Tijmen Smit on "[Plugin: WP Store Locator] Mutiple API's"

ساخت وبلاگ

jaapjaapie
Member
Posted 1 hour ago #

Hi There,

I'm using this awesome plugin, but it doesn't work anymore.
I've installed Delightfull Downloads, and since then the locator won't work.
The map doens't load anymore

Trough a debugger tool i've found out that it gives the following error:

You have included the Google Maps API multiple times on this page. This may cause unexpected errors. js?language=nl&region=nl:99

ah @ js?language=nl&region=nl:99
(anonymous function) @ js?language=nl&region=nl:135
google.maps.Load @ js?language=nl&region=nl:18
(anonymous function) @ js?language=nl&region=nl:135
(anonymous function) @ js?language=nl&region=nl:136

I hope somebody can help me with a solution!

Kind Regards,
Jaap de Jong

https://wordpress.org/plugins/wp-store-locator/

jaapjaapie
Member
Posted 1 hour ago #

My Delightful downloads plugin didn't work correctly, so from the support i got a line of code which resolve my problem with Delightful downloads.

But that line of code is also creating the problem with store locator, if i remove this line of code, the store locator works perfectly but my downloads plugin not.

This is the code i added:


function dedo_custom_ddownload_supports( $args ) {
retu array( 'title', 'editor' );
}
add_filter( 'dedo_ddownload_supports', 'dedo_custom_ddownload_supports' );

Tijmen Smit
Member
Plugin Author

Posted 12 minutes ago #

Including the Google Maps library multiple times will break it.

This problem happens on the front-end, right?

The only way you can fix this issue, is by making sure Delightful downloads conditionally loads the Google Maps library.

You can use is_page for that, to only make it include Google Maps if you're not on the store locator page. So you can try to use that inside the code you added to make the retued array conditional.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 108 تاريخ : دوشنبه 13 ارديبهشت 1395 ساعت: 21:24