Test Failed
Push — master ( f3cf1b...aecc65 )
by Stiofan
12:45
created
geodirectory_template_tags.php 1 patch
Indentation   +352 added lines, -352 removed lines patch added patch discarded remove patch
@@ -36,177 +36,177 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function geodir_templates_scripts()
38 38
 {
39
-    $is_detail_page = false;
40
-    $geodir_map_name = geodir_map_name();
39
+	$is_detail_page = false;
40
+	$geodir_map_name = geodir_map_name();
41 41
 
42
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
43
-        $is_detail_page = true;
44
-    }
42
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
43
+		$is_detail_page = true;
44
+	}
45 45
 
46
-    wp_enqueue_script('jquery');
46
+	wp_enqueue_script('jquery');
47 47
 
48
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
49
-    wp_enqueue_script('geodirectory-script');
48
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
49
+	wp_enqueue_script('geodirectory-script');
50 50
 
51
-    $geodir_vars_data = array(
52
-        'siteurl' => get_option('siteurl'),
53
-        'geodir_plugin_url' => geodir_plugin_url(),
54
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
55
-        'geodir_ajax_url' => geodir_get_ajax_url(),
56
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
57
-        'is_rtl' => is_rtl() ? 1 : 0, // fix rtl issue
51
+	$geodir_vars_data = array(
52
+		'siteurl' => get_option('siteurl'),
53
+		'geodir_plugin_url' => geodir_plugin_url(),
54
+		'geodir_lazy_load' => get_option('geodir_lazy_load',1),
55
+		'geodir_ajax_url' => geodir_get_ajax_url(),
56
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
57
+		'is_rtl' => is_rtl() ? 1 : 0, // fix rtl issue
58 58
 		'lightBox_txtImage' => addslashes(__('Image', 'geodirectory')),
59 59
 		'lightBox_txtOf' => addslashes(__('of', 'geodirectory')),
60
-    );
61
-
62
-    /**
63
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
64
-     *
65
-     * This is used by addons to add JS translatable variables.
66
-     *
67
-     * @since 1.4.4
68
-     * @param array $geodir_vars_data {
69
-     *    geodir var data used by addons to add JS translatable variables.
70
-     *
71
-     *    @type string $siteurl Site url.
72
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
73
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
74
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
75
-     *    @type int $is_rtl Checks if current locale is RTL.
76
-     *
77
-     * }
78
-     */
79
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
80
-
81
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
82
-
83
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
85
-
86
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
87
-    wp_enqueue_script('geodirectory-lightbox-jquery');
88
-
89
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
90
-    if ($is_detail_page) {
91
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
92
-    }
60
+	);
61
+
62
+	/**
63
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
64
+	 *
65
+	 * This is used by addons to add JS translatable variables.
66
+	 *
67
+	 * @since 1.4.4
68
+	 * @param array $geodir_vars_data {
69
+	 *    geodir var data used by addons to add JS translatable variables.
70
+	 *
71
+	 *    @type string $siteurl Site url.
72
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
73
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
74
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
75
+	 *    @type int $is_rtl Checks if current locale is RTL.
76
+	 *
77
+	 * }
78
+	 */
79
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
80
+
81
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
82
+
83
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
84
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
85
+
86
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
87
+	wp_enqueue_script('geodirectory-lightbox-jquery');
88
+
89
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
90
+	if ($is_detail_page) {
91
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
92
+	}
93 93
 
94
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
95
-        $map_lang = "&language=" . geodir_get_map_default_language();
96
-        $map_key = "&key=" . geodir_get_map_api_key();
97
-        /**
98
-         * Filter the variables that are added to the end of the google maps script call.
99
-         *
100
-         * This i used to change things like google maps language etc.
101
-         *
102
-         * @since 1.0.0
103
-         * @param string $var The string to filter, default is empty string.
104
-         */
105
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
106
-        wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
94
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
95
+		$map_lang = "&language=" . geodir_get_map_default_language();
96
+		$map_key = "&key=" . geodir_get_map_api_key();
97
+		/**
98
+		 * Filter the variables that are added to the end of the google maps script call.
99
+		 *
100
+		 * This i used to change things like google maps language etc.
101
+		 *
102
+		 * @since 1.0.0
103
+		 * @param string $var The string to filter, default is empty string.
104
+		 */
105
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
106
+		wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
107 107
         
108
-        // Overlapping Marker Spiderfier
109
-        wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
110
-        wp_enqueue_script('geodirectory-g-overlappingmarker-script');
111
-    }
108
+		// Overlapping Marker Spiderfier
109
+		wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
110
+		wp_enqueue_script('geodirectory-g-overlappingmarker-script');
111
+	}
112 112
     
113
-    if ($geodir_map_name == 'osm') {
114
-        // Leaflet OpenStreetMap
115
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
116
-        wp_enqueue_style('geodirectory-leaflet-style');
113
+	if ($geodir_map_name == 'osm') {
114
+		// Leaflet OpenStreetMap
115
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
116
+		wp_enqueue_style('geodirectory-leaflet-style');
117 117
             
118
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
119
-        wp_enqueue_script('geodirectory-leaflet-script');
118
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
119
+		wp_enqueue_script('geodirectory-leaflet-script');
120 120
         
121
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
122
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
121
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
122
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
123 123
         
124
-        if ($is_detail_page) {
125
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
126
-            wp_enqueue_style('geodirectory-leaflet-routing-style');
124
+		if ($is_detail_page) {
125
+			wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
126
+			wp_enqueue_style('geodirectory-leaflet-routing-style');
127 127
                 
128
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
129
-            wp_enqueue_script('geodirectory-leaflet-routing-script');
130
-        }
128
+			wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
129
+			wp_enqueue_script('geodirectory-leaflet-routing-script');
130
+		}
131 131
         
132
-        // Overlapping Marker Spiderfier Leaflet
133
-        wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
134
-        wp_enqueue_script('geodirectory-o-overlappingmarker-script');
135
-    }
136
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
132
+		// Overlapping Marker Spiderfier Leaflet
133
+		wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
134
+		wp_enqueue_script('geodirectory-o-overlappingmarker-script');
135
+	}
136
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
137 137
     
138
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
139
-    wp_enqueue_script('geodirectory-goMap-script');
140
-
141
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
142
-    wp_enqueue_script('chosen');
143
-
144
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
145
-    wp_enqueue_script('geodirectory-choose-ajax');
146
-
147
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
148
-
149
-    if (is_page() && geodir_is_page('add-listing')) {
150
-        // SCRIPT FOR UPLOAD
151
-        wp_enqueue_script('plupload-all');
152
-        wp_enqueue_script('jquery-ui-sortable');
153
-
154
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
155
-        wp_enqueue_script('geodirectory-plupload-script');
156
-        // SCRIPT FOR UPLOAD END
157
-
158
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
159
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
160
-            $ajax_url = admin_url('admin-ajax.php');
161
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
162
-            $ajax_url = admin_url('admin-ajax.php');
163
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
164
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
165
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
166
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
167
-        } else {
168
-            $ajax_url = admin_url('admin-ajax.php');
169
-        }
138
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
139
+	wp_enqueue_script('geodirectory-goMap-script');
140
+
141
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
142
+	wp_enqueue_script('chosen');
143
+
144
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
145
+	wp_enqueue_script('geodirectory-choose-ajax');
146
+
147
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
148
+
149
+	if (is_page() && geodir_is_page('add-listing')) {
150
+		// SCRIPT FOR UPLOAD
151
+		wp_enqueue_script('plupload-all');
152
+		wp_enqueue_script('jquery-ui-sortable');
153
+
154
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
155
+		wp_enqueue_script('geodirectory-plupload-script');
156
+		// SCRIPT FOR UPLOAD END
157
+
158
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
159
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
160
+			$ajax_url = admin_url('admin-ajax.php');
161
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
162
+			$ajax_url = admin_url('admin-ajax.php');
163
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
164
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
165
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
166
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
167
+		} else {
168
+			$ajax_url = admin_url('admin-ajax.php');
169
+		}
170 170
 
171
-        // place js config array for plupload
172
-        $plupload_init = array(
173
-            'runtimes' => 'html5,silverlight,browserplus,gears,html4',
174
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
175
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
176
-            'drop_element' => 'dropbox', // will be adjusted per uploader
177
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
178
-            'multiple_queues' => true,
179
-            'max_file_size' => geodir_max_upload_size(),
180
-            'url' => $ajax_url,
181
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
182
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
183
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
184
-            'multipart' => true,
185
-            'urlstream_upload' => true,
186
-            'multi_selection' => false, // will be added per uploader
187
-            // additional post data to send to our ajax hook
188
-            'multipart_params' => array(
189
-                '_ajax_nonce' => "", // will be added per uploader
190
-                'action' => 'plupload_action', // the ajax action name
191
-                'imgid' => 0 // will be added per uploader
192
-            )
193
-        );
194
-        $base_plupload_config = json_encode($plupload_init);
195
-
196
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
197
-            'upload_img_size' => geodir_max_upload_size());
198
-
199
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
200
-
201
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
202
-    } // End if for add place page
203
-
204
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
205
-    if ($is_detail_page) {
171
+		// place js config array for plupload
172
+		$plupload_init = array(
173
+			'runtimes' => 'html5,silverlight,browserplus,gears,html4',
174
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
175
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
176
+			'drop_element' => 'dropbox', // will be adjusted per uploader
177
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
178
+			'multiple_queues' => true,
179
+			'max_file_size' => geodir_max_upload_size(),
180
+			'url' => $ajax_url,
181
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
182
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
183
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
184
+			'multipart' => true,
185
+			'urlstream_upload' => true,
186
+			'multi_selection' => false, // will be added per uploader
187
+			// additional post data to send to our ajax hook
188
+			'multipart_params' => array(
189
+				'_ajax_nonce' => "", // will be added per uploader
190
+				'action' => 'plupload_action', // the ajax action name
191
+				'imgid' => 0 // will be added per uploader
192
+			)
193
+		);
194
+		$base_plupload_config = json_encode($plupload_init);
195
+
196
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
197
+			'upload_img_size' => geodir_max_upload_size());
198
+
199
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
200
+
201
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
202
+	} // End if for add place page
203
+
204
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
205
+	if ($is_detail_page) {
206 206
 		wp_enqueue_script('geodirectory-post-custom-js');
207 207
 	}
208 208
 
209
-    // font awesome rating script
209
+	// font awesome rating script
210 210
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
211 211
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
212 212
 		wp_enqueue_script('geodir-barrating-js');
@@ -215,11 +215,11 @@  discard block
 block discarded – undo
215 215
 		wp_enqueue_script('geodir-jRating-js');
216 216
 	}
217 217
 
218
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
219
-    wp_enqueue_script('geodir-on-document-load');
218
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
219
+	wp_enqueue_script('geodir-on-document-load');
220 220
 
221
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
222
-    wp_enqueue_script('google-geometa');
221
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
222
+	wp_enqueue_script('google-geometa');
223 223
 }
224 224
 
225 225
 /**
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
  */
234 234
 function geodir_header_scripts()
235 235
 {
236
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
237
-    echo stripslashes(get_option('geodir_header_scripts'));
236
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
237
+	echo stripslashes(get_option('geodir_header_scripts'));
238 238
 }
239 239
 
240 240
 /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_google_analytics_tracking_code()
249 249
 {
250
-    if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
250
+	if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
251 251
 
252 252
         <script>
253 253
             (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
         </script>
263 263
 
264 264
         <?php
265
-    }elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
266
-        echo stripslashes(get_option('geodir_ga_tracking_code'));
267
-    }
265
+	}elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
266
+		echo stripslashes(get_option('geodir_ga_tracking_code'));
267
+	}
268 268
 }
269 269
 
270 270
 /**
@@ -278,16 +278,16 @@  discard block
 block discarded – undo
278 278
 function geodir_footer_scripts()
279 279
 {
280 280
 
281
-    echo stripslashes(get_option('geodir_footer_scripts'));
281
+	echo stripslashes(get_option('geodir_footer_scripts'));
282 282
 
283
-    /*
283
+	/*
284 284
      * Apple suck and can't/won't fix bugs: https://bugs.webkit.org/show_bug.cgi?id=136041
285 285
      *
286 286
      * Flexbox wont wrap on ios for search form items
287 287
      */
288
-    if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
289
-        echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
290
-    }
288
+	if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
289
+		echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
290
+	}
291 291
 }
292 292
 
293 293
 
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
  */
302 302
 function geodir_add_async_forscript($url)
303 303
 {
304
-    if (strpos($url, '#asyncload')===false)
305
-        return $url;
306
-    else if (is_admin())
307
-        return str_replace('#asyncload', '', $url);
308
-    else
309
-        return str_replace('#asyncload', '', $url)."' async='async";
304
+	if (strpos($url, '#asyncload')===false)
305
+		return $url;
306
+	else if (is_admin())
307
+		return str_replace('#asyncload', '', $url);
308
+	else
309
+		return str_replace('#asyncload', '', $url)."' async='async";
310 310
 }
311 311
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
312 312
 
@@ -319,18 +319,18 @@  discard block
 block discarded – undo
319 319
 function geodir_templates_styles()
320 320
 {
321 321
 
322
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
323
-    wp_enqueue_style('geodir-core-scss');
324
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
322
+	wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
323
+	wp_enqueue_style('geodir-core-scss');
324
+	wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
325 325
 
326
-    if(is_rtl()){
327
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
328
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
329
-    }
326
+	if(is_rtl()){
327
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
328
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
329
+	}
330 330
 
331
-    wp_register_script('font-awesome', 'https://use.fontawesome.com/releases/v5.5.0/js/all.js#faload', array('font-awesome-shim'), GEODIRECTORY_VERSION);
332
-    wp_register_script('font-awesome-shim', 'https://use.fontawesome.com/releases/v5.5.0/js/v4-shims.js', array(), GEODIRECTORY_VERSION);
333
-    wp_enqueue_script( 'font-awesome' );
331
+	wp_register_script('font-awesome', 'https://use.fontawesome.com/releases/v5.5.0/js/all.js#faload', array('font-awesome-shim'), GEODIRECTORY_VERSION);
332
+	wp_register_script('font-awesome-shim', 'https://use.fontawesome.com/releases/v5.5.0/js/v4-shims.js', array(), GEODIRECTORY_VERSION);
333
+	wp_enqueue_script( 'font-awesome' );
334 334
 
335 335
 
336 336
 }
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function geodir_get_sidebar()
346 346
 {
347
-    get_sidebar('geodirectory');
347
+	get_sidebar('geodirectory');
348 348
 }
349 349
 
350 350
 /**
@@ -363,122 +363,122 @@  discard block
 block discarded – undo
363 363
  * @param bool $always_show Do you want to show the pagination always? Default: false.
364 364
  */
365 365
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
366
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
366
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
367 367
 
368
-    if (empty($prelabel)) {
369
-        $prelabel = '<strong>&lt;</strong>';
370
-    }
368
+	if (empty($prelabel)) {
369
+		$prelabel = '<strong>&lt;</strong>';
370
+	}
371 371
 
372
-    if (empty($nxtlabel)) {
373
-        $nxtlabel = '<strong>&gt;</strong>';
374
-    }
372
+	if (empty($nxtlabel)) {
373
+		$nxtlabel = '<strong>&gt;</strong>';
374
+	}
375 375
 
376
-    $half_pages_to_show = round($pages_to_show / 2);
376
+	$half_pages_to_show = round($pages_to_show / 2);
377 377
 
378
-    if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
379
-        return;
378
+	if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
379
+		return;
380 380
 
381
-    if (!is_single()) {
382
-        if (function_exists('geodir_location_geo_home_link')) {
383
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
384
-        }
385
-        $numposts = $wp_query->found_posts;
381
+	if (!is_single()) {
382
+		if (function_exists('geodir_location_geo_home_link')) {
383
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
384
+		}
385
+		$numposts = $wp_query->found_posts;
386 386
 
387
-        $max_page = ceil($numposts / $posts_per_page);
387
+		$max_page = ceil($numposts / $posts_per_page);
388 388
 
389
-        if (empty($paged)) {
390
-            $paged = 1;
391
-        }
389
+		if (empty($paged)) {
390
+			$paged = 1;
391
+		}
392 392
         
393
-        $post_type = geodir_get_current_posttype();
394
-        $listing_type_name = get_post_type_plural_label($post_type);
395
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
396
-            $term = array();
393
+		$post_type = geodir_get_current_posttype();
394
+		$listing_type_name = get_post_type_plural_label($post_type);
395
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
396
+			$term = array();
397 397
             
398
-            if (is_tax()) {
399
-                $term_id = get_queried_object_id();
400
-                $taxonomy = get_query_var('taxonomy');
398
+			if (is_tax()) {
399
+				$term_id = get_queried_object_id();
400
+				$taxonomy = get_query_var('taxonomy');
401 401
 
402
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
403
-                    $term = get_term($term_id, $post_type . 'category');
404
-                }
405
-            }
402
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
403
+					$term = get_term($term_id, $post_type . 'category');
404
+				}
405
+			}
406 406
             
407
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
408
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
407
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
408
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
409 409
                 
410
-                if (!is_array($taxonomy_search)) {
411
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
412
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
413
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
414
-                }
415
-            }
410
+				if (!is_array($taxonomy_search)) {
411
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
412
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
413
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
414
+				}
415
+			}
416 416
             
417
-            if (!empty($term) && !is_wp_error($term)) {
418
-                $listing_type_name = $term->name;
419
-            }
420
-        }
417
+			if (!empty($term) && !is_wp_error($term)) {
418
+				$listing_type_name = $term->name;
419
+			}
420
+		}
421 421
 
422
-        if ($max_page > 1 || $always_show) {            
423
-            // Extra pagination info
424
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
425
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
426
-            $end_no = min($paged * $posts_per_page, $numposts);
422
+		if ($max_page > 1 || $always_show) {            
423
+			// Extra pagination info
424
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
425
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
426
+			$end_no = min($paged * $posts_per_page, $numposts);
427 427
 
428
-            if ($geodir_pagination_more_info != '') {
429
-                if ($listing_type_name) {
430
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
431
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
432
-                } else {
433
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
434
-                }
435
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
436
-                /**
437
-                 * Adds an extra pagination info above/under pagination.
438
-                 *
439
-                 * @since 1.5.9
440
-                 *
441
-                 * @param string $pagination_info Extra pagination info content.
442
-                 * @param string $listing_type_name Listing results type.
443
-                 * @param string $start_no First result number.
444
-                 * @param string $end_no Last result number.
445
-                 * @param string $numposts Total number of listings.
446
-                 * @param string $post_type The post type.
447
-                 */
448
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
428
+			if ($geodir_pagination_more_info != '') {
429
+				if ($listing_type_name) {
430
+					$listing_type_name = __($listing_type_name, 'geodirectory');
431
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
432
+				} else {
433
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
434
+				}
435
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
436
+				/**
437
+				 * Adds an extra pagination info above/under pagination.
438
+				 *
439
+				 * @since 1.5.9
440
+				 *
441
+				 * @param string $pagination_info Extra pagination info content.
442
+				 * @param string $listing_type_name Listing results type.
443
+				 * @param string $start_no First result number.
444
+				 * @param string $end_no Last result number.
445
+				 * @param string $numposts Total number of listings.
446
+				 * @param string $post_type The post type.
447
+				 */
448
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
449 449
                 
450
-                if ($geodir_pagination_more_info == 'before') {
451
-                    $before = $before . $pagination_info;
452
-                } else if ($geodir_pagination_more_info == 'after') {
453
-                    $after = $pagination_info . $after;
454
-                }
455
-            }
450
+				if ($geodir_pagination_more_info == 'before') {
451
+					$before = $before . $pagination_info;
452
+				} else if ($geodir_pagination_more_info == 'after') {
453
+					$after = $pagination_info . $after;
454
+				}
455
+			}
456 456
             
457
-            echo "$before <div class='Navi gd-navi'>";
458
-            if ($paged >= ($pages_to_show - 1)) {
459
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
460
-            }
461
-            previous_posts_link($prelabel);
462
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
463
-                if ($i >= 1 && $i <= $max_page) {
464
-                    if ($i == $paged) {
465
-                        echo "<strong class='on'>$i</strong>";
466
-                    } else {
467
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
468
-                    }
469
-                }
470
-            }
471
-            next_posts_link($nxtlabel, $max_page);
472
-            if (($paged + $half_pages_to_show) < ($max_page)) {
473
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
474
-            }
475
-            echo "</div> $after";
476
-        }
457
+			echo "$before <div class='Navi gd-navi'>";
458
+			if ($paged >= ($pages_to_show - 1)) {
459
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
460
+			}
461
+			previous_posts_link($prelabel);
462
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
463
+				if ($i >= 1 && $i <= $max_page) {
464
+					if ($i == $paged) {
465
+						echo "<strong class='on'>$i</strong>";
466
+					} else {
467
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
468
+					}
469
+				}
470
+			}
471
+			next_posts_link($nxtlabel, $max_page);
472
+			if (($paged + $half_pages_to_show) < ($max_page)) {
473
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
474
+			}
475
+			echo "</div> $after";
476
+		}
477 477
         
478
-        if (function_exists('geodir_location_geo_home_link')) {
479
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
480
-        }
481
-    }
478
+		if (function_exists('geodir_location_geo_home_link')) {
479
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
480
+		}
481
+	}
482 482
 }
483 483
 
484 484
 /**
@@ -489,20 +489,20 @@  discard block
 block discarded – undo
489 489
  */
490 490
 function geodir_listingsearch_scripts()
491 491
 {
492
-    if (get_option('gd_search_dist') != '') {
493
-        $dist = get_option('gd_search_dist');
494
-    } else {
495
-        $dist = 500;
496
-    }
497
-    $dist_dif = 1000;
498
-
499
-    if ($dist <= 5000) $dist_dif = 500;
500
-    if ($dist <= 1000) $dist_dif = 100;
501
-    if ($dist <= 500) $dist_dif = 50;
502
-    if ($dist <= 100) $dist_dif = 10;
503
-    if ($dist <= 50) $dist_dif = 5;
504
-
505
-    ?>
492
+	if (get_option('gd_search_dist') != '') {
493
+		$dist = get_option('gd_search_dist');
494
+	} else {
495
+		$dist = 500;
496
+	}
497
+	$dist_dif = 1000;
498
+
499
+	if ($dist <= 5000) $dist_dif = 500;
500
+	if ($dist <= 1000) $dist_dif = 100;
501
+	if ($dist <= 500) $dist_dif = 50;
502
+	if ($dist <= 100) $dist_dif = 10;
503
+	if ($dist <= 50) $dist_dif = 5;
504
+
505
+	?>
506 506
     <script type="text/javascript">
507 507
 
508 508
         jQuery(function ($) {
@@ -560,20 +560,20 @@  discard block
 block discarded – undo
560 560
  * @package GeoDirectory
561 561
  */
562 562
 function geodir_add_sharelocation_scripts() {
563
-    $default_search_for_text = SEARCH_FOR_TEXT;
564
-    if (get_option('geodir_search_field_default_text'))
565
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
563
+	$default_search_for_text = SEARCH_FOR_TEXT;
564
+	if (get_option('geodir_search_field_default_text'))
565
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
566 566
 
567
-    $default_near_text = NEAR_TEXT;
568
-    if (get_option('geodir_near_field_default_text'))
569
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
567
+	$default_near_text = NEAR_TEXT;
568
+	if (get_option('geodir_near_field_default_text'))
569
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
570 570
     
571
-    $search_location = geodir_get_default_location();
571
+	$search_location = geodir_get_default_location();
572 572
     
573
-    $default_search_for_text = addslashes(stripslashes($default_search_for_text));
574
-    $default_near_text = addslashes(stripslashes($default_near_text));
575
-    $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
576
-    ?>
573
+	$default_search_for_text = addslashes(stripslashes($default_search_for_text));
574
+	$default_near_text = addslashes(stripslashes($default_near_text));
575
+	$city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
576
+	?>
577 577
     <script type="text/javascript">
578 578
         var default_location = '<?php echo $city ;?>';
579 579
         var latlng;
@@ -665,14 +665,14 @@  discard block
 block discarded – undo
665 665
                     initialise2();
666 666
                 } else {
667 667
                     <?php
668
-                    $near_add = get_option('geodir_search_near_addition');
669
-                    /**
670
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
671
-                     *
672
-                     * @since 1.0.0
673
-                     */
674
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
675
-                    ?>
668
+					$near_add = get_option('geodir_search_near_addition');
669
+					/**
670
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
671
+					 *
672
+					 * @since 1.0.0
673
+					 */
674
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
675
+					?>
676 676
                     if (window.gdMaps === 'google') {
677 677
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
678 678
                             function (results, status) {
@@ -786,32 +786,32 @@  discard block
 block discarded – undo
786 786
  */
787 787
 function geodir_show_badges_on_image($which, $post, $link)
788 788
 {
789
-    $return = '';
790
-    switch ($which) {
791
-        case 'featured':
792
-            /**
793
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
794
-             *
795
-             * @since 1.0.0
796
-             * @param object $post The post object.
797
-             * @param string $link The link to the post.
798
-             */
799
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
800
-            break;
801
-        case 'new' :
802
-            /**
803
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
804
-             *
805
-             * @since 1.0.0
806
-             * @param object $post The post object.
807
-             * @param string $link The link to the post.
808
-             */
809
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
810
-            break;
811
-
812
-    }
789
+	$return = '';
790
+	switch ($which) {
791
+		case 'featured':
792
+			/**
793
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
794
+			 *
795
+			 * @since 1.0.0
796
+			 * @param object $post The post object.
797
+			 * @param string $link The link to the post.
798
+			 */
799
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
800
+			break;
801
+		case 'new' :
802
+			/**
803
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
804
+			 *
805
+			 * @since 1.0.0
806
+			 * @param object $post The post object.
807
+			 * @param string $link The link to the post.
808
+			 */
809
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
810
+			break;
811
+
812
+	}
813 813
     
814
-    return $return;
814
+	return $return;
815 815
 }
816 816
 
817 817
 /**
@@ -820,9 +820,9 @@  discard block
 block discarded – undo
820 820
  * @since 1.6.22
821 821
  */
822 822
 function geodir_fix_script_conflict() {
823
-    if ( wp_script_is( 'flexslider', 'enqueued' ) && wp_script_is( 'geodirectory-jquery-flexslider-js', 'enqueued' ) ) {
824
-        wp_dequeue_script( 'flexslider' );
825
-    }
823
+	if ( wp_script_is( 'flexslider', 'enqueued' ) && wp_script_is( 'geodirectory-jquery-flexslider-js', 'enqueued' ) ) {
824
+		wp_dequeue_script( 'flexslider' );
825
+	}
826 826
 }
827 827
 add_action( 'wp_enqueue_scripts', 'geodir_fix_script_conflict', 100 );
828 828
 
@@ -835,12 +835,12 @@  discard block
 block discarded – undo
835 835
  */
836 836
 function geodir_fontawesome_defer($url)
837 837
 {
838
-    if (strpos($url, 'use.fontawesome.com/releases/')===false)
839
-        return $url;
840
-    else if (is_admin())
841
-        return str_replace('#faload', '', $url);
842
-    else
843
-        return $url."' data-search-pseudo-elements defer='defer";
838
+	if (strpos($url, 'use.fontawesome.com/releases/')===false)
839
+		return $url;
840
+	else if (is_admin())
841
+		return str_replace('#faload', '', $url);
842
+	else
843
+		return $url."' data-search-pseudo-elements defer='defer";
844 844
 }
845 845
 add_filter('clean_url', 'geodir_fontawesome_defer', 11, 1);
846 846
 
@@ -848,8 +848,8 @@  discard block
 block discarded – undo
848 848
  * Dequeue our fontawesome if using BB page.
849 849
  */
850 850
 function geodir_fix_beaver_builder(){
851
-    if(isset($_REQUEST['fl_builder'])){
852
-        wp_dequeue_script( 'font-awesome' );
853
-    }
851
+	if(isset($_REQUEST['fl_builder'])){
852
+		wp_dequeue_script( 'font-awesome' );
853
+	}
854 854
 }
855 855
 add_filter('wp_print_scripts','geodir_fix_beaver_builder',100);
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_functions.php 1 patch
Indentation   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function  geodir_init_map_jason()
17 17
 {
18
-    global $map_jason;
19
-    $map_jason = array();
18
+	global $map_jason;
19
+	$map_jason = array();
20 20
 }
21 21
 
22 22
 /**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
  */
29 29
 function geodir_init_map_canvas_array()
30 30
 {
31
-    global $map_canvas_arr;
32
-    $map_canvas_arr = array();
31
+	global $map_canvas_arr;
32
+	$map_canvas_arr = array();
33 33
 }
34 34
 
35 35
 
@@ -50,68 +50,68 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function create_marker_jason_of_posts($post)
52 52
 {
53
-    global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
53
+	global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
54 54
 
55
-    if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array)) {
55
+	if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array)) {
56 56
 
57
-        if(isset($map_jason[$post->ID])){return null;}
57
+		if(isset($map_jason[$post->ID])){return null;}
58 58
 
59
-        $srcharr = array("'", "/", "-", '"', '\\');
60
-        $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
59
+		$srcharr = array("'", "/", "-", '"', '\\');
60
+		$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
61 61
 
62
-        $default_category = isset($post->default_category) ? $post->default_category : geodir_get_post_meta($post->ID,'default_category');
62
+		$default_category = isset($post->default_category) ? $post->default_category : geodir_get_post_meta($post->ID,'default_category');
63 63
 
64
-        $geodir_cat_icons = geodir_get_term_icon();
65
-        $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$default_category]) ? $geodir_cat_icons[$default_category] : '';
64
+		$geodir_cat_icons = geodir_get_term_icon();
65
+		$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$default_category]) ? $geodir_cat_icons[$default_category] : '';
66 66
 
67
-        $post_title = $post->post_title;
68
-        $title = str_replace($srcharr, $replarr, $post_title);
67
+		$post_title = $post->post_title;
68
+		$title = str_replace($srcharr, $replarr, $post_title);
69 69
 
70
-        if (is_ssl()) {
71
-            $icon = str_replace("http:","https:",$icon );
72
-        }
70
+		if (is_ssl()) {
71
+			$icon = str_replace("http:","https:",$icon );
72
+		}
73 73
         
74
-        if ($icon != '') {
75
-            $gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
74
+		if ($icon != '') {
75
+			$gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
76 76
             
77
-            if (isset($gd_marker_sizes[$icon])) {
78
-                $icon_size = $gd_marker_sizes[$icon];
79
-            } else {
80
-                $icon_size = geodir_get_marker_size($icon);
81
-                $gd_marker_sizes[$icon] = $icon_size;
82
-            }               
83
-        } else {
84
-            $icon_size = array('w' => 36, 'h' => 45);
85
-        }
86
-
87
-        $post_latitude = isset($post->post_latitude) ? $post->post_latitude : geodir_get_post_meta($post->ID,'post_latitude');
88
-        $post_longitude = isset($post->post_longitude) ? $post->post_longitude : geodir_get_post_meta($post->ID,'post_longitude');
89
-
90
-
91
-        $post_json = '{"id":"' . $post->ID
92
-                     . '","t": "' . $title
93
-                     . '","lt": "' . $post_latitude
94
-                     . '","ln": "' . $post_longitude
95
-                     . '","mk_id":"' . $post->ID . '_' . $default_category
96
-                     . '","i":"' . $icon
97
-                     . '","w":"' . $icon_size['w']
98
-                     . '","h":"' . $icon_size['h'] . '"}';
99
-
100
-        /**
101
-         * Filter the json data when creating output for post json marker..
102
-         *
103
-         * @since 1.5.7
104
-         * @param string $post_json JSON representation of the post marker info.
105
-         * @param object $post The post object.
106
-         */
107
-        $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
108
-
109
-        // only assign it if it has a value
110
-        if($post_map_json){
111
-            $map_jason[$post->ID] = $post_map_json;
112
-        }
113
-
114
-    }
77
+			if (isset($gd_marker_sizes[$icon])) {
78
+				$icon_size = $gd_marker_sizes[$icon];
79
+			} else {
80
+				$icon_size = geodir_get_marker_size($icon);
81
+				$gd_marker_sizes[$icon] = $icon_size;
82
+			}               
83
+		} else {
84
+			$icon_size = array('w' => 36, 'h' => 45);
85
+		}
86
+
87
+		$post_latitude = isset($post->post_latitude) ? $post->post_latitude : geodir_get_post_meta($post->ID,'post_latitude');
88
+		$post_longitude = isset($post->post_longitude) ? $post->post_longitude : geodir_get_post_meta($post->ID,'post_longitude');
89
+
90
+
91
+		$post_json = '{"id":"' . $post->ID
92
+					 . '","t": "' . $title
93
+					 . '","lt": "' . $post_latitude
94
+					 . '","ln": "' . $post_longitude
95
+					 . '","mk_id":"' . $post->ID . '_' . $default_category
96
+					 . '","i":"' . $icon
97
+					 . '","w":"' . $icon_size['w']
98
+					 . '","h":"' . $icon_size['h'] . '"}';
99
+
100
+		/**
101
+		 * Filter the json data when creating output for post json marker..
102
+		 *
103
+		 * @since 1.5.7
104
+		 * @param string $post_json JSON representation of the post marker info.
105
+		 * @param object $post The post object.
106
+		 */
107
+		$post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
108
+
109
+		// only assign it if it has a value
110
+		if($post_map_json){
111
+			$map_jason[$post->ID] = $post_map_json;
112
+		}
113
+
114
+	}
115 115
 }
116 116
 
117 117
 /**
@@ -124,67 +124,67 @@  discard block
 block discarded – undo
124 124
  */
125 125
 function send_marker_jason_to_js()
126 126
 {
127
-    global $map_jason, $map_canvas_arr;
128
-
129
-    if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
130
-        foreach ($map_canvas_arr as $canvas => $jason) {
131
-            if (is_array($map_jason) && !empty($map_jason)) {
132
-
133
-                // on details page only show the main marker on the map
134
-                if(geodir_is_page('detail')){
135
-                    global $post;
136
-                    if(isset($map_jason[$post->ID])){
137
-                        $map_jason = array($map_jason[$post->ID]);
138
-                    }
139
-                }
140
-                $canvas_jason = $canvas . "_jason";
141
-                $map_canvas_arr[$canvas] = array_unique($map_jason);
142
-                unset($cat_content_info);
143
-                $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
144
-                $totalcount = count(array_unique($map_jason));
145
-                if (!empty($cat_content_info)) {
146
-                    $json_content = substr(implode(',', $cat_content_info), 1);
147
-                    $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
148
-                    $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
149
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
150
-                } else {
151
-                    $canvas_jason = '[{"totalcount":"0"}]';
152
-                }
153
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
154
-
155
-                /**
156
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
157
-                 *
158
-                 * You can use this filter to modify map canvas json args.
159
-                 *
160
-                 * @since 1.0.0
161
-                 * @package GeoDirectory
162
-                 * @param string $canvas Map canvas array key.
163
-                 * @param array $map_canvas_jason_args Map canvas args.
164
-                 */
165
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
166
-
167
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
168
-            } else {
169
-                $canvas_jason = '[{"totalcount":"0"}]';
170
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
171
-
172
-                /**
173
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
174
-                 *
175
-                 * You can use this filter to modify map canvas json args.
176
-                 *
177
-                 * @since 1.0.0
178
-                 * @package GeoDirectory
179
-                 * @param string $canvas Map canvas array key.
180
-                 * @param array $map_canvas_jason_args Map canvas args.
181
-                 */
182
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
183
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
184
-            }
185
-        }
186
-
187
-    }
127
+	global $map_jason, $map_canvas_arr;
128
+
129
+	if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
130
+		foreach ($map_canvas_arr as $canvas => $jason) {
131
+			if (is_array($map_jason) && !empty($map_jason)) {
132
+
133
+				// on details page only show the main marker on the map
134
+				if(geodir_is_page('detail')){
135
+					global $post;
136
+					if(isset($map_jason[$post->ID])){
137
+						$map_jason = array($map_jason[$post->ID]);
138
+					}
139
+				}
140
+				$canvas_jason = $canvas . "_jason";
141
+				$map_canvas_arr[$canvas] = array_unique($map_jason);
142
+				unset($cat_content_info);
143
+				$cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
144
+				$totalcount = count(array_unique($map_jason));
145
+				if (!empty($cat_content_info)) {
146
+					$json_content = substr(implode(',', $cat_content_info), 1);
147
+					$json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
148
+					$json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
149
+					$canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
150
+				} else {
151
+					$canvas_jason = '[{"totalcount":"0"}]';
152
+				}
153
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
154
+
155
+				/**
156
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
157
+				 *
158
+				 * You can use this filter to modify map canvas json args.
159
+				 *
160
+				 * @since 1.0.0
161
+				 * @package GeoDirectory
162
+				 * @param string $canvas Map canvas array key.
163
+				 * @param array $map_canvas_jason_args Map canvas args.
164
+				 */
165
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
166
+
167
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
168
+			} else {
169
+				$canvas_jason = '[{"totalcount":"0"}]';
170
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
171
+
172
+				/**
173
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
174
+				 *
175
+				 * You can use this filter to modify map canvas json args.
176
+				 *
177
+				 * @since 1.0.0
178
+				 * @package GeoDirectory
179
+				 * @param string $canvas Map canvas array key.
180
+				 * @param array $map_canvas_jason_args Map canvas args.
181
+				 */
182
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
183
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
184
+			}
185
+		}
186
+
187
+	}
188 188
 }
189 189
 
190 190
 /**
@@ -207,99 +207,99 @@  discard block
 block discarded – undo
207 207
  */
208 208
 function home_map_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = true, $pading = 0, $map_canvas_name = '', $child_collapse, $is_home_map = false)
209 209
 {
210
-    global $cat_count, $geodir_cat_icons, $gd_session;
210
+	global $cat_count, $geodir_cat_icons, $gd_session;
211 211
 
212
-    $exclude_categories = get_option('geodir_exclude_cat_on_map');
213
-    $exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
212
+	$exclude_categories = get_option('geodir_exclude_cat_on_map');
213
+	$exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
214 214
 
215
-    // check if exclude categories saved before fix of categories identical names
216
-    if ($exclude_categories_new) {
217
-        $gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
218
-        $exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
219
-    }
215
+	// check if exclude categories saved before fix of categories identical names
216
+	if ($exclude_categories_new) {
217
+		$gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
218
+		$exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
219
+	}
220 220
 
221
-    $exclude_cat_str = implode(',', $exclude_categories);
221
+	$exclude_cat_str = implode(',', $exclude_categories);
222 222
 
223
-    if ($exclude_cat_str == '') {
224
-        $exclude_cat_str = '0';
225
-    }
223
+	if ($exclude_cat_str == '') {
224
+		$exclude_cat_str = '0';
225
+	}
226 226
 
227
-    $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
227
+	$cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
228 228
 
229
-    if ($hide_empty) {
230
-        $cat_terms = geodir_filter_empty_terms($cat_terms);
231
-    }
229
+	if ($hide_empty) {
230
+		$cat_terms = geodir_filter_empty_terms($cat_terms);
231
+	}
232 232
 
233
-    $main_list_class = '';
234
-    //If there are terms, start displaying
235
-    if (count($cat_terms) > 0) {
236
-        //Displaying as a list
237
-        $p = $pading * 15;
238
-        $pading++;
233
+	$main_list_class = '';
234
+	//If there are terms, start displaying
235
+	if (count($cat_terms) > 0) {
236
+		//Displaying as a list
237
+		$p = $pading * 15;
238
+		$pading++;
239 239
 
240
-        if ($cat_parent == 0) {
241
-            $list_class = 'main_list';
242
-            $display = '';
243
-        } else {
244
-            $list_class = 'sub_list';
245
-            $display = !$child_collapse ? '' : 'display:none';
246
-        }
240
+		if ($cat_parent == 0) {
241
+			$list_class = 'main_list';
242
+			$display = '';
243
+		} else {
244
+			$list_class = 'sub_list';
245
+			$display = !$child_collapse ? '' : 'display:none';
246
+		}
247 247
 
248
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
248
+		$out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
249 249
 
250
-        $geodir_cat_icons = geodir_get_term_icon();
250
+		$geodir_cat_icons = geodir_get_term_icon();
251 251
 
252
-        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
253
-        if ($is_home_map && $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype')) {
254
-            $geodir_default_map_search_pt = $homemap_catlist_ptype;
255
-        }
256
-        $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : (isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : $geodir_default_map_search_pt);
252
+		$geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
253
+		if ($is_home_map && $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype')) {
254
+			$geodir_default_map_search_pt = $homemap_catlist_ptype;
255
+		}
256
+		$post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : (isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : $geodir_default_map_search_pt);
257 257
         
258
-        foreach ($cat_terms as $cat_term):
259
-            $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
260
-
261
-            if (!in_array($cat_term->term_id, $exclude_categories)):
262
-                //Secret sauce.  Function calls itself to display child elements, if any
263
-                $checked = 'checked="checked"';
264
-
265
-                // Untick the category by default on home map
266
-                if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
267
-                    if (geodir_wpml_is_taxonomy_translated($post_type . 'category')) { // if WPML
268
-                        global $sitepress;
269
-                        $default_lang = $sitepress->get_default_language();
270
-                        $term_id = geodir_wpml_object_id($cat_term->term_id, $post_type.'category', true, $default_lang);
271
-                    }else{
272
-                        $term_id = $cat_term->term_id;
273
-                    }
274
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) {
275
-                        $checked = '';
276
-                    }
277
-                }
278
-
279
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
280
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
281
-                $term_check .= '  title="' . esc_attr(geodir_utf8_ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
282
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '"/>';
283
-                $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . geodir_utf8_ucfirst($cat_term->name) . '</label><span class="gd-map-cat-toggle"><i class="fas fa-long-arrow-alt-down" style="display:none"></span></i>';
284
-
285
-            endif;
286
-
287
-
288
-            // get sub category by recursion
289
-            $out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
290
-
291
-            $out .= '</li>';
292
-
293
-        endforeach;
294
-
295
-        $out .= '</ul>';
296
-
297
-        return $out;
298
-    } else {
299
-        if ($cat_parent == 0)
300
-            return _e('No category', 'geodirectory');
301
-    }
302
-    return;
258
+		foreach ($cat_terms as $cat_term):
259
+			$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
260
+
261
+			if (!in_array($cat_term->term_id, $exclude_categories)):
262
+				//Secret sauce.  Function calls itself to display child elements, if any
263
+				$checked = 'checked="checked"';
264
+
265
+				// Untick the category by default on home map
266
+				if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
267
+					if (geodir_wpml_is_taxonomy_translated($post_type . 'category')) { // if WPML
268
+						global $sitepress;
269
+						$default_lang = $sitepress->get_default_language();
270
+						$term_id = geodir_wpml_object_id($cat_term->term_id, $post_type.'category', true, $default_lang);
271
+					}else{
272
+						$term_id = $cat_term->term_id;
273
+					}
274
+					if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) {
275
+						$checked = '';
276
+					}
277
+				}
278
+
279
+				$term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
280
+				$term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
281
+				$term_check .= '  title="' . esc_attr(geodir_utf8_ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
282
+				$term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '"/>';
283
+				$out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . geodir_utf8_ucfirst($cat_term->name) . '</label><span class="gd-map-cat-toggle"><i class="fas fa-long-arrow-alt-down" style="display:none"></span></i>';
284
+
285
+			endif;
286
+
287
+
288
+			// get sub category by recursion
289
+			$out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
290
+
291
+			$out .= '</li>';
292
+
293
+		endforeach;
294
+
295
+		$out .= '</ul>';
296
+
297
+		return $out;
298
+	} else {
299
+		if ($cat_parent == 0)
300
+			return _e('No category', 'geodirectory');
301
+	}
302
+	return;
303 303
 }
304 304
 
305 305
 /**
@@ -311,19 +311,19 @@  discard block
 block discarded – undo
311 311
  * @return string The map API provider name.
312 312
  */
313 313
 function geodir_map_name() {
314
-    $geodir_map_name = get_option('geodir_load_map', 'google');
314
+	$geodir_map_name = get_option('geodir_load_map', 'google');
315 315
     
316
-    if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
317
-        $geodir_map_name = 'auto';
318
-    }
319
-
320
-    /**
321
-     * Filter the map JS API provider name.
322
-     *
323
-     * @since 1.6.1
324
-     * @param string $geodir_map_name The map API provider name.
325
-     */
326
-    return apply_filters('geodir_map_name', $geodir_map_name);
316
+	if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
317
+		$geodir_map_name = 'auto';
318
+	}
319
+
320
+	/**
321
+	 * Filter the map JS API provider name.
322
+	 *
323
+	 * @since 1.6.1
324
+	 * @param string $geodir_map_name The map API provider name.
325
+	 */
326
+	return apply_filters('geodir_map_name', $geodir_map_name);
327 327
 }
328 328
 
329 329
 /**
@@ -339,48 +339,48 @@  discard block
 block discarded – undo
339 339
  * @return array The icon size.
340 340
  */
341 341
 function geodir_get_marker_size($icon, $default_size = array('w' => 36, 'h' => 45)) {
342
-    global $gd_marker_sizes;
342
+	global $gd_marker_sizes;
343 343
     
344
-    if (empty($gd_marker_sizes)) {
345
-        $gd_marker_sizes = array();
346
-    }
344
+	if (empty($gd_marker_sizes)) {
345
+		$gd_marker_sizes = array();
346
+	}
347 347
       
348
-    if (!empty($gd_marker_sizes[$icon])) {
349
-        return $gd_marker_sizes[$icon];
350
-    }
348
+	if (!empty($gd_marker_sizes[$icon])) {
349
+		return $gd_marker_sizes[$icon];
350
+	}
351 351
     
352
-    if (empty($icon)) {
353
-        $gd_marker_sizes[$icon] = $default_size;
352
+	if (empty($icon)) {
353
+		$gd_marker_sizes[$icon] = $default_size;
354 354
         
355
-        return $default_size;
356
-    }
355
+		return $default_size;
356
+	}
357 357
     
358
-    $icon_url = $icon;
358
+	$icon_url = $icon;
359 359
     
360
-    $uploads = wp_upload_dir(); // Array of key => value pairs
360
+	$uploads = wp_upload_dir(); // Array of key => value pairs
361 361
       
362
-    if (!path_is_absolute($icon)) {
363
-        $icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
364
-    }
362
+	if (!path_is_absolute($icon)) {
363
+		$icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
364
+	}
365 365
     
366
-    if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
367
-        $icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
368
-    }
366
+	if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
367
+		$icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
368
+	}
369 369
     
370
-    $sizes = array();
371
-    if (is_file($icon) && file_exists($icon)) {
372
-        $size = getimagesize(trim($icon));
370
+	$sizes = array();
371
+	if (is_file($icon) && file_exists($icon)) {
372
+		$size = getimagesize(trim($icon));
373 373
         
374
-        if (!empty($size[0]) && !empty($size[1])) {
375
-            $sizes = array('w' => $size[0], 'h' => $size[1]);
376
-        }
377
-    }
374
+		if (!empty($size[0]) && !empty($size[1])) {
375
+			$sizes = array('w' => $size[0], 'h' => $size[1]);
376
+		}
377
+	}
378 378
     
379
-    $sizes = !empty($sizes) ? $sizes : $default_size;
379
+	$sizes = !empty($sizes) ? $sizes : $default_size;
380 380
     
381
-    $gd_marker_sizes[$icon_url] = $sizes;
381
+	$gd_marker_sizes[$icon_url] = $sizes;
382 382
     
383
-    return $sizes;
383
+	return $sizes;
384 384
 }
385 385
 
386 386
 add_action('wp_footer', 'geodir_map_load_script', 10);
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
  * @package GeoDirectory
393 393
  */
394 394
 function geodir_map_load_script() {
395
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'google-maps-api', 'done')) {
396
-        $plugin_url = geodir_plugin_url();
395
+	if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'google-maps-api', 'done')) {
396
+		$plugin_url = geodir_plugin_url();
397 397
 ?>
398 398
 <script type="text/javascript">
399 399
 if (!(window.google && typeof google.maps !== 'undefined')) {
@@ -408,5 +408,5 @@  discard block
 block discarded – undo
408 408
 }
409 409
 </script>
410 410
 <?php
411
-    }
411
+	}
412 412
 }
413 413
\ No newline at end of file
Please login to merge, or discard this patch.