Test Failed
Push — master ( f3cf1b...aecc65 )
by Stiofan
12:45
created
geodirectory_template_tags.php 3 patches
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.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -39,21 +39,21 @@  discard block
 block discarded – undo
39 39
     $is_detail_page = false;
40 40
     $geodir_map_name = geodir_map_name();
41 41
 
42
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
43 43
         $is_detail_page = true;
44 44
     }
45 45
 
46 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);
48
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
49 49
     wp_enqueue_script('geodirectory-script');
50 50
 
51 51
     $geodir_vars_data = array(
52 52
         'siteurl' => get_option('siteurl'),
53 53
         'geodir_plugin_url' => geodir_plugin_url(),
54
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
55 55
         'geodir_ajax_url' => geodir_get_ajax_url(),
56
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
57 57
         'is_rtl' => is_rtl() ? 1 : 0, // fix rtl issue
58 58
 		'lightBox_txtImage' => addslashes(__('Image', 'geodirectory')),
59 59
 		'lightBox_txtOf' => addslashes(__('of', 'geodirectory')),
@@ -76,24 +76,24 @@  discard block
 block discarded – undo
76 76
      *
77 77
      * }
78 78
      */
79
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
79
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
80 80
 
81 81
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
82 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');}
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 85
 
86
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     wp_enqueue_script('geodirectory-lightbox-jquery');
88 88
 
89
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
89
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
90 90
     if ($is_detail_page) {
91 91
         wp_enqueue_script('geodirectory-jquery-simplemodal');
92 92
     }
93 93
 
94 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();
95
+        $map_lang = "&language=".geodir_get_map_default_language();
96
+        $map_key = "&key=".geodir_get_map_api_key();
97 97
         /**
98 98
          * Filter the variables that are added to the end of the google maps script call.
99 99
          *
@@ -103,55 +103,55 @@  discard block
 block discarded – undo
103 103
          * @param string $var The string to filter, default is empty string.
104 104
          */
105 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);
106
+        wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
107 107
         
108 108
         // Overlapping Marker Spiderfier
109
-        wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
109
+        wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
110 110
         wp_enqueue_script('geodirectory-g-overlappingmarker-script');
111 111
     }
112 112
     
113 113
     if ($geodir_map_name == 'osm') {
114 114
         // Leaflet OpenStreetMap
115
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
115
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
116 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);
118
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
119 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);
121
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
122 122
         wp_enqueue_script('geodirectory-leaflet-geo-script');
123 123
         
124 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);
125
+            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
126 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);
128
+            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
129 129
             wp_enqueue_script('geodirectory-leaflet-routing-script');
130 130
         }
131 131
         
132 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);
133
+        wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
134 134
         wp_enqueue_script('geodirectory-o-overlappingmarker-script');
135 135
     }
136
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
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);
138
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
139 139
     wp_enqueue_script('geodirectory-goMap-script');
140 140
 
141
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
141
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
142 142
     wp_enqueue_script('chosen');
143 143
 
144
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
144
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
145 145
     wp_enqueue_script('geodirectory-choose-ajax');
146 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);
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 148
 
149 149
     if (is_page() && geodir_is_page('add-listing')) {
150 150
         // SCRIPT FOR UPLOAD
151 151
         wp_enqueue_script('plupload-all');
152 152
         wp_enqueue_script('jquery-ui-sortable');
153 153
 
154
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
154
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
155 155
         wp_enqueue_script('geodirectory-plupload-script');
156 156
         // SCRIPT FOR UPLOAD END
157 157
 
@@ -198,27 +198,27 @@  discard block
 block discarded – undo
198 198
 
199 199
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
200 200
 
201
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
201
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
202 202
     } // End if for add place page
203 203
 
204
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
204
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
205 205
     if ($is_detail_page) {
206 206
 		wp_enqueue_script('geodirectory-post-custom-js');
207 207
 	}
208 208
 
209 209
     // font awesome rating script
210 210
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
211
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
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');
213 213
 	} else { // default rating script
214
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
214
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
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);
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 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);
221
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
222 222
     wp_enqueue_script('google-geometa');
223 223
 }
224 224
 
@@ -233,7 +233,7 @@  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>';
236
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
237 237
     echo stripslashes(get_option('geodir_header_scripts'));
238 238
 }
239 239
 
@@ -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(){
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
                 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
256 256
             })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
257 257
 
258
-            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
259
-            <?php if(get_option('geodir_ga_anonymize_ip')){echo "ga('set', 'anonymizeIP', true);";}?>
258
+            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
259
+            <?php if (get_option('geodir_ga_anonymize_ip')) {echo "ga('set', 'anonymizeIP', true);"; }?>
260 260
             ga('send', 'pageview');
261 261
 
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')){
265
+    }elseif (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
266 266
         echo stripslashes(get_option('geodir_ga_tracking_code'));
267 267
     }
268 268
 }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
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'] ) ) {
288
+    if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
289 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 290
     }
291 291
 }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
  */
302 302
 function geodir_add_async_forscript($url)
303 303
 {
304
-    if (strpos($url, '#asyncload')===false)
304
+    if (strpos($url, '#asyncload') === false)
305 305
         return $url;
306 306
     else if (is_admin())
307 307
         return str_replace('#asyncload', '', $url);
@@ -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);
322
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
323 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);
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);
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 328
     wp_enqueue_style('geodirectory-frontend-rtl-style');
329 329
     }
330 330
 
331 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 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' );
333
+    wp_enqueue_script('font-awesome');
334 334
 
335 335
 
336 336
 }
@@ -399,18 +399,18 @@  discard block
 block discarded – undo
399 399
                 $term_id = get_queried_object_id();
400 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');
402
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
403
+                    $term = get_term($term_id, $post_type.'category');
404 404
                 }
405 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 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');
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 414
                 }
415 415
             }
416 416
             
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         if ($max_page > 1 || $always_show) {            
423 423
             // Extra pagination info
424 424
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
425
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
425
+            $start_no = ($paged - 1) * $posts_per_page + 1;
426 426
             $end_no = min($paged * $posts_per_page, $numposts);
427 427
 
428 428
             if ($geodir_pagination_more_info != '') {
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                 } else {
433 433
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
434 434
                 }
435
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
435
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
436 436
                 /**
437 437
                  * Adds an extra pagination info above/under pagination.
438 438
                  *
@@ -448,15 +448,15 @@  discard block
 block discarded – undo
448 448
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
449 449
                 
450 450
                 if ($geodir_pagination_more_info == 'before') {
451
-                    $before = $before . $pagination_info;
451
+                    $before = $before.$pagination_info;
452 452
                 } else if ($geodir_pagination_more_info == 'after') {
453
-                    $after = $pagination_info . $after;
453
+                    $after = $pagination_info.$after;
454 454
                 }
455 455
             }
456 456
             
457 457
             echo "$before <div class='Navi gd-navi'>";
458 458
             if ($paged >= ($pages_to_show - 1)) {
459
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
459
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
460 460
             }
461 461
             previous_posts_link($prelabel);
462 462
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -464,13 +464,13 @@  discard block
 block discarded – undo
464 464
                     if ($i == $paged) {
465 465
                         echo "<strong class='on'>$i</strong>";
466 466
                     } else {
467
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
467
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
468 468
                     }
469 469
                 }
470 470
             }
471 471
             next_posts_link($nxtlabel, $max_page);
472 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>';
473
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
474 474
             }
475 475
             echo "</div> $after";
476 476
         }
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
         jQuery(function ($) {
509 509
             $("#distance_slider").slider({
510 510
                 range: true,
511
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
511
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
512 512
                 min: 0,
513 513
                 max: <?php echo $dist; ?>,
514 514
                 step: <?php echo $dist_dif; ?>,
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
     $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
576 576
     ?>
577 577
     <script type="text/javascript">
578
-        var default_location = '<?php echo $city ;?>';
578
+        var default_location = '<?php echo $city; ?>';
579 579
         var latlng;
580 580
         var address;
581 581
         var dist = 0;
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 				var $form = jQuery(this).closest('form');
592 592
 
593 593
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
594
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
594
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
595 595
 				
596 596
 				// Disable location based search for disabled location post type.
597 597
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 					}
606 606
 				}
607 607
 				
608
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
608
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
609 609
 
610 610
                     // OSM can't handel post code with no space so we test for it and add one if needed
611 611
                     if(window.gdMaps === 'osm'){
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
         });
635 635
         
636 636
 		function geodir_setsearch($form) {
637
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
637
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
638 638
 			geocodeAddress($form);
639 639
 		}
640 640
 
@@ -653,15 +653,15 @@  discard block
 block discarded – undo
653 653
             // Call the geocode function
654 654
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
655 655
 
656
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
657
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
656
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
657
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
658 658
                     jQuery(".snear", $form).val('');
659 659
                 }
660 660
                 jQuery($form).submit();
661 661
             } else {
662 662
                 var address = jQuery(".snear", $form).val();
663 663
 
664
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
664
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
665 665
                     initialise2();
666 666
                 } else {
667 667
                     <?php
@@ -674,21 +674,21 @@  discard block
 block discarded – undo
674 674
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
675 675
                     ?>
676 676
                     if (window.gdMaps === 'google') {
677
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
677
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
678 678
                             function (results, status) {
679 679
                                 if (status == google.maps.GeocoderStatus.OK) {
680 680
                                     updateSearchPosition(results[0].geometry.location, $form);
681 681
                                 } else {
682
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
682
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
683 683
                                 }
684 684
                             });
685 685
                     } else if (window.gdMaps === 'osm') {
686
-                        geocodePositionOSM(false, address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>, false, false,
686
+                        geocodePositionOSM(false, address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>, false, false,
687 687
                             function(geo) {
688 688
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
689 689
                                     updateSearchPosition(geo, $form);
690 690
                                 } else {
691
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
691
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
692 692
                                 }
693 693
                             });
694 694
                     } else {
@@ -734,19 +734,19 @@  discard block
 block discarded – undo
734 734
             var msg;
735 735
             switch (err.code) {
736 736
                 case err.UNKNOWN_ERROR:
737
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
737
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
738 738
                     break;
739 739
                 case err.PERMISSION_DENINED:
740
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
740
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
741 741
                     break;
742 742
                 case err.POSITION_UNAVAILABLE:
743
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
743
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
744 744
                     break;
745 745
                 case err.BREAK:
746
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
746
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
747 747
                     break;
748 748
                 default:
749
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
749
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
750 750
             }
751 751
             jQuery('#info').html(msg);
752 752
         }
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
              * @param object $post The post object.
797 797
              * @param string $link The link to the post.
798 798
              */
799
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
799
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
800 800
             break;
801 801
         case 'new' :
802 802
             /**
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
              * @param object $post The post object.
807 807
              * @param string $link The link to the post.
808 808
              */
809
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
809
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
810 810
             break;
811 811
 
812 812
     }
@@ -820,11 +820,11 @@  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' );
823
+    if (wp_script_is('flexslider', 'enqueued') && wp_script_is('geodirectory-jquery-flexslider-js', 'enqueued')) {
824
+        wp_dequeue_script('flexslider');
825 825
     }
826 826
 }
827
-add_action( 'wp_enqueue_scripts', 'geodir_fix_script_conflict', 100 );
827
+add_action('wp_enqueue_scripts', 'geodir_fix_script_conflict', 100);
828 828
 
829 829
 /**
830 830
  * make fontawesome search for inline before and after icons
@@ -835,7 +835,7 @@  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)
838
+    if (strpos($url, 'use.fontawesome.com/releases/') === false)
839 839
         return $url;
840 840
     else if (is_admin())
841 841
         return str_replace('#faload', '', $url);
@@ -847,9 +847,9 @@  discard block
 block discarded – undo
847 847
 /**
848 848
  * Dequeue our fontawesome if using BB page.
849 849
  */
850
-function geodir_fix_beaver_builder(){
851
-    if(isset($_REQUEST['fl_builder'])){
852
-        wp_dequeue_script( 'font-awesome' );
850
+function geodir_fix_beaver_builder() {
851
+    if (isset($_REQUEST['fl_builder'])) {
852
+        wp_dequeue_script('font-awesome');
853 853
     }
854 854
 }
855
-add_filter('wp_print_scripts','geodir_fix_beaver_builder',100);
855
+add_filter('wp_print_scripts', 'geodir_fix_beaver_builder', 100);
Please login to merge, or discard this patch.
Braces   +42 added lines, -26 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@  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')){
265
+    } elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
266 266
         echo stripslashes(get_option('geodir_ga_tracking_code'));
267 267
     }
