Last active
September 5, 2016 05:43
-
-
Save kprajapatii/dd617fc89f25d24227de73b6e072e6a9 to your computer and use it in GitHub Desktop.
Fixing Google Maps error "You have included the Google Maps API multiple times on this page. This may cause unexpected errors." Put code in your current theme functions.php file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Fixing Google Maps error "You have included the Google Maps API multiple times on this page. This may cause unexpected errors." | |
function geodirectory_fix_multiple_google_maps_api() { | |
$dequeue_handle = 'google-maps'; // script handle to dequeue script | |
if ( wp_script_is( 'geodirectory-googlemap-script', 'enqueued' ) && wp_script_is( $dequeue_handle, 'enqueued' ) ) { | |
wp_dequeue_script( $dequeue_handle ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'geodirectory_fix_multiple_google_maps_api', 101 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment