Permalink
Browse files

Added is_ssl() check for external JS files.

  • Loading branch information...
1 parent f9ed2fe commit 0fd7e22fa346fe0182cdbe29bfa6072ffa6336d5 @remcotolsma remcotolsma committed Feb 8, 2013
Showing with 14 additions and 2 deletions.
  1. +14 −2 classes/Pronamic/Google/Maps/Maps.php
@@ -179,16 +179,28 @@ public static function parse_query( $query ) {
* Register scripts
*/
public static function registerScripts() {
+ $protocol = is_ssl() ? 'https' : 'http';
+
// Register the Google JavaScript API loader script
wp_register_script(
'google-jsapi',
- 'http://www.google.com/jsapi'
+ add_query_arg(
+ array(
+
+ ),
+ $protocol . '://www.google.com/jsapi'
+ )
);
// Register the Google Maps script
wp_register_script(
'google-maps',
- 'https://maps.googleapis.com/maps/api/js?sensor=false'
+ add_query_arg(
+ array(
+ 'sensor' => 'false'
+ ),
+ $protocol . '://maps.googleapis.com/maps/api/js'
+ )
);
// MarkerClustererPlus

0 comments on commit 0fd7e22

Please sign in to comment.