268 268
 }
@@ -301,13 +301,14 @@  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";
310
-}
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
+    }
311
+    }
311 312
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
312 313
 
313 314
 /**
@@ -375,8 +376,10 @@  discard block
 block discarded – undo
375 376
 
376 377
     $half_pages_to_show = round($pages_to_show / 2);
377 378
 
378
-    if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
379
-        return;
379
+    if (geodir_is_page('home')) {
380
+    	// dont apply default  pagination for geodirectory home page.
381
+        return;
382
+    }
380 383
 
381 384
     if (!is_single()) {
382 385
         if (function_exists('geodir_location_geo_home_link')) {
@@ -496,11 +499,21 @@  discard block
 block discarded – undo
496 499
     }
497 500
     $dist_dif = 1000;
498 501
 
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;
502
+    if ($dist <= 5000) {
503
+    	$dist_dif = 500;
504
+    }
505
+    if ($dist <= 1000) {
506
+    	$dist_dif = 100;
507
+    }
508
+    if ($dist <= 500) {
509
+    	$dist_dif = 50;
510
+    }
511
+    if ($dist <= 100) {
512
+    	$dist_dif = 10;
513
+    }
514
+    if ($dist <= 50) {
515
+    	$dist_dif = 5;
516
+    }
504 517
 
505 518
     ?>
506 519
     <script type="text/javascript">
@@ -561,12 +574,14 @@  discard block
 block discarded – undo
561 574
  */
562 575
 function geodir_add_sharelocation_scripts() {
563 576
     $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');
577
+    if (get_option('geodir_search_field_default_text')) {
578
+            $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
579
+    }
566 580
 
567 581
     $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');
582
+    if (get_option('geodir_near_field_default_text')) {
583
+            $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
584
+    }
570 585
     
571 586
     $search_location = geodir_get_default_location();
572 587
     
@@ -835,13 +850,14 @@  discard block
 block discarded – undo
835 850
  */
836 851
 function geodir_fontawesome_defer($url)
837 852
 {
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
-}
853
+    if (strpos($url, 'use.fontawesome.com/releases/')===false) {
854
+            return $url;
855
+    } else if (is_admin()) {
856
+            return str_replace('#faload', '', $url);
857
+    } else {
858
+            return $url."' data-search-pseudo-elements defer='defer";
859
+    }
860
+    }
845 861
 add_filter('clean_url', 'geodir_fontawesome_defer', 11, 1);
846 862
 
847 863
 /**
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_template_tags.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -132,12 +132,12 @@  discard block
 block discarded – undo
132 132
 
133 133
     if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
134 134
     } else {
135
-        $geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
135
+        $geodir_map_options['height'] = $geodir_map_options['height'].'px';
136 136
     }
137 137
 
138 138
     if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
139 139
     } else {
140
-        $geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
140
+        $geodir_map_options['width'] = $geodir_map_options['width'].'px';
141 141
     }
142 142
 
143 143
     /**
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
171 171
 
172
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
172
+    if (count((array) $post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
173 173
         // Set default map options
174 174
 
175
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
175
+        wp_enqueue_script('geodir-map-widget', geodir_plugin_url().'/geodirectory-functions/map-functions/js/map.min.js', array(), false, true);
176 176
 
177 177
         wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
178 178
 
@@ -191,41 +191,41 @@  discard block
 block discarded – undo
191 191
 		 */
192 192
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
193 193
         ?>
194
-        <div id="catcher_<?php echo $map_canvas_name;?>"></div>
194
+        <div id="catcher_<?php echo $map_canvas_name; ?>"></div>
195 195
         <div class="stick_trigger_container">
196 196
             <div class="trigger_sticky triggeroff_sticky"></div>
