Code Duplication    Length = 7-14 lines in 2 locations

geodirectory_template_tags.php 1 location

@@ 91-104 (lines=14) @@
88
        wp_enqueue_script('geodirectory-jquery-simplemodal');
89
    }
90
91
    if (in_array($geodir_map_name, array('auto', 'google'))) {
92
        $map_lang = "&language=" . geodir_get_map_default_language();
93
        $map_key = "&key=" . geodir_get_map_api_key();
94
        /**
95
         * Filter the variables that are added to the end of the google maps script call.
96
         *
97
         * This i used to change things like google maps language etc.
98
         *
99
         * @since 1.0.0
100
         * @param string $var The string to filter, default is empty string.
101
         */
102
        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
    }
105
    
106
    if ($geodir_map_name == 'osm') {
107
        // Leaflet OpenStreetMap

geodirectory-admin/admin_functions.php 1 location

@@ 109-115 (lines=7) @@
106
107
        wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true);
108
109
        if (in_array($geodir_map_name, array('auto', 'google'))) {
110
            $map_lang = "&language=" . geodir_get_map_default_language();
111
            $map_key = "&key=" . geodir_get_map_api_key();
112
            /** This filter is documented in geodirectory_template_tags.php */
113
            $map_extra = apply_filters('geodir_googlemap_script_extra', '');
114
            wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra, '', NULL);
115
        }
116
        
117
        if ($geodir_map_name == 'osm') {
118
            // Leaflet OpenStreetMap