Test Failed
Pull Request — master (#308)
by Kiran
23:47
created
geodirectory_template_actions.php 1 patch
Indentation   +1804 added lines, -1804 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,107 +275,107 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
278
+	$tc = get_option('theme_compatibility_setting');
279 279
 //print_r($tc);
280
-    if (empty($tc)) {
281
-        return;
282
-    }
283
-
284
-    //php
285
-    if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
-    }
288
-
289
-    //geodir_full_page_class
290
-    if (!empty($tc['geodir_full_page_class_filter'])) {
291
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
-    }
293
-
294
-    //widget before filter
295
-    if (!empty($tc['geodir_before_widget_filter'])) {
296
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
-    }
298
-
299
-    //widget after filter
300
-    if (!empty($tc['geodir_after_widget_filter'])) {
301
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
-    }
303
-
304
-    //widget before title filter
305
-    if (!empty($tc['geodir_before_title_filter'])) {
306
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
-    }
308
-
309
-    //widget before title filter
310
-    if (!empty($tc['geodir_after_title_filter'])) {
311
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
-    }
313
-
314
-    //menu li class
315
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
316
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
-    }
318
-
319
-    //menu ul class
320
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
-    }
323
-
324
-    //menu sub li class
325
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
-    }
328
-
329
-    //menu a class
330
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
331
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
-    }
333
-
334
-    //menu sub a class
335
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
-    }
338
-
339
-    //location menu li class
340
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
-    }
343
-
344
-    //location menu sub ul class
345
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
-    }
348
-
349
-    //location menu sub li class
350
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
-    }
353
-
354
-    //location menu a class
355
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
-    }
358
-
359
-    // compat styles
360
-    if (!empty($tc['geodir_theme_compat_css'])) {
361
-        add_action('wp_head', 'gd_compat_styles');
362
-    }
363
-
364
-    // compat js
365
-    if (!empty($tc['geodir_theme_compat_js'])) {
366
-        add_action('wp_footer', 'gd_compat_script');
367
-    }
368
-
369
-
370
-    // geodir_top_content_add
371
-    if (!empty($tc['geodir_top_content_add'])) {
372
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
-    }
374
-
375
-    // geodir_before_main_content_add
376
-    if (!empty($tc['geodir_before_main_content_add'])) {
377
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
-    }
280
+	if (empty($tc)) {
281
+		return;
282
+	}
283
+
284
+	//php
285
+	if (!empty($tc['geodir_theme_compat_code'])) {
286
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
+	}
288
+
289
+	//geodir_full_page_class
290
+	if (!empty($tc['geodir_full_page_class_filter'])) {
291
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
+	}
293
+
294
+	//widget before filter
295
+	if (!empty($tc['geodir_before_widget_filter'])) {
296
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
+	}
298
+
299
+	//widget after filter
300
+	if (!empty($tc['geodir_after_widget_filter'])) {
301
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
+	}
303
+
304
+	//widget before title filter
305
+	if (!empty($tc['geodir_before_title_filter'])) {
306
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
+	}
308
+
309
+	//widget before title filter
310
+	if (!empty($tc['geodir_after_title_filter'])) {
311
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
+	}
313
+
314
+	//menu li class
315
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
316
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
+	}
318
+
319
+	//menu ul class
320
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
+	}
323
+
324
+	//menu sub li class
325
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
+	}
328
+
329
+	//menu a class
330
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
331
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
+	}
333
+
334
+	//menu sub a class
335
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
+	}
338
+
339
+	//location menu li class
340
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
+	}
343
+
344
+	//location menu sub ul class
345
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
+	}
348
+
349
+	//location menu sub li class
350
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
+	}
353
+
354
+	//location menu a class
355
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
+	}
358
+
359
+	// compat styles
360
+	if (!empty($tc['geodir_theme_compat_css'])) {
361
+		add_action('wp_head', 'gd_compat_styles');
362
+	}
363
+
364
+	// compat js
365
+	if (!empty($tc['geodir_theme_compat_js'])) {
366
+		add_action('wp_footer', 'gd_compat_script');
367
+	}
368
+
369
+
370
+	// geodir_top_content_add
371
+	if (!empty($tc['geodir_top_content_add'])) {
372
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
+	}
374
+
375
+	// geodir_before_main_content_add
376
+	if (!empty($tc['geodir_before_main_content_add'])) {
377
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
+	}
379 379
 
380 380
 
381 381
 }
@@ -398,23 +398,23 @@  discard block
 block discarded – undo
398 398
  */
399 399
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
400 400
 {
401
-    $tc = get_option('theme_compatibility_setting');
402
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
403
-        $text = $tc['geodir_wrapper_open_replace'];
404
-    } else {
405
-        $text = '<div id="[id]" class="[class]">';
406
-    }
401
+	$tc = get_option('theme_compatibility_setting');
402
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
403
+		$text = $tc['geodir_wrapper_open_replace'];
404
+	} else {
405
+		$text = '<div id="[id]" class="[class]">';
406
+	}
407 407
 
408
-    if (!empty($tc['geodir_wrapper_open_id'])) {
409
-        $id = $tc['geodir_wrapper_open_id'];
410
-    }
411
-    if (!empty($tc['geodir_wrapper_open_class'])) {
412
-        $class = $tc['geodir_wrapper_open_class'];
413
-    }
408
+	if (!empty($tc['geodir_wrapper_open_id'])) {
409
+		$id = $tc['geodir_wrapper_open_id'];
410
+	}
411
+	if (!empty($tc['geodir_wrapper_open_class'])) {
412
+		$class = $tc['geodir_wrapper_open_class'];
413
+	}
414 414
 
415
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
416 416
 
417
-    echo $text;
417
+	echo $text;
418 418
 }
419 419
 
420 420
 // action for adding the wrapperdiv closing tag
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
  */
430 430
 function geodir_action_wrapper_close($type = '')
431 431
 {
432
-    $tc = get_option('theme_compatibility_setting');
433
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
434
-        $text = $tc['geodir_wrapper_close_replace'];
435
-    } else {
436
-        $text = '</div><!-- wrapper ends here-->';
437
-    }
432
+	$tc = get_option('theme_compatibility_setting');
433
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
434
+		$text = $tc['geodir_wrapper_close_replace'];
435
+	} else {
436
+		$text = '</div><!-- wrapper ends here-->';
437
+	}
438 438
 
439
-    echo $text;
439
+	echo $text;
440 440
 }
441 441
 
442 442
 // action for adding the content div opening tag
@@ -452,35 +452,35 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
457
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
459
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
461
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
463
-    } else {
464
-        $width_css = '';
465
-    }
466
-
467
-    $tc = get_option('theme_compatibility_setting');
468
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
-        $text = $tc['geodir_wrapper_content_open_replace'];
470
-    } else {
471
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
-    }
473
-
474
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
-        $id = $tc['geodir_wrapper_content_open_id'];
476
-    }
477
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
-        $class = $tc['geodir_wrapper_content_open_class'];
479
-    }
480
-
481
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
-
483
-    echo $text;
455
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
+		$width_css = 'style="width:' . $width . '%;"';
457
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
+		$width_css = 'style="width:' . $width . '%;"';
459
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
+		$width_css = 'style="width:' . $width . '%;"';
461
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
+		$width_css = 'style="width:' . $width . '%;"';
463
+	} else {
464
+		$width_css = '';
465
+	}
466
+
467
+	$tc = get_option('theme_compatibility_setting');
468
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
+		$text = $tc['geodir_wrapper_content_open_replace'];
470
+	} else {
471
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
+	}
473
+
474
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
+		$id = $tc['geodir_wrapper_content_open_id'];
476
+	}
477
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
+		$class = $tc['geodir_wrapper_content_open_class'];
479
+	}
480
+
481
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
+
483
+	echo $text;
484 484
 }
485 485
 
486 486
 // action for adding the primary div closing tag
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_action_wrapper_content_close($type = '')
496 496
 {
497
-    $tc = get_option('theme_compatibility_setting');
498
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
-        $text = $tc['geodir_wrapper_content_close_replace'];
500
-    } else {
501
-        $text = '</div><!-- content ends here-->';
502
-    }
503
-    echo $text;
497
+	$tc = get_option('theme_compatibility_setting');
498
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
+		$text = $tc['geodir_wrapper_content_close_replace'];
500
+	} else {
501
+		$text = '</div><!-- content ends here-->';
502
+	}
503
+	echo $text;
504 504
 }
505 505
 
506 506
 // action for adding the <article> opening tag
@@ -518,24 +518,24 @@  discard block
 block discarded – undo
518 518
  */
519 519
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
520 520
 {
521
-    $class = implode(" ", $class);
522
-    $tc = get_option('theme_compatibility_setting');
523
-    if (!empty($tc['geodir_article_open_replace'])) {
524
-        $text = $tc['geodir_article_open_replace'];
525
-    } else {
526
-        $text = '<article  id="[id]" class="[class]" >';
527
-    }
521
+	$class = implode(" ", $class);
522
+	$tc = get_option('theme_compatibility_setting');
523
+	if (!empty($tc['geodir_article_open_replace'])) {
524
+		$text = $tc['geodir_article_open_replace'];
525
+	} else {
526
+		$text = '<article  id="[id]" class="[class]" >';
527
+	}
528 528
 
529
-    if (!empty($tc['geodir_article_open_id'])) {
530
-        $id = $tc['geodir_article_open_id'];
531
-    }
532
-    if (!empty($tc['geodir_article_open_class'])) {
533
-        $class = $tc['geodir_article_open_class'];
534
-    }
529
+	if (!empty($tc['geodir_article_open_id'])) {
530
+		$id = $tc['geodir_article_open_id'];
531
+	}
532
+	if (!empty($tc['geodir_article_open_class'])) {
533
+		$class = $tc['geodir_article_open_class'];
534
+	}
535 535
 
536
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
537 537
 
538
-    echo $text;
538
+	echo $text;
539 539
 }
540 540
 
541 541
 // action for adding the primary div closing tag
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_action_article_close($type = '')
551 551
 {
552
-    $tc = get_option('theme_compatibility_setting');
553
-    if (!empty($tc['geodir_article_close_replace'])) {
554
-        $text = $tc['geodir_article_close_replace'];
555
-    } else {
556
-        $text = '</article><!-- article ends here-->';
557
-    }
558
-    echo $text;
552
+	$tc = get_option('theme_compatibility_setting');
553
+	if (!empty($tc['geodir_article_close_replace'])) {
554
+		$text = $tc['geodir_article_close_replace'];
555
+	} else {
556
+		$text = '</article><!-- article ends here-->';
557
+	}
558
+	echo $text;
559 559
 }
560 560
 
561 561
 // action for adding the sidebar opening tag
@@ -572,35 +572,35 @@  discard block
 block discarded – undo
572 572
  */
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
577
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
579
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
581
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
583
-    } else {
584
-        $width_css = '';
585
-    }
586
-
587
-    $tc = get_option('theme_compatibility_setting');
588
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
-        $text = $tc['geodir_sidebar_right_open_replace'];
590
-    } else {
591
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
-    }
593
-
594
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
-        $id = $tc['geodir_sidebar_right_open_id'];
596
-    }
597
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
-        $class = $tc['geodir_sidebar_right_open_class'];
599
-    }
600
-
601
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
-
603
-    echo $text;
575
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
+		$width_css = 'style="width:' . $width . '%;"';
577
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
+		$width_css = 'style="width:' . $width . '%;"';
579
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
+		$width_css = 'style="width:' . $width . '%;"';
581
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
+		$width_css = 'style="width:' . $width . '%;"';
583
+	} else {
584
+		$width_css = '';
585
+	}
586
+
587
+	$tc = get_option('theme_compatibility_setting');
588
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
+		$text = $tc['geodir_sidebar_right_open_replace'];
590
+	} else {
591
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
+	}
593
+
594
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
+		$id = $tc['geodir_sidebar_right_open_id'];
596
+	}
597
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
+		$class = $tc['geodir_sidebar_right_open_class'];
599
+	}
600
+
601
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
+
603
+	echo $text;
604 604
 }
605 605
 
606 606
 // action for adding the primary div closing tag
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_action_sidebar_right_close($type = '')
616 616
 {
617
-    $tc = get_option('theme_compatibility_setting');
618
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
-        $text = $tc['geodir_sidebar_right_close_replace'];
620
-    } else {
621
-        $text = '</aside><!-- sidebar ends here-->';
622
-    }
623
-    echo $text;
617
+	$tc = get_option('theme_compatibility_setting');
618
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
+		$text = $tc['geodir_sidebar_right_close_replace'];
620
+	} else {
621
+		$text = '</aside><!-- sidebar ends here-->';
622
+	}
623
+	echo $text;
624 624
 }
625 625
 
626 626
 
@@ -641,121 +641,121 @@  discard block
 block discarded – undo
641 641
  */
642 642
 function geodir_action_geodir_set_preview_post()
643 643
 {
644
-    global $post, $preview, $gd_session;
645
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
-    if (!$preview || $is_backend_preview) {
647
-        return;
648
-    }// bail if not previewing
649
-
650
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
-
652
-    $fields_info = geodir_get_custom_fields_type($listing_type);
653
-
654
-    foreach ($_REQUEST as $pkey => $pval) {
655
-        if ($pkey == 'geodir_video') {
656
-            $tags = '<iframe>';
657
-        } else if ($pkey == 'post_desc') {
658
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
-        } else if (is_array($_REQUEST[$pkey])) {
662
-            $tags = 'skip_field';
663
-        } else {
664
-            $tags = '';
665
-        }
666
-        /**
667
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
-         *
669
-         * @since 1.0.0
670
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
-         */
673
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
-
675
-        if ($tags != 'skip_field') {
676
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
-        }
678
-    }
679
-
680
-    $post = (object)$_REQUEST;
681
-
682
-
683
-    if (isset($post->video)) {
684
-        $post->video = stripslashes($post->video);
685
-    }
686
-
687
-    if (isset($post->Video2)) {
688
-        $post->Video2 = stripslashes($post->Video2);
689
-    }
690
-
691
-    $post_type = $post->listing_type;
692
-    $post_type_info = get_post_type_object($post_type);
693
-
694
-    $listing_label = $post_type_info->labels->singular_name;
695
-
696
-    $term_icon = '';
697
-
698
-    if (!empty($post->post_category)) {
699
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
700
-
701
-            if ($post_term != '' && !is_array($post_term)) {
702
-                $post_term = explode(',', trim($post_term, ','));
703
-            }
644
+	global $post, $preview, $gd_session;
645
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
+	if (!$preview || $is_backend_preview) {
647
+		return;
648
+	}// bail if not previewing
649
+
650
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
+
652
+	$fields_info = geodir_get_custom_fields_type($listing_type);
653
+
654
+	foreach ($_REQUEST as $pkey => $pval) {
655
+		if ($pkey == 'geodir_video') {
656
+			$tags = '<iframe>';
657
+		} else if ($pkey == 'post_desc') {
658
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
+		} else if (is_array($_REQUEST[$pkey])) {
662
+			$tags = 'skip_field';
663
+		} else {
664
+			$tags = '';
665
+		}
666
+		/**
667
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
+		 *
669
+		 * @since 1.0.0
670
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
+		 */
673
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
+
675
+		if ($tags != 'skip_field') {
676
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
+		}
678
+	}
679
+
680
+	$post = (object)$_REQUEST;
681
+
682
+
683
+	if (isset($post->video)) {
684
+		$post->video = stripslashes($post->video);
685
+	}
686
+
687
+	if (isset($post->Video2)) {
688
+		$post->Video2 = stripslashes($post->Video2);
689
+	}
690
+
691
+	$post_type = $post->listing_type;
692
+	$post_type_info = get_post_type_object($post_type);
693
+
694
+	$listing_label = $post_type_info->labels->singular_name;
695
+
696
+	$term_icon = '';
697
+
698
+	if (!empty($post->post_category)) {
699
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
700
+
701
+			if ($post_term != '' && !is_array($post_term)) {
702
+				$post_term = explode(',', trim($post_term, ','));
703
+			}
704 704
 
705
-            if (is_array($post_term)) {
706
-                $post_term = array_unique($post_term);
707
-            }
705
+			if (is_array($post_term)) {
706
+				$post_term = array_unique($post_term);
707
+			}
708 708
 
709
-            if (!empty($post_term)) {
710
-                foreach ($post_term as $cat_id) {
711
-                    $cat_id = trim($cat_id);
712
-
713
-                    if ($cat_id != '') {
714
-                        $term_icon = get_option('geodir_default_marker_icon');
715
-
716
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
720
-                                break;
721
-                            }
722
-                        }
723
-                    }
724
-                }
725
-            }
726
-        }
727
-    }
709
+			if (!empty($post_term)) {
710
+				foreach ($post_term as $cat_id) {
711
+					$cat_id = trim($cat_id);
712
+
713
+					if ($cat_id != '') {
714
+						$term_icon = get_option('geodir_default_marker_icon');
715
+
716
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
+									$term_icon = $term_icon_url['src'];
720
+								break;
721
+							}
722
+						}
723
+					}
724
+				}
725
+			}
726
+		}
727
+	}
728 728
 