197
-            <div class="top_banner_section geodir_map_container <?php echo $map_class_name;?>"
198
-                 id="sticky_map_<?php echo $map_canvas_name;?>"
199
-                 style="min-height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
197
+            <div class="top_banner_section geodir_map_container <?php echo $map_class_name; ?>"
198
+                 id="sticky_map_<?php echo $map_canvas_name; ?>"
199
+                 style="min-height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
200 200
 
201 201
                 <div class="map_background">
202 202
                     <div class="top_banner_section_in clearfix">
203
-                        <div class="<?php echo $map_canvas_name;?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name;?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fas fa-expand-arrows-alt"></i></span></div>
204
-                        <div class="<?php echo $map_canvas_name;?>_TopRight TopRight"></div>
205
-                        <div id="<?php echo $map_canvas_name;?>_wrapper" class="main_map_wrapper"
206
-                             style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
203
+                        <div class="<?php echo $map_canvas_name; ?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name; ?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fas fa-expand-arrows-alt"></i></span></div>
204
+                        <div class="<?php echo $map_canvas_name; ?>_TopRight TopRight"></div>
205
+                        <div id="<?php echo $map_canvas_name; ?>_wrapper" class="main_map_wrapper"
206
+                             style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
207 207
                             <!-- new map start -->
208 208
                             <div class="iprelative">
209
-                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name;?>"
210
-                                     style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
211
-                                <div id="<?php echo $map_canvas_name;?>_loading_div" class="loading_div"
212
-                                     style=" height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
209
+                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name; ?>"
210
+                                     style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
211
+                                <div id="<?php echo $map_canvas_name; ?>_loading_div" class="loading_div"
212
+                                     style=" height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
213 213
                                 <!--<div id="home_map_counter"></div>        -->
214
-                                <div id="<?php echo $map_canvas_name;?>_map_nofound"
214
+                                <div id="<?php echo $map_canvas_name; ?>_map_nofound"
215 215
                                      class="advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
216
-                                <div id="<?php echo $map_canvas_name;?>_map_notloaded"
216
+                                <div id="<?php echo $map_canvas_name; ?>_map_notloaded"
217 217
                                      class="advmap_notloaded"><?php _e('<h3>Google Map Not Loaded</h3><p>Sorry, unable to load Google Maps API.', 'geodirectory'); ?></div>
218 218
                             </div>
219 219
                             <!-- new map end -->
220 220
                         </div>
221
-                        <div class="<?php echo $map_canvas_name;?>_BottomLeft BottomLeft"></div>
221
+                        <div class="<?php echo $map_canvas_name; ?>_BottomLeft BottomLeft"></div>
222 222
                     </div>
223 223
                 </div>
224 224
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
225
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
225
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="1"/>
226 226
                 <?php } else {
227 227
                     ?>
228
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
228
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="0"/>
229 229
                 <?php }
230 230
 
231 231
                 if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                       <div class="gd-input-group-addon gd-directions-right gd-mylocation-go"><input type="button" value="<?php _e('Get Directions', 'geodirectory'); ?>" class="<?php echo $map_canvas_name; ?>_getdirection" id="directions" onclick="calcRoute('<?php echo $map_canvas_name; ?>')" /></div>
246 246
                     </div>
247 247
                     <script>
248
-                        <?php if(geodir_is_page('detail')){?>
248
+                        <?php if (geodir_is_page('detail')) {?>
249 249
                         jQuery(function () {
250 250
                             gd_initialize_ac();
251 251
                         });
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                                 // Create the autocomplete object, restricting the search
257 257
                                 // to geographical location types.
258 258
                                 autocomplete = new google.maps.places.Autocomplete(
259
-                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name;?>_fromAddress')),
259
+                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name; ?>_fromAddress')),
260 260
                                     {types: ['geocode']});
261 261
                                 // When the user selects an address from the dropdown,
262 262
                                 // populate the address fields in the form.
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                                 
271 271
                                 if (window.gdMaps == 'osm') {
272 272
                                     window.setTimeout(function() {
273
-                                        calcRoute('<?php echo $map_canvas_name;?>');
273
+                                        calcRoute('<?php echo $map_canvas_name; ?>');
274 274
                                     }, 1000);
275 275
                                 }
276 276
                             }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				 */
325 325
 				$map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
326 326
 				?>
327
-                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
327
+                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel; ?>">
328 328
                     <?php
329 329
                     $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
330 330
                     $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
@@ -334,12 +334,12 @@  discard block
 block discarded – undo
334 334
 					}
335 335
                     ?>
336 336
                     <div
337
-                        class="map-category-listing<?php echo $map_cat_class;?>">
337
+                        class="map-category-listing<?php echo $map_cat_class; ?>">
338 338
                         <div class="gd-trigger gd-triggeroff"><i class="fas fa-compress"></i><i class="fas fa-expand"></i></div>
339
-                        <div id="<?php echo $map_canvas_name;?>_cat"
340
-                             class="<?php echo $map_canvas_name;?>_map_category  map_category"
341
-                             <?php if ($child_collapse){ ?>checked="checked" <?php }?>
342
-                             style="max-height:<?php echo $geodir_map_options['height'];?>;">
339
+                        <div id="<?php echo $map_canvas_name; ?>_cat"
340
+                             class="<?php echo $map_canvas_name; ?>_map_category  map_category"
341
+                             <?php if ($child_collapse) { ?>checked="checked" <?php }?>
342
+                             style="max-height:<?php echo $geodir_map_options['height']; ?>;">
343 343
                             <input
344 344
                                 onkeydown="if(event.keyCode == 13){build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false)}"
345 345
                                 type="text"
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
352 352
                                 <?php } else {$child_collapse = "0";
353 353
                                     ?>
354
-                                    <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
354
+                                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="0"/>
355 355
                                 <?php } ?>
356 356
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
357 357
                                 <div class="geodir_toggle">
358
-                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'),0,true,0,$map_canvas_name,$child_collapse,true); ?>
358
+                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'), 0, true, 0, $map_canvas_name, $child_collapse, true); ?>
359 359
                                     <script>
360 360
                                         jQuery(window).load(function() {
361 361
                                             geodir_show_sub_cat_collapse_button();
@@ -385,21 +385,21 @@  discard block
 block discarded – undo
385 385
 					$city = $country != 'me' ? $city : '';
386 386
                     $gd_neighbourhood = $country != 'me' ? $gd_neighbourhood : '';
387 387
                     ?>
388
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
389
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
390
-                           value="<?php echo $country;?>"/>
391
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_region" name="gd_region"
392
-                           value="<?php echo $region;?>"/>
393
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_city" name="gd_city"
394
-                           value="<?php echo $city;?>"/>
395
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
396
-                           value="<?php echo $gd_neighbourhood;?>"/>
388
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="1"/>
389
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_country" name="gd_country"
390
+                           value="<?php echo $country; ?>"/>
391
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_region" name="gd_region"
392
+                           value="<?php echo $region; ?>"/>
393
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_city" name="gd_city"
394
+                           value="<?php echo $city; ?>"/>
395
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_neighbourhood" name="gd_neighbourhood"
396
+                           value="<?php echo $gd_neighbourhood; ?>"/>
397 397
                 <?php } else { //end of location filter
398 398
                     ?>
399
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
399
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="0"/>
400 400
                 <?php }?>
401 401
 
402
-                <input type="hidden" id="<?php echo $map_canvas_name;?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt;?>"/>
402
+                <input type="hidden" id="<?php echo $map_canvas_name; ?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt; ?>"/>
403 403
 
404 404
                 <input type="hidden" name="limitstart" value=""/>
405 405
 
@@ -416,8 +416,8 @@  discard block
 block discarded – undo
416 416
                     }
417 417
                     if (count($map_post_types) > 1) {
418 418
                         ?>
419
-                        <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
420
-                             style="max-width:<?php echo $map_width;?>!important;">
419
+                        <div class="map-places-listing" id="<?php echo $map_canvas_name; ?>_posttype_menu"
420
+                             style="max-width:<?php echo $map_width; ?>!important;">
421 421
 
422 422
                             <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
423 423
                             <div class="geodir-map-posttype-list"><?php } ?>
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
                                     foreach ($post_types as $post_type => $args) {
429 429
                                         if (!in_array($post_type, $exclude_post_types)) {
430 430
                                             $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
431
-											echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __($args->labels->name, 'geodirectory') . '</a></li>';
431
+											echo '<li id="'.$post_type.'" '.$class.'><a href="javascript:void(0);" onclick="jQuery(\'#'.$map_canvas_name.'_posttype\').val(\''.$post_type.'\');build_map_ajax_search_param(\''.$map_canvas_name.'\', true)">'.__($args->labels->name, 'geodirectory').'</a></li>';
432 432
                                         }
433 433
                                     }
