Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( google_map_needed() ) {
- // TODO: improve google map arguments by adding option to provide API key
- // default map query parameters
- $google_map_arguments = array ();
- // Localise Google Map if related theme options is set
- if ( 'true' == get_option( 'theme_map_localization' ) ) {
- if ( function_exists( 'wpml_object_id_filter' ) ) { // FOR WPML
- $google_map_arguments[ 'language' ] = urlencode( ICL_LANGUAGE_CODE );
- } else { // FOR Default
- $google_map_arguments[ 'language' ] = urlencode( get_locale() );
- }
- }
- // Google Map API
- wp_enqueue_script(
- 'google-map-api',
- esc_url_raw(
- add_query_arg(
- apply_filters(
- 'inspiry_google_map_arguments',
- $google_map_arguments
- ),
- '//maps.google.com/maps/api/js'
- )
- ),
- array(),
- '3.21',
- false
- );
- // Google Map Info Box API
- wp_enqueue_script(
- 'google-map-info-box',
- esc_url_raw( $js_directory_uri . 'infobox.js' ),
- array( 'google-map-api' ),
- '1.1.9'
- );
- wp_enqueue_script(
- 'google-map-marker-clusterer',
- esc_url_raw( $js_directory_uri . 'markerclusterer.js' ),
- array( 'google-map-api' ),
- '2.1.1'
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement