Skip to content

Commit

Permalink
Fix: Google Maps async. Prefix added for [listing_map] feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
mervb committed Feb 13, 2024
1 parent 00c15b7 commit 4810e61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/shortcodes/shortcode-listing-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ function epl_shortcode_googlemap_callback( $atts, $content = null ) {
* Loads google map script on non EPL pages if listing_map shortcode is called.
*
* @since 3.5.0
* @since 3.5.3 Google Maps async. Prefix added.
*/
function epl_shortcode_googlemap_enqueue() {

$googleapiurl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=Function.prototype';
$googleapiurl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=Function.prototype&loading=async';
$epl_google_api_key = epl_get_option( 'epl_google_api_key' );
if ( ! empty( $epl_google_api_key ) ) {
$googleapiurl = $googleapiurl . '&key=' . epl_get_option( 'epl_google_api_key' );
}

if ( epl_get_option( 'epl_disable_google_api' ) !== 'on' ) {
wp_enqueue_script( 'google-map-v-3', $googleapiurl, array(), EPL_PROPERTY_VER, false );
wp_enqueue_script( 'epl-google-map-v-3', $googleapiurl, array(), EPL_PROPERTY_VER, false );
}
}

0 comments on commit 4810e61

Please sign in to comment.