729
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
729
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
731 731
 
732
-    $srcharr = array("'", "/", "-", '"', '\\');
733
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
732
+	$srcharr = array("'", "/", "-", '"', '\\');
733
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
734 734
 
735
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
735
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
736 736
 
737
-    $json = '{';
738
-    $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
743
-    $json .= '}';
737
+	$json = '{';
738
+	$json .= '"post_preview": "1",';
739
+	$json .= '"t": "' . $json_title . '",';
740
+	$json .= '"lt": "' . $post_latitude . '",';
741
+	$json .= '"ln": "' . $post_longitude . '",';
742
+	$json .= '"i":"' . $term_icon . '"';
743
+	$json .= '}';
744 744
 
745
-    $post->marker_json = $json;
745
+	$post->marker_json = $json;
746 746
 
747
-    $gd_session->set('listing', $_REQUEST);
747
+	$gd_session->set('listing', $_REQUEST);
748 748
 
749
-    // we need to define a few things to trick the setup_postdata
750
-    if (!isset($post->ID)) {
751
-        $post->ID = '';
752
-        $post->post_author = '';
753
-        $post->post_date = '';
754
-        $post->post_content = '';
755
-        $post->default_category = '';
756
-        $post->post_type = '';
757
-    }
758
-    setup_postdata($post);
749
+	// we need to define a few things to trick the setup_postdata
750
+	if (!isset($post->ID)) {
751
+		$post->ID = '';
752
+		$post->post_author = '';
753
+		$post->post_date = '';
754
+		$post->post_content = '';
755
+		$post->default_category = '';
756
+		$post->post_type = '';
757
+	}
758
+	setup_postdata($post);
759 759
 }
760 760
 
761 761
 /**
@@ -767,15 +767,15 @@  discard block
 block discarded – undo
767 767
  */
768 768
 function geodir_action_geodir_preview_code()
769 769
 {
770
-    global $preview;
770
+	global $preview;
771 771
 
772
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
773 773
 
774
-    if (!$preview || $is_backend_preview) {
775
-        return;
776
-    }// bail if not previewing
774
+	if (!$preview || $is_backend_preview) {
775
+		return;
776
+	}// bail if not previewing
777 777
 
778
-    geodir_get_template_part('preview', 'buttons');
778
+	geodir_get_template_part('preview', 'buttons');
779 779
 }
780 780
 
781 781
 // action for adding the details page top widget area
@@ -791,20 +791,20 @@  discard block
 block discarded – undo
791 791
  */
792 792
 function geodir_action_geodir_sidebar_detail_top($class = '')
793 793
 {
794
-    if (get_option('geodir_show_detail_top_section')) { ?>
794
+	if (get_option('geodir_show_detail_top_section')) { ?>
795 795
         <div
796 796
             class="<?php
797
-            /**
798
-             * Filter the div class for the wrapper of the full width widget areas.
799
-             *
800
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
-             *
802
-             * @since 1.0.0
803
-             * @param string $class The class of the div.
804
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
-             */
807
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
797
+			/**
798
+			 * Filter the div class for the wrapper of the full width widget areas.
799
+			 *
800
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
+			 *
802
+			 * @since 1.0.0
803
+			 * @param string $class The class of the div.
804
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
+			 */
807
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
808 808
             <?php dynamic_sidebar('geodir_detail_top'); ?>
809 809
         </div>
810 810
     <?php }
@@ -828,11 +828,11 @@  discard block
 block discarded – undo
828 828
  */
829 829
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
830 830
 {
831
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
831
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
832 832
         <div
833 833
             class="<?php
834
-            /** This action is documented in geodirectory_template_actions.php */
835
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
834
+			/** This action is documented in geodirectory_template_actions.php */
835
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
836 836
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
837 837
         </div><!-- clearfix ends here-->
838 838
     <?php }
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
  */
847 847
 function geodir_details_sidebar_widget_area()
848 848
 {
849
-    dynamic_sidebar('geodir_detail_sidebar');
849
+	dynamic_sidebar('geodir_detail_sidebar');
850 850
 }
851 851
 
852 852
 /**
@@ -857,12 +857,12 @@  discard block
 block discarded – undo
857 857
  */
858 858
 function geodir_details_sidebar_place_details()
859 859
 {
860
-    /**
861
-     * Used to add items to the details page sidebar.
862
-     *
863
-     * @since 1.0.0
864
-     */
865
-    do_action('geodir_detail_page_sidebar');
860
+	/**
861
+	 * Used to add items to the details page sidebar.
862
+	 *
863
+	 * @since 1.0.0
864
+	 */
865
+	do_action('geodir_detail_page_sidebar');
866 866
 }
867 867
 
868 868
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -877,68 +877,68 @@  discard block
 block discarded – undo
877 877
  */
878 878
 function geodir_action_details_sidebar()
879 879
 {
880
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
-    if (get_option('geodir_detail_sidebar_left_section')) {
882
-        /**
883
-         * Called before the details page left sidebar is opened.
884
-         *
885
-         * This is used to add opening wrapper HTML to the details page left sidebar.
886
-         *
887
-         * @since 1.0.0
888
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
-         */
893
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
-        ?>
880
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
+	if (get_option('geodir_detail_sidebar_left_section')) {
882
+		/**
883
+		 * Called before the details page left sidebar is opened.
884
+		 *
885
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
886
+		 *
887
+		 * @since 1.0.0
888
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
+		 */
893
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
+		?>
895 895
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
896
-        /**
897
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
-         *
899
-         * This is used to add all info to the details page sidebars.
900
-         *
901
-         * @since 1.0.0
902
-         */
903
-        do_action('geodir_detail_sidebar_inside');
904
-        ?></div><!-- end geodir-content-left --><?php
905
-        /**
906
-         * Called after the details page left sidebar.
907
-         *
908
-         * This is used to add closing wrapper HTML to the details page left sidebar.
909
-         *
910
-         * @since 1.0.0
911
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
-         */
913
-        do_action('geodir_sidebar_left_close', 'details-page');
914
-    } else {
915
-        /**
916
-         * Called before the details page right sidebar is opened.
917
-         *
918
-         * This is used to add opening wrapper HTML to the details page right sidebar.
919
-         *
920
-         * @since 1.0.0
921
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
-         */
926
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
-        ?>
896
+		/**
897
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
+		 *
899
+		 * This is used to add all info to the details page sidebars.
900
+		 *
901
+		 * @since 1.0.0
902
+		 */
903
+		do_action('geodir_detail_sidebar_inside');
904
+		?></div><!-- end geodir-content-left --><?php
905
+		/**
906
+		 * Called after the details page left sidebar.
907
+		 *
908
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
909
+		 *
910
+		 * @since 1.0.0
911
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
+		 */
913
+		do_action('geodir_sidebar_left_close', 'details-page');
914
+	} else {
915
+		/**
916
+		 * Called before the details page right sidebar is opened.
917
+		 *
918
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
919
+		 *
920
+		 * @since 1.0.0
921
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
+		 */
926
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
+		?>
928 928
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
929
-        /** This action is documented in geodirectory_template_actions.php */
930
-        do_action('geodir_detail_sidebar_inside');
931
-        ?></div><!-- end geodir-content-right --><?php
932
-        /**
933
-         * Called after the details page right sidebar.
934
-         *
935
-         * This is used to add closing wrapper HTML to the details page right sidebar.
936
-         *
937
-         * @since 1.0.0
938
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
-         */
940
-        do_action('geodir_sidebar_right_close', 'details-page');
941
-    }
929
+		/** This action is documented in geodirectory_template_actions.php */
930
+		do_action('geodir_detail_sidebar_inside');
931
+		?></div><!-- end geodir-content-right --><?php
932
+		/**
933
+		 * Called after the details page right sidebar.
934
+		 *
935
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
936
+		 *
937
+		 * @since 1.0.0
938
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
+		 */
940
+		do_action('geodir_sidebar_right_close', 'details-page');
941
+	}
942 942
 }
943 943
 
944 944
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -952,21 +952,21 @@  discard block
 block discarded – undo
952 952
  */
953 953
 function geodir_action_page_title()
954 954
 {
955
-    /**
956
-     * Filter the page title HTML h1 class.
957
-     *
958
-     * @since 1.0.0
959
-     * @param string $class The class to use. Default is 'entry-title fn'.
960
-     */
961
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
-    /**
963
-     * Filter the page title HTML header wrapper class.
964
-     *
965
-     * @since 1.0.0
966
-     * @param string $class The class to use. Default is 'entry-header'.
967
-     */
968
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
955
+	/**
956
+	 * Filter the page title HTML h1 class.
957
+	 *
958
+	 * @since 1.0.0
959
+	 * @param string $class The class to use. Default is 'entry-title fn'.
960
+	 */
961
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
+	/**
963
+	 * Filter the page title HTML header wrapper class.
964
+	 *
965
+	 * @since 1.0.0
966
+	 * @param string $class The class to use. Default is 'entry-header'.
967
+	 */
968
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
970 970
 }
971 971
 
972 972
 
@@ -983,87 +983,87 @@  discard block
 block discarded – undo
983 983
  */
984 984
 function geodir_action_details_slider()
985 985
 {
986
-    global $preview, $post;
986
+	global $preview, $post;
987 987
 
988
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
989 989
 
990
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
990
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
992 992
 
993
-        $preview_post_images = array();
994
-        if ($preview_get_images) {
995
-            foreach ($preview_get_images as $row) {
996
-                $preview_post_images[] = $row->src;
997
-            }
998
-        }
999
-        if (!empty($preview_post_images)) {
1000
-            $post->post_images = implode(',', $preview_post_images);
1001
-        }
1002
-    }
1003
-
1004
-    if ($preview) {
1005
-        $post_images = array();
1006
-        if (isset($post->post_images) && !empty($post->post_images)) {
1007
-            $post->post_images = trim($post->post_images, ",");
1008
-            $post_images = explode(",", $post->post_images);
1009
-        }
1010
-
1011
-        $main_slides = '';
1012
-        $nav_slides = '';
1013
-        $slides = 0;
1014
-
1015
-        if (!empty($post_images)) {
1016
-            foreach ($post_images as $image) {
1017
-                if (!empty($image)) {
1018
-                    $sizes = getimagesize(trim($image));
1019
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
-
1022
-                    if ($image && $width && $height) {
1023
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
-                    }
1025
-
1026
-                    if (isset($image->src)) {
1027
-                        if ($image->height >= 400) {
1028
-                            $spacer_height = 0;
1029
-                        } else {
1030
-                            $spacer_height = ((400 - $image->height) / 2);
1031
-                        }
1032
-
1033
-                        $image_title = isset($image->title) ? $image->title : '';
1034
-
1035
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1036
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
-                        $slides++;
1039
-                    }
1040
-                }
1041
-            }// endfore
1042
-        } //end if
1043
-    } else {
1044
-        $main_slides = '';
1045
-        $nav_slides = '';
1046
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1047
-        $slides = 0;
1048
-
1049
-        if (!empty($post_images)) {
1050
-            foreach ($post_images as $image) {
1051
-                if ($image->height >= 400) {
1052
-                    $spacer_height = 0;
1053
-                } else {
1054
-                    $spacer_height = ((400 - $image->height) / 2);
1055
-                }
1056
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1057
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1058
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1059
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1060
-                $slides++;
1061
-            }
1062
-        }// endfore
1063
-    }
993
+		$preview_post_images = array();
994
+		if ($preview_get_images) {
995
+			foreach ($preview_get_images as $row) {
996
+				$preview_post_images[] = $row->src;
997
+			}
998
+		}
999
+		if (!empty($preview_post_images)) {
1000
+			$post->post_images = implode(',', $preview_post_images);
1001
+		}
1002
+	}
1003
+
1004
+	if ($preview) {
1005
+		$post_images = array();
1006
+		if (isset($post->post_images) && !empty($post->post_images)) {
1007
+			$post->post_images = trim($post->post_images, ",");
1008
+			$post_images = explode(",", $post->post_images);
1009
+		}
1010
+
1011
+		$main_slides = '';
1012
+		$nav_slides = '';
1013
+		$slides = 0;
1014
+
1015
+		if (!empty($post_images)) {
1016
+			foreach ($post_images as $image) {
1017
+				if (!empty($image)) {
1018
+					$sizes = getimagesize(trim($image));
1019
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
+
1022
+					if ($image && $width && $height) {
1023
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
+					}
1025
+
1026
+					if (isset($image->src)) {
1027
+						if ($image->height >= 400) {
1028
+							$spacer_height = 0;
1029
+						} else {
1030
+							$spacer_height = ((400 - $image->height) / 2);
1031
+						}
1032
+
1033
+						$image_title = isset($image->title) ? $image->title : '';
1034
+
1035
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1036
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
+						$slides++;
1039
+					}
1040
+				}
1041
+			}// endfore
1042
+		} //end if
1043
+	} else {
1044
+		$main_slides = '';
1045
+		$nav_slides = '';
1046
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1047
+		$slides = 0;
1048
+
1049
+		if (!empty($post_images)) {
1050
+			foreach ($post_images as $image) {
1051
+				if ($image->height >= 400) {
1052
+					$spacer_height = 0;
1053
+				} else {
1054
+					$spacer_height = ((400 - $image->height) / 2);
1055
+				}
1056
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1057
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1058
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1059
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1060
+				$slides++;
1061
+			}
1062
+		}// endfore
1063
+	}
1064 1064
 
1065
-    if (!empty($post_images)) {
1066
-        ?>
1065
+	if (!empty($post_images)) {
1066
+		?>
1067 1067
         <div class="geodir_flex-container">
1068 1068
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1069 1069
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
             <?php } ?>
1077 1077
         </div>
1078 1078
     <?php
1079
-    }
1079
+	}
1080 1080
 }
1081 1081
 
1082 1082
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1091,177 +1091,177 @@  discard block
 block discarded – undo
1091 1091
  */
1092 1092
 function geodir_action_details_taxonomies()
1093 1093
 {
1094
-    global $preview, $post;?>
1094
+	global $preview, $post;?>
1095 1095
     <p class="geodir_post_taxomomies clearfix">
1096 1096
     <?php
1097
-    $taxonomies = array();
1098
-
1099
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1100
-
1101
-    if ($preview && !$is_backend_preview) {
1102
-        $post_type = $post->listing_type;
1103
-        $post_taxonomy = $post_type . 'category';
1104
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1105
-    } else {
1106
-        $post_type = $post->post_type;
1107
-        $post_taxonomy = $post_type . 'category';
1108
-    }
1097
+	$taxonomies = array();
1098
+
1099
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1100
+
1101
+	if ($preview && !$is_backend_preview) {
1102
+		$post_type = $post->listing_type;
1103
+		$post_taxonomy = $post_type . 'category';
1104
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1105
+	} else {
1106
+		$post_type = $post->post_type;
1107
+		$post_taxonomy = $post_type . 'category';
1108
+	}
1109 1109
 //{	
1110
-    $post_type_info = get_post_type_object($post_type);
1111
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1112
-
1113
-    if (!empty($post->post_tags)) {
1114
-
1115
-        if (taxonomy_exists($post_type . '_tags')):
1116
-            $links = array();
1117
-            $terms = array();
1118
-            // to limit post tags
1119
-            $post_tags = trim($post->post_tags, ",");
1120
-            $post_id = isset($post->ID) ? $post->ID : '';
1121
-            /**
1122
-             * Filter the post tags.
1123
-             *
1124
-             * Allows you to filter the post tags output on the details page of a post.
1125
-             *
1126
-             * @since 1.0.0
1127
-             * @param string $post_tags A comma seperated list of tags.
1128
-             * @param int $post_id The current post id.
1129
-             */
1130
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1131
-
1132
-            $post->post_tags = $post_tags;
1133
-            $post_tags = explode(",", trim($post->post_tags, ","));
1134
-
1135
-
1136
-            foreach ($post_tags as $post_term) {
1137
-
1138
-                // fix slug creation order for tags & location
1139
-                $post_term = trim($post_term);
1140
-
1141
-                $priority_location = false;
1142
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1143
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1144
-                } else {
1145
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1146
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1147
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1148
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1149
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1150
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1151
-                    if ($match_country || $match_region || $match_city) {
1152
-                        $priority_location = true;
1153
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1154
-                    } else {
1155
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1156
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1157
-                    }
1158
-                }
1159
-
1160
-                if (!is_wp_error($term) && is_object($term)) {
1161
-
1162
-                    // fix tag link on detail page
1163
-                    if ($priority_location) {
1164
-
1165
-                        $tag_link = "<a href=''>$post_term</a>";
1166
-                        /**
1167
-                         * Filter the tag name on the details page.
1168
-                         *
1169
-                         * @since 1.5.6
1170
-                         * @param string $tag_link The tag link html.
1171
-                         * @param object $term The tag term object.
1172
-                         */
1173
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1174
-                        $links[] = $tag_link;
1175
-                    } else {
1176
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1177
-                        /** This action is documented in geodirectory-template_actions.php */
1178
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1179
-                        $links[] = $tag_link;
1180
-                    }
1181
-                    $terms[] = $term;
1182
-                }
1183
-                //
1184
-            }
1185
-            if (!isset($listing_label)) {
1186
-                $listing_label = '';
1187
-            }
1188
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1189
-        endif;
1190
-
1191
-    }
1192
-
1193
-    if (!empty($post->{$post_taxonomy})) {
1194
-        $links = array();
1195
-        $terms = array();
1196
-        $termsOrdered = array();
1197
-        if (!is_array($post->{$post_taxonomy})) {
1198
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1199
-        } else {
1200
-            $post_term = $post->{$post_taxonomy};
1110
+	$post_type_info = get_post_type_object($post_type);
1111
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1112
+
1113
+	if (!empty($post->post_tags)) {
1114
+
1115
+		if (taxonomy_exists($post_type . '_tags')):
1116
+			$links = array();
1117
+			$terms = array();
1118
+			// to limit post tags
1119
+			$post_tags = trim($post->post_tags, ",");
1120
+			$post_id = isset($post->ID) ? $post->ID : '';
1121
+			/**
1122
+			 * Filter the post tags.
1123
+			 *
1124
+			 * Allows you to filter the post tags output on the details page of a post.
1125
+			 *
1126
+			 * @since 1.0.0
1127
+			 * @param string $post_tags A comma seperated list of tags.
1128
+			 * @param int $post_id The current post id.
1129
+			 */
1130
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1131
+
1132
+			$post->post_tags = $post_tags;
1133
+			$post_tags = explode(",", trim($post->post_tags, ","));
1134
+
1135
+
1136
+			foreach ($post_tags as $post_term) {
1137
+
1138
+				// fix slug creation order for tags & location
1139
+				$post_term = trim($post_term);
1140
+
1141
+				$priority_location = false;
1142
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1143
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1144
+				} else {
1145
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1146
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1147
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1148
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1149
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1150
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1151
+					if ($match_country || $match_region || $match_city) {
1152
+						$priority_location = true;
1153
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1154
+					} else {
1155
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1156
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1157
+					}
1158
+				}
1159
+
1160
+				if (!is_wp_error($term) && is_object($term)) {
1161
+
1162
+					// fix tag link on detail page
1163
+					if ($priority_location) {
1164
+
1165
+						$tag_link = "<a href=''>$post_term</a>";
1166
+						/**
1167
+						 * Filter the tag name on the details page.
1168
+						 *
1169
+						 * @since 1.5.6
1170
+						 * @param string $tag_link The tag link html.
1171
+						 * @param object $term The tag term object.
1172
+						 */
1173
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1174
+						$links[] = $tag_link;
1175
+					} else {
1176
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1177
+						/** This action is documented in geodirectory-template_actions.php */
1178
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1179
+						$links[] = $tag_link;
1180
+					}
1181
+					$terms[] = $term;
1182
+				}
1183
+				//
1184
+			}
1185
+			if (!isset($listing_label)) {
1186
+				$listing_label = '';
1187
+			}
1188
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1189
+		endif;
1190
+
1191
+	}
1192
+
1193
+	if (!empty($post->{$post_taxonomy})) {
1194
+		$links = array();
1195
+		$terms = array();
1196
+		$termsOrdered = array();
1197
+		if (!is_array($post->{$post_taxonomy})) {
1198
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1199
+		} else {
1200
+			$post_term = $post->{$post_taxonomy};
1201 1201
 			
1202 1202
 			if ($preview && !$is_backend_preview) {
1203 1203
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1204 1204
 			}
1205
-        }
1206
-
1207
-        $post_term = array_unique($post_term);
1208
-        if (!empty($post_term)) {
1209
-            foreach ($post_term as $post_term) {
1210
-                $post_term = trim($post_term);
1211
-
1212
-                if ($post_term != ''):
1213
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1214
-
1215
-                    if (is_object($term)) {
1216
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1217
-                        /**
1218
-                         * Filter the category name on the details page.
1219
-                         *
1220
-                         * @since 1.5.6
1221
-                         * @param string $term_link The link html to the category.
1222
-                         * @param object $term The category term object.
1223
-                         */
1224
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1225
-                        $links[] = $term_link;
1226
-                        $terms[] = $term;
1227
-                    }
1228
-                endif;
1229
-            }
1230
-            // order alphabetically
1231
-            asort($links);
1232
-            foreach (array_keys($links) as $key) {
1233
-                $termsOrdered[$key] = $terms[$key];
1234
-            }
1235
-            $terms = $termsOrdered;
1205
+		}
1206
+
1207
+		$post_term = array_unique($post_term);
1208
+		if (!empty($post_term)) {
1209
+			foreach ($post_term as $post_term) {
1210
+				$post_term = trim($post_term);
1211
+
1212
+				if ($post_term != ''):
1213
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1214
+
1215
+					if (is_object($term)) {
1216
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1217
+						/**
1218
+						 * Filter the category name on the details page.
1219
+						 *
1220
+						 * @since 1.5.6
1221
+						 * @param string $term_link The link html to the category.
1222
+						 * @param object $term The category term object.
1223
+						 */
1224
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1225
+						$links[] = $term_link;
1226
+						$terms[] = $term;
1227
+					}
1228
+				endif;
1229
+			}
1230
+			// order alphabetically
1231
+			asort($links);
1232
+			foreach (array_keys($links) as $key) {
1233
+				$termsOrdered[$key] = $terms[$key];
1234
+			}
1235
+			$terms = $termsOrdered;
1236 1236
 
1237
-        }
1237
+		}
1238 1238
 
1239
-        if (!isset($listing_label)) {
1240
-            $listing_label = '';
1241
-        }
1242
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1239
+		if (!isset($listing_label)) {
1240
+			$listing_label = '';
1241
+		}
1242
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1243 1243
 
1244
-    }
1244
+	}
1245 1245
 
1246
-    /**
1247
-     * Filter the taxonomies array before output.
1248
-     *
1249
-     * @since 1.5.9
1250
-     * @param array $taxonomies The array of cats and tags.
1251
-     * @param string $post_type The post type being output.
1252
-     * @param string $listing_label The post type label.
1253
-     * @param string $listing_label The post type label with ucwords function.
1254
-     */
1255
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1246
+	/**
1247
+	 * Filter the taxonomies array before output.
1248
+	 *
1249
+	 * @since 1.5.9
1250
+	 * @param array $taxonomies The array of cats and tags.
1251
+	 * @param string $post_type The post type being output.
1252
+	 * @param string $listing_label The post type label.
1253
+	 * @param string $listing_label The post type label with ucwords function.
1254
+	 */
1255
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1256 1256
 
1257
-    if (isset($taxonomies[$post_taxonomy])) {
1258
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1259
-    }
1257
+	if (isset($taxonomies[$post_taxonomy])) {
1258
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1259
+	}
1260 1260
 
1261
-    if (isset($taxonomies[$post_type . '_tags']))
1262
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1261
+	if (isset($taxonomies[$post_type . '_tags']))
1262
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1263 1263
 
1264
-    ?>
1264
+	?>
1265 1265
     </p><?php
1266 1266
 }
1267 1267
 
@@ -1283,140 +1283,140 @@  discard block
 block discarded – undo
1283 1283
 function geodir_action_details_micordata($post='')
1284 1284
 {
1285 1285
 
1286
-    global $preview;
1287
-    if(empty($post)){global $post;}
1288
-    if ($preview || !geodir_is_page('detail')) {
1289
-        return;
1290
-    }
1291
-
1292
-    // url
1293
-    $c_url = geodir_curPageURL();
1294
-
1295
-    // post reviews
1296
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1297
-    if (empty($post_reviews)) {
1298
-        $reviews = '';
1299
-    } else {
1300
-        foreach ($post_reviews as $review) {
1301
-            $reviews[] = array(
1302
-                "@type" => "Review",
1303
-                "author" => $review->comment_author,
1304
-                "datePublished" => $review->comment_date,
1305
-                "description" => $review->comment_content,
1306
-                "reviewRating" => array(
1307
-                    "@type" => "Rating",
1308
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1309
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1310
-                    "worstRating" => "1"
1311
-                )
1312
-            );
1313
-        }
1314
-
1315
-    }
1316
-
1317
-    // post images
1318
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1319
-    if (empty($post_images)) {
1320
-        $images = '';
1321
-    } else {
1322
-        $i_arr = array();
1323
-        foreach ($post_images as $img) {
1324
-            $i_arr[] = $img->src;
1325
-        }
1326
-
1327
-        if (count($i_arr) == 1) {
1328
-            $images = $i_arr[0];
1329
-        } else {
1330
-            $images = $i_arr;
1331
-        }
1332
-
1333
-    }
1334
-    //print_r($post);
1335
-    // external links
1336
-    $external_links =  array();
1337
-    $external_links[] = $post->geodir_website;
1338
-    $external_links[] = $post->geodir_twitter;
1339
-    $external_links[] = $post->geodir_facebook;
1340
-    $external_links = array_filter($external_links);
1341
-
1342
-    if(!empty($external_links)){
1343
-        $external_links = array_values($external_links);
1344
-    }
1345
-
1346
-    // reviews
1347
-    $comment_count = geodir_get_review_count_total($post->ID);
1348
-    $post_avgratings = geodir_get_post_rating($post->ID);
1349
-
1350
-    // schema type
1351
-    $schema_type = 'LocalBusiness';
1352
-    if(isset($post->default_category) && $post->default_category){
1353
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1354
-        if($cat_schema){$schema_type = $cat_schema;}
1355
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1356
-    }
1357
-
1358
-    $schema = array();
1359
-    $schema['@context'] = "https://schema.org";
1360
-    $schema['@type'] = $schema_type;
1361
-    $schema['name'] = $post->post_title;
1362
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1363
-    $schema['telephone'] = $post->geodir_contact;
1364
-    $schema['url'] = $c_url;
1365
-    $schema['sameAs'] = $external_links;
1366
-    $schema['image'] = $images;
1367
-    $schema['address'] = array(
1368
-        "@type" => "PostalAddress",
1369
-        "streetAddress" => $post->post_address,
1370
-        "addressLocality" => $post->post_city,
1371
-        "addressRegion" => $post->post_region,
1372
-        "addressCountry" => $post->post_country,
1373
-        "postalCode" => $post->post_zip
1374
-    );
1375
-
1376
-    if($post->post_latitude && $post->post_longitude) {
1377
-        $schema['geo'] = array(
1378
-            "@type" => "GeoCoordinates",
1379
-            "latitude" => $post->post_latitude,
1380
-            "longitude" => $post->post_longitude
1381
-        );
1382
-    }
1383
-
1384
-    if($post_avgratings) {
1385
-        $schema['aggregateRating'] = array(
1386
-            "@type" => "AggregateRating",
1387
-            "ratingValue" => $post_avgratings,
1388
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1389
-            "worstRating" => "1",
1390
-            "ratingCount" => $comment_count
1391
-        );
1392
-    }
1393
-    $schema['review'] = $reviews;
1394
-
1395
-    /**
1396
-     * Allow the schema JSON-LD info to be filtered.
1397
-     *
1398
-     * @since 1.5.4
1399
-     * @since 1.5.7 Added $post variable.
1400
-     * @param array $schema The array of schema data to be filtered.
1401
-     * @param object $post The post object.
1402
-     */
1403
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1404
-
1405
-
1406
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1407
-
1408
-
1409
-    $uploads = wp_upload_dir();
1410
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1411
-
1412
-    /**
1413
-     * Show facebook open graph meta info
1414
-     *
1415
-     * @since 1.6.6
1416
-     * @param string $facebook_og The open graph html to be filtered.
1417
-     * @param object $post The post object.
1418
-     */
1419
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1286
+	global $preview;
1287
+	if(empty($post)){global $post;}
1288
+	if ($preview || !geodir_is_page('detail')) {
1289
+		return;
1290
+	}
1291
+
1292
+	// url
1293
+	$c_url = geodir_curPageURL();
1294
+
1295
+	// post reviews
1296
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1297
+	if (empty($post_reviews)) {
1298
+		$reviews = '';
1299
+	} else {
1300
+		foreach ($post_reviews as $review) {
1301
+			$reviews[] = array(
1302
+				"@type" => "Review",
1303
+				"author" => $review->comment_author,
1304
+				"datePublished" => $review->comment_date,
1305
+				"description" => $review->comment_content,
1306
+				"reviewRating" => array(
1307
+					"@type" => "Rating",
1308
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1309
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1310
+					"worstRating" => "1"
1311
+				)
1312
+			);
1313
+		}
1314
+
1315
+	}
1316
+
1317
+	// post images
1318
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1319
+	if (empty($post_images)) {
1320
+		$images = '';
1321
+	} else {
1322
+		$i_arr = array();
1323
+		foreach ($post_images as $img) {
1324
+			$i_arr[] = $img->src;
1325
+		}
1326
+
1327
+		if (count($i_arr) == 1) {
1328
+			$images = $i_arr[0];
1329
+		} else {
1330
+			$images = $i_arr;
1331
+		}
1332
+
1333
+	}
1334
+	//print_r($post);
1335
+	// external links
1336
+	$external_links =  array();
1337
+	$external_links[] = $post->geodir_website;
1338
+	$external_links[] = $post->geodir_twitter;
1339
+	$external_links[] = $post->geodir_facebook;
1340
+	$external_links = array_filter($external_links);
1341
+
1342
+	if(!empty($external_links)){
1343
+		$external_links = array_values($external_links);
1344
+	}
1345
+
1346
+	// reviews
1347
+	$comment_count = geodir_get_review_count_total($post->ID);
1348
+	$post_avgratings = geodir_get_post_rating($post->ID);
1349
+
1350
+	// schema type
1351
+	$schema_type = 'LocalBusiness';
1352
+	if(isset($post->default_category) && $post->default_category){
1353
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1354
+		if($cat_schema){$schema_type = $cat_schema;}
1355
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1356
+	}
1357
+
1358
+	$schema = array();
1359
+	$schema['@context'] = "https://schema.org";
1360
+	$schema['@type'] = $schema_type;
1361
+	$schema['name'] = $post->post_title;
1362
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1363
+	$schema['telephone'] = $post->geodir_contact;
1364
+	$schema['url'] = $c_url;
1365
+	$schema['sameAs'] = $external_links;
1366
+	$schema['image'] = $images;
1367
+	$schema['address'] = array(
1368
+		"@type" => "PostalAddress",
1369
+		"streetAddress" => $post->post_address,
1370
+		"addressLocality" => $post->post_city,
1371
+		"addressRegion" => $post->post_region,
1372
+		"addressCountry" => $post->post_country,
1373
+		"postalCode" => $post->post_zip
1374
+	);
1375
+
1376
+	if($post->post_latitude && $post->post_longitude) {
1377
+		$schema['geo'] = array(
1378
+			"@type" => "GeoCoordinates",
1379
+			"latitude" => $post->post_latitude,
1380
+			"longitude" => $post->post_longitude
1381
+		);
1382
+	}
1383
+
1384
+	if($post_avgratings) {
1385
+		$schema['aggregateRating'] = array(
1386
+			"@type" => "AggregateRating",
1387
+			"ratingValue" => $post_avgratings,
1388
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1389
+			"worstRating" => "1",
1390
+			"ratingCount" => $comment_count
1391
+		);
1392
+	}
1393
+	$schema['review'] = $reviews;
1394
+
1395
+	/**
1396
+	 * Allow the schema JSON-LD info to be filtered.
1397
+	 *
1398
+	 * @since 1.5.4
1399
+	 * @since 1.5.7 Added $post variable.
1400
+	 * @param array $schema The array of schema data to be filtered.
1401
+	 * @param object $post The post object.
1402
+	 */
1403
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1404
+
1405
+
1406
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1407
+
1408
+
1409
+	$uploads = wp_upload_dir();
1410
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1411
+
1412
+	/**
1413
+	 * Show facebook open graph meta info
1414
+	 *
1415
+	 * @since 1.6.6
1416
+	 * @param string $facebook_og The open graph html to be filtered.
1417
+	 * @param object $post The post object.
1418
+	 */
1419
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1420 1420
 
1421 1421
 
1422 1422
 
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_action_details_next_prev()
1438 1438
 {
1439
-    ?>
1439
+	?>
1440 1440
     <div class="geodir-pos_navigation clearfix">
1441 1441
     <div
1442 1442
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1454,15 +1454,15 @@  discard block
 block discarded – undo
1454 1454
  */
1455 1455
 function geodir_action_before_single_post()
1456 1456
 {
1457
-    global $post;
1458
-    /**
1459
-     * Called at the very start of the details page output, before the title section.
1460
-     *
1461
-     * @since 1.0.0
1462
-     * @param object $post The current post object.
1463
-     * @global WP_Post|null $post The current post, if available.
1464
-     */
1465
-    do_action('geodir_before_single_post', $post); // extra action	
1457
+	global $post;
1458
+	/**
1459
+	 * Called at the very start of the details page output, before the title section.
1460
+	 *
1461
+	 * @since 1.0.0
1462
+	 * @param object $post The current post object.
1463
+	 * @global WP_Post|null $post The current post, if available.
1464
+	 */
1465
+	do_action('geodir_before_single_post', $post); // extra action	
1466 1466
 }
1467 1467
 
1468 1468
 /**
@@ -1473,13 +1473,13 @@  discard block
 block discarded – undo
1473 1473
  */
1474 1474
 function geodir_action_after_single_post($post)
1475 1475
 {
1476
-    /**
1477
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1478
-     *
1479
-     * @since 1.0.0
1480
-     * @param object $post The current post object.
1481
-     */
1482
-    do_action('geodir_after_single_post', $post); // extra action	
1476
+	/**
1477
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1478
+	 *
1479
+	 * @since 1.0.0
1480
+	 * @param object $post The current post object.
1481
+	 */
1482
+	do_action('geodir_after_single_post', $post); // extra action	
1483 1483
 }
1484 1484
 
1485 1485
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1505,168 +1505,168 @@  discard block
 block discarded – undo
1505 1505
  */
1506 1506
 function geodir_action_listings_title()
1507 1507
 {
1508
-    global $wp, $term;
1508
+	global $wp, $term;
1509 1509
 
1510
-    $gd_post_type = geodir_get_current_posttype();
1511
-    $post_type_info = get_post_type_object($gd_post_type);
1510
+	$gd_post_type = geodir_get_current_posttype();
1511
+	$post_type_info = get_post_type_object($gd_post_type);
1512 1512
 
1513
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1514
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1515
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1516
-    }
1513
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1514
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1515
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1516
+	}
1517 1517
 
1518
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1519
-    $single_name = $post_type_info->labels->singular_name;
1518
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1519
+	$single_name = $post_type_info->labels->singular_name;
1520 1520
 
1521
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1521
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1522 1522
 
1523
-    $gd_country = get_query_var('gd_country');
1524
-    $gd_region = get_query_var('gd_region');
1525
-    $gd_city = get_query_var('gd_city');
1523
+	$gd_country = get_query_var('gd_country');
1524
+	$gd_region = get_query_var('gd_region');
1525
+	$gd_city = get_query_var('gd_city');
1526 1526
 
1527
-    if (!empty($term)) {
1528
-        $location_name = '';
1529
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1530
-            if ($gd_country != '') {
1531
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1532
-            }
1533
-
1534
-            if ($gd_region != '') {
1535
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1536
-            }
1537
-
1538
-            if ($gd_city != '') {
1539
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1540
-            }
1541
-        }
1542
-
1543
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1544
-        if (!empty($current_term)) {
1545
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1546
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1547
-                $location_last_char = substr($location_name, -1);
1548
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1549
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1550
-            } else {
1551
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1552
-            }
1553
-        } else {
1554
-            if (count($taxonomy) > 1) {
1555
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1556
-
1557
-                if (!empty($current_term)) {
1558
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1559
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1560
-                        $location_last_char = substr($location_name, -1);
1561
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1562
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1563
-                    } else {
1564
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1565
-                    }
1566
-                }
1567
-            }
1568
-        }
1569
-
1570
-    } else {
1571
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1572
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1573
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1574
-
1575
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1576
-
1577
-        if (function_exists('get_actual_location_name')) {
1578
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1579
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1580
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1581
-        }
1582
-
1583
-        if ($gd_city != '') {
1584
-            if ($gd_city_actual != '') {
1585
-                $gd_city = $gd_city_actual;
1586
-            } else {
1587
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1588
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1589
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1590
-            }
1591
-
1592
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1593
-        } else if ($gd_region != '') {
1594
-            if ($gd_region_actual != '') {
1595
-                $gd_region = $gd_region_actual;
1596
-            } else {
1597
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1598
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1599
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1600
-            }
1601
-
1602
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1603
-        } else if ($gd_country != '') {
1604
-            if ($gd_country_actual != '') {
1605
-                $gd_country = $gd_country_actual;
1606
-            } else {
1607
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1608
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1609
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1610
-            }
1611
-
1612
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1613
-        }
1614
-    }
1615
-
1616
-    if (is_search()) {
1617
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1618
-    }
1619
-    /** This action is documented in geodirectory_template_actions.php */
1620
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1621
-    /** This action is documented in geodirectory_template_actions.php */
1622
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1623
-
1624
-
1625
-    $title = $list_title;
1626
-    $gd_page = '';
1627
-    if(geodir_is_page('pt')){
1628
-        $gd_page = 'pt';
1629
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1630
-    }
1631
-    elseif(geodir_is_page('listing')){
1632
-        $gd_page = 'listing';
1633
-        global $wp_query;
1634
-        $current_term = $wp_query->get_queried_object();
1635
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1636
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1637
-        }else{
1638
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1639
-        }
1527
+	if (!empty($term)) {
1528
+		$location_name = '';
1529
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1530
+			if ($gd_country != '') {
1531
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1532
+			}
1640 1533
 
1641
-    }
1642
-    elseif(geodir_is_page('author')){
1643
-        $gd_page = 'author';
1644
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1645
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1646
-        }else{
1647
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1648
-        }
1534
+			if ($gd_region != '') {
1535
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1536
+			}
1649 1537
 
