Changeset 1870007
- Timestamp:
- 05/07/2018 01:06:55 PM (8 years ago)
- Location:
- gmaps-google-maps-shortcode/trunk
- Files:
-
- 2 edited
-
GMaps.php (modified) (4 diffs)
-
README.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
gmaps-google-maps-shortcode/trunk/GMaps.php
r1868734 r1870007 4 4 Plugin URI: https://github.com/VSTeks/GMapsGoogleMapsShortcode 5 5 Description: Adds shortcode's to insert Google Maps via the javascript API. 6 Version: 1.0. 06 Version: 1.0.1 7 7 Author: VSteks 8 8 Author URI: http://vsteks.com/ … … 100 100 } 101 101 unset($GLOBALS["5ae9fcc8cf7e2-current-gmaps-map-id"]); 102 wp_enqueue_script('gmaps-includes-5ae9fcc8cf7e2', "https://maps.googleapis.com/maps/api/js?key=".get_option('google_maps_api_key_5ae9fcc8cf7e2')."&callback=gmaps_init_5ae9fcc8cf7e2", array(), "1.0", false); 102 103 return $out."id='$mapId'></div>"; 103 104 } … … 308 309 $polygons = implode('', $GLOBALS["5ae9fcc8cf7e2-gmaps-polygons"]); 309 310 $info_windows = implode('', $GLOBALS["5ae9fcc8cf7e2-gmaps-info-windows"]); 310 $key = get_option("google_maps_api_key_5ae9fcc8cf7e2");311 312 if(!$key) {313 echo "<div class='notice notice-error'>Google Maps Require an api key be set in Settings > General</div>";314 }315 311 $script = " 316 312 function gmaps_init_5ae9fcc8cf7e2() { … … 321 317 $info_windows 322 318 }"; 323 wp_enqueue_script('gmaps-includes-5ae9fcc8cf7e2', "https://maps.googleapis.com/maps/api/js?key=".$key."&callback=gmaps_init_5ae9fcc8cf7e2", array(), "1.0", false);324 319 wp_add_inline_script("gmaps-includes-5ae9fcc8cf7e2", $script, 'before'); 325 320 // Unset Global variables. -
gmaps-google-maps-shortcode/trunk/README.txt
r1868737 r1870007 14 14 == Changelog == 15 15 16 v1.0.1 [5-5-2018] 17 Only enqueue Google maps javascript if shortcode is present on page. 18 16 19 == Frequently Asked Questions == 17 20
Note: See TracChangeset
for help on using the changeset viewer.