434 434
                                     ?>
@@ -453,8 +453,8 @@  discard block
 block discarded – undo
453 453
         <script type="text/javascript">
454 454
 
455 455
             jQuery(document).ready(function () {
456
-                build_map_ajax_search_param('<?php echo $map_canvas_name;?>', false);
457
-                map_sticky('<?php echo $map_canvas_name;?>');
456
+                build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false);
457
+                map_sticky('<?php echo $map_canvas_name; ?>');
458 458
             });
459 459
 
460 460
         </script>
@@ -465,18 +465,18 @@  discard block
 block discarded – undo
465 465
             <script>
466 466
                 (function () {
467 467
                     var screenH = jQuery(window).height();
468
-                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']);?>";
468
+                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']); ?>";
469 469
 
470 470
                     var ptypeH = '';
471
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
472
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
471
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
472
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
473 473
                     }
474 474
 
475
-                    jQuery("#sticky_map_<?php echo $map_canvas_name;?>").css("min-height", screenH * (heightVH / 100) + 'px');
476
-                    jQuery("#<?php echo $map_canvas_name;?>_wrapper").height(screenH * (heightVH / 100) + 'px');
477
-                    jQuery("#<?php echo $map_canvas_name;?>").height(screenH * (heightVH / 100) + 'px');
478
-                    jQuery("#<?php echo $map_canvas_name;?>_loading_div").height(screenH * (heightVH / 100) + 'px');
479
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
475
+                    jQuery("#sticky_map_<?php echo $map_canvas_name; ?>").css("min-height", screenH * (heightVH / 100) + 'px');
476
+                    jQuery("#<?php echo $map_canvas_name; ?>_wrapper").height(screenH * (heightVH / 100) + 'px');
477
+                    jQuery("#<?php echo $map_canvas_name; ?>").height(screenH * (heightVH / 100) + 'px');
478
+                    jQuery("#<?php echo $map_canvas_name; ?>_loading_div").height(screenH * (heightVH / 100) + 'px');
479
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
480 480
 
481 481
                 }());
482 482
             </script>
@@ -488,13 +488,13 @@  discard block
 block discarded – undo
488 488
             <script>
489 489
                 (function () {
490 490
                     var screenH = jQuery(window).height();
491
-                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']);?>";
491
+                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']); ?>";
492 492
                     var ptypeH = '';
493
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
494
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
493
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
494
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
495 495
                     }
496 496
 
497
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", heightVH - ptypeH + 'px');
497
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", heightVH - ptypeH + 'px');
498 498
 
499 499
                 }());
500 500
             </script>
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
          * @param array $geodir_map_options Array of map settings.
510 510
          * @param string $map_canvas_name The canvas name and ID for the map.
511 511
          */
512
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
512
+        do_action('geodir_map_after_render', $geodir_map_options, $map_canvas_name);
513 513
 
514 514
 
515 515
     endif; // Exclude posttypes if end
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_functions.php 2 patches
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.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 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 59
         $srcharr = array("'", "/", "-", '"', '\\');
60 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 64
         $geodir_cat_icons = geodir_get_term_icon();
65 65
         $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$default_category]) ? $geodir_cat_icons[$default_category] : '';
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $title = str_replace($srcharr, $replarr, $post_title);
69 69
 
70 70
         if (is_ssl()) {
71
-            $icon = str_replace("http:","https:",$icon );
71
+            $icon = str_replace("http:", "https:", $icon);
72 72
         }
73 73
         
74 74
         if ($icon != '') {
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
             $icon_size = array('w' => 36, 'h' => 45);
85 85
         }
86 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');
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 89
 
90 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'] . '"}';
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 99
 