1650
-    }
1538
+			if ($gd_city != '') {
1539
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1540
+			}
1541
+		}
1542
+
1543
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1544
+		if (!empty($current_term)) {
1545
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1546
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1547
+				$location_last_char = substr($location_name, -1);
1548
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1549
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1550
+			} else {
1551
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1552
+			}
1553
+		} else {
1554
+			if (count($taxonomy) > 1) {
1555
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1556
+
1557
+				if (!empty($current_term)) {
1558
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1559
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1560
+						$location_last_char = substr($location_name, -1);
1561
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1562
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1563
+					} else {
1564
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1565
+					}
1566
+				}
1567
+			}
1568
+		}
1569
+
1570
+	} else {
1571
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1572
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1573
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1574
+
1575
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1576
+
1577
+		if (function_exists('get_actual_location_name')) {
1578
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1579
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1580
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1581
+		}
1582
+
1583
+		if ($gd_city != '') {
1584
+			if ($gd_city_actual != '') {
1585
+				$gd_city = $gd_city_actual;
1586
+			} else {
1587
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1588
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1589
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1590
+			}
1651 1591
 
1592
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1593
+		} else if ($gd_region != '') {
1594
+			if ($gd_region_actual != '') {
1595
+				$gd_region = $gd_region_actual;
1596
+			} else {
1597
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1598
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1599
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1600
+			}
1652 1601
 
1653
-    /**
1654
-     * Filter page title to replace variables.
1655
-     *
1656
-     * @since 1.5.4
1657
-     * @param string $title The page title including variables.
1658
-     * @param string $gd_page The GeoDirectory page type if any.
1659
-     */
1660
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1602
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1603
+		} else if ($gd_country != '') {
1604
+			if ($gd_country_actual != '') {
1605
+				$gd_country = $gd_country_actual;
1606
+			} else {
1607
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1608
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1609
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1610
+			}
1661 1611
 
1662
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1663
-        /**
1664
-         * Filter the listing page title.
1665
-         *
1666
-         * @since 1.0.0
1667
-         * @param string $list_title The title for the category page.
1668
-         */
1669
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1612
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1613
+		}
1614
+	}
1615
+
1616
+	if (is_search()) {
1617
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1618
+	}
1619
+	/** This action is documented in geodirectory_template_actions.php */
1620
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1621
+	/** This action is documented in geodirectory_template_actions.php */
1622
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1623
+
1624
+
1625
+	$title = $list_title;
1626
+	$gd_page = '';
1627
+	if(geodir_is_page('pt')){
1628
+		$gd_page = 'pt';
1629
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1630
+	}
1631
+	elseif(geodir_is_page('listing')){
1632
+		$gd_page = 'listing';
1633
+		global $wp_query;
1634
+		$current_term = $wp_query->get_queried_object();
1635
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1636
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1637
+		}else{
1638
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1639
+		}
1640
+
1641
+	}
1642
+	elseif(geodir_is_page('author')){
1643
+		$gd_page = 'author';
1644
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1645
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1646
+		}else{
1647
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1648
+		}
1649
+
1650
+	}
1651
+
1652
+
1653
+	/**
1654
+	 * Filter page title to replace variables.
1655
+	 *
1656
+	 * @since 1.5.4
1657
+	 * @param string $title The page title including variables.
1658
+	 * @param string $gd_page The GeoDirectory page type if any.
1659
+	 */
1660
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1661
+
1662
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1663
+		/**
1664
+		 * Filter the listing page title.
1665
+		 *
1666
+		 * @since 1.0.0
1667
+		 * @param string $list_title The title for the category page.
1668
+		 */
1669
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1670 1670
 }
1671 1671
 
1672 1672
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1679,46 +1679,46 @@  discard block
 block discarded – undo
1679 1679
  */
1680 1680
 function geodir_action_listings_description()
1681 1681
 {
1682
-    global $wp_query;
1683
-    $current_term = $wp_query->get_queried_object();
1682
+	global $wp_query;
1683
+	$current_term = $wp_query->get_queried_object();
1684 1684
 
1685
-    $gd_post_type = geodir_get_current_posttype();
1686
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1685
+	$gd_post_type = geodir_get_current_posttype();
1686
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1687 1687
 
1688
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1689
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1690
-        if ($term_desc && !$saved_data) {
1691
-            $saved_data = $term_desc;
1692
-        }
1688
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1689
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1690
+		if ($term_desc && !$saved_data) {
1691
+			$saved_data = $term_desc;
1692
+		}
1693 1693
 
1694
-        // stop payment manager filtering content length
1695
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1696
-        if ( false !== $filter_priority ) {
1697
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1698
-        }
1694
+		// stop payment manager filtering content length
1695
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1696
+		if ( false !== $filter_priority ) {
1697
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1698
+		}
1699 1699
 
1700
-        /**
1701
-         * Apply the core filter `the_content` filter to the variable string.
1702
-         *
1703
-         * This is a WordPress core filter that does many things.
1704
-         *
1705
-         * @since 1.0.0
1706
-         * @param string $var The string to apply the filter to.
1707
-         */
1708
-        $cat_description = apply_filters('the_content', $saved_data);
1700
+		/**
1701
+		 * Apply the core filter `the_content` filter to the variable string.
1702
+		 *
1703
+		 * This is a WordPress core filter that does many things.
1704
+		 *
1705
+		 * @since 1.0.0
1706
+		 * @param string $var The string to apply the filter to.
1707
+		 */
1708
+		$cat_description = apply_filters('the_content', $saved_data);
1709 1709
 
1710 1710
 
1711
-        if ( false !== $filter_priority ) {
1712
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1713
-        }
1711
+		if ( false !== $filter_priority ) {
1712
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1713
+		}
1714 1714
 
1715
-        if ($cat_description) {
1716
-            ?>
1715
+		if ($cat_description) {
1716
+			?>
1717 1717
 
1718 1718
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1719
-        }
1719
+		}
1720 1720
 
1721
-    }
1721
+	}
1722 1722
 }
1723 1723
 
1724 1724
 // action for adding the listings page top widget area
@@ -1737,11 +1737,11 @@  discard block
 block discarded – undo
1737 1737
  */
1738 1738
 function geodir_action_geodir_sidebar_listings_top()
1739 1739
 {
1740
-    if (get_option('geodir_show_listing_top_section')) { ?>
1740
+	if (get_option('geodir_show_listing_top_section')) { ?>
1741 1741
         <div
1742 1742
             class="<?php
1743
-            /** This action is documented in geodirectory_template_actions.php */
1744
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1743
+			/** This action is documented in geodirectory_template_actions.php */
1744
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1745 1745
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1746 1746
         </div><!-- clearfix ends here-->
1747 1747
     <?php }
@@ -1764,35 +1764,35 @@  discard block
 block discarded – undo
1764 1764
  */
1765 1765
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1766 1766
 {
1767
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1768
-        $width_css = 'style="width:' . $width . '%;"';
1769
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1770
-        $width_css = 'style="width:' . $width . '%;"';
1771
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1772
-        $width_css = 'style="width:' . $width . '%;"';
1773
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1774
-        $width_css = 'style="width:' . $width . '%;"';
1775
-    } else {
1776
-        $width_css = '';
1777
-    }
1778
-
1779
-    $tc = get_option('theme_compatibility_setting');
1780
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1781
-        $text = $tc['geodir_sidebar_left_open_replace'];
1782
-    } else {
1783
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1784
-    }
1785
-
1786
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1787
-        $id = $tc['geodir_sidebar_left_open_id'];
1788
-    }
1789
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1790
-        $class = $tc['geodir_sidebar_left_open_class'];
1791
-    }
1792
-
1793
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1794
-
1795
-    echo $text;
1767
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1768
+		$width_css = 'style="width:' . $width . '%;"';
1769
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1770
+		$width_css = 'style="width:' . $width . '%;"';
1771
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1772
+		$width_css = 'style="width:' . $width . '%;"';
1773
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1774
+		$width_css = 'style="width:' . $width . '%;"';
1775
+	} else {
1776
+		$width_css = '';
1777
+	}
1778
+
1779
+	$tc = get_option('theme_compatibility_setting');
1780
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1781
+		$text = $tc['geodir_sidebar_left_open_replace'];
1782
+	} else {
1783
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1784
+	}
1785
+
1786
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1787
+		$id = $tc['geodir_sidebar_left_open_id'];
1788
+	}
1789
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1790
+		$class = $tc['geodir_sidebar_left_open_class'];
1791
+	}
1792
+
1793
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1794
+
1795
+	echo $text;
1796 1796
 }
1797 1797
 
1798 1798
 // action for adding the primary div closing tag
@@ -1808,13 +1808,13 @@  discard block
 block discarded – undo
1808 1808
  */
1809 1809
 function geodir_action_sidebar_left_close($type = '')
1810 1810
 {
1811
-    $tc = get_option('theme_compatibility_setting');
1812
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1813
-        $text = $tc['geodir_sidebar_left_close_replace'];
1814
-    } else {
1815
-        $text = '</aside><!-- sidebar ends here-->';
1816
-    }
1817
-    echo $text;
1811
+	$tc = get_option('theme_compatibility_setting');
1812
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1813
+		$text = $tc['geodir_sidebar_left_close_replace'];
1814
+	} else {
1815
+		$text = '</aside><!-- sidebar ends here-->';
1816
+	}
1817
+	echo $text;
1818 1818
 }
1819 1819
 
1820 1820
 /**
@@ -1827,7 +1827,7 @@  discard block
 block discarded – undo
1827 1827
  */
1828 1828
 function geodir_listing_left_section()
