Advertisement
Guest User

java

a guest
Jul 5th, 2016
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             if ( google_map_needed() ) {
  2.  
  3.                 // TODO: improve google map arguments by adding option to provide API key
  4.  
  5.                 // default map query parameters
  6.                 $google_map_arguments = array ();
  7.  
  8.                 // Localise Google Map if related theme options is set
  9.                 if ( 'true' == get_option( 'theme_map_localization' ) ) {
  10.                     if ( function_exists( 'wpml_object_id_filter' ) ) {                         // FOR WPML
  11.                         $google_map_arguments[ 'language' ] = urlencode( ICL_LANGUAGE_CODE );
  12.                     } else {                                                                    // FOR Default
  13.                         $google_map_arguments[ 'language' ] = urlencode( get_locale() );
  14.                     }
  15.                 }
  16.  
  17.                 // Google Map API
  18.                 wp_enqueue_script(
  19.                     'google-map-api',
  20.                     esc_url_raw(
  21.                         add_query_arg(
  22.                             apply_filters(
  23.                                 'inspiry_google_map_arguments',
  24.                                 $google_map_arguments
  25.                             ),
  26.                             '//maps.google.com/maps/api/js'
  27.                         )
  28.                     ),
  29.                     array(),
  30.                     '3.21',
  31.                     false
  32.                 );
  33.  
  34.                 // Google Map Info Box API
  35.                 wp_enqueue_script(
  36.                     'google-map-info-box',
  37.                     esc_url_raw( $js_directory_uri . 'infobox.js' ),
  38.                     array( 'google-map-api' ),
  39.                     '1.1.9'
  40.                 );
  41.  
  42.                 wp_enqueue_script(
  43.                     'google-map-marker-clusterer',
  44.                     esc_url_raw( $js_directory_uri . 'markerclusterer.js' ),
  45.                     array( 'google-map-api' ),
  46.                     '2.1.1'
  47.                 );
  48.  
  49.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement