Test Failed
Push — master ( 01cd99...42481c )
by Stiofan
19:58
created
geodirectory_template_actions.php 1 patch
Indentation   +1841 added lines, -1841 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 = geodir_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 = geodir_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,94 +983,94 @@  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
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'));
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
-    }
988
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
1003 989
 
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
-        }
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'));
1010 992
 
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
-        /**
1047
-         * Filter if default images should show on the details page.
1048
-         *
1049
-         * @param bool $use_default_image Default false.
1050
-         * @since 1.6.16
1051
-         */
1052
-        $use_default_image = apply_filters('geodir_details_default_image_show', false);
1053
-        $post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1054
-        $slides = 0;
1055
-
1056
-        if (!empty($post_images)) {
1057
-            foreach ($post_images as $image) {
1058
-                if ($image->height >= 400) {
1059
-                    $spacer_height = 0;
1060
-                } else {
1061
-                    $spacer_height = ((400 - $image->height) / 2);
1062
-                }
1063
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1064
-                $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;" />';
1065
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1066
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1067
-                $slides++;
1068
-            }
1069
-        }// endfore
1070
-    }
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
+		/**
1047
+		 * Filter if default images should show on the details page.
1048
+		 *
1049
+		 * @param bool $use_default_image Default false.
1050
+		 * @since 1.6.16
1051
+		 */
1052
+		$use_default_image = apply_filters('geodir_details_default_image_show', false);
1053
+		$post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1054
+		$slides = 0;
1055
+
1056
+		if (!empty($post_images)) {
1057
+			foreach ($post_images as $image) {
1058
+				if ($image->height >= 400) {
1059
+					$spacer_height = 0;
1060
+				} else {
1061
+					$spacer_height = ((400 - $image->height) / 2);
1062
+				}
1063
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1064
+				$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;" />';
1065
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1066
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1067
+				$slides++;
1068
+			}
1069
+		}// endfore
1070
+	}
1071 1071
 
1072
-    if (!empty($post_images)) {
1073
-        ?>
1072
+	if (!empty($post_images)) {
1073
+		?>
1074 1074
         <div class="geodir_flex-container">
1075 1075
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1076 1076
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
             <?php } ?>
1084 1084
         </div>
1085 1085
     <?php
1086
-    }
1086
+	}
1087 1087
 }
1088 1088
 
1089 1089
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1098,177 +1098,177 @@  discard block
 block discarded – undo
1098 1098
  */
1099 1099
 function geodir_action_details_taxonomies()
1100 1100
 {
1101
-    global $preview, $post;?>
1101
+	global $preview, $post;?>
1102 1102
     <p class="geodir_post_taxomomies clearfix">
1103 1103
     <?php
1104
-    $taxonomies = array();
1105
-
1106
-    $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
1107
-
1108
-    if ($preview && !$is_backend_preview) {
1109
-        $post_type = $post->listing_type;
1110
-        $post_taxonomy = $post_type . 'category';
1111
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1112
-    } else {
1113
-        $post_type = $post->post_type;
1114
-        $post_taxonomy = $post_type . 'category';
1115
-    }
1104
+	$taxonomies = array();
1105
+
1106
+	$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
1107
+
1108
+	if ($preview && !$is_backend_preview) {
1109
+		$post_type = $post->listing_type;
1110
+		$post_taxonomy = $post_type . 'category';
1111
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1112
+	} else {
1113
+		$post_type = $post->post_type;
1114
+		$post_taxonomy = $post_type . 'category';
1115
+	}
1116 1116
 //{	
1117
-    $post_type_info = get_post_type_object($post_type);
1118
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1119
-
1120
-    if (!empty($post->post_tags)) {
1121
-
1122
-        if (taxonomy_exists($post_type . '_tags')):
1123
-            $links = array();
1124
-            $terms = array();
1125
-            // to limit post tags
1126
-            $post_tags = trim($post->post_tags, ",");
1127
-            $post_id = isset($post->ID) ? $post->ID : '';
1128
-            /**
1129
-             * Filter the post tags.
1130
-             *
1131
-             * Allows you to filter the post tags output on the details page of a post.
1132
-             *
1133
-             * @since 1.0.0
1134
-             * @param string $post_tags A comma seperated list of tags.
1135
-             * @param int $post_id The current post id.
1136
-             */
1137
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1138
-
1139
-            $post->post_tags = $post_tags;
1140
-            $post_tags = explode(",", trim($post->post_tags, ","));
1141
-
1142
-
1143
-            foreach ($post_tags as $post_term) {
1144
-
1145
-                // fix slug creation order for tags & location
1146
-                $post_term = trim($post_term);
1147
-
1148
-                $priority_location = false;
1149
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1150
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1151
-                } else {
1152
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1153
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1154
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1155
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1156
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1157
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1158
-                    if ($match_country || $match_region || $match_city) {
1159
-                        $priority_location = true;
1160
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1161
-                    } else {
1162
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1163
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1164
-                    }
1165
-                }
1166
-
1167
-                if (!is_wp_error($term) && is_object($term)) {
1168
-
1169
-                    // fix tag link on detail page
1170
-                    if ($priority_location) {
1171
-
1172
-                        $tag_link = "<a href=''>$post_term</a>";
1173
-                        /**
1174
-                         * Filter the tag name on the details page.
1175
-                         *
1176
-                         * @since 1.5.6
1177
-                         * @param string $tag_link The tag link html.
1178
-                         * @param object $term The tag term object.
1179
-                         */
1180
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1181
-                        $links[] = $tag_link;
1182
-                    } else {
1183
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1184
-                        /** This action is documented in geodirectory-template_actions.php */
1185
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1186
-                        $links[] = $tag_link;
1187
-                    }
1188
-                    $terms[] = $term;
1189
-                }
1190
-                //
1191
-            }
1192
-            if (!isset($listing_label)) {
1193
-                $listing_label = '';
1194
-            }
1195
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1196
-        endif;
1197
-
1198
-    }
1199
-
1200
-    if (!empty($post->{$post_taxonomy})) {
1201
-        $links = array();
1202
-        $terms = array();
1203
-        $termsOrdered = array();
1204
-        if (!is_array($post->{$post_taxonomy})) {
1205
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1206
-        } else {
1207
-            $post_term = $post->{$post_taxonomy};
1117
+	$post_type_info = get_post_type_object($post_type);
1118
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1119
+
1120
+	if (!empty($post->post_tags)) {
1121
+
1122
+		if (taxonomy_exists($post_type . '_tags')):
1123
+			$links = array();
1124
+			$terms = array();
1125
+			// to limit post tags
1126
+			$post_tags = trim($post->post_tags, ",");
1127
+			$post_id = isset($post->ID) ? $post->ID : '';
1128
+			/**
1129
+			 * Filter the post tags.
1130
+			 *
1131
+			 * Allows you to filter the post tags output on the details page of a post.
1132
+			 *
1133
+			 * @since 1.0.0
1134
+			 * @param string $post_tags A comma seperated list of tags.
1135
+			 * @param int $post_id The current post id.
1136
+			 */
1137
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1138
+
1139
+			$post->post_tags = $post_tags;
1140
+			$post_tags = explode(",", trim($post->post_tags, ","));
1141
+
1142
+
1143
+			foreach ($post_tags as $post_term) {
1144
+
1145
+				// fix slug creation order for tags & location
1146
+				$post_term = trim($post_term);
1147
+
1148
+				$priority_location = false;
1149
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1150
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1151
+				} else {
1152
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1153
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1154
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1155
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1156
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1157
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1158
+					if ($match_country || $match_region || $match_city) {
1159
+						$priority_location = true;
1160
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1161
+					} else {
1162
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1163
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1164
+					}
1165
+				}
1166
+
1167
+				if (!is_wp_error($term) && is_object($term)) {
1168
+
1169
+					// fix tag link on detail page
1170
+					if ($priority_location) {
1171
+
1172
+						$tag_link = "<a href=''>$post_term</a>";
1173
+						/**
1174
+						 * Filter the tag name on the details page.
1175
+						 *
1176
+						 * @since 1.5.6
1177
+						 * @param string $tag_link The tag link html.
1178
+						 * @param object $term The tag term object.
1179
+						 */
1180
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1181
+						$links[] = $tag_link;
1182
+					} else {
1183
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1184
+						/** This action is documented in geodirectory-template_actions.php */
1185
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1186
+						$links[] = $tag_link;
1187
+					}
1188
+					$terms[] = $term;
1189
+				}
1190
+				//
1191
+			}
1192
+			if (!isset($listing_label)) {
1193
+				$listing_label = '';
1194
+			}
1195
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1196
+		endif;
1197
+
1198
+	}
1199
+
1200
+	if (!empty($post->{$post_taxonomy})) {
1201
+		$links = array();
1202
+		$terms = array();
1203
+		$termsOrdered = array();
1204
+		if (!is_array($post->{$post_taxonomy})) {
1205
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1206
+		} else {
1207
+			$post_term = $post->{$post_taxonomy};
1208 1208
 			
1209 1209
 			if ($preview && !$is_backend_preview) {
1210 1210
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1211 1211
 			}
1212
-        }
1213
-
1214
-        $post_term = array_unique($post_term);
1215
-        if (!empty($post_term)) {
1216
-            foreach ($post_term as $post_term) {
1217
-                $post_term = trim($post_term);
1218
-
1219
-                if ($post_term != ''):
1220
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1221
-
1222
-                    if (is_object($term)) {
1223
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1224
-                        /**
1225
-                         * Filter the category name on the details page.
1226
-                         *
1227
-                         * @since 1.5.6
1228
-                         * @param string $term_link The link html to the category.
1229
-                         * @param object $term The category term object.
1230
-                         */
1231
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1232
-                        $links[] = $term_link;
1233
-                        $terms[] = $term;
1234
-                    }
1235
-                endif;
1236
-            }
1237
-            // order alphabetically
1238
-            asort($links);
1239
-            foreach (array_keys($links) as $key) {
1240
-                $termsOrdered[$key] = $terms[$key];
1241
-            }
1242
-            $terms = $termsOrdered;
1212
+		}
1213
+
1214
+		$post_term = array_unique($post_term);
1215
+		if (!empty($post_term)) {
1216
+			foreach ($post_term as $post_term) {
1217
+				$post_term = trim($post_term);
1218
+
1219
+				if ($post_term != ''):
1220
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1221
+
1222
+					if (is_object($term)) {
1223
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1224
+						/**
1225
+						 * Filter the category name on the details page.
1226
+						 *
1227
+						 * @since 1.5.6
1228
+						 * @param string $term_link The link html to the category.
1229
+						 * @param object $term The category term object.
1230
+						 */
1231
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1232
+						$links[] = $term_link;
1233
+						$terms[] = $term;
1234
+					}
1235
+				endif;
1236
+			}
1237
+			// order alphabetically
1238
+			asort($links);
1239
+			foreach (array_keys($links) as $key) {
1240
+				$termsOrdered[$key] = $terms[$key];
1241
+			}
1242
+			$terms = $termsOrdered;
1243 1243
 
1244
-        }
1244
+		}
1245 1245
 
1246
-        if (!isset($listing_label)) {
1247
-            $listing_label = '';
1248
-        }
1249
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1246
+		if (!isset($listing_label)) {
1247
+			$listing_label = '';
1248
+		}
1249
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1250 1250
 
1251
-    }
1251
+	}
1252 1252
 
1253
-    /**
1254
-     * Filter the taxonomies array before output.
1255
-     *
1256
-     * @since 1.5.9
1257
-     * @param array $taxonomies The array of cats and tags.
1258
-     * @param string $post_type The post type being output.
1259
-     * @param string $listing_label The post type label.
1260
-     * @param string $listing_label The post type label with ucwords function.
1261
-     */
1262
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1253
+	/**
1254
+	 * Filter the taxonomies array before output.
1255
+	 *
1256
+	 * @since 1.5.9
1257
+	 * @param array $taxonomies The array of cats and tags.
1258
+	 * @param string $post_type The post type being output.
1259
+	 * @param string $listing_label The post type label.
1260
+	 * @param string $listing_label The post type label with ucwords function.
1261
+	 */
1262
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1263 1263
 
1264
-    if (isset($taxonomies[$post_taxonomy])) {
1265
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266
-    }
1264
+	if (isset($taxonomies[$post_taxonomy])) {
1265
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266
+	}
1267 1267
 
1268
-    if (isset($taxonomies[$post_type . '_tags']))
1269
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1268
+	if (isset($taxonomies[$post_type . '_tags']))
1269
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1270 1270
 
1271
-    ?>
1271
+	?>
1272 1272
     </p><?php
1273 1273
 }
1274 1274
 
@@ -1290,144 +1290,144 @@  discard block
 block discarded – undo
1290 1290
 function geodir_action_details_micordata($post='')
1291 1291
 {
1292 1292
 
1293
-    global $preview;
1294
-    if(empty($post)){global $post;}
1295
-    if ($preview || !geodir_is_page('detail')) {
1296
-        return;
1297
-    }
1298
-
1299
-    // url
1300
-    $c_url = geodir_curPageURL();
1301
-
1302
-    // post reviews
1303
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1304
-    if (empty($post_reviews)) {
1305
-        $reviews = '';
1306
-    } else {
1307
-        foreach ($post_reviews as $review) {
1308
-
1309
-            if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1310
-                $reviews[] = array(
1311
-                    "@type" => "Review",
1312
-                    "author" => $review->comment_author,
1313
-                    "datePublished" => $review->comment_date,
1314
-                    "description" => $review->comment_content,
1315
-                    "reviewRating" => array(
1316
-                        "@type" => "Rating",
1317
-                        "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1318
-                        "ratingValue" => $rating_value,
1319
-                        "worstRating" => "1"
1320
-                    )
1321
-                );
1322
-            }
1323
-
1324
-        }
1325
-
1326
-    }
1327
-
1328
-    // post images
1329
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1330
-    if (empty($post_images)) {
1331
-        $images = '';
1332
-    } else {
1333
-        $i_arr = array();
1334
-        foreach ($post_images as $img) {
1335
-            $i_arr[] = $img->src;
1336
-        }
1337
-
1338
-        if (count($i_arr) == 1) {
1339
-            $images = $i_arr[0];
1340
-        } else {
1341
-            $images = $i_arr;
1342
-        }
1293
+	global $preview;
1294
+	if(empty($post)){global $post;}
1295
+	if ($preview || !geodir_is_page('detail')) {
1296
+		return;
1297
+	}
1298
+
1299
+	// url
1300
+	$c_url = geodir_curPageURL();
1301
+
1302
+	// post reviews
1303
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1304
+	if (empty($post_reviews)) {
1305
+		$reviews = '';
1306
+	} else {
1307
+		foreach ($post_reviews as $review) {
1308
+
1309
+			if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1310
+				$reviews[] = array(
1311
+					"@type" => "Review",
1312
+					"author" => $review->comment_author,
1313
+					"datePublished" => $review->comment_date,
1314
+					"description" => $review->comment_content,
1315
+					"reviewRating" => array(
1316
+						"@type" => "Rating",
1317
+						"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1318
+						"ratingValue" => $rating_value,
1319
+						"worstRating" => "1"
1320
+					)
1321
+				);
1322
+			}
1343 1323
 
1344
-    }
1345
-    //print_r($post);
1346
-    // external links
1347
-    $external_links =  array();
1348
-    $external_links[] = $post->geodir_website;
1349
-    $external_links[] = $post->geodir_twitter;
1350
-    $external_links[] = $post->geodir_facebook;
1351
-    $external_links = array_filter($external_links);
1352
-
1353
-    if(!empty($external_links)){
1354
-        $external_links = array_values($external_links);
1355
-    }
1356
-
1357
-    // reviews
1358
-    $comment_count = geodir_get_review_count_total($post->ID);
1359
-    $post_avgratings = geodir_get_post_rating($post->ID);
1360
-
1361
-    // schema type
1362
-    $schema_type = 'LocalBusiness';
1363
-    if(isset($post->default_category) && $post->default_category){
1364
-        $cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1365
-        if($cat_schema){$schema_type = $cat_schema;}
1366
-        if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1367
-    }
1368
-
1369
-    $schema = array();
1370
-    $schema['@context'] = "https://schema.org";
1371
-    $schema['@type'] = $schema_type;
1372
-    $schema['name'] = $post->post_title;
1373
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1374
-    $schema['telephone'] = $post->geodir_contact;
1375
-    $schema['url'] = $c_url;
1376
-    $schema['sameAs'] = $external_links;
1377
-    $schema['image'] = $images;
1378
-    $schema['address'] = array(
1379
-        "@type" => "PostalAddress",
1380
-        "streetAddress" => $post->post_address,
1381
-        "addressLocality" => $post->post_city,
1382
-        "addressRegion" => $post->post_region,
1383
-        "addressCountry" => $post->post_country,
1384
-        "postalCode" => $post->post_zip
1385
-    );
1386
-
1387
-    if($post->post_latitude && $post->post_longitude) {
1388
-        $schema['geo'] = array(
1389
-            "@type" => "GeoCoordinates",
1390
-            "latitude" => $post->post_latitude,
1391
-            "longitude" => $post->post_longitude
1392
-        );
1393
-    }
1394
-
1395
-    if($post_avgratings) {
1396
-        $schema['aggregateRating'] = array(
1397
-            "@type" => "AggregateRating",
1398
-            "ratingValue" => $post_avgratings,
1399
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1400
-            "worstRating" => "1",
1401
-            "ratingCount" => $comment_count
1402
-        );
1403
-    }
1404
-    $schema['review'] = $reviews;
1405
-
1406
-    /**
1407
-     * Allow the schema JSON-LD info to be filtered.
1408
-     *
1409
-     * @since 1.5.4
1410
-     * @since 1.5.7 Added $post variable.
1411
-     * @param array $schema The array of schema data to be filtered.
1412
-     * @param object $post The post object.
1413
-     */
1414
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1415
-
1416
-
1417
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1418
-
1419
-
1420
-    $uploads = wp_upload_dir();
1421
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1422
-
1423
-    /**
1424
-     * Show facebook open graph meta info
1425
-     *
1426
-     * @since 1.6.6
1427
-     * @param string $facebook_og The open graph html to be filtered.
1428
-     * @param object $post The post object.
1429
-     */
1430
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1324
+		}
1325
+
1326
+	}
1327
+
1328
+	// post images
1329
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1330
+	if (empty($post_images)) {
1331
+		$images = '';
1332
+	} else {
1333
+		$i_arr = array();
1334
+		foreach ($post_images as $img) {
1335
+			$i_arr[] = $img->src;
1336
+		}
1337
+
1338
+		if (count($i_arr) == 1) {
1339
+			$images = $i_arr[0];
1340
+		} else {
1341
+			$images = $i_arr;
1342
+		}
1343
+
1344
+	}
1345
+	//print_r($post);
1346
+	// external links
1347
+	$external_links =  array();
1348
+	$external_links[] = $post->geodir_website;
1349
+	$external_links[] = $post->geodir_twitter;
1350
+	$external_links[] = $post->geodir_facebook;
1351
+	$external_links = array_filter($external_links);
1352
+
1353
+	if(!empty($external_links)){
1354
+		$external_links = array_values($external_links);
1355
+	}
1356
+
1357
+	// reviews
1358
+	$comment_count = geodir_get_review_count_total($post->ID);
1359
+	$post_avgratings = geodir_get_post_rating($post->ID);
1360
+
1361
+	// schema type
1362
+	$schema_type = 'LocalBusiness';
1363
+	if(isset($post->default_category) && $post->default_category){
1364
+		$cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1365
+		if($cat_schema){$schema_type = $cat_schema;}
1366
+		if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1367
+	}
1368
+
1369
+	$schema = array();
1370
+	$schema['@context'] = "https://schema.org";
1371
+	$schema['@type'] = $schema_type;
1372
+	$schema['name'] = $post->post_title;
1373
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1374
+	$schema['telephone'] = $post->geodir_contact;
1375
+	$schema['url'] = $c_url;
1376
+	$schema['sameAs'] = $external_links;
1377
+	$schema['image'] = $images;
1378
+	$schema['address'] = array(
1379
+		"@type" => "PostalAddress",
1380
+		"streetAddress" => $post->post_address,
1381
+		"addressLocality" => $post->post_city,
1382
+		"addressRegion" => $post->post_region,
1383
+		"addressCountry" => $post->post_country,
1384
+		"postalCode" => $post->post_zip
1385
+	);
1386
+
1387
+	if($post->post_latitude && $post->post_longitude) {
1388
+		$schema['geo'] = array(
1389
+			"@type" => "GeoCoordinates",
1390
+			"latitude" => $post->post_latitude,
1391
+			"longitude" => $post->post_longitude
1392
+		);
1393
+	}
1394
+
1395
+	if($post_avgratings) {
1396
+		$schema['aggregateRating'] = array(
1397
+			"@type" => "AggregateRating",
1398
+			"ratingValue" => $post_avgratings,
1399
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1400
+			"worstRating" => "1",
1401
+			"ratingCount" => $comment_count
1402
+		);
1403
+	}
1404
+	$schema['review'] = $reviews;
1405
+
1406
+	/**
1407
+	 * Allow the schema JSON-LD info to be filtered.
1408
+	 *
1409
+	 * @since 1.5.4
1410
+	 * @since 1.5.7 Added $post variable.
1411
+	 * @param array $schema The array of schema data to be filtered.
1412
+	 * @param object $post The post object.
1413
+	 */
1414
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1415
+
1416
+
1417
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1418
+
1419
+
1420
+	$uploads = wp_upload_dir();
1421
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1422
+
1423
+	/**
1424
+	 * Show facebook open graph meta info
1425
+	 *
1426
+	 * @since 1.6.6
1427
+	 * @param string $facebook_og The open graph html to be filtered.
1428
+	 * @param object $post The post object.
1429
+	 */
1430
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1431 1431
 
1432 1432
 
1433 1433
 
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
  */
1448 1448
 function geodir_action_details_next_prev()
1449 1449
 {
1450
-    ?>
1450
+	?>
1451 1451
     <div class="geodir-pos_navigation clearfix">
1452 1452
     <div
1453 1453
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1465,15 +1465,15 @@  discard block
 block discarded – undo
1465 1465
  */
1466 1466
 function geodir_action_before_single_post()
1467 1467
 {
1468
-    global $post;
1469
-    /**
1470
-     * Called at the very start of the details page output, before the title section.
1471
-     *
1472
-     * @since 1.0.0
1473
-     * @param object $post The current post object.
1474
-     * @global WP_Post|null $post The current post, if available.
1475
-     */
1476
-    do_action('geodir_before_single_post', $post); // extra action	
1468
+	global $post;
1469
+	/**
1470
+	 * Called at the very start of the details page output, before the title section.
1471
+	 *
1472
+	 * @since 1.0.0
1473
+	 * @param object $post The current post object.
1474
+	 * @global WP_Post|null $post The current post, if available.
1475
+	 */
1476
+	do_action('geodir_before_single_post', $post); // extra action	
1477 1477
 }
1478 1478
 
1479 1479
 /**
@@ -1484,13 +1484,13 @@  discard block
 block discarded – undo
1484 1484
  */
1485 1485
 function geodir_action_after_single_post($post)
1486 1486
 {
1487
-    /**
1488
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1489
-     *
1490
-     * @since 1.0.0
1491
-     * @param object $post The current post object.
1492
-     */
1493
-    do_action('geodir_after_single_post', $post); // extra action	
1487
+	/**
1488
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1489
+	 *
1490
+	 * @since 1.0.0
1491
+	 * @param object $post The current post object.
1492
+	 */
1493
+	do_action('geodir_after_single_post', $post); // extra action	
1494 1494
 }
1495 1495
 
1496 1496
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1516,168 +1516,168 @@  discard block
 block discarded – undo
1516 1516
  */
1517 1517
 function geodir_action_listings_title()
1518 1518
 {
1519
-    global $wp, $term;
1520
-
1521
-    $gd_post_type = geodir_get_current_posttype();
1522
-    $post_type_info = get_post_type_object($gd_post_type);
1523
-
1524
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1525
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1526
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1527
-    }
1528
-
1529
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1530
-    $single_name = $post_type_info->labels->singular_name;
1531
-
1532
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1533
-
1534
-    $gd_country = get_query_var('gd_country');
1535
-    $gd_region = get_query_var('gd_region');
1536
-    $gd_city = get_query_var('gd_city');
1537
-
1538
-    if (!empty($term)) {
1539
-        $location_name = '';
1540
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1541
-            if ($gd_country != '') {
1542
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1543
-            }
1519
+	global $wp, $term;
1544 1520
 
1545
-            if ($gd_region != '') {
1546
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1547
-            }
1548
-
1549
-            if ($gd_city != '') {
1550
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1551
-            }
1552
-        }
1553
-
1554
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1555
-        if (!empty($current_term)) {
1556
-            $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1557
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1558
-                $location_last_char = substr($location_name, -1);
1559
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1560
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1561
-            } else {
1562
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1563
-            }
1564
-        } else {
1565
-            if (count($taxonomy) > 1) {
1566
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1567
-
1568
-                if (!empty($current_term)) {
1569
-                    $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1570
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1571
-                        $location_last_char = substr($location_name, -1);
1572
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1573
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1574
-                    } else {
1575
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1576
-                    }
1577
-                }
1578
-            }
1579
-        }
1580
-
1581
-    } else {
1582
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1583
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1584
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1521
+	$gd_post_type = geodir_get_current_posttype();
1522
+	$post_type_info = get_post_type_object($gd_post_type);
1585 1523
 
1586
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1524
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1525
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1526
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1527
+	}
1587 1528
 
1588
-        if (function_exists('get_actual_location_name')) {
1589
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1590
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1591
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1592
-        }
1529
+	$list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1530
+	$single_name = $post_type_info->labels->singular_name;
1593 1531
 
1594
-        if ($gd_city != '') {
1595
-            if ($gd_city_actual != '') {
1596
-                $gd_city = $gd_city_actual;
1597
-            } else {
1598
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1599
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1600
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1601
-            }
1532
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1602 1533
 
1603
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1604
-        } else if ($gd_region != '') {
1605
-            if ($gd_region_actual != '') {
1606
-                $gd_region = $gd_region_actual;
1607
-            } else {
1608
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1609
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1610
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1611
-            }
1612
-
1613
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1614
-        } else if ($gd_country != '') {
1615
-            if ($gd_country_actual != '') {
1616
-                $gd_country = $gd_country_actual;
1617
-            } else {
1618
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1619
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1620
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1621
-            }
1534
+	$gd_country = get_query_var('gd_country');
1535
+	$gd_region = get_query_var('gd_region');
1536
+	$gd_city = get_query_var('gd_city');
1622 1537
 
1623
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1624
-        }
1625
-    }
1626
-
1627
-    if (is_search()) {
1628
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1629
-    }
1630
-    /** This action is documented in geodirectory_template_actions.php */
1631
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1632
-    /** This action is documented in geodirectory_template_actions.php */
1633
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1634
-
1635
-
1636
-    $title = $list_title;
1637
-    $gd_page = '';
1638
-    if(geodir_is_page('pt')){
1639
-        $gd_page = 'pt';
1640
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1641
-    }
1642
-    elseif(geodir_is_page('listing')){
1643
-        $gd_page = 'listing';
1644
-        global $wp_query;
1645
-        $current_term = $wp_query->get_queried_object();
1646
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1647
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1648
-        }else{
1649
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1650
-        }
1538
+	if (!empty($term)) {
1539
+		$location_name = '';
1540
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1541
+			if ($gd_country != '') {
1542
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1543
+			}
1651 1544
 
1652
-    }
1653
-    elseif(geodir_is_page('author')){
1654
-        $gd_page = 'author';
1655
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1656
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1657
-        }else{
1658
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1659
-        }
1545
+			if ($gd_region != '') {
1546
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1547
+			}
1660 1548
 
1661
-    }
1549
+			if ($gd_city != '') {
1550
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1551
+			}
1552
+		}
1553
+
1554
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1555
+		if (!empty($current_term)) {
1556
+			$current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1557
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1558
+				$location_last_char = substr($location_name, -1);
1559
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1560
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1561
+			} else {
1562
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1563
+			}
1564
+		} else {
1565
+			if (count($taxonomy) > 1) {
1566
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1567
+
1568
+				if (!empty($current_term)) {
1569
+					$current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1570
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1571
+						$location_last_char = substr($location_name, -1);
1572
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1573
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1574
+					} else {
1575
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1576
+					}
1577
+				}
1578
+			}
1579
+		}
1580
+
1581
+	} else {
1582
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1583
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1584
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1585
+
1586
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1587
+
1588
+		if (function_exists('get_actual_location_name')) {
1589
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1590
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1591
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1592
+		}
1593
+
1594
+		if ($gd_city != '') {
1595
+			if ($gd_city_actual != '') {
1596
+				$gd_city = $gd_city_actual;
1597
+			} else {
1598
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1599
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1600
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1601
+			}
1662 1602
 
1603
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1604
+		} else if ($gd_region != '') {
1605
+			if ($gd_region_actual != '') {
1606
+				$gd_region = $gd_region_actual;
1607
+			} else {
1608
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1609
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1610
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1611
+			}
1663 1612
 
1664
-    /**
1665
-     * Filter page title to replace variables.
1666
-     *
1667
-     * @since 1.5.4
1668
-     * @param string $title The page title including variables.
1669
-     * @param string $gd_page The GeoDirectory page type if any.
1670
-     */
1671
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1613
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1614
+		} else if ($gd_country != '') {
1615
+			if ($gd_country_actual != '') {
1616
+				$gd_country = $gd_country_actual;
1617
+			} else {
1618
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1619
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1620
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1621
+			}
1672 1622
 
1673
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1674
-        /**
1675
-         * Filter the listing page title.
1676
-         *
1677
-         * @since 1.0.0
1678
-         * @param string $list_title The title for the category page.
1679
-         */
1680
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1623
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1624
+		}
1625
+	}
1626
+
1627
+	if (is_search()) {
1628
+		$list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1629
+	}
1630
+	/** This action is documented in geodirectory_template_actions.php */
1631
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1632
+	/** This action is documented in geodirectory_template_actions.php */
1633
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1634
+
1635
+
1636
+	$title = $list_title;
1637
+	$gd_page = '';
1638
+	if(geodir_is_page('pt')){
1639
+		$gd_page = 'pt';
1640
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1641
+	}
1642
+	elseif(geodir_is_page('listing')){
1643
+		$gd_page = 'listing';
1644
+		global $wp_query;
1645
+		$current_term = $wp_query->get_queried_object();
1646
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1647
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1648
+		}else{
1649
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1650
+		}
1651
+
1652
+	}
1653
+	elseif(geodir_is_page('author')){
1654
+		$gd_page = 'author';
1655
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1656
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1657
+		}else{
1658
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1659
+		}
1660
+
1661
+	}
1662
+
1663
+
1664
+	/**
1665
+	 * Filter page title to replace variables.
1666
+	 *
1667
+	 * @since 1.5.4
1668
+	 * @param string $title The page title including variables.
1669
+	 * @param string $gd_page The GeoDirectory page type if any.
1670
+	 */
1671
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1672
+
1673
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1674
+		/**
1675
+		 * Filter the listing page title.
1676
+		 *
1677
+		 * @since 1.0.0
1678
+		 * @param string $list_title The title for the category page.
1679
+		 */
1680
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1681 1681
 }
1682 1682
 
1683 1683
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1690,46 +1690,46 @@  discard block
 block discarded – undo
1690 1690
  */
1691 1691
 function geodir_action_listings_description()
1692 1692
 {
1693
-    global $wp_query;
1694
-    $current_term = $wp_query->get_queried_object();
1693
+	global $wp_query;
1694
+	$current_term = $wp_query->get_queried_object();
1695 1695
 
1696
-    $gd_post_type = geodir_get_current_posttype();
1697
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1696
+	$gd_post_type = geodir_get_current_posttype();
1697
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1698 1698
 
1699
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1700
-        $saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1701
-        if ($term_desc && !$saved_data) {
1702
-            $saved_data = $term_desc;
1703
-        }
1699
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1700
+		$saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1701
+		if ($term_desc && !$saved_data) {
1702
+			$saved_data = $term_desc;
1703
+		}
1704 1704
 
1705
-        // stop payment manager filtering content length
1706
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1707
-        if ( false !== $filter_priority ) {
1708
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1709
-        }
1705
+		// stop payment manager filtering content length
1706
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1707
+		if ( false !== $filter_priority ) {
1708
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1709
+		}
1710 1710
 
1711
-        /**
1712
-         * Apply the core filter `the_content` filter to the variable string.
1713
-         *
1714
-         * This is a WordPress core filter that does many things.
1715
-         *
1716
-         * @since 1.0.0
1717
-         * @param string $var The string to apply the filter to.
1718
-         */
1719
-        $cat_description = apply_filters('the_content', $saved_data);
1711
+		/**
1712
+		 * Apply the core filter `the_content` filter to the variable string.
1713
+		 *
1714
+		 * This is a WordPress core filter that does many things.
1715
+		 *
1716
+		 * @since 1.0.0
1717
+		 * @param string $var The string to apply the filter to.
1718
+		 */
1719
+		$cat_description = apply_filters('the_content', $saved_data);
1720 1720
 
1721 1721
 
1722
-        if ( false !== $filter_priority ) {
1723
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1724
-        }
1722
+		if ( false !== $filter_priority ) {
1723
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1724
+		}
1725 1725
 
1726
-        if ($cat_description) {
1727
-            ?>
1726
+		if ($cat_description) {
1727
+			?>
1728 1728
 
1729 1729
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1730
-        }
1730
+		}
1731 1731
 
1732
-    }
1732
+	}
1733 1733
 }
1734 1734
 
1735 1735
 // action for adding the listings page top widget area
@@ -1748,11 +1748,11 @@  discard block
 block discarded – undo
1748 1748
  */
1749 1749
 function geodir_action_geodir_sidebar_listings_top()
1750 1750
 {
1751
-    if (get_option('geodir_show_listing_top_section')) { ?>
1751
+	if (get_option('geodir_show_listing_top_section')) { ?>
1752 1752
         <div
1753 1753
             class="<?php
1754
-            /** This action is documented in geodirectory_template_actions.php */
1755
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1754
+			/** This action is documented in geodirectory_template_actions.php */
1755
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1756 1756
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1757 1757
         </div><!-- clearfix ends here-->
1758 1758
     <?php }
@@ -1775,35 +1775,35 @@  discard block
 block discarded – undo
1775 1775
  */
1776 1776
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1777 1777
 {
1778
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1779
-        $width_css = 'style="width:' . $width . '%;"';
1780
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1781
-        $width_css = 'style="width:' . $width . '%;"';
1782
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1783
-        $width_css = 'style="width:' . $width . '%;"';
1784
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1785
-        $width_css = 'style="width:' . $width . '%;"';
1786
-    } else {
1787
-        $width_css = '';
1788
-    }
1789
-
1790
-    $tc = get_option('theme_compatibility_setting');
1791
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1792
-        $text = $tc['geodir_sidebar_left_open_replace'];
1793
-    } else {
1794
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1795
-    }
1796
-
1797
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1798
-        $id = $tc['geodir_sidebar_left_open_id'];
1799
-    }
1800
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1801
-        $class = $tc['geodir_sidebar_left_open_class'];
1802
-    }
1803
-
1804
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1805
-
1806
-    echo $text;
1778
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1779
+		$width_css = 'style="width:' . $width . '%;"';
1780
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1781
+		$width_css = 'style="width:' . $width . '%;"';
1782
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1783
+		$width_css = 'style="width:' . $width . '%;"';
1784
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1785
+		$width_css = 'style="width:' . $width . '%;"';
1786
+	} else {
1787
+		$width_css = '';
1788
+	}
1789
+
1790
+	$tc = get_option('theme_compatibility_setting');
1791
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1792
+		$text = $tc['geodir_sidebar_left_open_replace'];
1793
+	} else {
1794
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1795
+	}
1796
+
1797
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1798
+		$id = $tc['geodir_sidebar_left_open_id'];
1799
+	}
1800
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1801
+		$class = $tc['geodir_sidebar_left_open_class'];
1802
+	}
1803
+
1804
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1805
+
1806
+	echo $text;
1807 1807
 }
1808 1808
 
1809 1809
 // action for adding the primary div closing tag
@@ -1819,13 +1819,13 @@  discard block
 block discarded – undo
1819 1819
  */
1820 1820
 function geodir_action_sidebar_left_close($type = '')
1821 1821
 {
1822
-    $tc = get_option('theme_compatibility_setting');
1823
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1824
-        $text = $tc['geodir_sidebar_left_close_replace'];
1825
-    } else {
1826
-        $text = '</aside><!-- sidebar ends here-->';
1827
-    }
1828
-    echo $text;
1822
+	$tc = get_option('theme_compatibility_setting');
1823
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1824
+		$text = $tc['geodir_sidebar_left_close_replace'];
1825
+	} else {
1826
+		$text = '</aside><!-- sidebar ends here-->';
1827
+	}
1828
+	echo $text;
1829 1829
 }
1830 1830
 
1831 1831
 /**
@@ -1838,7 +1838,7 @@  discard block
 block discarded – undo
1838 1838
  */
1839 1839
 function geodir_listing_left_section()
1840 1840
 {
1841
-    if (get_option('geodir_show_listing_left_section')) { ?>
1841
+	if (get_option('geodir_show_listing_left_section')) { ?>
1842 1842
         <div class="geodir-content-left geodir-sidebar-wrap">
1843 1843
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1844 1844
         </div><!-- end geodir-content-left -->
@@ -1856,20 +1856,20 @@  discard block
 block discarded – undo
1856 1856
  */
1857 1857
 function geodir_action_listings_sidebar_left()
1858 1858
 {
1859
-    if (get_option('geodir_show_listing_left_section')) {
1860
-        /** This action is documented in geodirectory_template_actions.php */
1861
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1862
-        /**
1863
-         * Calls the listings page (category) left sidebar content.
1864
-         *
1865
-         * All the content for the listings page left sidebar is added via this hook.
1866
-         *
1867
-         * @since 1.0.0
1868
-         */
1869
-        do_action('geodir_listings_sidebar_left_inside');
1870
-        /** This action is documented in geodirectory_template_actions.php */
1871
-        do_action('geodir_sidebar_left_close', 'listings-page');
1872
-    }
1859
+	if (get_option('geodir_show_listing_left_section')) {
1860
+		/** This action is documented in geodirectory_template_actions.php */
1861
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1862
+		/**
1863
+		 * Calls the listings page (category) left sidebar content.
1864
+		 *
1865
+		 * All the content for the listings page left sidebar is added via this hook.
1866
+		 *
1867
+		 * @since 1.0.0
1868
+		 */
1869
+		do_action('geodir_listings_sidebar_left_inside');
1870
+		/** This action is documented in geodirectory_template_actions.php */
1871
+		do_action('geodir_sidebar_left_close', 'listings-page');
1872
+	}
1873 1873
 }
1874 1874
 
1875 1875
 /**
@@ -1882,7 +1882,7 @@  discard block
 block discarded – undo
1882 1882
  */
1883 1883
 function geodir_listing_right_section()
1884 1884
 {
1885
-    if (get_option('geodir_show_listing_right_section')) { ?>
1885
+	if (get_option('geodir_show_listing_right_section')) { ?>
1886 1886
         <div class="geodir-content-right geodir-sidebar-wrap">
1887 1887
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1888 1888
         </div><!-- end geodir-content-right -->
@@ -1900,20 +1900,20 @@  discard block
 block discarded – undo
1900 1900
  */
1901 1901
 function geodir_action_listings_sidebar_right()
1902 1902
 {
1903
-    if (get_option('geodir_show_listing_right_section')) {
1904
-        /** This action is documented in geodirectory_template_actions.php */
1905
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1906
-        /**
1907
-         * Calls the listings page (category) right sidebar content.
1908
-         *
1909
-         * All the content for the listings page right sidebar is added via this hook.
1910
-         *
1911
-         * @since 1.0.0
1912
-         */
1913
-        do_action('geodir_listings_sidebar_right_inside');
1914
-        /** This action is documented in geodirectory_template_actions.php */
1915
-        do_action('geodir_sidebar_right_close', 'listings-page');
1916
-    }
1903
+	if (get_option('geodir_show_listing_right_section')) {
1904
+		/** This action is documented in geodirectory_template_actions.php */
1905
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1906
+		/**
1907
+		 * Calls the listings page (category) right sidebar content.
1908
+		 *
1909
+		 * All the content for the listings page right sidebar is added via this hook.
1910
+		 *
1911
+		 * @since 1.0.0
1912
+		 */
1913
+		do_action('geodir_listings_sidebar_right_inside');
1914
+		/** This action is documented in geodirectory_template_actions.php */
1915
+		do_action('geodir_sidebar_right_close', 'listings-page');
1916
+	}
1917 1917
 }
1918 1918
 
1919 1919
 
@@ -1930,23 +1930,23 @@  discard block
 block discarded – undo
1930 1930
  */
1931 1931
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1932 1932
 {
1933
-    $tc = get_option('theme_compatibility_setting');
1934
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1935
-        $text = $tc['geodir_main_content_open_replace'];
1936
-    } else {
1937
-        $text = '<main id="[id]" class="[class]" role="main">';
1938
-    }
1933
+	$tc = get_option('theme_compatibility_setting');
1934
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1935
+		$text = $tc['geodir_main_content_open_replace'];
1936
+	} else {
1937
+		$text = '<main id="[id]" class="[class]" role="main">';
1938
+	}
1939 1939
 
1940
-    if (!empty($tc['geodir_main_content_open_id'])) {
1941
-        $id = $tc['geodir_main_content_open_id'];
1942
-    }
1943
-    if (!empty($tc['geodir_main_content_open_class'])) {
1944
-        $class = $tc['geodir_main_content_open_class'];
1945
-    }
1940
+	if (!empty($tc['geodir_main_content_open_id'])) {
1941
+		$id = $tc['geodir_main_content_open_id'];
1942
+	}
1943
+	if (!empty($tc['geodir_main_content_open_class'])) {
1944
+		$class = $tc['geodir_main_content_open_class'];
1945
+	}
1946 1946
 
1947
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1947
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1948 1948
 
1949
-    echo $text;
1949
+	echo $text;
1950 1950
 }
1951 1951
 
1952 1952
 // action for adding the primary div closing tag
@@ -1959,13 +1959,13 @@  discard block
 block discarded – undo
1959 1959
  */
1960 1960
 function geodir_action_main_content_close()
1961 1961
 {
1962
-    $tc = get_option('theme_compatibility_setting');
1963
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1964
-        $text = $tc['geodir_main_content_close_replace'];
1965
-    } else {
1966
-        $text = '</main><!-- main ends here-->';
1967
-    }
1968
-    echo $text;
1962
+	$tc = get_option('theme_compatibility_setting');
1963
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1964
+		$text = $tc['geodir_main_content_close_replace'];
1965
+	} else {
1966
+		$text = '</main><!-- main ends here-->';
1967
+	}
1968
+	echo $text;
1969 1969
 }
1970 1970
 
1971 1971
 /**
@@ -1977,14 +1977,14 @@  discard block
 block discarded – undo
1977 1977
  */
1978 1978
 function geodir_action_listings_content_inside()
1979 1979
 {
1980
-    global $gridview_columns;
1981
-    $listing_view = get_option('geodir_listing_view');
1982
-    if (strstr($listing_view, 'gridview')) {
1983
-        $gridview_columns = $listing_view;
1984
-        $listing_view_exp = explode('_', $listing_view);
1985
-        $listing_view = $listing_view_exp[0];
1986
-    }
1987
-    geodir_get_template_part('listing', 'listview');
1980
+	global $gridview_columns;
1981
+	$listing_view = get_option('geodir_listing_view');
1982
+	if (strstr($listing_view, 'gridview')) {
1983
+		$gridview_columns = $listing_view;
1984
+		$listing_view_exp = explode('_', $listing_view);
1985
+		$listing_view = $listing_view_exp[0];
1986
+	}
1987
+	geodir_get_template_part('listing', 'listview');
1988 1988
 }
1989 1989
 
1990 1990
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -2000,47 +2000,47 @@  discard block
 block discarded – undo
2000 2000
  */
2001 2001
 function geodir_action_listings_content()
2002 2002
 {
2003
-    /**
2004
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2005
-     *
2006
-     * @since 1.0.0
2007
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2008
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
2009
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2010
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2011
-     */
2012
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2013
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2014
-    echo '<div class="clearfix '.$extra_class.'">';
2015
-    /**
2016
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2017
-     *
2018
-     * @since 1.0.0
2019
-     */
2020
-    do_action('geodir_before_listing');
2021
-    echo '</div>';
2022
-
2023
-    /**
2024
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2025
-     *
2026
-     * @since 1.0.0
2027
-     */
2028
-    do_action('geodir_listings_content_inside');
2029
-
2030
-    /**
2031
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2032
-     *
2033
-     * @since 1.0.0
2034
-     */
2035
-    do_action('geodir_after_listing');
2036
-
2037
-    /**
2038
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2039
-     *
2040
-     * @since 1.0.0
2041
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2042
-     */
2043
-    do_action('geodir_main_content_close', 'listings-page');
2003
+	/**
2004
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2005
+	 *
2006
+	 * @since 1.0.0
2007
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2008
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
2009
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2010
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2011
+	 */
2012
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2013
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2014
+	echo '<div class="clearfix '.$extra_class.'">';
2015
+	/**
2016
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2017
+	 *
2018
+	 * @since 1.0.0
2019
+	 */
2020
+	do_action('geodir_before_listing');
2021
+	echo '</div>';
2022
+
2023
+	/**
2024
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2025
+	 *
2026
+	 * @since 1.0.0
2027
+	 */
2028
+	do_action('geodir_listings_content_inside');
2029
+
2030
+	/**
2031
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2032
+	 *
2033
+	 * @since 1.0.0
2034
+	 */
2035
+	do_action('geodir_after_listing');
2036
+
2037
+	/**
2038
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2039
+	 *
2040
+	 * @since 1.0.0
2041
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2042
+	 */
2043
+	do_action('geodir_main_content_close', 'listings-page');
2044 2044
 }
2045 2045
 
2046 2046
 
@@ -2055,10 +2055,10 @@  discard block
 block discarded – undo
2055 2055
  */
2056 2056
 function geodir_action_sidebar_listings_bottom_section()
2057 2057
 {
2058
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2058
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2059 2059
         <div class="<?php
2060
-            /** This action is documented in geodirectory_template_actions.php */
2061
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2060
+			/** This action is documented in geodirectory_template_actions.php */
2061
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2062 2062
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2063 2063
         </div><!-- clearfix ends here-->
2064 2064
     <?php }
@@ -2078,38 +2078,38 @@  discard block
 block discarded – undo
2078 2078
  */
2079 2079
 function geodir_action_add_listing_page_title()
2080 2080
 {
2081
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2082
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2083
-    /** This action is documented in geodirectory_template_actions.php */
2084
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2085
-    /** This action is documented in geodirectory_template_actions.php */
2086
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2087
-
2088
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2089
-
2090
-    if(geodir_is_page('add-listing')){
2091
-        $gd_page = 'add-listing';
2092
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2093
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2094
-        }elseif(isset($listing_type)){
2095
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2096
-        }
2081
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2082
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2083
+	/** This action is documented in geodirectory_template_actions.php */
2084
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2085
+	/** This action is documented in geodirectory_template_actions.php */
2086
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2087
+
2088
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2089
+
2090
+	if(geodir_is_page('add-listing')){
2091
+		$gd_page = 'add-listing';
2092
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2093
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2094
+		}elseif(isset($listing_type)){
2095
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2096
+		}
2097 2097
 
2098
-    }
2098
+	}
2099 2099
 
2100 2100
 
2101
-    /**
2102
-     * Filter page title to replace variables.
2103
-     *
2104
-     * @since 1.5.4
2105
-     * @param string $title The page title including variables.
2106
-     * @param string $gd_page The GeoDirectory page type if any.
2107
-     */
2108
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2101
+	/**
2102
+	 * Filter page title to replace variables.
2103
+	 *
2104
+	 * @since 1.5.4
2105
+	 * @param string $title The page title including variables.
2106
+	 * @param string $gd_page The GeoDirectory page type if any.
2107
+	 */
2108
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2109 2109
 
2110
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2111
-    echo $title;
2112
-    echo '</h1></header>';
2110
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2111
+	echo $title;
2112
+	echo '</h1></header>';
2113 2113
 }
2114 2114
 
2115 2115
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2140,61 +2140,61 @@  discard block
 block discarded – undo
2140 2140
  */
2141 2141
 function geodir_action_add_listing_form()
2142 2142
 {
2143
-    global $cat_display, $post_cat, $current_user, $gd_session;
2144
-    $page_id = get_the_ID();
2145
-    $post = '';
2146
-    $title = '';
2147
-    $desc = '';
2148
-    $kw_tags = '';
2149
-    $required_msg = '';
2150
-    $submit_button = '';
2151
-
2152
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2153
-
2154
-    $thumb_img_arr = array();
2155
-    $curImages = '';
2156
-
2157
-    if (isset($_REQUEST['backandedit'])) {
2158
-        global $post;
2159
-        $post = (object)$gd_session->get('listing');
2160
-        $listing_type = $post->listing_type;
2161
-        $title = $post->post_title;
2162
-        $desc = $post->post_desc;
2163
-        $post_cat = isset($post->post_category) ? $post->post_category : '';
2164
-
2165
-        $kw_tags = $post->post_tags;
2166
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2167
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2168
-        global $post, $post_images;
2169
-
2170
-        $post = geodir_get_post_info($_REQUEST['pid']);
2171
-        $thumb_img_arr = geodir_get_images($post->ID);
2172
-        if ($thumb_img_arr) {
2173
-            foreach ($thumb_img_arr as $post_img) {
2174
-                $curImages .= $post_img->src . ',';
2175
-            }
2176
-        }
2143
+	global $cat_display, $post_cat, $current_user, $gd_session;
2144
+	$page_id = get_the_ID();
2145
+	$post = '';
2146
+	$title = '';
2147
+	$desc = '';
2148
+	$kw_tags = '';
2149
+	$required_msg = '';
2150
+	$submit_button = '';
2151
+
2152
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2153
+
2154
+	$thumb_img_arr = array();
2155
+	$curImages = '';
2156
+
2157
+	if (isset($_REQUEST['backandedit'])) {
2158
+		global $post;
2159
+		$post = (object)$gd_session->get('listing');
2160
+		$listing_type = $post->listing_type;
2161
+		$title = $post->post_title;
2162
+		$desc = $post->post_desc;
2163
+		$post_cat = isset($post->post_category) ? $post->post_category : '';
2164
+
2165
+		$kw_tags = $post->post_tags;
2166
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2167
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2168
+		global $post, $post_images;
2169
+
2170
+		$post = geodir_get_post_info($_REQUEST['pid']);
2171
+		$thumb_img_arr = geodir_get_images($post->ID);
2172
+		if ($thumb_img_arr) {
2173
+			foreach ($thumb_img_arr as $post_img) {
2174
+				$curImages .= $post_img->src . ',';
2175
+			}
2176
+		}
2177 2177
 
2178
-        $listing_type = $post->post_type;
2179
-        $title = $post->post_title;
2180
-        $desc = $post->post_content;
2181
-        $kw_tags = $post->post_tags;
2182
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2183
-    } else {
2184
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2185
-    }
2178
+		$listing_type = $post->post_type;
2179
+		$title = $post->post_title;
2180
+		$desc = $post->post_content;
2181
+		$kw_tags = $post->post_tags;
2182
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2183
+	} else {
2184
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2185
+	}
2186 2186
 
2187
-    if ($current_user->ID != '0') {
2188
-        $user_login = true;
2189
-    }
2187
+	if ($current_user->ID != '0') {
2188
+		$user_login = true;
2189
+	}
2190 2190
 
2191
-    $post_type_info = geodir_get_posttype_info($listing_type);
2191
+	$post_type_info = geodir_get_posttype_info($listing_type);
2192 2192
 
2193
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2193
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2194 2194
     
2195
-    $package_info = array();
2196
-    $package_info = geodir_post_package_info($package_info, $post);
2197
-    ?>
2195
+	$package_info = array();
2196
+	$package_info = geodir_post_package_info($package_info, $post);
2197
+	?>
2198 2198
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2199 2199
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2200 2200
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2205,114 +2205,114 @@  discard block
 block discarded – undo
2205 2205
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2206 2206
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2207 2207
         <?php
2208
-        } 
2209
-        /**
2210
-         * Called at the very top of the add listing page form for frontend.
2211
-         *
2212
-         * This is called just before the "Enter Listing Details" text.
2213
-         *
2214
-         * @since 1.0.0
2215
-         */
2216
-        do_action('geodir_before_detail_fields');
2217
-        ?>
2208
+		} 
2209
+		/**
2210
+		 * Called at the very top of the add listing page form for frontend.
2211
+		 *
2212
+		 * This is called just before the "Enter Listing Details" text.
2213
+		 *
2214
+		 * @since 1.0.0
2215
+		 */
2216
+		do_action('geodir_before_detail_fields');
2217
+		?>
2218 2218
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2219 2219
         <?php
2220
-        /**
2221
-         * Called at the top of the add listing page form for frontend.
2222
-         *
2223
-         * This is called after the "Enter Listing Details" text.
2224
-         *
2225
-         * @since 1.0.0
2226
-         */
2227
-        do_action('geodir_before_main_form_fields');
2228
-        ?>
2220
+		/**
2221
+		 * Called at the top of the add listing page form for frontend.
2222
+		 *
2223
+		 * This is called after the "Enter Listing Details" text.
2224
+		 *
2225
+		 * @since 1.0.0
2226
+		 */
2227
+		do_action('geodir_before_main_form_fields');
2228
+		?>
2229 2229
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2230 2230
             <label><?php
2231
-                /**
2232
-                 * Filter the add listing page title input label.
2233
-                 *
2234
-                 * @since 1.6.11
2235
-                 * @param string $title The title to be output.
2236
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2237
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2238
-                 */
2239
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2231
+				/**
2232
+				 * Filter the add listing page title input label.
2233
+				 *
2234
+				 * @since 1.6.11
2235
+				 * @param string $title The title to be output.
2236
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2237
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2238
+				 */
2239
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2240 2240
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2241 2241
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2242 2242
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2243 2243
         </div>
2244 2244
         <?php
2245
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2246
-        $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2247
-        /**
2248
-         * Filter whether to show or don't show the editor.
2249
-         *
2250
-         * @since 1.6.16
2251
-         * @param bool $show_editor If true the editor will be available for description field.
2252
-         * @param object $package_info The listing package.
2253
-         * @param string $listing_type The current post type.
2254
-         * @param object $post The current post object.
2255
-         */
2256
-        $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2257
-
2258
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2259
-        $desc_limit = '';
2260
-        /**
2261
-         * Filter the add listing description field character limit number.
2262
-         *
2263
-         * @since 1.0.0
2264
-         * @param int $desc_limit The amount of characters to limit the description to.
2265
-         */
2266
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2267
-        /**
2268
-         * Filter the add listing description field text.
2269
-         *
2270
-         * @since 1.0.0
2271
-         * @param string $desc The text for the description field.
2272
-         * @param int $desc_limit The character limit number if any.
2273
-         */
2274
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2275
-        $desc_limit_msg = '';
2276
-        /**
2277
-         * Filter the add listing description limit message.
2278
-         *
2279
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2280
-         *
2281
-         * @since 1.0.0
2282
-         * @param string $desc_limit_msg The limit message string if any.
2283
-         * @param int $desc_limit The character limit numer if any.
2284
-         */
2285
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2245
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2246
+		$show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2247
+		/**
2248
+		 * Filter whether to show or don't show the editor.
2249
+		 *
2250
+		 * @since 1.6.16
2251
+		 * @param bool $show_editor If true the editor will be available for description field.
2252
+		 * @param object $package_info The listing package.
2253
+		 * @param string $listing_type The current post type.
2254
+		 * @param object $post The current post object.
2255
+		 */
2256
+		$show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2257
+
2258
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2259
+		$desc_limit = '';
2260
+		/**
2261
+		 * Filter the add listing description field character limit number.
2262
+		 *
2263
+		 * @since 1.0.0
2264
+		 * @param int $desc_limit The amount of characters to limit the description to.
2265
+		 */
2266
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2267
+		/**
2268
+		 * Filter the add listing description field text.
2269
+		 *
2270
+		 * @since 1.0.0
2271
+		 * @param string $desc The text for the description field.
2272
+		 * @param int $desc_limit The character limit number if any.
2273
+		 */
2274
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2275
+		$desc_limit_msg = '';
2276
+		/**
2277
+		 * Filter the add listing description limit message.
2278
+		 *
2279
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2280
+		 *
2281
+		 * @since 1.0.0
2282
+		 * @param string $desc_limit_msg The limit message string if any.
2283
+		 * @param int $desc_limit The character limit numer if any.
2284
+		 */
2285
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2286 2286
         
2287
-        $desc_class = '';
2288
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2289
-            /**
2290
-             * Called on the add listing page form for frontend just before the description field.
2291
-             *
2292
-             * @since 1.0.0
2293
-             */
2294
-            do_action('geodir_before_description_field');
2287
+		$desc_class = '';
2288
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2289
+			/**
2290
+			 * Called on the add listing page form for frontend just before the description field.
2291
+			 *
2292
+			 * @since 1.0.0
2293
+			 */
2294
+			do_action('geodir_before_description_field');
2295 2295
             
2296
-            $desc_class = ' required_field';
2297
-        } else {
2298
-            $desc_class = ' hidden';
2299
-        }
2300
-        ?>
2296
+			$desc_class = ' required_field';
2297
+		} else {
2298
+			$desc_class = ' hidden';
2299
+		}
2300
+		?>
2301 2301
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2302 2302
             <label><?php
2303
-                /**
2304
-                 * Filter the add listing page description input label.
2305
-                 *
2306
-                 * @since 1.6.11
2307
-                 * @param string $title The title to be output.
2308
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2309
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2310
-                 */
2311
-                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>
2303
+				/**
2304
+				 * Filter the add listing page description input label.
2305
+				 *
2306
+				 * @since 1.6.11
2307
+				 * @param string $title The title to be output.
2308
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2309
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2310
+				 */
2311
+				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>
2312 2312
             <?php
2313
-            if ($show_editor) {
2314
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2315
-            ?>
2313
+			if ($show_editor) {
2314
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2315
+			?>
2316 2316
                 <div class="editor" field_id="post_desc" field_type="editor">
2317 2317
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2318 2318
                 </div>
@@ -2326,56 +2326,56 @@  discard block
 block discarded – undo
2326 2326
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2327 2327
         </div>
2328 2328
         <?php
2329
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2330
-            /**
2331
-             * Called on the add listing page form for frontend just after the description field.
2332
-             *
2333
-             * @since 1.0.0
2334
-             */
2335
-            do_action('geodir_after_description_field');
2336
-        }
2329
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2330
+			/**
2331
+			 * Called on the add listing page form for frontend just after the description field.
2332
+			 *
2333
+			 * @since 1.0.0
2334
+			 */
2335
+			do_action('geodir_after_description_field');
2336
+		}
2337 2337
         
2338
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2339
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2340
-        $kw_tags_msg = TAGKW_MSG;
2341
-        /**
2342
-         * Filter the add listing tags character limit.
2343
-         *
2344
-         * @since 1.0.0
2345
-         * @param int $kw_tags_count The character count limit if any.
2346
-         */
2347
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2348
-        /**
2349
-         * Filter the add listing tags field value.
2350
-         *
2351
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2352
-         *
2353
-         * @since 1.0.0
2354
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2355
-         * @param int $kw_tags_count The character count limit if any.
2356
-         */
2357
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2358
-        /**
2359
-         * Filter the add listing tags field message text.
2360
-         *
2361
-         * @since 1.0.0
2362
-         * @param string $kw_tags_msg The message shown under the field.
2363
-         * @param int $kw_tags_count The character count limit if any.
2364
-         */
2365
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2338
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2339
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2340
+		$kw_tags_msg = TAGKW_MSG;
2341
+		/**
2342
+		 * Filter the add listing tags character limit.
2343
+		 *
2344
+		 * @since 1.0.0
2345
+		 * @param int $kw_tags_count The character count limit if any.
2346
+		 */
2347
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2348
+		/**
2349
+		 * Filter the add listing tags field value.
2350
+		 *
2351
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2352
+		 *
2353
+		 * @since 1.0.0
2354
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2355
+		 * @param int $kw_tags_count The character count limit if any.
2356
+		 */
2357
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2358
+		/**
2359
+		 * Filter the add listing tags field message text.
2360
+		 *
2361
+		 * @since 1.0.0
2362
+		 * @param string $kw_tags_msg The message shown under the field.
2363
+		 * @param int $kw_tags_count The character count limit if any.
2364
+		 */
2365
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2366 2366
         
2367
-        $tags_class = '';
2368
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2369
-            /**
2370
-             * Called on the add listing page form for frontend just before the tags field.
2371
-             *
2372
-             * @since 1.0.0
2373
-             */
2374
-            do_action('geodir_before_listing_tags_field');
2375
-        } else {
2376
-            $tags_class = ' hidden';
2377
-        }
2378
-        ?>
2367
+		$tags_class = '';
2368
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2369
+			/**
2370
+			 * Called on the add listing page form for frontend just before the tags field.
2371
+			 *
2372
+			 * @since 1.0.0
2373
+			 */
2374
+			do_action('geodir_before_listing_tags_field');
2375
+		} else {
2376
+			$tags_class = ' hidden';
2377
+		}
2378
+		?>
2379 2379
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2380 2380
             <label><?php echo TAGKW_TEXT; ?></label>
2381 2381
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2383,90 +2383,90 @@  discard block
 block discarded – undo
2383 2383
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2384 2384
         </div>
2385 2385
         <?php
2386
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2387
-            /**
2388
-             * Called on the add listing page form for frontend just after the tags field.
2389
-             *
2390
-             * @since 1.0.0
2391
-             */
2392
-            do_action('geodir_after_listing_tags_field');
2393
-        }
2386
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2387
+			/**
2388
+			 * Called on the add listing page form for frontend just after the tags field.
2389
+			 *
2390
+			 * @since 1.0.0
2391
+			 */
2392
+			do_action('geodir_after_listing_tags_field');
2393
+		}
2394 2394
         
2395
-        $package_info = array();
2396
-        $package_info = geodir_post_package_info($package_info, $post);
2395
+		$package_info = array();
2396
+		$package_info = geodir_post_package_info($package_info, $post);
2397 2397
         
2398
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2398
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2399 2399
         
2400
-        // adjust values here
2401
-        $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
2400
+		// adjust values here
2401
+		$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
2402 2402
 
2403
-        $multiple = true; // allow multiple files upload
2403
+		$multiple = true; // allow multiple files upload
2404 2404
 
2405
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2405
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2406 2406
 
2407
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2407
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2408 2408
 
2409
-        $thumb_img_arr = array();
2410
-        $totImg = 0;
2411
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2412
-            $post = (object)$gd_session->get('listing');
2413
-            if (isset($post->post_images))
2414
-                $curImages = trim($post->post_images, ",");
2409
+		$thumb_img_arr = array();
2410
+		$totImg = 0;
2411
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2412
+			$post = (object)$gd_session->get('listing');
2413
+			if (isset($post->post_images))
2414
+				$curImages = trim($post->post_images, ",");
2415 2415
 
2416 2416
 
2417
-            if ($curImages != '') {
2418
-                $curImages_array = explode(',', $curImages);
2419
-                $totImg = count($curImages_array);
2420
-            }
2417
+			if ($curImages != '') {
2418
+				$curImages_array = explode(',', $curImages);
2419
+				$totImg = count($curImages_array);
2420
+			}
2421 2421
 
2422
-            $listing_type = $post->listing_type;
2422
+			$listing_type = $post->listing_type;
2423 2423
 
2424
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2425
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2426
-            $listing_type = $post->post_type;
2427
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2424
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2425
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2426
+			$listing_type = $post->post_type;
2427
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2428 2428
 
2429
-        } else {
2430
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2431
-        }
2429
+		} else {
2430
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2431
+		}
2432 2432
 
2433 2433
 
2434
-        if (!empty($thumb_img_arr)) {
2435
-            foreach ($thumb_img_arr as $img) {
2436
-                //$curImages = $img->src.",";
2437
-            }
2438
-
2439
-            $totImg = count((array)$thumb_img_arr);
2440
-        }
2434
+		if (!empty($thumb_img_arr)) {
2435
+			foreach ($thumb_img_arr as $img) {
2436
+				//$curImages = $img->src.",";
2437
+			}
2441 2438
 
2442
-        if ($curImages != '')
2443
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2444
-        else
2445
-            $svalue = '';
2446
-
2447
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2448
-        $show_image_input_box = ($image_limit != '0');
2449
-        /**
2450
-         * Filter to be able to show/hide the image upload section of the add listing form.
2451
-         *
2452
-         * @since 1.0.0
2453
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2454
-         * @param string $listing_type The custom post type slug.
2455
-         */
2456
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2457
-        if ($show_image_input_box) {
2458
-            ?>
2439
+			$totImg = count((array)$thumb_img_arr);
2440
+		}
2441
+
2442
+		if ($curImages != '')
2443
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2444
+		else
2445
+			$svalue = '';
2446
+
2447
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2448
+		$show_image_input_box = ($image_limit != '0');
2449
+		/**
2450
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2451
+		 *
2452
+		 * @since 1.0.0
2453
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2454
+		 * @param string $listing_type The custom post type slug.
2455
+		 */
2456
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2457
+		if ($show_image_input_box) {
2458
+			?>
2459 2459
 
2460 2460
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2461 2461
                 <?php if ($image_limit == 1) {
2462
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2463
-                } ?>
2462
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2463
+				} ?>
2464 2464
                 <?php if ($image_limit > 1) {
2465
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2466
-                } ?>
2465
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2466
+				} ?>
2467 2467
                 <?php if ($image_limit == '') {
2468
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2469
-                } ?>
2468
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2469
+				} ?>
2470 2470
             </h5>
2471 2471
 
2472 2472
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2504,12 +2504,12 @@  discard block
 block discarded – undo
2504 2504
         <?php } ?>
2505 2505
 
2506 2506
         <?php
2507
-        /**
2508
-         * Called on the add listing page form for frontend just after the image upload field.
2509
-         *
2510
-         * @since 1.0.0
2511
-         */
2512
-        do_action('geodir_after_main_form_fields');?>
2507
+		/**
2508
+		 * Called on the add listing page form for frontend just after the image upload field.
2509
+		 *
2510
+		 * @since 1.0.0
2511
+		 */
2512
+		do_action('geodir_after_main_form_fields');?>
2513 2513
 
2514 2514
 
2515 2515
         <!-- add captcha code -->
@@ -2538,7 +2538,7 @@  discard block
 block discarded – undo
2538 2538
 
2539 2539
     </form>
2540 2540
     <?php
2541
-    wp_reset_query();
2541
+	wp_reset_query();
2542 2542
 }
2543 2543
 
2544 2544
 /**
@@ -2549,7 +2549,7 @@  discard block
 block discarded – undo
2549 2549
  */
2550 2550
 function geodir_add_listing_sidebar_widget_area()
2551 2551
 {
2552
-    dynamic_sidebar('geodir_add_listing_sidebar');
2552
+	dynamic_sidebar('geodir_add_listing_sidebar');
2553 2553
 }
2554 2554
 
2555 2555
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2564,16 +2564,16 @@  discard block
 block discarded – undo
2564 2564
  */
2565 2565
 function geodir_action_add_listing_sidebar()
2566 2566
 {
2567
-    /** This action is documented in geodirectory_template_actions.php */
2568
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2569
-    /**
2570
-     * This is used to add the content to the add listing page sidebar.
2571
-     *
2572
-     * @since 1.0.0
2573
-     */
2574
-    do_action('geodir_add_listing_sidebar_inside');
2575
-    /** This action is documented in geodirectory_template_actions.php */
2576
-    do_action('geodir_sidebar_right_close', 'details-page');
2567
+	/** This action is documented in geodirectory_template_actions.php */
2568
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2569
+	/**
2570
+	 * This is used to add the content to the add listing page sidebar.
2571
+	 *
2572
+	 * @since 1.0.0
2573
+	 */
2574
+	do_action('geodir_add_listing_sidebar_inside');
2575
+	/** This action is documented in geodirectory_template_actions.php */
2576
+	do_action('geodir_sidebar_right_close', 'details-page');
2577 2577
 }
2578 2578
 
2579 2579
 ###############################################
@@ -2590,11 +2590,11 @@  discard block
 block discarded – undo
2590 2590
  */
2591 2591
 function geodir_action_geodir_sidebar_signup_top()
2592 2592
 {
2593
-    ?>
2593
+	?>
2594 2594
     <div
2595 2595
         class="<?php
2596
-        /** This action is documented in geodirectory_template_actions.php */
2597
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2596
+		/** This action is documented in geodirectory_template_actions.php */
2597
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2598 2598
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2599 2599
     </div><!-- clearfix ends here-->
2600 2600
 <?php
@@ -2613,11 +2613,11 @@  discard block
 block discarded – undo
2613 2613
 function geodir_action_signup_forms()
2614 2614
 {
2615 2615
 
2616
-    global $user_login;
2616
+	global $user_login;
2617 2617
     
2618
-    $is_enable_signup = get_option( 'users_can_register' );
2618
+	$is_enable_signup = get_option( 'users_can_register' );
2619 2619
     
2620
-    ?>
2620
+	?>
2621 2621
     <script type="text/javascript">
2622 2622
         <?php if ( $user_login ) { ?>
2623 2623
         setTimeout(function () {
@@ -2653,67 +2653,67 @@  discard block
 block discarded – undo
2653 2653
         <?php } ?>
2654 2654
     </script><?php
2655 2655
 
2656
-    global $errors;
2657
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2658
-        $errors->add('claim_login', LOGIN_CLAIM);
2659
-
2660
-    if (!empty($errors)) {
2661
-        foreach ($errors as $errorsObj) {
2662
-            foreach ($errorsObj as $key => $val) {
2663
-                for ($i = 0; $i < count($val); $i++) {
2664
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2665
-                    $registration_error_msg = 1;
2666
-                }
2667
-            }
2668
-        }
2669
-    }
2656
+	global $errors;
2657
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2658
+		$errors->add('claim_login', LOGIN_CLAIM);
2659
+
2660
+	if (!empty($errors)) {
2661
+		foreach ($errors as $errorsObj) {
2662
+			foreach ($errorsObj as $key => $val) {
2663
+				for ($i = 0; $i < count($val); $i++) {
2664
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2665
+					$registration_error_msg = 1;
2666
+				}
2667
+			}
2668
+		}
2669
+	}
2670 2670
 
2671
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2672
-        ?>
2671
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2672
+		?>
2673 2673
 
2674 2674
         <div class="login_form">
2675 2675
             <?php
2676
-            /**
2677
-             * Contains login form template.
2678
-             *
2679
-             * @since 1.0.0
2680
-             */
2681
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2676
+			/**
2677
+			 * Contains login form template.
2678
+			 *
2679
+			 * @since 1.0.0
2680
+			 */
2681
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2682 2682
         </div>
2683 2683
 
2684 2684
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup ) { ?>
2685 2685
 
2686 2686
         <div class="registration_form">
2687 2687
             <?php
2688
-            /**
2689
-             * Contains registration form template.
2690
-             *
2691
-             * @since 1.0.0
2692
-             */
2693
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2688
+			/**
2689
+			 * Contains registration form template.
2690
+			 *
2691
+			 * @since 1.0.0
2692
+			 */
2693
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2694 2694
         </div>
2695 2695
 
2696 2696
     <?php } else { ?>
2697 2697
 
2698 2698
         <div class="login_form_l">
2699 2699
             <?php
2700
-            /**
2701
-             * Contains login form template.
2702
-             *
2703
-             * @since 1.0.0
2704
-             */
2705
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2700
+			/**
2701
+			 * Contains login form template.
2702
+			 *
2703
+			 * @since 1.0.0
2704
+			 */
2705
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2706 2706
         </div>
2707 2707
         
2708 2708
         <?php if ( $is_enable_signup ) { ?>
2709 2709
             <div class="registration_form_r">
2710 2710
                 <?php
2711
-                /**
2712
-                 * Contains registration form template.
2713
-                 *
2714
-                 * @since 1.0.0
2715
-                 */
2716
-                include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2711
+				/**
2712
+				 * Contains registration form template.
2713
+				 *
2714
+				 * @since 1.0.0
2715
+				 */
2716
+				include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2717 2717
             </div>
2718 2718
         <?php } ?>
2719 2719
 
@@ -2745,66 +2745,66 @@  discard block
 block discarded – undo
2745 2745
  */
2746 2746
 function geodir_action_author_page_title()
2747 2747
 {
2748
-    global $term;
2748
+	global $term;
2749 2749
 
2750
-    $gd_post_type = geodir_get_current_posttype();
2751
-    $post_type_info = get_post_type_object($gd_post_type);
2750
+	$gd_post_type = geodir_get_current_posttype();
2751
+	$post_type_info = get_post_type_object($gd_post_type);
2752 2752
 
2753
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2754
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2755
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2756
-    }
2753
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2754
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2755
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2756
+	}
2757 2757
 
2758
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2759
-    $single_name = $post_type_info->labels->singular_name;
2758
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2759
+	$single_name = $post_type_info->labels->singular_name;
2760 2760
 
2761
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2761
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2762 2762
 
2763
-    if (!empty($term)) {
2764
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2765
-        if (!empty($current_term))
2766
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2767
-    }
2763
+	if (!empty($term)) {
2764
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2765
+		if (!empty($current_term))
2766
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2767
+	}
2768 2768
 
2769 2769
 
2770
-    if (is_search()) {
2771
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2770
+	if (is_search()) {
2771
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2772 2772
 
2773
-    }
2774
-    /** This action is documented in geodirectory_template_actions.php */
2775
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2776
-    /** This action is documented in geodirectory_template_actions.php */
2777
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2773
+	}
2774
+	/** This action is documented in geodirectory_template_actions.php */
2775
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2776
+	/** This action is documented in geodirectory_template_actions.php */
2777
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2778 2778
 
2779
-    $title = $list_title;
2780
-    if(geodir_is_page('author')){
2781
-        $gd_page = 'author';
2782
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2783
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2784
-        }else{
2785
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2786
-        }
2779
+	$title = $list_title;
2780
+	if(geodir_is_page('author')){
2781
+		$gd_page = 'author';
2782
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2783
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2784
+		}else{
2785
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2786
+		}
2787 2787
 
2788
-    }
2788
+	}
2789 2789
 
2790 2790
 
2791
-    /**
2792
-     * Filter page title to replace variables.
2793
-     *
2794
-     * @since 1.5.4
2795
-     * @param string $title The page title including variables.
2796
-     * @param string $gd_page The GeoDirectory page type if any.
2797
-     */
2798
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2791
+	/**
2792
+	 * Filter page title to replace variables.
2793
+	 *
2794
+	 * @since 1.5.4
2795
+	 * @param string $title The page title including variables.
2796
+	 * @param string $gd_page The GeoDirectory page type if any.
2797
+	 */
2798
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2799 2799
 
2800
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2801
-        /**
2802
-         * Filter the author page title text.
2803
-         *
2804
-         * @since 1.0.0
2805
-         * @param string $list_title The title for the page.
2806
-         */
2807
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2800
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2801
+		/**
2802
+		 * Filter the author page title text.
2803
+		 *
2804
+		 * @since 1.0.0
2805
+		 * @param string $list_title The title for the page.
2806
+		 */
2807
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2808 2808
 }
2809 2809
 
2810 2810
 
@@ -2822,11 +2822,11 @@  discard block
 block discarded – undo
2822 2822
  */
2823 2823
 function geodir_action_geodir_sidebar_author_top()
2824 2824
 {
2825
-    if (get_option('geodir_show_author_top_section')) { ?>
2825
+	if (get_option('geodir_show_author_top_section')) { ?>
2826 2826
         <div
2827 2827
             class="<?php
2828
-            /** This action is documented in geodirectory_template_actions.php */
2829
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2828
+			/** This action is documented in geodirectory_template_actions.php */
2829
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2830 2830
             <?php dynamic_sidebar('geodir_author_top'); ?>
2831 2831
         </div><!-- clearfix ends here-->
2832 2832
     <?php }
@@ -2842,7 +2842,7 @@  discard block
 block discarded – undo
2842 2842
  */
2843 2843
 function geodir_author_left_section()
2844 2844
 {
2845
-    if (get_option('geodir_show_author_left_section')) { ?>
2845
+	if (get_option('geodir_show_author_left_section')) { ?>
2846 2846
         <div class="geodir-content-left geodir-sidebar-wrap">
2847 2847
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2848 2848
         </div><!-- end geodir-content-left -->
@@ -2863,19 +2863,19 @@  discard block
 block discarded – undo
2863 2863
  */
2864 2864
 function geodir_action_author_sidebar_left()
2865 2865
 {
2866
-    if (get_option('geodir_show_author_left_section')) {
2866
+	if (get_option('geodir_show_author_left_section')) {
2867 2867
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2868
-        /** This action is documented in geodirectory_template_actions.php */
2869
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2870
-        /**
2871
-         * This is used to add the content to the author page left sidebar (if active).
2872
-         *
2873
-         * @since 1.0.0
2874
-         */
2875
-        do_action('geodir_author_sidebar_left_inside');
2876
-        /** This action is documented in geodirectory_template_actions.php */
2877
-        do_action('geodir_sidebar_left_close', 'author-page');
2878
-    }
2868
+		/** This action is documented in geodirectory_template_actions.php */
2869
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2870
+		/**
2871
+		 * This is used to add the content to the author page left sidebar (if active).
2872
+		 *
2873
+		 * @since 1.0.0
2874
+		 */
2875
+		do_action('geodir_author_sidebar_left_inside');
2876
+		/** This action is documented in geodirectory_template_actions.php */
2877
+		do_action('geodir_sidebar_left_close', 'author-page');
2878
+	}
2879 2879
 }
2880 2880
 
2881 2881
 /**
@@ -2888,7 +2888,7 @@  discard block
 block discarded – undo
2888 2888
  */
2889 2889
 function geodir_author_right_section()
2890 2890
 {
2891
-    if (get_option('geodir_show_author_right_section')) { ?>
2891
+	if (get_option('geodir_show_author_right_section')) { ?>
2892 2892
         <div class="geodir-content-right geodir-sidebar-wrap">
2893 2893
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2894 2894
         </div><!-- end geodir-content-right -->
@@ -2908,18 +2908,18 @@  discard block
 block discarded – undo
2908 2908
  */
2909 2909
 function geodir_action_author_sidebar_right()
2910 2910
 {
2911
-    if (get_option('geodir_show_author_right_section')) {
2912
-        /** This action is documented in geodirectory_template_actions.php */
2913
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2914
-        /**
2915
-         * This is used to add the content to the author page right sidebar (if active).
2916
-         *
2917
-         * @since 1.0.0
2918
-         */
2919
-        do_action('geodir_author_sidebar_right_inside');
2920
-        /** This action is documented in geodirectory_template_actions.php */
2921
-        do_action('geodir_sidebar_right_close', 'author-page');
2922
-    }
2911
+	if (get_option('geodir_show_author_right_section')) {
2912
+		/** This action is documented in geodirectory_template_actions.php */
2913
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2914
+		/**
2915
+		 * This is used to add the content to the author page right sidebar (if active).
2916
+		 *
2917
+		 * @since 1.0.0
2918
+		 */
2919
+		do_action('geodir_author_sidebar_right_inside');
2920
+		/** This action is documented in geodirectory_template_actions.php */
2921
+		do_action('geodir_sidebar_right_close', 'author-page');
2922
+	}
2923 2923
 }
2924 2924
 
2925 2925
 /**
@@ -2931,14 +2931,14 @@  discard block
 block discarded – undo
2931 2931
  */
2932 2932
 function geodir_action_author_content_inside()
2933 2933
 {
2934
-    global $gridview_columns;
2935
-    $listing_view = get_option('geodir_author_view');
2936
-    if (strstr($listing_view, 'gridview')) {
2937
-        $gridview_columns = $listing_view;
2938
-        $listing_view_exp = explode('_', $listing_view);
2939
-        $listing_view = $listing_view_exp[0];
2940
-    }
2941
-    geodir_get_template_part('listing', 'listview');
2934
+	global $gridview_columns;
2935
+	$listing_view = get_option('geodir_author_view');
2936
+	if (strstr($listing_view, 'gridview')) {
2937
+		$gridview_columns = $listing_view;
2938
+		$listing_view_exp = explode('_', $listing_view);
2939
+		$listing_view = $listing_view_exp[0];
2940
+	}
2941
+	geodir_get_template_part('listing', 'listview');
2942 2942
 }
2943 2943
 
2944 2944
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2953,22 +2953,22 @@  discard block
 block discarded – undo
2953 2953
  */
2954 2954
 function geodir_action_author_content()
2955 2955
 {
2956
-    /** This action is documented in geodirectory_template_actions.php */
2957
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2958
-    echo '<div class="clearfix">';
2959
-    /** This action is documented in geodirectory_template_actions.php */
2960
-    do_action('geodir_before_listing');
2961
-    echo '</div>';
2962
-    /**
2963
-     * This is used to add the content to the author page main content.
2964
-     *
2965
-     * @since 1.0.0
2966
-     */
2967
-    do_action('geodir_author_content_inside');
2968
-    /** This action is documented in geodirectory_template_actions.php */
2969
-    do_action('geodir_after_listing');
2970
-    /** This action is documented in geodirectory_template_actions.php */
2971
-    do_action('geodir_main_content_close', 'author-page');
2956
+	/** This action is documented in geodirectory_template_actions.php */
2957
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2958
+	echo '<div class="clearfix">';
2959
+	/** This action is documented in geodirectory_template_actions.php */
2960
+	do_action('geodir_before_listing');
2961
+	echo '</div>';
2962
+	/**
2963
+	 * This is used to add the content to the author page main content.
2964
+	 *
2965
+	 * @since 1.0.0
2966
+	 */
2967
+	do_action('geodir_author_content_inside');
2968
+	/** This action is documented in geodirectory_template_actions.php */
2969
+	do_action('geodir_after_listing');
2970
+	/** This action is documented in geodirectory_template_actions.php */
2971
+	do_action('geodir_main_content_close', 'author-page');
2972 2972
 }
2973 2973
 
2974 2974
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2982,11 +2982,11 @@  discard block
 block discarded – undo
2982 2982
  */
2983 2983
 function geodir_action_sidebar_author_bottom_section()
2984 2984
 {
2985
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2985
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2986 2986
         <div
2987 2987
             class="<?php
2988
-            /** This action is documented in geodirectory_template_actions.php */
2989
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2988
+			/** This action is documented in geodirectory_template_actions.php */
2989
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2990 2990
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2991 2991
         </div><!-- clearfix ends here-->
2992 2992
     <?php }
@@ -3005,23 +3005,23 @@  discard block
 block discarded – undo
3005 3005
  */
3006 3006
 function geodir_action_search_page_title()
3007 3007
 {
3008
-    $gd_post_type = geodir_get_current_posttype();
3009
-    $post_type_info = get_post_type_object($gd_post_type);
3008
+	$gd_post_type = geodir_get_current_posttype();
3009
+	$post_type_info = get_post_type_object($gd_post_type);
3010 3010
 
3011
-    $pt_name = '';
3012
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3011
+	$pt_name = '';
3012
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3013 3013
 
3014
-    if (is_search()) {
3015
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3014
+	if (is_search()) {
3015
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3016 3016
 
3017
-    }
3018
-    /** This action is documented in geodirectory_template_actions.php */
3019
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3020
-    /** This action is documented in geodirectory_template_actions.php */
3021
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3022
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3023
-        /** This action is documented in geodirectory_template_actions.php */
3024
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3017
+	}
3018
+	/** This action is documented in geodirectory_template_actions.php */
3019
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
3020
+	/** This action is documented in geodirectory_template_actions.php */
3021
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3022
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3023
+		/** This action is documented in geodirectory_template_actions.php */
3024
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3025 3025
 }
3026 3026
 
3027 3027
 // action for adding the listings page top widget area
@@ -3037,11 +3037,11 @@  discard block
 block discarded – undo
3037 3037
  */
3038 3038
 function geodir_action_geodir_sidebar_search_top()
3039 3039
 {
3040
-    if (get_option('geodir_show_search_top_section')) { ?>
3040
+	if (get_option('geodir_show_search_top_section')) { ?>
3041 3041
         <div
3042 3042
             class="<?php
3043
-            /** This action is documented in geodirectory_template_actions.php */
3044
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3043
+			/** This action is documented in geodirectory_template_actions.php */
3044
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3045 3045
             <?php dynamic_sidebar('geodir_search_top'); ?>
3046 3046
         </div><!-- clearfix ends here-->
3047 3047
     <?php }
@@ -3057,7 +3057,7 @@  discard block
 block discarded – undo
3057 3057
  */
3058 3058
 function geodir_search_left_section()
3059 3059
 {
3060
-    if (get_option('geodir_show_search_left_section')) { ?>
3060
+	if (get_option('geodir_show_search_left_section')) { ?>
3061 3061
         <div class="geodir-content-left geodir-sidebar-wrap">
3062 3062
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3063 3063
         </div><!-- end geodir-content-left -->
@@ -3077,19 +3077,19 @@  discard block
 block discarded – undo
3077 3077
  */
3078 3078
 function geodir_action_search_sidebar_left()
3079 3079
 {
3080
-    if (get_option('geodir_show_search_left_section')) {
3080
+	if (get_option('geodir_show_search_left_section')) {
3081 3081
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3082
-        /** This action is documented in geodirectory_template_actions.php */
3083
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3084
-        /**
3085
-         * This is used to add the content to the search page left sidebar (if active).
3086
-         *
3087
-         * @since 1.0.0
3088
-         */
3089
-        do_action('geodir_search_sidebar_left_inside');
3090
-        /** This action is documented in geodirectory_template_actions.php */
3091
-        do_action('geodir_sidebar_left_close', 'search-page');
3092
-    }
3082
+		/** This action is documented in geodirectory_template_actions.php */
3083
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3084
+		/**
3085
+		 * This is used to add the content to the search page left sidebar (if active).
3086
+		 *
3087
+		 * @since 1.0.0
3088
+		 */
3089
+		do_action('geodir_search_sidebar_left_inside');
3090
+		/** This action is documented in geodirectory_template_actions.php */
3091
+		do_action('geodir_sidebar_left_close', 'search-page');
3092
+	}
3093 3093
 }
3094 3094
 
3095 3095
 /**
@@ -3102,7 +3102,7 @@  discard block
 block discarded – undo
3102 3102
  */
3103 3103
 function geodir_search_right_section()
3104 3104
 {
3105
-    if (get_option('geodir_show_search_right_section')) { ?>
3105
+	if (get_option('geodir_show_search_right_section')) { ?>
3106 3106
         <div class="geodir-content-right geodir-sidebar-wrap">
3107 3107
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3108 3108
         </div><!-- end geodir-content-right -->
@@ -3122,18 +3122,18 @@  discard block
 block discarded – undo
3122 3122
  */
3123 3123
 function geodir_action_search_sidebar_right()
3124 3124
 {
3125
-    if (get_option('geodir_show_search_right_section')) {
3126
-        /** This action is documented in geodirectory_template_actions.php */
3127
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3128
-        /**
3129
-         * This is used to add the content to the search page right sidebar (if active).
3130
-         *
3131
-         * @since 1.0.0
3132
-         */
3133
-        do_action('geodir_search_sidebar_right_inside');
3134
-        /** This action is documented in geodirectory_template_actions.php */
3135
-        do_action('geodir_sidebar_right_close', 'search-page');
3136
-    }
3125
+	if (get_option('geodir_show_search_right_section')) {
3126
+		/** This action is documented in geodirectory_template_actions.php */
3127
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3128
+		/**
3129
+		 * This is used to add the content to the search page right sidebar (if active).
3130
+		 *
3131
+		 * @since 1.0.0
3132
+		 */
3133
+		do_action('geodir_search_sidebar_right_inside');
3134
+		/** This action is documented in geodirectory_template_actions.php */
3135
+		do_action('geodir_sidebar_right_close', 'search-page');
3136
+	}
3137 3137
 }
3138 3138
 
3139 3139
 
@@ -3148,11 +3148,11 @@  discard block
 block discarded – undo
3148 3148
  */
3149 3149
 function geodir_action_sidebar_search_bottom_section()
3150 3150
 {
3151
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3151
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3152 3152
         <div
3153 3153
             class="<?php
3154
-            /** This action is documented in geodirectory_template_actions.php */
3155
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3154
+			/** This action is documented in geodirectory_template_actions.php */
3155
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3156 3156
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3157 3157
         </div><!-- clearfix ends here-->
3158 3158
     <?php }
@@ -3167,14 +3167,14 @@  discard block
 block discarded – undo
3167 3167
  */
3168 3168
 function geodir_action_search_content_inside()
3169 3169
 {
3170
-    global $gridview_columns;
3171
-    $listing_view = get_option('geodir_search_view');
3172
-    if (strstr($listing_view, 'gridview')) {
3173
-        $gridview_columns = $listing_view;
3174
-        $listing_view_exp = explode('_', $listing_view);
3175
-        $listing_view = $listing_view_exp[0];
3176
-    }
3177
-    geodir_get_template_part('listing', 'listview');
3170
+	global $gridview_columns;
3171
+	$listing_view = get_option('geodir_search_view');
3172
+	if (strstr($listing_view, 'gridview')) {
3173
+		$gridview_columns = $listing_view;
3174
+		$listing_view_exp = explode('_', $listing_view);
3175
+		$listing_view = $listing_view_exp[0];
3176
+	}
3177
+	geodir_get_template_part('listing', 'listview');
3178 3178
 }
3179 3179
 
3180 3180
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3190,22 +3190,22 @@  discard block
 block discarded – undo
3190 3190
  */
3191 3191
 function geodir_action_search_content()
3192 3192
 {
3193
-    /** This action is documented in geodirectory_template_actions.php */
3194
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3195
-    echo '<div class="clearfix">';
3196
-    /** This action is documented in geodirectory_template_actions.php */
3197
-    do_action('geodir_before_listing');
3198
-    echo '</div>';
3199
-    /**
3200
-     * This is used to add the content to the search page main content.
3201
-     *
3202
-     * @since 1.0.0
3203
-     */
3204
-    do_action('geodir_search_content_inside');
3205
-    /** This action is documented in geodirectory_template_actions.php */
3206
-    do_action('geodir_after_listing');
3207
-    /** This action is documented in geodirectory_template_actions.php */
3208
-    do_action('geodir_main_content_close', 'search-page');
3193
+	/** This action is documented in geodirectory_template_actions.php */
3194
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3195
+	echo '<div class="clearfix">';
3196
+	/** This action is documented in geodirectory_template_actions.php */
3197
+	do_action('geodir_before_listing');
3198
+	echo '</div>';
3199
+	/**
3200
+	 * This is used to add the content to the search page main content.
3201
+	 *
3202
+	 * @since 1.0.0
3203
+	 */
3204
+	do_action('geodir_search_content_inside');
3205
+	/** This action is documented in geodirectory_template_actions.php */
3206
+	do_action('geodir_after_listing');
3207
+	/** This action is documented in geodirectory_template_actions.php */
3208
+	do_action('geodir_main_content_close', 'search-page');
3209 3209
 }
3210 3210
 
3211 3211
 ###############################################
@@ -3228,11 +3228,11 @@  discard block
 block discarded – undo
3228 3228
  */
3229 3229
 function geodir_action_geodir_sidebar_home_top()
3230 3230
 {
3231
-    if (get_option('geodir_show_home_top_section')) { ?>
3231
+	if (get_option('geodir_show_home_top_section')) { ?>
3232 3232
         <div
3233 3233
             class="<?php
3234
-            /** This action is documented in geodirectory_template_actions.php */
3235
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3234
+			/** This action is documented in geodirectory_template_actions.php */
3235
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3236 3236
             <?php dynamic_sidebar('geodir_home_top'); ?>
3237 3237
         </div><!-- clearfix ends here-->
3238 3238
     <?php }
@@ -3248,7 +3248,7 @@  discard block
 block discarded – undo
3248 3248
  */
3249 3249
 function geodir_home_left_section()
3250 3250
 {
3251
-    if (get_option('geodir_show_home_left_section')) { ?>
3251
+	if (get_option('geodir_show_home_left_section')) { ?>
3252 3252
         <div class="geodir-content-left geodir-sidebar-wrap">
3253 3253
             <?php dynamic_sidebar('geodir_home_left'); ?>
3254 3254
         </div><!-- end geodir-content-left -->
@@ -3270,19 +3270,19 @@  discard block
 block discarded – undo
3270 3270
  */
3271 3271
 function geodir_action_home_sidebar_left()
3272 3272
 {
3273
-    if (get_option('geodir_show_home_left_section')) {
3273
+	if (get_option('geodir_show_home_left_section')) {
3274 3274
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3275
-        /** This action is documented in geodirectory_template_actions.php */
3276
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3277
-        /**
3278
-         * This is used to add the content to the home page left sidebar (if active).
3279
-         *
3280
-         * @since 1.0.0
3281
-         */
3282
-        do_action('geodir_home_sidebar_left_inside');
3283
-        /** This action is documented in geodirectory_template_actions.php */
3284
-        do_action('geodir_sidebar_left_close', 'home-page');
3285
-    }
3275
+		/** This action is documented in geodirectory_template_actions.php */
3276
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3277
+		/**
3278
+		 * This is used to add the content to the home page left sidebar (if active).
3279
+		 *
3280
+		 * @since 1.0.0
3281
+		 */
3282
+		do_action('geodir_home_sidebar_left_inside');
3283
+		/** This action is documented in geodirectory_template_actions.php */
3284
+		do_action('geodir_sidebar_left_close', 'home-page');
3285
+	}
3286 3286
 }
3287 3287
 
3288 3288
 /**
@@ -3295,7 +3295,7 @@  discard block
 block discarded – undo
3295 3295
  */
3296 3296
 function geodir_home_right_section()
3297 3297
 {
3298
-    if (get_option('geodir_show_home_right_section')) { ?>
3298
+	if (get_option('geodir_show_home_right_section')) { ?>
3299 3299
         <div class="geodir-content-right geodir-sidebar-wrap">
3300 3300
             <?php dynamic_sidebar('geodir_home_right'); ?>
3301 3301
         </div><!-- end geodir-content-right -->
@@ -3316,18 +3316,18 @@  discard block
 block discarded – undo
3316 3316
  */
3317 3317
 function geodir_action_home_sidebar_right()
3318 3318
 {
3319
-    if (get_option('geodir_show_home_right_section')) {
3320
-        /** This action is documented in geodirectory_template_actions.php */
3321
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3322
-        /**
3323
-         * This is used to add the content to the home page right sidebar (if active).
3324
-         *
3325
-         * @since 1.0.0
3326
-         */
3327
-        do_action('geodir_home_sidebar_right_inside');
3328
-        /** This action is documented in geodirectory_template_actions.php */
3329
-        do_action('geodir_sidebar_right_close', 'home-page');
3330
-    }
3319
+	if (get_option('geodir_show_home_right_section')) {
3320
+		/** This action is documented in geodirectory_template_actions.php */
3321
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3322
+		/**
3323
+		 * This is used to add the content to the home page right sidebar (if active).
3324
+		 *
3325
+		 * @since 1.0.0
3326
+		 */
3327
+		do_action('geodir_home_sidebar_right_inside');
3328
+		/** This action is documented in geodirectory_template_actions.php */
3329
+		do_action('geodir_sidebar_right_close', 'home-page');
3330
+	}
3331 3331
 }
3332 3332
 
3333 3333
 /**
@@ -3338,7 +3338,7 @@  discard block
 block discarded – undo
3338 3338
  */
3339 3339
 function geodir_action_home_content_inside()
3340 3340
 {
3341
-    dynamic_sidebar('geodir_home_content');
3341
+	dynamic_sidebar('geodir_home_content');
3342 3342
 }
3343 3343
 
3344 3344
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3353,28 +3353,28 @@  discard block
 block discarded – undo
3353 3353
  */
3354 3354
 function geodir_action_home_content()
3355 3355
 {
3356
-    /** This action is documented in geodirectory_template_actions.php */
3357
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3358
-    /**
3359
-     * This called before the home page main content.
3360
-     *
3361
-     * @since 1.0.0
3362
-     */
3363
-    do_action('geodir_before_home_content');
3364
-    /**
3365
-     * This is used to add the content to the home page main content.
3366
-     *
3367
-     * @since 1.0.0
3368
-     */
3369
-    do_action('geodir_home_content_inside');
3370
-    /**
3371
-     * This is called after the homepage main content.
3372
-     *
3373
-     * @since 1.0.0
3374
-     */
3375
-    do_action('geodir_after_home_content');
3376
-    /** This action is documented in geodirectory_template_actions.php */
3377
-    do_action('geodir_main_content_close', 'home-page');
3356
+	/** This action is documented in geodirectory_template_actions.php */
3357
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3358
+	/**
3359
+	 * This called before the home page main content.
3360
+	 *
3361
+	 * @since 1.0.0
3362
+	 */
3363
+	do_action('geodir_before_home_content');
3364
+	/**
3365
+	 * This is used to add the content to the home page main content.
3366
+	 *
3367
+	 * @since 1.0.0
3368
+	 */
3369
+	do_action('geodir_home_content_inside');
3370
+	/**
3371
+	 * This is called after the homepage main content.
3372
+	 *
3373
+	 * @since 1.0.0
3374
+	 */
3375
+	do_action('geodir_after_home_content');
3376
+	/** This action is documented in geodirectory_template_actions.php */
3377
+	do_action('geodir_main_content_close', 'home-page');
3378 3378
 }
3379 3379
 
3380 3380
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3389,11 +3389,11 @@  discard block
 block discarded – undo
3389 3389
  */
3390 3390
 function geodir_action_sidebar_home_bottom_section()
3391 3391
 {
3392
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3392
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3393 3393
         <div
3394 3394
             class="<?php
3395
-            /** This action is documented in geodirectory_template_actions.php */
3396
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3395
+			/** This action is documented in geodirectory_template_actions.php */
3396
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3397 3397
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3398 3398
         </div><!-- clearfix ends here-->
3399 3399
     <?php }
@@ -3421,13 +3421,13 @@  discard block
 block discarded – undo
3421 3421
  */
3422 3422
 function geodir_filter_listing_page_title($list_title)
3423 3423
 {
3424
-    if (is_search() && trim(get_search_query()) == '') {
3425
-        $gd_post_type = geodir_get_current_posttype();
3426
-        $post_type_info = get_post_type_object($gd_post_type);
3424
+	if (is_search() && trim(get_search_query()) == '') {
3425
+		$gd_post_type = geodir_get_current_posttype();
3426
+		$post_type_info = get_post_type_object($gd_post_type);
3427 3427
 
3428
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3429
-    }
3430
-    return $list_title;
3428
+		$list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3429
+	}
3430
+	return $list_title;
3431 3431
 }
3432 3432
 
3433 3433
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3442,62 +3442,62 @@  discard block
 block discarded – undo
3442 3442
  * @param string $gd_page The geodirectory page type. Default null.
3443 3443
  */
3444 3444
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3445
-    global $post;
3446
-
3447
-    $gd_page_id = NULL;
3448
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3449
-        $gd_page_id = geodir_home_page_id();
3450
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3451
-        $gd_page_id = geodir_preview_page_id();
3452
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3453
-        $gd_page_id = geodir_add_listing_page_id();
3454
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3455
-        $gd_page_id = geodir_success_page_id();
3456
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3457
-        $gd_page_id = geodir_location_page_id();
3458
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3459
-        $gd_page_id = geodir_info_page_id();
3460
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3461
-        $gd_page_id = geodir_login_page_id();
3462
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3463
-        $gd_page_id = geodir_payment_checkout_page_id();
3464
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3465
-        $gd_page_id = geodir_payment_invoices_page_id();
3466
-    }
3467
-
3468
-    if (!$gd_page_id > 0) {
3469
-        return;
3470
-    }
3445
+	global $post;
3446
+
3447
+	$gd_page_id = NULL;
3448
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3449
+		$gd_page_id = geodir_home_page_id();
3450
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3451
+		$gd_page_id = geodir_preview_page_id();
3452
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3453
+		$gd_page_id = geodir_add_listing_page_id();
3454
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3455
+		$gd_page_id = geodir_success_page_id();
3456
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3457
+		$gd_page_id = geodir_location_page_id();
3458
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3459
+		$gd_page_id = geodir_info_page_id();
3460
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3461
+		$gd_page_id = geodir_login_page_id();
3462
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3463
+		$gd_page_id = geodir_payment_checkout_page_id();
3464
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3465
+		$gd_page_id = geodir_payment_invoices_page_id();
3466
+	}
3467
+
3468
+	if (!$gd_page_id > 0) {
3469
+		return;
3470
+	}
3471 3471
     
3472
-    $display = 'before';
3473
-    /**
3474
-     * Filter the position to display the page content.
3475
-     *
3476
-     * @since 1.6.3
3477
-     *
3478
-     * @param string $display Position to add the post content.
3479
-     * @param string $gd_page The geodirectory page type.
3480
-     */
3481
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3482
-
3483
-    if ($position !== $display) {
3484
-        return;
3485
-    }
3486
-
3487
-    $gd_post = $post;
3472
+	$display = 'before';
3473
+	/**
3474
+	 * Filter the position to display the page content.
3475
+	 *
3476
+	 * @since 1.6.3
3477
+	 *
3478
+	 * @param string $display Position to add the post content.
3479
+	 * @param string $gd_page The geodirectory page type.
3480
+	 */
3481
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3482
+
3483
+	if ($position !== $display) {
3484
+		return;
3485
+	}
3486
+
3487
+	$gd_post = $post;
3488 3488
     
3489
-    setup_postdata(get_post($gd_page_id));
3489
+	setup_postdata(get_post($gd_page_id));
3490 3490
 
3491
-    if (get_the_content()) {
3492
-        ?>
3491
+	if (get_the_content()) {
3492
+		?>
3493 3493
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3494 3494
         <?php
3495
-    }
3495
+	}
3496 3496
 
3497
-    $post = $gd_post;
3498
-    if (!empty($gd_post) && is_object($gd_post)) {
3499
-        setup_postdata($gd_post);
3500
-    }
3497
+	$post = $gd_post;
3498
+	if (!empty($gd_post) && is_object($gd_post)) {
3499
+		setup_postdata($gd_post);
3500
+	}
3501 3501
 
3502 3502
 }
3503 3503
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
@@ -3518,13 +3518,13 @@  discard block
 block discarded – undo
3518 3518
  * @return string Filtered SQL JOIN clause.
3519 3519
  */
3520 3520
 function geodir_previous_next_post_join( $join, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3521
-    global $plugin_prefix;
3521
+	global $plugin_prefix;
3522 3522
 
3523
-    if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3524
-        $join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3525
-    }
3523
+	if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3524
+		$join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3525
+	}
3526 3526
     
3527
-    return $join;
3527
+	return $join;
3528 3528
 }
3529 3529
 add_filter( 'get_previous_post_join', 'geodir_previous_next_post_join', 10, 5 );
3530 3530
 add_filter( 'get_next_post_join', 'geodir_previous_next_post_join', 10, 5 );
@@ -3546,31 +3546,31 @@  discard block
 block discarded – undo
3546 3546
  * @return string Filtered SQL WHERE clause.
3547 3547
  */
3548 3548
 function geodir_previous_next_post_where( $where, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3549
-    global $wpdb, $plugin_prefix;
3549
+	global $wpdb, $plugin_prefix;
3550 3550
 
3551
-    if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3552
-        $post_locations = '';
3553
-        $post_locations_var = array();
3551
+	if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3552
+		$post_locations = '';
3553
+		$post_locations_var = array();
3554 3554
         
3555
-        if ( !empty( $post->country_slug ) ) {
3556
-            $post_locations .= " AND post_locations LIKE %s";
3557
-            $post_locations_var[] = "%,[" . $post->country_slug . "]";
3558
-        }
3559
-
3560
-        if ( !empty( $post->region_slug ) ) {
3561
-            $post_locations .= " AND post_locations LIKE %s";
3562
-            $post_locations_var[] = "%,[" . $post->region_slug . "],%";
3563
-        }
3564
-
3565
-        if ( !empty( $post->city_slug ) ) {
3566
-            $post_locations .= " AND post_locations LIKE %s";
3567
-            $post_locations_var[] = "[" . $post->city_slug . "],%";
3568
-        }
3555
+		if ( !empty( $post->country_slug ) ) {
3556
+			$post_locations .= " AND post_locations LIKE %s";
3557
+			$post_locations_var[] = "%,[" . $post->country_slug . "]";
3558
+		}
3559
+
3560
+		if ( !empty( $post->region_slug ) ) {
3561
+			$post_locations .= " AND post_locations LIKE %s";
3562
+			$post_locations_var[] = "%,[" . $post->region_slug . "],%";
3563
+		}
3564
+
3565
+		if ( !empty( $post->city_slug ) ) {
3566
+			$post_locations .= " AND post_locations LIKE %s";
3567
+			$post_locations_var[] = "[" . $post->city_slug . "],%";
3568
+		}
3569 3569
         
3570
-        $where .= $wpdb->prepare( $post_locations, $post_locations_var );
3571
-    }
3570
+		$where .= $wpdb->prepare( $post_locations, $post_locations_var );
3571
+	}
3572 3572
     
3573
-    return $where;
3573
+	return $where;
3574 3574
 }
3575 3575
 add_filter( 'get_previous_post_where', 'geodir_previous_next_post_where', 10, 5 );
3576 3576
 add_filter( 'get_next_post_where', 'geodir_previous_next_post_where', 10, 5 );
3577 3577
\ No newline at end of file
Please login to merge, or discard this patch.