1829 1829
 {
1830
-    if (get_option('geodir_show_listing_left_section')) { ?>
1830
+	if (get_option('geodir_show_listing_left_section')) { ?>
1831 1831
         <div class="geodir-content-left geodir-sidebar-wrap">
1832 1832
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1833 1833
         </div><!-- end geodir-content-left -->
@@ -1845,20 +1845,20 @@  discard block
 block discarded – undo
1845 1845
  */
1846 1846
 function geodir_action_listings_sidebar_left()
1847 1847
 {
1848
-    if (get_option('geodir_show_listing_left_section')) {
1849
-        /** This action is documented in geodirectory_template_actions.php */
1850
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1851
-        /**
1852
-         * Calls the listings page (category) left sidebar content.
1853
-         *
1854
-         * All the content for the listings page left sidebar is added via this hook.
1855
-         *
1856
-         * @since 1.0.0
1857
-         */
1858
-        do_action('geodir_listings_sidebar_left_inside');
1859
-        /** This action is documented in geodirectory_template_actions.php */
1860
-        do_action('geodir_sidebar_left_close', 'listings-page');
1861
-    }
1848
+	if (get_option('geodir_show_listing_left_section')) {
1849
+		/** This action is documented in geodirectory_template_actions.php */
1850
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1851
+		/**
1852
+		 * Calls the listings page (category) left sidebar content.
1853
+		 *
1854
+		 * All the content for the listings page left sidebar is added via this hook.
1855
+		 *
1856
+		 * @since 1.0.0
1857
+		 */
1858
+		do_action('geodir_listings_sidebar_left_inside');
1859
+		/** This action is documented in geodirectory_template_actions.php */
1860
+		do_action('geodir_sidebar_left_close', 'listings-page');
1861
+	}
1862 1862
 }
1863 1863
 
1864 1864
 /**
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
  */
1872 1872
 function geodir_listing_right_section()
1873 1873
 {
1874
-    if (get_option('geodir_show_listing_right_section')) { ?>
1874
+	if (get_option('geodir_show_listing_right_section')) { ?>
1875 1875
         <div class="geodir-content-right geodir-sidebar-wrap">
1876 1876
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1877 1877
         </div><!-- end geodir-content-right -->
@@ -1889,20 +1889,20 @@  discard block
 block discarded – undo
1889 1889
  */
1890 1890
 function geodir_action_listings_sidebar_right()
1891 1891
 {
1892
-    if (get_option('geodir_show_listing_right_section')) {
1893
-        /** This action is documented in geodirectory_template_actions.php */
1894
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1895
-        /**
1896
-         * Calls the listings page (category) right sidebar content.
1897
-         *
1898
-         * All the content for the listings page right sidebar is added via this hook.
1899
-         *
1900
-         * @since 1.0.0
1901
-         */
1902
-        do_action('geodir_listings_sidebar_right_inside');
1903
-        /** This action is documented in geodirectory_template_actions.php */
1904
-        do_action('geodir_sidebar_right_close', 'listings-page');
1905
-    }
1892
+	if (get_option('geodir_show_listing_right_section')) {
1893
+		/** This action is documented in geodirectory_template_actions.php */
1894
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1895
+		/**
1896
+		 * Calls the listings page (category) right sidebar content.
1897
+		 *
1898
+		 * All the content for the listings page right sidebar is added via this hook.
1899
+		 *
1900
+		 * @since 1.0.0
1901
+		 */
1902
+		do_action('geodir_listings_sidebar_right_inside');
1903
+		/** This action is documented in geodirectory_template_actions.php */
1904
+		do_action('geodir_sidebar_right_close', 'listings-page');
1905
+	}
1906 1906
 }
1907 1907
 
1908 1908
 
@@ -1919,23 +1919,23 @@  discard block
 block discarded – undo
1919 1919
  */
1920 1920
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1921 1921
 {
1922
-    $tc = get_option('theme_compatibility_setting');
1923
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1924
-        $text = $tc['geodir_main_content_open_replace'];
1925
-    } else {
1926
-        $text = '<main id="[id]" class="[class]" role="main">';
1927
-    }
1922
+	$tc = get_option('theme_compatibility_setting');
1923
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1924
+		$text = $tc['geodir_main_content_open_replace'];
1925
+	} else {
1926
+		$text = '<main id="[id]" class="[class]" role="main">';
1927
+	}
1928 1928
 
1929
-    if (!empty($tc['geodir_main_content_open_id'])) {
1930
-        $id = $tc['geodir_main_content_open_id'];
1931
-    }
1932
-    if (!empty($tc['geodir_main_content_open_class'])) {
1933
-        $class = $tc['geodir_main_content_open_class'];
1934
-    }
1929
+	if (!empty($tc['geodir_main_content_open_id'])) {
1930
+		$id = $tc['geodir_main_content_open_id'];
1931
+	}
1932
+	if (!empty($tc['geodir_main_content_open_class'])) {
1933
+		$class = $tc['geodir_main_content_open_class'];
1934
+	}
1935 1935
 
1936
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1936
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1937 1937
 
1938
-    echo $text;
1938
+	echo $text;
1939 1939
 }
1940 1940
 
1941 1941
 // action for adding the primary div closing tag
@@ -1948,13 +1948,13 @@  discard block
 block discarded – undo
1948 1948
  */
1949 1949
 function geodir_action_main_content_close()
1950 1950
 {
1951
-    $tc = get_option('theme_compatibility_setting');
1952
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1953
-        $text = $tc['geodir_main_content_close_replace'];
1954
-    } else {
1955
-        $text = '</main><!-- main ends here-->';
1956
-    }
1957
-    echo $text;
1951
+	$tc = get_option('theme_compatibility_setting');
1952
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1953
+		$text = $tc['geodir_main_content_close_replace'];
1954
+	} else {
1955
+		$text = '</main><!-- main ends here-->';
1956
+	}
1957
+	echo $text;
1958 1958
 }
1959 1959
 
1960 1960
 /**
@@ -1966,14 +1966,14 @@  discard block
 block discarded – undo
1966 1966
  */
1967 1967
 function geodir_action_listings_content_inside()
1968 1968
 {
1969
-    global $gridview_columns;
1970
-    $listing_view = get_option('geodir_listing_view');
1971
-    if (strstr($listing_view, 'gridview')) {
1972
-        $gridview_columns = $listing_view;
1973
-        $listing_view_exp = explode('_', $listing_view);
1974
-        $listing_view = $listing_view_exp[0];
1975
-    }
1976
-    geodir_get_template_part('listing', 'listview');
1969
+	global $gridview_columns;
1970
+	$listing_view = get_option('geodir_listing_view');
1971
+	if (strstr($listing_view, 'gridview')) {
1972
+		$gridview_columns = $listing_view;
1973
+		$listing_view_exp = explode('_', $listing_view);
1974
+		$listing_view = $listing_view_exp[0];
1975
+	}
1976
+	geodir_get_template_part('listing', 'listview');
1977 1977
 }
1978 1978
 
1979 1979
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1989,47 +1989,47 @@  discard block
 block discarded – undo
1989 1989
  */
1990 1990
 function geodir_action_listings_content()
1991 1991
 {
1992
-    /**
1993
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1994
-     *
1995
-     * @since 1.0.0
1996
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1997
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1998
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1999
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2000
-     */
2001
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2002
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2003
-    echo '<div class="clearfix '.$extra_class.'">';
2004
-    /**
2005
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2006
-     *
2007
-     * @since 1.0.0
2008
-     */
2009
-    do_action('geodir_before_listing');
2010
-    echo '</div>';
2011
-
2012
-    /**
2013
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2014
-     *
2015
-     * @since 1.0.0
2016
-     */
2017
-    do_action('geodir_listings_content_inside');
2018
-
2019
-    /**
2020
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2021
-     *
2022
-     * @since 1.0.0
2023
-     */
2024
-    do_action('geodir_after_listing');
2025
-
2026
-    /**
2027
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2028
-     *
2029
-     * @since 1.0.0
2030
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2031
-     */
2032
-    do_action('geodir_main_content_close', 'listings-page');
1992
+	/**
1993
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1994
+	 *
1995
+	 * @since 1.0.0
1996
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1997
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1998
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1999
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2000
+	 */
2001
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2002
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2003
+	echo '<div class="clearfix '.$extra_class.'">';
2004
+	/**
2005
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2006
+	 *
2007
+	 * @since 1.0.0
2008
+	 */
2009
+	do_action('geodir_before_listing');
2010
+	echo '</div>';
2011
+
2012
+	/**
2013
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2014
+	 *
2015
+	 * @since 1.0.0
2016
+	 */
2017
+	do_action('geodir_listings_content_inside');
2018
+
2019
+	/**
2020
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2021
+	 *
2022
+	 * @since 1.0.0
2023
+	 */
2024
+	do_action('geodir_after_listing');
2025
+
2026
+	/**
2027
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2028
+	 *
2029
+	 * @since 1.0.0
2030
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2031
+	 */
2032
+	do_action('geodir_main_content_close', 'listings-page');
2033 2033
 }
2034 2034
 
2035 2035
 
@@ -2044,10 +2044,10 @@  discard block
 block discarded – undo
2044 2044
  */
2045 2045
 function geodir_action_sidebar_listings_bottom_section()
2046 2046
 {
2047
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2047
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2048 2048
         <div class="<?php
2049
-            /** This action is documented in geodirectory_template_actions.php */
2050
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2049
+			/** This action is documented in geodirectory_template_actions.php */
2050
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2051 2051
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2052 2052
         </div><!-- clearfix ends here-->
2053 2053
     <?php }
@@ -2067,38 +2067,38 @@  discard block
 block discarded – undo
2067 2067
  */
2068 2068
 function geodir_action_add_listing_page_title()
2069 2069
 {
2070
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2071
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2072
-    /** This action is documented in geodirectory_template_actions.php */
2073
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2074
-    /** This action is documented in geodirectory_template_actions.php */
2075
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2076
-
2077
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2078
-
2079
-    if(geodir_is_page('add-listing')){
2080
-        $gd_page = 'add-listing';
2081
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2082
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2083
-        }elseif(isset($listing_type)){
2084
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2085
-        }
2070
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2071
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2072
+	/** This action is documented in geodirectory_template_actions.php */
2073
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2074
+	/** This action is documented in geodirectory_template_actions.php */
2075
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2076
+
2077
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2078
+
2079
+	if(geodir_is_page('add-listing')){
2080
+		$gd_page = 'add-listing';
2081
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2082
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2083
+		}elseif(isset($listing_type)){
2084
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2085
+		}
2086 2086
 
2087
-    }
2087
+	}
2088 2088
 
2089 2089
 
2090
-    /**
2091
-     * Filter page title to replace variables.
2092
-     *
2093
-     * @since 1.5.4
2094
-     * @param string $title The page title including variables.
2095
-     * @param string $gd_page The GeoDirectory page type if any.
2096
-     */
2097
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2090
+	/**
2091
+	 * Filter page title to replace variables.
2092
+	 *
2093
+	 * @since 1.5.4
2094
+	 * @param string $title The page title including variables.
2095
+	 * @param string $gd_page The GeoDirectory page type if any.
2096
+	 */
2097
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2098 2098
 
2099
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2100
-    echo $title;
2101
-    echo '</h1></header>';
2099
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2100
+	echo $title;
2101
+	echo '</h1></header>';
2102 2102
 }
2103 2103
 
2104 2104
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2129,61 +2129,61 @@  discard block
 block discarded – undo
2129 2129
  */
2130 2130
 function geodir_action_add_listing_form()
2131 2131
 {
2132
-    global $cat_display, $post_cat, $current_user, $gd_session;
2133
-    $page_id = get_the_ID();
2134
-    $post = '';
2135
-    $title = '';
2136
-    $desc = '';
2137
-    $kw_tags = '';
2138
-    $required_msg = '';
2139
-    $submit_button = '';
2140
-
2141
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2142
-
2143
-    $thumb_img_arr = array();
2144
-    $curImages = '';
2145
-
2146
-    if (isset($_REQUEST['backandedit'])) {
2147
-        global $post;
2148
-        $post = (object)$gd_session->get('listing');
2149
-        $listing_type = $post->listing_type;
2150
-        $title = $post->post_title;
2151
-        $desc = $post->post_desc;
2152
-        $post_cat = $post->post_category;
2153
-
2154
-        $kw_tags = $post->post_tags;
2155
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2156
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2157
-        global $post, $post_images;
2158
-
2159
-        $post = geodir_get_post_info($_REQUEST['pid']);
2160
-        $thumb_img_arr = geodir_get_images($post->ID);
2161
-        if ($thumb_img_arr) {
2162
-            foreach ($thumb_img_arr as $post_img) {
2163
-                $curImages .= $post_img->src . ',';
2164
-            }
2165
-        }
2132
+	global $cat_display, $post_cat, $current_user, $gd_session;
2133
+	$page_id = get_the_ID();
2134
+	$post = '';
2135
+	$title = '';
2136
+	$desc = '';
2137
+	$kw_tags = '';
2138
+	$required_msg = '';
2139
+	$submit_button = '';
2140
+
2141
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2142
+
2143
+	$thumb_img_arr = array();
2144
+	$curImages = '';
2145
+
2146
+	if (isset($_REQUEST['backandedit'])) {
2147
+		global $post;
2148
+		$post = (object)$gd_session->get('listing');
2149
+		$listing_type = $post->listing_type;
2150
+		$title = $post->post_title;
2151
+		$desc = $post->post_desc;
2152
+		$post_cat = $post->post_category;
2153
+
2154
+		$kw_tags = $post->post_tags;
2155
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2156
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2157
+		global $post, $post_images;
2158
+
2159
+		$post = geodir_get_post_info($_REQUEST['pid']);
2160
+		$thumb_img_arr = geodir_get_images($post->ID);
2161
+		if ($thumb_img_arr) {
2162
+			foreach ($thumb_img_arr as $post_img) {
2163
+				$curImages .= $post_img->src . ',';
2164
+			}
2165
+		}
2166 2166
 
2167
-        $listing_type = $post->post_type;
2168
-        $title = $post->post_title;
2169
-        $desc = $post->post_content;
2170
-        $kw_tags = $post->post_tags;
2171
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2172
-    } else {
2173
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2174
-    }
2167
+		$listing_type = $post->post_type;
2168
+		$title = $post->post_title;
2169
+		$desc = $post->post_content;
2170
+		$kw_tags = $post->post_tags;
2171
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2172
+	} else {
2173
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2174
+	}
2175 2175
 
2176
-    if ($current_user->ID != '0') {
2177
-        $user_login = true;
2178
-    }
2176
+	if ($current_user->ID != '0') {
2177
+		$user_login = true;
2178
+	}
2179 2179
 
2180
-    $post_type_info = geodir_get_posttype_info($listing_type);
2180
+	$post_type_info = geodir_get_posttype_info($listing_type);
2181 2181
 
2182
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2182
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2183 2183
     
2184
-    $package_info = array();
2185
-    $package_info = geodir_post_package_info($package_info, $post);
2186
-    ?>
2184
+	$package_info = array();
2185
+	$package_info = geodir_post_package_info($package_info, $post);
2186
+	?>
2187 2187
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2188 2188
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2189 2189
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2194,114 +2194,114 @@  discard block
 block discarded – undo
2194 2194
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2195 2195
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2196 2196
         <?php
2197
-        } 
2198
-        /**
2199
-         * Called at the very top of the add listing page form for frontend.
2200
-         *
2201
-         * This is called just before the "Enter Listing Details" text.
2202
-         *
2203
-         * @since 1.0.0
2204
-         */
2205
-        do_action('geodir_before_detail_fields');
2206
-        ?>
2197
+		} 
2198
+		/**
2199
+		 * Called at the very top of the add listing page form for frontend.
2200
+		 *
2201
+		 * This is called just before the "Enter Listing Details" text.
2202
+		 *
2203
+		 * @since 1.0.0
2204
+		 */
2205
+		do_action('geodir_before_detail_fields');
2206
+		?>
2207 2207
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2208 2208
         <?php
2209
-        /**
2210
-         * Called at the top of the add listing page form for frontend.
2211
-         *
2212
-         * This is called after the "Enter Listing Details" text.
2213
-         *
2214
-         * @since 1.0.0
2215
-         */
2216
-        do_action('geodir_before_main_form_fields');
2217
-        ?>
2209
+		/**
2210
+		 * Called at the top of the add listing page form for frontend.
2211
+		 *
2212
+		 * This is called after the "Enter Listing Details" text.
2213
+		 *
2214
+		 * @since 1.0.0
2215
+		 */
2216
+		do_action('geodir_before_main_form_fields');
2217
+		?>
2218 2218
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2219 2219
             <label><?php