100 100
         /**
101 101
          * Filter the json data when creating output for post json marker..
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
          * @param string $post_json JSON representation of the post marker info.
105 105
          * @param object $post The post object.
106 106
          */
107
-        $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
107
+        $post_map_json = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
108 108
 
109 109
         // only assign it if it has a value
110
-        if($post_map_json){
110
+        if ($post_map_json) {
111 111
             $map_jason[$post->ID] = $post_map_json;
112 112
         }
113 113
 
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
             if (is_array($map_jason) && !empty($map_jason)) {
132 132
 
133 133
                 // on details page only show the main marker on the map
134
-                if(geodir_is_page('detail')){
134
+                if (geodir_is_page('detail')) {
135 135
                     global $post;
136
-                    if(isset($map_jason[$post->ID])){
136
+                    if (isset($map_jason[$post->ID])) {
137 137
                         $map_jason = array($map_jason[$post->ID]);
138 138
                     }
139 139
                 }
140
-                $canvas_jason = $canvas . "_jason";
140
+                $canvas_jason = $canvas."_jason";
141 141
                 $map_canvas_arr[$canvas] = array_unique($map_jason);
142 142
                 unset($cat_content_info);
143 143
                 $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
                     $json_content = substr(implode(',', $cat_content_info), 1);
147 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 148
                     $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
149
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
149
+                    $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
150 150
                 } else {
151 151
                     $canvas_jason = '[{"totalcount":"0"}]';
152 152
                 }
153
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
153
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
154 154
 
155 155
                 /**
156 156
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
                  * @param string $canvas Map canvas array key.
163 163
                  * @param array $map_canvas_jason_args Map canvas args.
164 164
                  */
165
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
165
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
166 166
 
167
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
167
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
168 168
             } else {
169 169
                 $canvas_jason = '[{"totalcount":"0"}]';
170
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
170
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
171 171
 
172 172
                 /**
173 173
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
                  * @param string $canvas Map canvas array key.
180 180
                  * @param array $map_canvas_jason_args Map canvas args.
181 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);
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 184
             }
185 185
         }
186 186
 
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
             $display = !$child_collapse ? '' : 'display:none';
246 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 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';
252
+        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place';
253 253
         if ($is_home_map && $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype')) {
254 254
             $geodir_default_map_search_pt = $homemap_catlist_ptype;
255 255
         }
@@ -264,23 +264,23 @@  discard block
 block discarded – undo
264 264
 
265 265
                 // Untick the category by default on home map
266 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
267
+                    if (geodir_wpml_is_taxonomy_translated($post_type.'category')) { // if WPML
268 268
                         global $sitepress;
269 269
                         $default_lang = $sitepress->get_default_language();
270 270
                         $term_id = geodir_wpml_object_id($cat_term->term_id, $post_type.'category', true, $default_lang);
271
-                    }else{
271
+                    } else {
272 272
                         $term_id = $cat_term->term_id;
273 273
                     }
274
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) {
274
+                    if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$term_id, $geodir_home_map_untick)) {
275 275
                         $checked = '';
276 276
                     }
277 277
                 }
278 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>';
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 284
 
285 285
             endif;
286 286
 
@@ -392,19 +392,19 @@  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')) {
395
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('google-maps-api', 'done')) {
396 396
         $plugin_url = geodir_plugin_url();
397 397
 ?>
398 398
 <script type="text/javascript">
399 399
 if (!(window.google && typeof google.maps !== 'undefined')) {
400
-    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
400
+    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
401 401
     document.getElementsByTagName("head")[0].appendChild(css);
402
-    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
402
+    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
403 403
     document.getElementsByTagName("head")[0].appendChild(css);
404
-    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
405
-    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/osm.geocode.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
406
-    document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
407
-    document.write('<' + 'script id="geodirectory-o-overlappingmarker-script" src="<?php echo $plugin_url;?>/geodirectory-assets/jawj/oms-leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
404
+    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
405
+    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/osm.geocode.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
406
+    document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
407
+    document.write('<' + 'script id="geodirectory-o-overlappingmarker-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/jawj/oms-leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
408 408
 }
409 409
 </script>
410 410
 <?php
Please login to merge, or discard this patch.