2220
-                /**
2221
-                 * Filter the add listing page title input label.
2222
-                 *
2223
-                 * @since 1.6.11
2224
-                 * @param string $title The title to be output.
2225
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2226
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2227
-                 */
2228
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2220
+				/**
2221
+				 * Filter the add listing page title input label.
2222
+				 *
2223
+				 * @since 1.6.11
2224
+				 * @param string $title The title to be output.
2225
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2226
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2227
+				 */
2228
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2229 2229
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2230 2230
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2231 2231
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2232 2232
         </div>
2233 2233
         <?php
2234
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2235
-        $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2236
-        /**
2237
-         * Filter whether to show or don't show the editor.
2238
-         *
2239
-         * @since 1.6.16
2240
-         * @param bool $show_editor If true the editor will be available for description field.
2241
-         * @param object $package_info The listing package.
2242
-         * @param string $listing_type The current post type.
2243
-         * @param object $post The current post object.
2244
-         */
2245
-        $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2246
-
2247
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2248
-        $desc_limit = '';
2249
-        /**
2250
-         * Filter the add listing description field character limit number.
2251
-         *
2252
-         * @since 1.0.0
2253
-         * @param int $desc_limit The amount of characters to limit the description to.
2254
-         */
2255
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2256
-        /**
2257
-         * Filter the add listing description field text.
2258
-         *
2259
-         * @since 1.0.0
2260
-         * @param string $desc The text for the description field.
2261
-         * @param int $desc_limit The character limit number if any.
2262
-         */
2263
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2264
-        $desc_limit_msg = '';
2265
-        /**
2266
-         * Filter the add listing description limit message.
2267
-         *
2268
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2269
-         *
2270
-         * @since 1.0.0
2271
-         * @param string $desc_limit_msg The limit message string if any.
2272
-         * @param int $desc_limit The character limit numer if any.
2273
-         */
2274
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2234
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2235
+		$show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2236
+		/**
2237
+		 * Filter whether to show or don't show the editor.
2238
+		 *
2239
+		 * @since 1.6.16
2240
+		 * @param bool $show_editor If true the editor will be available for description field.
2241
+		 * @param object $package_info The listing package.
2242
+		 * @param string $listing_type The current post type.
2243
+		 * @param object $post The current post object.
2244
+		 */
2245
+		$show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2246
+
2247
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2248
+		$desc_limit = '';
2249
+		/**
2250
+		 * Filter the add listing description field character limit number.
2251
+		 *
2252
+		 * @since 1.0.0
2253
+		 * @param int $desc_limit The amount of characters to limit the description to.
2254
+		 */
2255
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2256
+		/**
2257
+		 * Filter the add listing description field text.
2258
+		 *
2259
+		 * @since 1.0.0
2260
+		 * @param string $desc The text for the description field.
2261
+		 * @param int $desc_limit The character limit number if any.
2262
+		 */
2263
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2264
+		$desc_limit_msg = '';
2265
+		/**
2266
+		 * Filter the add listing description limit message.
2267
+		 *
2268
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2269
+		 *
2270
+		 * @since 1.0.0
2271
+		 * @param string $desc_limit_msg The limit message string if any.
2272
+		 * @param int $desc_limit The character limit numer if any.
2273
+		 */
2274
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2275 2275
         
2276
-        $desc_class = '';
2277
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2278
-            /**
2279
-             * Called on the add listing page form for frontend just before the description field.
2280
-             *
2281
-             * @since 1.0.0
2282
-             */
2283
-            do_action('geodir_before_description_field');
2276
+		$desc_class = '';
2277
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2278
+			/**
2279
+			 * Called on the add listing page form for frontend just before the description field.
2280
+			 *
2281
+			 * @since 1.0.0
2282
+			 */
2283
+			do_action('geodir_before_description_field');
2284 2284
             
2285
-            $desc_class = ' required_field';
2286
-        } else {
2287
-            $desc_class = ' hidden';
2288
-        }
2289
-        ?>
2285
+			$desc_class = ' required_field';
2286
+		} else {
2287
+			$desc_class = ' hidden';
2288
+		}
2289
+		?>
2290 2290
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2291 2291
             <label><?php
2292
-                /**
2293
-                 * Filter the add listing page description input label.
2294
-                 *
2295
-                 * @since 1.6.11
2296
-                 * @param string $title The title to be output.
2297
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2298
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2299
-                 */
2300
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2292
+				/**
2293
+				 * Filter the add listing page description input label.
2294
+				 *
2295
+				 * @since 1.6.11
2296
+				 * @param string $title The title to be output.
2297
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2298
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2299
+				 */
2300
+				echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2301 2301
             <?php
2302
-            if ($show_editor) {
2303
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2304
-            ?>
2302
+			if ($show_editor) {
2303
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2304
+			?>
2305 2305
                 <div class="editor" field_id="post_desc" field_type="editor">
2306 2306
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2307 2307
                 </div>
@@ -2315,56 +2315,56 @@  discard block
 block discarded – undo
2315 2315
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2316 2316
         </div>
2317 2317
         <?php
2318
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2319
-            /**
2320
-             * Called on the add listing page form for frontend just after the description field.
2321
-             *
2322
-             * @since 1.0.0
2323
-             */
2324
-            do_action('geodir_after_description_field');
2325
-        }
2318
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2319
+			/**
2320
+			 * Called on the add listing page form for frontend just after the description field.
2321
+			 *
2322
+			 * @since 1.0.0
2323
+			 */
2324
+			do_action('geodir_after_description_field');
2325
+		}
2326 2326
         
2327
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2328
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2329
-        $kw_tags_msg = TAGKW_MSG;
2330
-        /**
2331
-         * Filter the add listing tags character limit.
2332
-         *
2333
-         * @since 1.0.0
2334
-         * @param int $kw_tags_count The character count limit if any.
2335
-         */
2336
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2337
-        /**
2338
-         * Filter the add listing tags field value.
2339
-         *
2340
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2341
-         *
2342
-         * @since 1.0.0
2343
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2344
-         * @param int $kw_tags_count The character count limit if any.
2345
-         */
2346
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2347
-        /**
2348
-         * Filter the add listing tags field message text.
2349
-         *
2350
-         * @since 1.0.0
2351
-         * @param string $kw_tags_msg The message shown under the field.
2352
-         * @param int $kw_tags_count The character count limit if any.
2353
-         */
2354
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2327
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2328
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2329
+		$kw_tags_msg = TAGKW_MSG;
2330
+		/**
2331
+		 * Filter the add listing tags character limit.
2332
+		 *
2333
+		 * @since 1.0.0
2334
+		 * @param int $kw_tags_count The character count limit if any.
2335
+		 */
2336
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2337
+		/**
2338
+		 * Filter the add listing tags field value.
2339
+		 *
2340
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2341
+		 *
2342
+		 * @since 1.0.0
2343
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2344
+		 * @param int $kw_tags_count The character count limit if any.
2345
+		 */
2346
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2347
+		/**
2348
+		 * Filter the add listing tags field message text.
2349
+		 *
2350
+		 * @since 1.0.0
2351
+		 * @param string $kw_tags_msg The message shown under the field.
2352
+		 * @param int $kw_tags_count The character count limit if any.
2353
+		 */
2354
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2355 2355
         
2356
-        $tags_class = '';
2357
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2358
-            /**
2359
-             * Called on the add listing page form for frontend just before the tags field.
2360
-             *
2361
-             * @since 1.0.0
2362
-             */
2363
-            do_action('geodir_before_listing_tags_field');
2364
-        } else {
2365
-            $tags_class = ' hidden';
2366
-        }
2367
-        ?>
2356
+		$tags_class = '';
2357
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2358
+			/**
2359
+			 * Called on the add listing page form for frontend just before the tags field.
2360
+			 *
2361
+			 * @since 1.0.0
2362
+			 */
2363
+			do_action('geodir_before_listing_tags_field');
2364
+		} else {
2365
+			$tags_class = ' hidden';
2366
+		}
2367
+		?>
2368 2368
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2369 2369
             <label><?php echo TAGKW_TEXT; ?></label>
2370 2370
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2372,90 +2372,90 @@  discard block
 block discarded – undo
2372 2372
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2373 2373
         </div>
2374 2374
         <?php
2375
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2376
-            /**
2377
-             * Called on the add listing page form for frontend just after the tags field.
2378
-             *
2379
-             * @since 1.0.0
2380
-             */
2381
-            do_action('geodir_after_listing_tags_field');
2382
-        }
2375
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2376
+			/**
2377
+			 * Called on the add listing page form for frontend just after the tags field.
2378
+			 *
2379
+			 * @since 1.0.0
2380
+			 */
2381
+			do_action('geodir_after_listing_tags_field');
2382
+		}
2383 2383
         
2384
-        $package_info = array();
2385
-        $package_info = geodir_post_package_info($package_info, $post);
2384
+		$package_info = array();
2385
+		$package_info = geodir_post_package_info($package_info, $post);
2386 2386
         
2387
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2387
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2388 2388
         
2389
-        // adjust values here
2390
-        $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2391
-
2392
-        $multiple = true; // allow multiple files upload
2389
+		// adjust values here
2390
+		$id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2393 2391
 
2394
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2392
+		$multiple = true; // allow multiple files upload
2395 2393
 
2396
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2394
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2397 2395
 
2398
-        $thumb_img_arr = array();
2399
-        $totImg = 0;
2400
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2401
-            $post = (object)$gd_session->get('listing');
2402
-            if (isset($post->post_images))
2403
-                $curImages = trim($post->post_images, ",");
2396
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2404 2397
 
2398
+		$thumb_img_arr = array();
2399
+		$totImg = 0;
2400
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2401
+			$post = (object)$gd_session->get('listing');
2402
+			if (isset($post->post_images))
2403
+				$curImages = trim($post->post_images, ",");
2405 2404
 
2406
-            if ($curImages != '') {
2407
-                $curImages_array = explode(',', $curImages);
2408
-                $totImg = count($curImages_array);
2409
-            }
2410 2405
 
2411
-            $listing_type = $post->listing_type;
2406
+			if ($curImages != '') {
2407
+				$curImages_array = explode(',', $curImages);
2408
+				$totImg = count($curImages_array);
2409
+			}
2412 2410
 
2413
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2414
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2415
-            $listing_type = $post->post_type;
2416
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2411
+			$listing_type = $post->listing_type;
2417 2412
 
2418
-        } else {
2419
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2420
-        }
2413
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2414
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2415
+			$listing_type = $post->post_type;
2416
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2421 2417
 
2418
+		} else {
2419
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2420
+		}
2422 2421
 
2423
-        if (!empty($thumb_img_arr)) {
2424
-            foreach ($thumb_img_arr as $img) {
2425
-                //$curImages = $img->src.",";
2426
-            }
2427 2422
 
2428
-            $totImg = count((array)$thumb_img_arr);
2429
-        }
2423
+		if (!empty($thumb_img_arr)) {
2424
+			foreach ($thumb_img_arr as $img) {
2425
+				//$curImages = $img->src.",";
2426
+			}
2430 2427
 
2431
-        if ($curImages != '')
2432
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2433
-        else
2434
-            $svalue = '';
2435
-
2436
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2437
-        $show_image_input_box = ($image_limit != '0');
2438
-        /**
2439
-         * Filter to be able to show/hide the image upload section of the add listing form.
2440
-         *
2441
-         * @since 1.0.0
2442
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2443
-         * @param string $listing_type The custom post type slug.
2444
-         */
2445
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2446
-        if ($show_image_input_box) {
2447
-            ?>
2428
+			$totImg = count((array)$thumb_img_arr);
2429
+		}
2430
+
2431
+		if ($curImages != '')
2432
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2433
+		else
2434
+			$svalue = '';
2435
+
2436
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2437
+		$show_image_input_box = ($image_limit != '0');
2438
+		/**
2439
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2440
+		 *
2441
+		 * @since 1.0.0
2442
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2443
+		 * @param string $listing_type The custom post type slug.
2444
+		 */
2445
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2446
+		if ($show_image_input_box) {
2447
+			?>
2448 2448
 
2449 2449
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2450 2450
                 <?php if ($image_limit == 1) {
2451
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2452
-                } ?>
2451
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2452
+				} ?>
2453 2453
                 <?php if ($image_limit > 1) {
2454
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2455
-                } ?>
2454
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2455
+				} ?>
2456 2456
                 <?php if ($image_limit == '') {
2457
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2458
-                } ?>
2457
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2458
+				} ?>
2459 2459
             </h5>
2460 2460
 
2461 2461
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2493,12 +2493,12 @@  discard block
 block discarded – undo
2493 2493
         <?php } ?>
2494 2494
 
2495 2495
         <?php
2496
-        /**
2497
-         * Called on the add listing page form for frontend just after the image upload field.
2498
-         *
2499
-         * @since 1.0.0
2500
-         */
2501
-        do_action('geodir_after_main_form_fields');?>
2496
+		/**
2497
+		 * Called on the add listing page form for frontend just after the image upload field.
2498
+		 *
2499
+		 * @since 1.0.0
2500
+		 */
2501
+		do_action('geodir_after_main_form_fields');?>
2502 2502
 
2503 2503
 
2504 2504
         <!-- add captcha code -->
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
 
2528 2528
     </form>
2529 2529
     <?php
2530
-    wp_reset_query();
2530
+	wp_reset_query();
2531 2531
 }
2532 2532
 
2533 2533
 /**
@@ -2538,7 +2538,7 @@  discard block
 block discarded – undo
2538 2538
  */
2539 2539
 function geodir_add_listing_sidebar_widget_area()
2540 2540
 {
2541
-    dynamic_sidebar('geodir_add_listing_sidebar');
2541
+	dynamic_sidebar('geodir_add_listing_sidebar');
2542 2542
 }
2543 2543
 
2544 2544
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2553,16 +2553,16 @@  discard block
 block discarded – undo
2553 2553
  */
2554 2554
 function geodir_action_add_listing_sidebar()
2555 2555
 {
2556
-    /** This action is documented in geodirectory_template_actions.php */
2557
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2558
-    /**
2559
-     * This is used to add the content to the add listing page sidebar.
2560
-     *
2561
-     * @since 1.0.0
2562
-     */
2563
-    do_action('geodir_add_listing_sidebar_inside');
2564
-    /** This action is documented in geodirectory_template_actions.php */
2565
-    do_action('geodir_sidebar_right_close', 'details-page');
2556
+	/** This action is documented in geodirectory_template_actions.php */
2557
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2558
+	/**
2559
+	 * This is used to add the content to the add listing page sidebar.
2560
+	 *
2561
+	 * @since 1.0.0
2562
+	 */
2563
+	do_action('geodir_add_listing_sidebar_inside');
2564
+	/** This action is documented in geodirectory_template_actions.php */
2565
+	do_action('geodir_sidebar_right_close', 'details-page');
2566 2566
 }
2567 2567
 
2568 2568
 ###############################################
@@ -2579,11 +2579,11 @@  discard block
 block discarded – undo
2579 2579
  */
2580 2580
 function geodir_action_geodir_sidebar_signup_top()
2581 2581
 {
2582
-    ?>
2582
+	?>
2583 2583
     <div
2584 2584
         class="<?php
2585
-        /** This action is documented in geodirectory_template_actions.php */
2586
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2585
+		/** This action is documented in geodirectory_template_actions.php */
2586
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2587 2587
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2588 2588
     </div><!-- clearfix ends here-->
2589 2589
 <?php
@@ -2602,9 +2602,9 @@  discard block
 block discarded – undo
2602 2602
 function geodir_action_signup_forms()
2603 2603
 {
2604 2604
 
2605
-    global $user_login;
2605
+	global $user_login;
2606 2606
 
2607
-    ?>
2607
+	?>
2608 2608
     <script type="text/javascript">
2609 2609
         <?php if ( $user_login ) { ?>
2610 2610
         setTimeout(function () {
@@ -2640,65 +2640,65 @@  discard block
 block discarded – undo
2640 2640
         <?php } ?>
2641 2641
     </script><?php
2642 2642
 
2643
-    global $errors;
2644
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2645
-        $errors->add('claim_login', LOGIN_CLAIM);
2646
-
2647
-    if (!empty($errors)) {
2648
-        foreach ($errors as $errorsObj) {
2649
-            foreach ($errorsObj as $key => $val) {
2650
-                for ($i = 0; $i < count($val); $i++) {
2651
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2652
-                    $registration_error_msg = 1;
2653
-                }
2654
-            }
2655
-        }
2656
-    }
2643
+	global $errors;
2644
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2645
+		$errors->add('claim_login', LOGIN_CLAIM);
2646
+
2647
+	if (!empty($errors)) {
2648
+		foreach ($errors as $errorsObj) {
2649
+			foreach ($errorsObj as $key => $val) {
2650
+				for ($i = 0; $i < count($val); $i++) {
2651
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2652
+					$registration_error_msg = 1;
2653
+				}
2654
+			}
2655
+		}
2656
+	}
2657 2657
 
2658
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2659
-        ?>
2658
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2659
+		?>
2660 2660
 
2661 2661
         <div class="login_form">
2662 2662
             <?php
2663
-            /**
2664
-             * Contains login form template.
2665
-             *
2666
-             * @since 1.0.0
2667
-             */
2668
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2663
+			/**
2664
+			 * Contains login form template.
2665
+			 *
2666
+			 * @since 1.0.0
2667
+			 */
2668
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2669 2669
         </div>
2670 2670
 
2671 2671
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2672 2672
 
2673 2673
         <div class="registration_form">
2674 2674
             <?php
2675
-            /**
2676
-             * Contains registration form template.
2677
-             *
2678
-             * @since 1.0.0
2679
-             */
2680
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2675
+			/**
2676
+			 * Contains registration form template.
2677
+			 *
2678
+			 * @since 1.0.0
2679
+			 */
2680
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2681 2681
         </div>
2682 2682
 
2683 2683
     <?php } else { ?>
2684 2684
 
2685 2685
         <div class="login_form_l">
2686 2686
             <?php
2687
-            /**
2688
-             * Contains login form template.
2689
-             *
2690
-             * @since 1.0.0
2691
-             */
2692
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2687
+			/**
2688
+			 * Contains login form template.
2689
+			 *
2690
+			 * @since 1.0.0
2691
+			 */
2692
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2693 2693
         </div>
2694 2694
         <div class="registration_form_r">
2695 2695
             <?php
2696
-            /**
2697
-             * Contains registration form template.
2698
-             *
2699
-             * @since 1.0.0
2700
-             */
2701
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2696
+			/**
2697
+			 * Contains registration form template.
2698
+			 *
2699
+			 * @since 1.0.0
2700
+			 */
2701
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2702 2702
         </div>
2703 2703
 
2704 2704
     <?php }?>
@@ -2729,66 +2729,66 @@  discard block
 block discarded – undo
2729 2729
  */
2730 2730
 function geodir_action_author_page_title()
2731 2731
 {
2732
-    global $term;
2732
+	global $term;
2733 2733
 
2734
-    $gd_post_type = geodir_get_current_posttype();
2735
-    $post_type_info = get_post_type_object($gd_post_type);
2734
+	$gd_post_type = geodir_get_current_posttype();
2735
+	$post_type_info = get_post_type_object($gd_post_type);
2736 2736
 
2737
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2738
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2739
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2740
-    }
2737
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2738
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2739
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2740
+	}
2741 2741
 
2742
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2743
-    $single_name = $post_type_info->labels->singular_name;
2742
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2743
+	$single_name = $post_type_info->labels->singular_name;
2744 2744
 
2745
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2745
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2746 2746
 
2747
-    if (!empty($term)) {
2748
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2749
-        if (!empty($current_term))
2750
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2751
-    }
2747
+	if (!empty($term)) {
2748
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2749
+		if (!empty($current_term))
2750
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2751
+	}
2752 2752
 
2753 2753
 
2754
-    if (is_search()) {
2755
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2754
+	if (is_search()) {
2755
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2756 2756
 
2757
-    }
2758
-    /** This action is documented in geodirectory_template_actions.php */
2759
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2760
-    /** This action is documented in geodirectory_template_actions.php */
2761
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2757
+	}
2758
+	/** This action is documented in geodirectory_template_actions.php */
2759
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2760
+	/** This action is documented in geodirectory_template_actions.php */
2761
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2762 2762
 
2763
-    $title = $list_title;
2764
-    if(geodir_is_page('author')){
2765
-        $gd_page = 'author';
2766
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2767
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2768
-        }else{
2769
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2770
-        }
2763
+	$title = $list_title;
2764
+	if(geodir_is_page('author')){
2765
+		$gd_page = 'author';
2766
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2767
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2768
+		}else{
2769
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2770
+		}
2771 2771
 
2772
-    }
2772
+	}
2773 2773
 
2774 2774
 
2775
-    /**
2776
-     * Filter page title to replace variables.
2777
-     *
2778
-     * @since 1.5.4
2779
-     * @param string $title The page title including variables.
2780
-     * @param string $gd_page The GeoDirectory page type if any.
2781
-     */
2782
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2775
+	/**
2776
+	 * Filter page title to replace variables.
2777
+	 *
2778
+	 * @since 1.5.4
2779
+	 * @param string $title The page title including variables.
2780
+	 * @param string $gd_page The GeoDirectory page type if any.
2781
+	 */
2782
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2783 2783
 
2784
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2785
-        /**
2786
-         * Filter the author page title text.
2787
-         *
2788
-         * @since 1.0.0
2789
-         * @param string $list_title The title for the page.
2790
-         */
2791
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2784
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2785
+		/**
2786
+		 * Filter the author page title text.
2787
+		 *
2788
+		 * @since 1.0.0
2789
+		 * @param string $list_title The title for the page.
2790
+		 */
2791
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2792 2792
 }
2793 2793
 
2794 2794
 
@@ -2806,11 +2806,11 @@  discard block
 block discarded – undo
2806 2806
  */
2807 2807
 function geodir_action_geodir_sidebar_author_top()
2808 2808
 {
2809
-    if (get_option('geodir_show_author_top_section')) { ?>
2809
+	if (get_option('geodir_show_author_top_section')) { ?>
2810 2810
         <div
2811 2811
             class="<?php
2812
-            /** This action is documented in geodirectory_template_actions.php */
2813
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2812
+			/** This action is documented in geodirectory_template_actions.php */
2813
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2814 2814
             <?php dynamic_sidebar('geodir_author_top'); ?>
2815 2815
         </div><!-- clearfix ends here-->
2816 2816
     <?php }
@@ -2826,7 +2826,7 @@  discard block
 block discarded – undo
2826 2826
  */
2827 2827
 function geodir_author_left_section()
2828 2828
 {
2829
-    if (get_option('geodir_show_author_left_section')) { ?>
2829
+	if (get_option('geodir_show_author_left_section')) { ?>
2830 2830
         <div class="geodir-content-left geodir-sidebar-wrap">
2831 2831
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2832 2832
         </div><!-- end geodir-content-left -->
@@ -2847,19 +2847,19 @@  discard block
 block discarded – undo
2847 2847
  */
2848 2848
 function geodir_action_author_sidebar_left()
2849 2849
 {
2850
-    if (get_option('geodir_show_author_left_section')) {
2850
+	if (get_option('geodir_show_author_left_section')) {
2851 2851
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2852
-        /** This action is documented in geodirectory_template_actions.php */
2853
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2854
-        /**
2855
-         * This is used to add the content to the author page left sidebar (if active).
2856
-         *
2857
-         * @since 1.0.0
2858
-         */
2859
-        do_action('geodir_author_sidebar_left_inside');
2860
-        /** This action is documented in geodirectory_template_actions.php */
2861
-        do_action('geodir_sidebar_left_close', 'author-page');
2862
-    }
2852
+		/** This action is documented in geodirectory_template_actions.php */
2853
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2854
+		/**
2855
+		 * This is used to add the content to the author page left sidebar (if active).
2856
+		 *
2857
+		 * @since 1.0.0
2858
+		 */
2859
+		do_action('geodir_author_sidebar_left_inside');
2860
+		/** This action is documented in geodirectory_template_actions.php */
2861
+		do_action('geodir_sidebar_left_close', 'author-page');
2862
+	}
2863 2863
 }
2864 2864
 
2865 2865
 /**
@@ -2872,7 +2872,7 @@  discard block
 block discarded – undo
2872 2872
  */
2873 2873
 function geodir_author_right_section()
2874 2874
 {
2875
-    if (get_option('geodir_show_author_right_section')) { ?>
2875
+	if (get_option('geodir_show_author_right_section')) { ?>
2876 2876
         <div class="geodir-content-right geodir-sidebar-wrap">
2877 2877
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2878 2878
         </div><!-- end geodir-content-right -->
@@ -2892,18 +2892,18 @@  discard block
 block discarded – undo
2892 2892
  */
2893 2893
 function geodir_action_author_sidebar_right()
2894 2894
 {
2895
-    if (get_option('geodir_show_author_right_section')) {
2896
-        /** This action is documented in geodirectory_template_actions.php */
2897
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2898
-        /**
2899
-         * This is used to add the content to the author page right sidebar (if active).
2900
-         *
2901
-         * @since 1.0.0
2902
-         */
2903
-        do_action('geodir_author_sidebar_right_inside');
2904
-        /** This action is documented in geodirectory_template_actions.php */
2905
-        do_action('geodir_sidebar_right_close', 'author-page');
2906
-    }
2895
+	if (get_option('geodir_show_author_right_section')) {
2896
+		/** This action is documented in geodirectory_template_actions.php */
2897
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2898
+		/**
2899
+		 * This is used to add the content to the author page right sidebar (if active).
2900
+		 *
2901
+		 * @since 1.0.0
2902
+		 */
2903
+		do_action('geodir_author_sidebar_right_inside');
2904
+		/** This action is documented in geodirectory_template_actions.php */
2905
+		do_action('geodir_sidebar_right_close', 'author-page');
2906
+	}
2907 2907
 }
2908 2908
 
2909 2909
 /**
@@ -2915,14 +2915,14 @@  discard block
 block discarded – undo
2915 2915
  */
2916 2916
 function geodir_action_author_content_inside()
2917 2917
 {
2918
-    global $gridview_columns;
2919
-    $listing_view = get_option('geodir_author_view');
2920
-    if (strstr($listing_view, 'gridview')) {
2921
-        $gridview_columns = $listing_view;
2922
-        $listing_view_exp = explode('_', $listing_view);
2923
-        $listing_view = $listing_view_exp[0];
2924
-    }
2925
-    geodir_get_template_part('listing', 'listview');
2918
+	global $gridview_columns;
2919
+	$listing_view = get_option('geodir_author_view');
2920
+	if (strstr($listing_view, 'gridview')) {
2921
+		$gridview_columns = $listing_view;
2922
+		$listing_view_exp = explode('_', $listing_view);
2923
+		$listing_view = $listing_view_exp[0];
2924
+	}
2925
+	geodir_get_template_part('listing', 'listview');
2926 2926
 }
2927 2927
 
2928 2928
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2937,22 +2937,22 @@  discard block
 block discarded – undo
2937 2937
  */
2938 2938
 function geodir_action_author_content()
2939 2939
 {
2940
-    /** This action is documented in geodirectory_template_actions.php */
2941
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2942
-    echo '<div class="clearfix">';
2943
-    /** This action is documented in geodirectory_template_actions.php */
2944
-    do_action('geodir_before_listing');
2945
-    echo '</div>';
2946
-    /**
2947
-     * This is used to add the content to the author page main content.
2948
-     *
2949
-     * @since 1.0.0
2950
-     */
2951
-    do_action('geodir_author_content_inside');
2952
-    /** This action is documented in geodirectory_template_actions.php */
2953
-    do_action('geodir_after_listing');
2954
-    /** This action is documented in geodirectory_template_actions.php */
2955
-    do_action('geodir_main_content_close', 'author-page');
2940
+	/** This action is documented in geodirectory_template_actions.php */
2941
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2942
+	echo '<div class="clearfix">';
2943
+	/** This action is documented in geodirectory_template_actions.php */
2944
+	do_action('geodir_before_listing');
2945
+	echo '</div>';
2946
+	/**
2947
+	 * This is used to add the content to the author page main content.
2948
+	 *
2949
+	 * @since 1.0.0
2950
+	 */
2951
+	do_action('geodir_author_content_inside');
2952
+	/** This action is documented in geodirectory_template_actions.php */
2953
+	do_action('geodir_after_listing');
2954
+	/** This action is documented in geodirectory_template_actions.php */
2955
+	do_action('geodir_main_content_close', 'author-page');
2956 2956
 }
2957 2957
 
2958 2958
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2966,11 +2966,11 @@  discard block
 block discarded – undo
2966 2966
  */
2967 2967
 function geodir_action_sidebar_author_bottom_section()
2968 2968
 {
2969
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2969
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2970 2970
         <div
2971 2971
             class="<?php
2972
-            /** This action is documented in geodirectory_template_actions.php */
2973
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2972
+			/** This action is documented in geodirectory_template_actions.php */
2973
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2974 2974
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2975 2975
         </div><!-- clearfix ends here-->
2976 2976
     <?php }
@@ -2989,23 +2989,23 @@  discard block
 block discarded – undo
2989 2989
  */
2990 2990
 function geodir_action_search_page_title()
2991 2991
 {
2992
-    $gd_post_type = geodir_get_current_posttype();
2993
-    $post_type_info = get_post_type_object($gd_post_type);
2992
+	$gd_post_type = geodir_get_current_posttype();
2993
+	$post_type_info = get_post_type_object($gd_post_type);
2994 2994
 
2995
-    $pt_name = '';
2996
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2995
+	$pt_name = '';
2996
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2997 2997
 
2998
-    if (is_search()) {
2999
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2998
+	if (is_search()) {
2999
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3000 3000
 
3001
-    }
3002
-    /** This action is documented in geodirectory_template_actions.php */
3003
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3004
-    /** This action is documented in geodirectory_template_actions.php */
3005
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3006
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3007
-        /** This action is documented in geodirectory_template_actions.php */
3008
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3001
+	}
3002
+	/** This action is documented in geodirectory_template_actions.php */
3003
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
3004
+	/** This action is documented in geodirectory_template_actions.php */
3005
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3006
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3007
+		/** This action is documented in geodirectory_template_actions.php */
3008
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3009 3009
 }
3010 3010
 
3011 3011
 // action for adding the listings page top widget area
@@ -3021,11 +3021,11 @@  discard block
 block discarded – undo
3021 3021
  */
3022 3022
 function geodir_action_geodir_sidebar_search_top()
3023 3023
 {
3024
-    if (get_option('geodir_show_search_top_section')) { ?>
3024
+	if (get_option('geodir_show_search_top_section')) { ?>
3025 3025
         <div
3026 3026
             class="<?php
3027
-            /** This action is documented in geodirectory_template_actions.php */
3028
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3027
+			/** This action is documented in geodirectory_template_actions.php */
3028
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3029 3029
             <?php dynamic_sidebar('geodir_search_top'); ?>
3030 3030
         </div><!-- clearfix ends here-->
3031 3031
     <?php }
@@ -3041,7 +3041,7 @@  discard block
 block discarded – undo
3041 3041
  */
3042 3042
 function geodir_search_left_section()
3043 3043
 {
3044
-    if (get_option('geodir_show_search_left_section')) { ?>
3044
+	if (get_option('geodir_show_search_left_section')) { ?>
3045 3045
         <div class="geodir-content-left geodir-sidebar-wrap">
3046 3046
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3047 3047
         </div><!-- end geodir-content-left -->
@@ -3061,19 +3061,19 @@  discard block
 block discarded – undo
3061 3061
  */
3062 3062
 function geodir_action_search_sidebar_left()
3063 3063
 {
3064
-    if (get_option('geodir_show_search_left_section')) {
3064
+	if (get_option('geodir_show_search_left_section')) {
3065 3065
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3066
-        /** This action is documented in geodirectory_template_actions.php */
3067
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3068
-        /**
3069
-         * This is used to add the content to the search page left sidebar (if active).
3070
-         *
3071
-         * @since 1.0.0
3072
-         */
3073
-        do_action('geodir_search_sidebar_left_inside');
3074
-        /** This action is documented in geodirectory_template_actions.php */
3075
-        do_action('geodir_sidebar_left_close', 'search-page');
3076
-    }
3066
+		/** This action is documented in geodirectory_template_actions.php */
3067
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3068
+		/**
3069
+		 * This is used to add the content to the search page left sidebar (if active).
3070
+		 *
3071
+		 * @since 1.0.0
3072
+		 */
3073
+		do_action('geodir_search_sidebar_left_inside');
3074
+		/** This action is documented in geodirectory_template_actions.php */
3075
+		do_action('geodir_sidebar_left_close', 'search-page');
3076
+	}
3077 3077
 }
3078 3078
 
3079 3079
 /**
@@ -3086,7 +3086,7 @@  discard block
 block discarded – undo
3086 3086
  */
3087 3087
 function geodir_search_right_section()
3088 3088
 {
3089
-    if (get_option('geodir_show_search_right_section')) { ?>
3089
+	if (get_option('geodir_show_search_right_section')) { ?>
3090 3090
         <div class="geodir-content-right geodir-sidebar-wrap">
3091 3091
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3092 3092
         </div><!-- end geodir-content-right -->
@@ -3106,18 +3106,18 @@  discard block
 block discarded – undo
3106 3106
  */
3107 3107
 function geodir_action_search_sidebar_right()
3108 3108
 {
3109
-    if (get_option('geodir_show_search_right_section')) {
3110
-        /** This action is documented in geodirectory_template_actions.php */
3111
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3112
-        /**
3113
-         * This is used to add the content to the search page right sidebar (if active).
3114
-         *
3115
-         * @since 1.0.0
3116
-         */
3117
-        do_action('geodir_search_sidebar_right_inside');
3118
-        /** This action is documented in geodirectory_template_actions.php */
3119
-        do_action('geodir_sidebar_right_close', 'search-page');
3120
-    }
3109
+	if (get_option('geodir_show_search_right_section')) {
3110
+		/** This action is documented in geodirectory_template_actions.php */
3111
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3112
+		/**
3113
+		 * This is used to add the content to the search page right sidebar (if active).
3114
+		 *
3115
+		 * @since 1.0.0
3116
+		 */
3117
+		do_action('geodir_search_sidebar_right_inside');
3118
+		/** This action is documented in geodirectory_template_actions.php */
3119
+		do_action('geodir_sidebar_right_close', 'search-page');
3120
+	}
3121 3121
 }
3122 3122
 
3123 3123
 
@@ -3132,11 +3132,11 @@  discard block
 block discarded – undo
3132 3132
  */
3133 3133
 function geodir_action_sidebar_search_bottom_section()
3134 3134
 {
3135
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3135
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3136 3136
         <div
3137 3137
             class="<?php
3138
-            /** This action is documented in geodirectory_template_actions.php */
3139
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3138
+			/** This action is documented in geodirectory_template_actions.php */
3139
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3140 3140
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3141 3141
         </div><!-- clearfix ends here-->
3142 3142
     <?php }
@@ -3151,14 +3151,14 @@  discard block
 block discarded – undo
3151 3151
  */
3152 3152
 function geodir_action_search_content_inside()
3153 3153
 {
3154
-    global $gridview_columns;
3155
-    $listing_view = get_option('geodir_search_view');
3156
-    if (strstr($listing_view, 'gridview')) {
3157
-        $gridview_columns = $listing_view;
3158
-        $listing_view_exp = explode('_', $listing_view);
3159
-        $listing_view = $listing_view_exp[0];
3160
-    }
3161
-    geodir_get_template_part('listing', 'listview');
3154
+	global $gridview_columns;
3155
+	$listing_view = get_option('geodir_search_view');
3156
+	if (strstr($listing_view, 'gridview')) {
3157
+		$gridview_columns = $listing_view;
3158
+		$listing_view_exp = explode('_', $listing_view);
3159
+		$listing_view = $listing_view_exp[0];
3160
+	}
3161
+	geodir_get_template_part('listing', 'listview');
3162 3162
 }
3163 3163
 
3164 3164
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3174,22 +3174,22 @@  discard block
 block discarded – undo
3174 3174
  */
3175 3175
 function geodir_action_search_content()
3176 3176
 {
3177
-    /** This action is documented in geodirectory_template_actions.php */
3178
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3179
-    echo '<div class="clearfix">';
3180
-    /** This action is documented in geodirectory_template_actions.php */
3181
-    do_action('geodir_before_listing');
3182
-    echo '</div>';
3183
-    /**
3184
-     * This is used to add the content to the search page main content.
3185
-     *
3186
-     * @since 1.0.0
3187
-     */
3188
-    do_action('geodir_search_content_inside');
3189
-    /** This action is documented in geodirectory_template_actions.php */
3190
-    do_action('geodir_after_listing');
3191
-    /** This action is documented in geodirectory_template_actions.php */
3192
-    do_action('geodir_main_content_close', 'search-page');
3177
+	/** This action is documented in geodirectory_template_actions.php */
3178
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3179
+	echo '<div class="clearfix">';
3180
+	/** This action is documented in geodirectory_template_actions.php */
3181
+	do_action('geodir_before_listing');
3182
+	echo '</div>';
3183
+	/**
3184
+	 * This is used to add the content to the search page main content.
3185
+	 *
3186
+	 * @since 1.0.0
3187
+	 */
3188
+	do_action('geodir_search_content_inside');
3189
+	/** This action is documented in geodirectory_template_actions.php */
3190
+	do_action('geodir_after_listing');
3191
+	/** This action is documented in geodirectory_template_actions.php */
3192
+	do_action('geodir_main_content_close', 'search-page');
3193 3193
 }
3194 3194
 
3195 3195
 ###############################################
@@ -3212,11 +3212,11 @@  discard block
 block discarded – undo
3212 3212
  */
3213 3213
 function geodir_action_geodir_sidebar_home_top()
3214 3214
 {
3215
-    if (get_option('geodir_show_home_top_section')) { ?>
3215
+	if (get_option('geodir_show_home_top_section')) { ?>
3216 3216
         <div
3217 3217
             class="<?php
3218
-            /** This action is documented in geodirectory_template_actions.php */
3219
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3218
+			/** This action is documented in geodirectory_template_actions.php */
3219
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3220 3220
             <?php dynamic_sidebar('geodir_home_top'); ?>
3221 3221
         </div><!-- clearfix ends here-->
3222 3222
     <?php }
@@ -3232,7 +3232,7 @@  discard block
 block discarded – undo
3232 3232
  */
3233 3233
 function geodir_home_left_section()
3234 3234
 {
3235
-    if (get_option('geodir_show_home_left_section')) { ?>
3235
+	if (get_option('geodir_show_home_left_section')) { ?>
3236 3236
         <div class="geodir-content-left geodir-sidebar-wrap">
3237 3237
             <?php dynamic_sidebar('geodir_home_left'); ?>
3238 3238
         </div><!-- end geodir-content-left -->
@@ -3254,19 +3254,19 @@  discard block
 block discarded – undo
3254 3254
  */
3255 3255
 function geodir_action_home_sidebar_left()
3256 3256
 {
3257
-    if (get_option('geodir_show_home_left_section')) {
3257
+	if (get_option('geodir_show_home_left_section')) {
3258 3258
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3259
-        /** This action is documented in geodirectory_template_actions.php */
3260
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3261
-        /**
3262
-         * This is used to add the content to the home page left sidebar (if active).
3263
-         *
3264
-         * @since 1.0.0
3265
-         */
3266
-        do_action('geodir_home_sidebar_left_inside');
3267
-        /** This action is documented in geodirectory_template_actions.php */
3268
-        do_action('geodir_sidebar_left_close', 'home-page');
3269
-    }
3259
+		/** This action is documented in geodirectory_template_actions.php */
3260
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3261
+		/**
3262
+		 * This is used to add the content to the home page left sidebar (if active).
3263
+		 *
3264
+		 * @since 1.0.0
3265
+		 */
3266
+		do_action('geodir_home_sidebar_left_inside');
3267
+		/** This action is documented in geodirectory_template_actions.php */
3268
+		do_action('geodir_sidebar_left_close', 'home-page');
3269
+	}
3270 3270
 }
3271 3271
 
3272 3272
 /**
@@ -3279,7 +3279,7 @@  discard block
 block discarded – undo
3279 3279
  */
3280 3280
 function geodir_home_right_section()
3281 3281
 {
3282
-    if (get_option('geodir_show_home_right_section')) { ?>
3282
+	if (get_option('geodir_show_home_right_section')) { ?>
3283 3283
         <div class="geodir-content-right geodir-sidebar-wrap">
3284 3284
             <?php dynamic_sidebar('geodir_home_right'); ?>
3285 3285
         </div><!-- end geodir-content-right -->
@@ -3300,18 +3300,18 @@  discard block
 block discarded – undo
3300 3300
  */
3301 3301
 function geodir_action_home_sidebar_right()
3302 3302
 {
3303
-    if (get_option('geodir_show_home_right_section')) {
3304
-        /** This action is documented in geodirectory_template_actions.php */
3305
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3306
-        /**
3307
-         * This is used to add the content to the home page right sidebar (if active).
3308
-         *
3309
-         * @since 1.0.0
3310
-         */
3311
-        do_action('geodir_home_sidebar_right_inside');
3312
-        /** This action is documented in geodirectory_template_actions.php */
3313
-        do_action('geodir_sidebar_right_close', 'home-page');
3314
-    }
3303
+	if (get_option('geodir_show_home_right_section')) {
3304
+		/** This action is documented in geodirectory_template_actions.php */
3305
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3306
+		/**
3307
+		 * This is used to add the content to the home page right sidebar (if active).
3308
+		 *
3309
+		 * @since 1.0.0
3310
+		 */
3311
+		do_action('geodir_home_sidebar_right_inside');
3312
+		/** This action is documented in geodirectory_template_actions.php */
3313
+		do_action('geodir_sidebar_right_close', 'home-page');
3314
+	}
3315 3315
 }
3316 3316
 
3317 3317
 /**
@@ -3322,7 +3322,7 @@  discard block
 block discarded – undo
3322 3322
  */
3323 3323
 function geodir_action_home_content_inside()
3324 3324
 {
3325
-    dynamic_sidebar('geodir_home_content');
3325
+	dynamic_sidebar('geodir_home_content');
3326 3326
 }
3327 3327
 
3328 3328
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3337,28 +3337,28 @@  discard block
 block discarded – undo
3337 3337
  */
3338 3338
 function geodir_action_home_content()
3339 3339
 {
3340
-    /** This action is documented in geodirectory_template_actions.php */
3341
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3342
-    /**
3343
-     * This called before the home page main content.
3344
-     *
3345
-     * @since 1.0.0
3346
-     */
3347
-    do_action('geodir_before_home_content');
3348
-    /**
3349
-     * This is used to add the content to the home page main content.
3350
-     *
3351
-     * @since 1.0.0
3352
-     */
3353
-    do_action('geodir_home_content_inside');
3354
-    /**
3355
-     * This is called after the homepage main content.
3356
-     *
3357
-     * @since 1.0.0
3358
-     */
3359
-    do_action('geodir_after_home_content');
3360
-    /** This action is documented in geodirectory_template_actions.php */
3361
-    do_action('geodir_main_content_close', 'home-page');
3340
+	/** This action is documented in geodirectory_template_actions.php */
3341
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3342
+	/**
3343
+	 * This called before the home page main content.
3344
+	 *
3345
+	 * @since 1.0.0
3346
+	 */
3347
+	do_action('geodir_before_home_content');
3348
+	/**
3349
+	 * This is used to add the content to the home page main content.
3350
+	 *
3351
+	 * @since 1.0.0
3352
+	 */
3353
+	do_action('geodir_home_content_inside');
3354
+	/**
3355
+	 * This is called after the homepage main content.
3356
+	 *
3357
+	 * @since 1.0.0
3358
+	 */
3359
+	do_action('geodir_after_home_content');
3360
+	/** This action is documented in geodirectory_template_actions.php */
3361
+	do_action('geodir_main_content_close', 'home-page');
3362 3362
 }
3363 3363
 
3364 3364
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3373,11 +3373,11 @@  discard block
 block discarded – undo
3373 3373
  */
3374 3374
 function geodir_action_sidebar_home_bottom_section()
3375 3375
 {
3376
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3376
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3377 3377
         <div
3378 3378
             class="<?php
3379
-            /** This action is documented in geodirectory_template_actions.php */
3380
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3379
+			/** This action is documented in geodirectory_template_actions.php */
3380
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3381 3381
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3382 3382
         </div><!-- clearfix ends here-->
3383 3383
     <?php }
@@ -3405,13 +3405,13 @@  discard block
 block discarded – undo
3405 3405
  */
3406 3406
 function geodir_filter_listing_page_title($list_title)
3407 3407
 {
3408
-    if (is_search() && trim(get_search_query()) == '') {
3409
-        $gd_post_type = geodir_get_current_posttype();
3410
-        $post_type_info = get_post_type_object($gd_post_type);
3408
+	if (is_search() && trim(get_search_query()) == '') {
3409
+		$gd_post_type = geodir_get_current_posttype();
3410
+		$post_type_info = get_post_type_object($gd_post_type);
3411 3411
 
3412
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3413
-    }
3414
-    return $list_title;
3412
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3413
+	}
3414
+	return $list_title;
3415 3415
 }
3416 3416
 
3417 3417
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3426,62 +3426,62 @@  discard block
 block discarded – undo
3426 3426
  * @param string $gd_page The geodirectory page type. Default null.
3427 3427
  */
3428 3428
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3429
-    global $post;
3430
-
3431
-    $gd_page_id = NULL;
3432
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3433
-        $gd_page_id = geodir_home_page_id();
3434
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3435
-        $gd_page_id = geodir_preview_page_id();
3436
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3437
-        $gd_page_id = geodir_add_listing_page_id();
3438
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3439
-        $gd_page_id = geodir_success_page_id();
3440
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3441
-        $gd_page_id = geodir_location_page_id();
3442
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3443
-        $gd_page_id = geodir_info_page_id();
3444
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3445
-        $gd_page_id = geodir_login_page_id();
3446
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3447
-        $gd_page_id = geodir_payment_checkout_page_id();
3448
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3449
-        $gd_page_id = geodir_payment_invoices_page_id();
3450
-    }
3451
-
3452
-    if (!$gd_page_id > 0) {
3453
-        return;
3454
-    }
3429
+	global $post;
3430
+
3431
+	$gd_page_id = NULL;
3432
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3433
+		$gd_page_id = geodir_home_page_id();
3434
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3435
+		$gd_page_id = geodir_preview_page_id();
3436
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3437
+		$gd_page_id = geodir_add_listing_page_id();
3438
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3439
+		$gd_page_id = geodir_success_page_id();
3440
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3441
+		$gd_page_id = geodir_location_page_id();
3442
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3443
+		$gd_page_id = geodir_info_page_id();
3444
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3445
+		$gd_page_id = geodir_login_page_id();
3446
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3447
+		$gd_page_id = geodir_payment_checkout_page_id();
3448
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3449
+		$gd_page_id = geodir_payment_invoices_page_id();
3450
+	}
3451
+
3452
+	if (!$gd_page_id > 0) {
3453
+		return;
3454
+	}
3455 3455
     
3456
-    $display = 'before';
3457
-    /**
3458
-     * Filter the position to display the page content.
3459
-     *
3460
-     * @since 1.6.3
3461
-     *
3462
-     * @param string $display Position to add the post content.
3463
-     * @param string $gd_page The geodirectory page type.
3464
-     */
3465
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3466
-
3467
-    if ($position !== $display) {
3468
-        return;
3469
-    }
3470
-
3471
-    $gd_post = $post;
3456
+	$display = 'before';
3457
+	/**
3458
+	 * Filter the position to display the page content.
3459
+	 *
3460
+	 * @since 1.6.3
3461
+	 *
3462
+	 * @param string $display Position to add the post content.
3463
+	 * @param string $gd_page The geodirectory page type.
3464
+	 */
3465
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3466
+
3467
+	if ($position !== $display) {
3468
+		return;
3469
+	}
3470
+
3471
+	$gd_post = $post;
3472 3472
     
3473
-    setup_postdata(get_post($gd_page_id));
3473
+	setup_postdata(get_post($gd_page_id));
3474 3474
 
3475
-    if (get_the_content()) {
3476
-        ?>
3475
+	if (get_the_content()) {
3476
+		?>
3477 3477
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3478 3478
         <?php
3479
-    }
3479
+	}
3480 3480
 
3481
-    $post = $gd_post;
3482
-    if (!empty($gd_post) && is_object($gd_post)) {
3483
-        setup_postdata($gd_post);
3484
-    }
3481
+	$post = $gd_post;
3482
+	if (!empty($gd_post) && is_object($gd_post)) {
3483
+		setup_postdata($gd_post);
3484
+	}
3485 3485
 
3486 3486
 }
3487 3487
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3488 3488
\ No newline at end of file
Please login to merge, or discard this patch.