Passed
Push — master ( 3589e2...6f1fdc )
by Stiofan
15:08
created
geodirectory_template_actions.php 1 patch
Indentation   +1729 added lines, -1729 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,106 +275,106 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
279
-    if (empty($tc)) {
280
-        return;
281
-    }
278
+	$tc = get_option('theme_compatibility_setting');
279
+	if (empty($tc)) {
280
+		return;
281
+	}
282 282
 
283
-    //php
284
-    if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
-    }
283
+	//php
284
+	if (!empty($tc['geodir_theme_compat_code'])) {
285
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+	}
287 287
 
288
-    //geodir_full_page_class
289
-    if (!empty($tc['geodir_full_page_class_filter'])) {
290
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
-    }
288
+	//geodir_full_page_class
289
+	if (!empty($tc['geodir_full_page_class_filter'])) {
290
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
+	}
292 292
 
293
-    //widget before filter
294
-    if (!empty($tc['geodir_before_widget_filter'])) {
295
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
-    }
293
+	//widget before filter
294
+	if (!empty($tc['geodir_before_widget_filter'])) {
295
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
+	}
297 297
 
298
-    //widget after filter
299
-    if (!empty($tc['geodir_after_widget_filter'])) {
300
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
-    }
298
+	//widget after filter
299
+	if (!empty($tc['geodir_after_widget_filter'])) {
300
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
+	}
302 302
 
303
-    //widget before title filter
304
-    if (!empty($tc['geodir_before_title_filter'])) {
305
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
-    }
303
+	//widget before title filter
304
+	if (!empty($tc['geodir_before_title_filter'])) {
305
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
+	}
307 307
 
308
-    //widget before title filter
309
-    if (!empty($tc['geodir_after_title_filter'])) {
310
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
-    }
308
+	//widget before title filter
309
+	if (!empty($tc['geodir_after_title_filter'])) {
310
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
+	}
312 312
 
313
-    //menu li class
314
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
315
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
-    }
313
+	//menu li class
314
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
315
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
+	}
317 317
 
318
-    //menu ul class
319
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
-    }
318
+	//menu ul class
319
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
+	}
322 322
 
323
-    //menu sub li class
324
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
-    }
323
+	//menu sub li class
324
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
+	}
327 327
 
328
-    //menu a class
329
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
330
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
-    }
328
+	//menu a class
329
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
330
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
+	}
332 332
 
333
-    //menu sub a class
334
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
-    }
333
+	//menu sub a class
334
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
+	}
337 337
 
338
-    //location menu li class
339
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
-    }
338
+	//location menu li class
339
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
+	}
342 342
 
343
-    //location menu sub ul class
344
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
-    }
343
+	//location menu sub ul class
344
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
+	}
347 347
 
348
-    //location menu sub li class
349
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
-    }
348
+	//location menu sub li class
349
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
+	}
352 352
 
353
-    //location menu a class
354
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
-    }
353
+	//location menu a class
354
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
+	}
357 357
 
358
-    // compat styles
359
-    if (!empty($tc['geodir_theme_compat_css'])) {
360
-        add_action('wp_head', 'gd_compat_styles');
361
-    }
358
+	// compat styles
359
+	if (!empty($tc['geodir_theme_compat_css'])) {
360
+		add_action('wp_head', 'gd_compat_styles');
361
+	}
362 362
 
363
-    // compat js
364
-    if (!empty($tc['geodir_theme_compat_js'])) {
365
-        add_action('wp_footer', 'gd_compat_script');
366
-    }
363
+	// compat js
364
+	if (!empty($tc['geodir_theme_compat_js'])) {
365
+		add_action('wp_footer', 'gd_compat_script');
366
+	}
367 367
 
368 368
 
369
-    // geodir_top_content_add
370
-    if (!empty($tc['geodir_top_content_add'])) {
371
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
-    }
369
+	// geodir_top_content_add
370
+	if (!empty($tc['geodir_top_content_add'])) {
371
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
+	}
373 373
 
374
-    // geodir_before_main_content_add
375
-    if (!empty($tc['geodir_before_main_content_add'])) {
376
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
-    }
374
+	// geodir_before_main_content_add
375
+	if (!empty($tc['geodir_before_main_content_add'])) {
376
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
+	}
378 378
 
379 379
 
380 380
 }
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
  */
398 398
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
399 399
 {
400
-    $tc = get_option('theme_compatibility_setting');
401
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
402
-        $text = $tc['geodir_wrapper_open_replace'];
403
-    } else {
404
-        $text = '<div id="[id]" class="[class]">';
405
-    }
400
+	$tc = get_option('theme_compatibility_setting');
401
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
402
+		$text = $tc['geodir_wrapper_open_replace'];
403
+	} else {
404
+		$text = '<div id="[id]" class="[class]">';
405
+	}
406 406
 
407
-    if (!empty($tc['geodir_wrapper_open_id'])) {
408
-        $id = $tc['geodir_wrapper_open_id'];
409
-    }
410
-    if (!empty($tc['geodir_wrapper_open_class'])) {
411
-        $class = $tc['geodir_wrapper_open_class'];
412
-    }
407
+	if (!empty($tc['geodir_wrapper_open_id'])) {
408
+		$id = $tc['geodir_wrapper_open_id'];
409
+	}
410
+	if (!empty($tc['geodir_wrapper_open_class'])) {
411
+		$class = $tc['geodir_wrapper_open_class'];
412
+	}
413 413
 
414
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
414
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415 415
 
416
-    echo $text;
416
+	echo $text;
417 417
 }
418 418
 
419 419
 // action for adding the wrapperdiv closing tag
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
  */
429 429
 function geodir_action_wrapper_close($type = '')
430 430
 {
431
-    $tc = get_option('theme_compatibility_setting');
432
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
433
-        $text = $tc['geodir_wrapper_close_replace'];
434
-    } else {
435
-        $text = '</div><!-- wrapper ends here-->';
436
-    }
431
+	$tc = get_option('theme_compatibility_setting');
432
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
433
+		$text = $tc['geodir_wrapper_close_replace'];
434
+	} else {
435
+		$text = '</div><!-- wrapper ends here-->';
436
+	}
437 437
 
438
-    echo $text;
438
+	echo $text;
439 439
 }
440 440
 
441 441
 // action for adding the content div opening tag
@@ -451,35 +451,35 @@  discard block
 block discarded – undo
451 451
  */
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
456
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
458
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
460
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
462
-    } else {
463
-        $width_css = '';
464
-    }
465
-
466
-    $tc = get_option('theme_compatibility_setting');
467
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
-        $text = $tc['geodir_wrapper_content_open_replace'];
469
-    } else {
470
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
-    }
472
-
473
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
-        $id = $tc['geodir_wrapper_content_open_id'];
475
-    }
476
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
-        $class = $tc['geodir_wrapper_content_open_class'];
478
-    }
479
-
480
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
-
482
-    echo $text;
454
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
+		$width_css = 'style="width:' . $width . '%;"';
456
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
+		$width_css = 'style="width:' . $width . '%;"';
458
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
+		$width_css = 'style="width:' . $width . '%;"';
460
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
+		$width_css = 'style="width:' . $width . '%;"';
462
+	} else {
463
+		$width_css = '';
464
+	}
465
+
466
+	$tc = get_option('theme_compatibility_setting');
467
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
+		$text = $tc['geodir_wrapper_content_open_replace'];
469
+	} else {
470
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
+	}
472
+
473
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
+		$id = $tc['geodir_wrapper_content_open_id'];
475
+	}
476
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
+		$class = $tc['geodir_wrapper_content_open_class'];
478
+	}
479
+
480
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
+
482
+	echo $text;
483 483
 }
484 484
 
485 485
 // action for adding the primary div closing tag
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_action_wrapper_content_close($type = '')
495 495
 {
496
-    $tc = get_option('theme_compatibility_setting');
497
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
-        $text = $tc['geodir_wrapper_content_close_replace'];
499
-    } else {
500
-        $text = '</div><!-- content ends here-->';
501
-    }
502
-    echo $text;
496
+	$tc = get_option('theme_compatibility_setting');
497
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
+		$text = $tc['geodir_wrapper_content_close_replace'];
499
+	} else {
500
+		$text = '</div><!-- content ends here-->';
501
+	}
502
+	echo $text;
503 503
 }
504 504
 
505 505
 // action for adding the <article> opening tag
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
  */
518 518
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
519 519
 {
520
-    $class = implode(" ", $class);
521
-    $tc = get_option('theme_compatibility_setting');
522
-    if (!empty($tc['geodir_article_open_replace'])) {
523
-        $text = $tc['geodir_article_open_replace'];
524
-    } else {
525
-        $text = '<article  id="[id]" class="[class]" >';
526
-    }
520
+	$class = implode(" ", $class);
521
+	$tc = get_option('theme_compatibility_setting');
522
+	if (!empty($tc['geodir_article_open_replace'])) {
523
+		$text = $tc['geodir_article_open_replace'];
524
+	} else {
525
+		$text = '<article  id="[id]" class="[class]" >';
526
+	}
527 527
 
528
-    if (!empty($tc['geodir_article_open_id'])) {
529
-        $id = $tc['geodir_article_open_id'];
530
-    }
531
-    if (!empty($tc['geodir_article_open_class'])) {
532
-        $class = $tc['geodir_article_open_class'];
533
-    }
528
+	if (!empty($tc['geodir_article_open_id'])) {
529
+		$id = $tc['geodir_article_open_id'];
530
+	}
531
+	if (!empty($tc['geodir_article_open_class'])) {
532
+		$class = $tc['geodir_article_open_class'];
533
+	}
534 534
 
535
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
535
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536 536
 
537
-    echo $text;
537
+	echo $text;
538 538
 }
539 539
 
540 540
 // action for adding the primary div closing tag
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
  */
549 549
 function geodir_action_article_close($type = '')
550 550
 {
551
-    $tc = get_option('theme_compatibility_setting');
552
-    if (!empty($tc['geodir_article_close_replace'])) {
553
-        $text = $tc['geodir_article_close_replace'];
554
-    } else {
555
-        $text = '</article><!-- article ends here-->';
556
-    }
557
-    echo $text;
551
+	$tc = get_option('theme_compatibility_setting');
552
+	if (!empty($tc['geodir_article_close_replace'])) {
553
+		$text = $tc['geodir_article_close_replace'];
554
+	} else {
555
+		$text = '</article><!-- article ends here-->';
556
+	}
557
+	echo $text;
558 558
 }
559 559
 
560 560
 // action for adding the sidebar opening tag
@@ -571,35 +571,35 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
576
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
578
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
580
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
582
-    } else {
583
-        $width_css = '';
584
-    }
585
-
586
-    $tc = get_option('theme_compatibility_setting');
587
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
-        $text = $tc['geodir_sidebar_right_open_replace'];
589
-    } else {
590
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
-    }
592
-
593
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
-        $id = $tc['geodir_sidebar_right_open_id'];
595
-    }
596
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
-        $class = $tc['geodir_sidebar_right_open_class'];
598
-    }
599
-
600
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
-
602
-    echo $text;
574
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
+		$width_css = 'style="width:' . $width . '%;"';
576
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
+		$width_css = 'style="width:' . $width . '%;"';
578
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
+		$width_css = 'style="width:' . $width . '%;"';
580
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
+		$width_css = 'style="width:' . $width . '%;"';
582
+	} else {
583
+		$width_css = '';
584
+	}
585
+
586
+	$tc = get_option('theme_compatibility_setting');
587
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
+		$text = $tc['geodir_sidebar_right_open_replace'];
589
+	} else {
590
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
+	}
592
+
593
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
+		$id = $tc['geodir_sidebar_right_open_id'];
595
+	}
596
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
+		$class = $tc['geodir_sidebar_right_open_class'];
598
+	}
599
+
600
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
+
602
+	echo $text;
603 603
 }
604 604
 
605 605
 // action for adding the primary div closing tag
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
  */
614 614
 function geodir_action_sidebar_right_close($type = '')
615 615
 {
616
-    $tc = get_option('theme_compatibility_setting');
617
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
-        $text = $tc['geodir_sidebar_right_close_replace'];
619
-    } else {
620
-        $text = '</aside><!-- sidebar ends here-->';
621
-    }
622
-    echo $text;
616
+	$tc = get_option('theme_compatibility_setting');
617
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
+		$text = $tc['geodir_sidebar_right_close_replace'];
619
+	} else {
620
+		$text = '</aside><!-- sidebar ends here-->';
621
+	}
622
+	echo $text;
623 623
 }
624 624
 
625 625
 
@@ -640,121 +640,121 @@  discard block
 block discarded – undo
640 640
  */
641 641
 function geodir_action_geodir_set_preview_post()
642 642
 {
643
-    global $post, $preview, $gd_session;
644
-    $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
645
-    if (!$preview || $is_backend_preview) {
646
-        return;
647
-    }// bail if not previewing
648
-
649
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
-
651
-    $fields_info = geodir_get_custom_fields_type($listing_type);
652
-
653
-    foreach ($_REQUEST as $pkey => $pval) {
654
-        if ($pkey == 'geodir_video') {
655
-            $tags = '<iframe>';
656
-        } else if ($pkey == 'post_desc') {
657
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
-        } else if (is_array($_REQUEST[$pkey])) {
661
-            $tags = 'skip_field';
662
-        } else {
663
-            $tags = '';
664
-        }
665
-        /**
666
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
-         *
668
-         * @since 1.0.0
669
-         * @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>'.
670
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
-         */
672
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
-
674
-        if ($tags != 'skip_field') {
675
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
-        }
677
-    }
678
-
679
-    $post = (object)$_REQUEST;
680
-
681
-
682
-    if (isset($post->video)) {
683
-        $post->video = stripslashes($post->video);
684
-    }
685
-
686
-    if (isset($post->Video2)) {
687
-        $post->Video2 = stripslashes($post->Video2);
688
-    }
689
-
690
-    $post_type = $post->listing_type;
691
-    $post_type_info = get_post_type_object($post_type);
692
-
693
-    $listing_label = $post_type_info->labels->singular_name;
694
-
695
-    $term_icon = '';
696
-
697
-    if (!empty($post->post_category)) {
698
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
699
-
700
-            if ($post_term != '' && !is_array($post_term)) {
701
-                $post_term = explode(',', trim($post_term, ','));
702
-            }
643
+	global $post, $preview, $gd_session;
644
+	$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
645
+	if (!$preview || $is_backend_preview) {
646
+		return;
647
+	}// bail if not previewing
648
+
649
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
+
651
+	$fields_info = geodir_get_custom_fields_type($listing_type);
652
+
653
+	foreach ($_REQUEST as $pkey => $pval) {
654
+		if ($pkey == 'geodir_video') {
655
+			$tags = '<iframe>';
656
+		} else if ($pkey == 'post_desc') {
657
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
+		} else if (is_array($_REQUEST[$pkey])) {
661
+			$tags = 'skip_field';
662
+		} else {
663
+			$tags = '';
664
+		}
665
+		/**
666
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
+		 *
668
+		 * @since 1.0.0
669
+		 * @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>'.
670
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
+		 */
672
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
+
674
+		if ($tags != 'skip_field') {
675
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
+		}
677
+	}
678
+
679
+	$post = (object)$_REQUEST;
680
+
681
+
682
+	if (isset($post->video)) {
683
+		$post->video = stripslashes($post->video);
684
+	}
685
+
686
+	if (isset($post->Video2)) {
687
+		$post->Video2 = stripslashes($post->Video2);
688
+	}
689
+
690
+	$post_type = $post->listing_type;
691
+	$post_type_info = get_post_type_object($post_type);
692
+
693
+	$listing_label = $post_type_info->labels->singular_name;
694
+
695
+	$term_icon = '';
696
+
697
+	if (!empty($post->post_category)) {
698
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
699
+
700
+			if ($post_term != '' && !is_array($post_term)) {
701
+				$post_term = explode(',', trim($post_term, ','));
702
+			}
703 703
 
704
-            if (is_array($post_term)) {
705
-                $post_term = array_unique($post_term);
706
-            }
704
+			if (is_array($post_term)) {
705
+				$post_term = array_unique($post_term);
706
+			}
707 707
 
708
-            if (!empty($post_term)) {
709
-                foreach ($post_term as $cat_id) {
710
-                    $cat_id = trim($cat_id);
711
-
712
-                    if ($cat_id != '') {
713
-                        $term_icon = get_option('geodir_default_marker_icon');
714
-
715
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
719
-                                break;
720
-                            }
721
-                        }
722
-                    }
723
-                }
724
-            }
725
-        }
726
-    }
708
+			if (!empty($post_term)) {
709
+				foreach ($post_term as $cat_id) {
710
+					$cat_id = trim($cat_id);
711
+
712
+					if ($cat_id != '') {
713
+						$term_icon = get_option('geodir_default_marker_icon');
714
+
715
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
+									$term_icon = $term_icon_url['src'];
719
+								break;
720
+							}
721
+						}
722
+					}
723
+				}
724
+			}
725
+		}
726
+	}
727 727
 
728
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
728
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
730 730
 
731
-    $srcharr = array("'", "/", "-", '"', '\\');
732
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
733 733
 
734
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
734
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
735 735
 
736
-    $json = '{';
737
-    $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
742
-    $json .= '}';
736
+	$json = '{';
737
+	$json .= '"post_preview": "1",';
738
+	$json .= '"t": "' . $json_title . '",';
739
+	$json .= '"lt": "' . $post_latitude . '",';
740
+	$json .= '"ln": "' . $post_longitude . '",';
741
+	$json .= '"i":"' . $term_icon . '"';
742
+	$json .= '}';
743 743
 
744
-    $post->marker_json = $json;
744
+	$post->marker_json = $json;
745 745
 
746
-    $gd_session->set('listing', $_REQUEST);
746
+	$gd_session->set('listing', $_REQUEST);
747 747
 
748
-    // we need to define a few things to trick the setup_postdata
749
-    if (!isset($post->ID)) {
750
-        $post->ID = '';
751
-        $post->post_author = '';
752
-        $post->post_date = '';
753
-        $post->post_content = '';
754
-        $post->default_category = '';
755
-        $post->post_type = '';
756
-    }
757
-    setup_postdata($post);
748
+	// we need to define a few things to trick the setup_postdata
749
+	if (!isset($post->ID)) {
750
+		$post->ID = '';
751
+		$post->post_author = '';
752
+		$post->post_date = '';
753
+		$post->post_content = '';
754
+		$post->default_category = '';
755
+		$post->post_type = '';
756
+	}
757
+	setup_postdata($post);
758 758
 }
759 759
 
760 760
 /**
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
  */
767 767
 function geodir_action_geodir_preview_code()
768 768
 {
769
-    global $preview;
769
+	global $preview;
770 770
 
771
-    $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
771
+	$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 772
 
773
-    if (!$preview || $is_backend_preview) {
774
-        return;
775
-    }// bail if not previewing
773
+	if (!$preview || $is_backend_preview) {
774
+		return;
775
+	}// bail if not previewing
776 776
 
777
-    geodir_get_template_part('preview', 'buttons');
777
+	geodir_get_template_part('preview', 'buttons');
778 778
 }
779 779
 
780 780
 // action for adding the details page top widget area
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
  */
791 791
 function geodir_action_geodir_sidebar_detail_top($class = '')
792 792
 {
793
-    if (get_option('geodir_show_detail_top_section')) { ?>
793
+	if (get_option('geodir_show_detail_top_section')) { ?>
794 794
         <div
795 795
             class="<?php
796
-            /**
797
-             * Filter the div class for the wrapper of the full width widget areas.
798
-             *
799
-             * 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.
800
-             *
801
-             * @since 1.0.0
802
-             * @param string $class The class of the div.
803
-             * @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',
804
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
-             */
806
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
796
+			/**
797
+			 * Filter the div class for the wrapper of the full width widget areas.
798
+			 *
799
+			 * 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.
800
+			 *
801
+			 * @since 1.0.0
802
+			 * @param string $class The class of the div.
803
+			 * @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',
804
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
+			 */
806
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
807 807
             <?php dynamic_sidebar('geodir_detail_top'); ?>
808 808
         </div>
809 809
     <?php }
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
  */
828 828
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
829 829
 {
830
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
830
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
831 831
         <div
832 832
             class="<?php
833
-            /** This action is documented in geodirectory_template_actions.php */
834
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
833
+			/** This action is documented in geodirectory_template_actions.php */
834
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
835 835
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
836 836
         </div><!-- clearfix ends here-->
837 837
     <?php }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  */
846 846
 function geodir_details_sidebar_widget_area()
847 847
 {
848
-    dynamic_sidebar('geodir_detail_sidebar');
848
+	dynamic_sidebar('geodir_detail_sidebar');
849 849
 }
850 850
 
851 851
 /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
  */
857 857
 function geodir_details_sidebar_place_details()
858 858
 {
859
-    /**
860
-     * Used to add items to the details page sidebar.
861
-     *
862
-     * @since 1.0.0
863
-     */
864
-    do_action('geodir_detail_page_sidebar');
859
+	/**
860
+	 * Used to add items to the details page sidebar.
861
+	 *
862
+	 * @since 1.0.0
863
+	 */
864
+	do_action('geodir_detail_page_sidebar');
865 865
 }
866 866
 
867 867
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -876,68 +876,68 @@  discard block
 block discarded – undo
876 876
  */
877 877
 function geodir_action_details_sidebar()
878 878
 {
879
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
-    if (get_option('geodir_detail_sidebar_left_section')) {
881
-        /**
882
-         * Called before the details page left sidebar is opened.
883
-         *
884
-         * This is used to add opening wrapper HTML to the details page left sidebar.
885
-         *
886
-         * @since 1.0.0
887
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
-         */
892
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
-        ?>
879
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
+	if (get_option('geodir_detail_sidebar_left_section')) {
881
+		/**
882
+		 * Called before the details page left sidebar is opened.
883
+		 *
884
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
885
+		 *
886
+		 * @since 1.0.0
887
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
+		 */
892
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
+		?>
894 894
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
895
-        /**
896
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
-         *
898
-         * This is used to add all info to the details page sidebars.
899
-         *
900
-         * @since 1.0.0
901
-         */
902
-        do_action('geodir_detail_sidebar_inside');
903
-        ?></div><!-- end geodir-content-left --><?php
904
-        /**
905
-         * Called after the details page left sidebar.
906
-         *
907
-         * This is used to add closing wrapper HTML to the details page left sidebar.
908
-         *
909
-         * @since 1.0.0
910
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
-         */
912
-        do_action('geodir_sidebar_left_close', 'details-page');
913
-    } else {
914
-        /**
915
-         * Called before the details page right sidebar is opened.
916
-         *
917
-         * This is used to add opening wrapper HTML to the details page right sidebar.
918
-         *
919
-         * @since 1.0.0
920
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
-         */
925
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
-        ?>
895
+		/**
896
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
+		 *
898
+		 * This is used to add all info to the details page sidebars.
899
+		 *
900
+		 * @since 1.0.0
901
+		 */
902
+		do_action('geodir_detail_sidebar_inside');
903
+		?></div><!-- end geodir-content-left --><?php
904
+		/**
905
+		 * Called after the details page left sidebar.
906
+		 *
907
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
908
+		 *
909
+		 * @since 1.0.0
910
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
+		 */
912
+		do_action('geodir_sidebar_left_close', 'details-page');
913
+	} else {
914
+		/**
915
+		 * Called before the details page right sidebar is opened.
916
+		 *
917
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
918
+		 *
919
+		 * @since 1.0.0
920
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
+		 */
925
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
+		?>
927 927
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
928
-        /** This action is documented in geodirectory_template_actions.php */
929
-        do_action('geodir_detail_sidebar_inside');
930
-        ?></div><!-- end geodir-content-right --><?php
931
-        /**
932
-         * Called after the details page right sidebar.
933
-         *
934
-         * This is used to add closing wrapper HTML to the details page right sidebar.
935
-         *
936
-         * @since 1.0.0
937
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
-         */
939
-        do_action('geodir_sidebar_right_close', 'details-page');
940
-    }
928
+		/** This action is documented in geodirectory_template_actions.php */
929
+		do_action('geodir_detail_sidebar_inside');
930
+		?></div><!-- end geodir-content-right --><?php
931
+		/**
932
+		 * Called after the details page right sidebar.
933
+		 *
934
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
935
+		 *
936
+		 * @since 1.0.0
937
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
+		 */
939
+		do_action('geodir_sidebar_right_close', 'details-page');
940
+	}
941 941
 }
942 942
 
943 943
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -951,21 +951,21 @@  discard block
 block discarded – undo
951 951
  */
952 952
 function geodir_action_page_title()
953 953
 {
954
-    /**
955
-     * Filter the page title HTML h1 class.
956
-     *
957
-     * @since 1.0.0
958
-     * @param string $class The class to use. Default is 'entry-title fn'.
959
-     */
960
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
-    /**
962
-     * Filter the page title HTML header wrapper class.
963
-     *
964
-     * @since 1.0.0
965
-     * @param string $class The class to use. Default is 'entry-header'.
966
-     */
967
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
954
+	/**
955
+	 * Filter the page title HTML h1 class.
956
+	 *
957
+	 * @since 1.0.0
958
+	 * @param string $class The class to use. Default is 'entry-title fn'.
959
+	 */
960
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
+	/**
962
+	 * Filter the page title HTML header wrapper class.
963
+	 *
964
+	 * @since 1.0.0
965
+	 * @param string $class The class to use. Default is 'entry-header'.
966
+	 */
967
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -982,87 +982,87 @@  discard block
 block discarded – undo
982 982
  */
983 983
 function geodir_action_details_slider()
984 984
 {
985
-    global $preview, $post;
985
+	global $preview, $post;
986 986
 
987
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
987
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988 988
 
989
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
989
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
991 991
 
992
-        $preview_post_images = array();
993
-        if ($preview_get_images) {
994
-            foreach ($preview_get_images as $row) {
995
-                $preview_post_images[] = $row->src;
996
-            }
997
-        }
998
-        if (!empty($preview_post_images)) {
999
-            $post->post_images = implode(',', $preview_post_images);
1000
-        }
1001
-    }
1002
-
1003
-    if ($preview) {
1004
-        $post_images = array();
1005
-        if (isset($post->post_images) && !empty($post->post_images)) {
1006
-            $post->post_images = trim($post->post_images, ",");
1007
-            $post_images = explode(",", $post->post_images);
1008
-        }
1009
-
1010
-        $main_slides = '';
1011
-        $nav_slides = '';
1012
-        $slides = 0;
1013
-
1014
-        if (!empty($post_images)) {
1015
-            foreach ($post_images as $image) {
1016
-                if (!empty($image)) {
1017
-                    $sizes = getimagesize(trim($image));
1018
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
-
1021
-                    if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
-                    }
1024
-
1025
-                    if (isset($image->src)) {
1026
-                        if ($image->height >= 400) {
1027
-                            $spacer_height = 0;
1028
-                        } else {
1029
-                            $spacer_height = ((400 - $image->height) / 2);
1030
-                        }
1031
-
1032
-                        $image_title = isset($image->title) ? $image->title : '';
1033
-
1034
-                        $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;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
-                        $slides++;
1038
-                    }
1039
-                }
1040
-            }// endfore
1041
-        } //end if
1042
-    } else {
1043
-        $main_slides = '';
1044
-        $nav_slides = '';
1045
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
-        $slides = 0;
1047
-
1048
-        if (!empty($post_images)) {
1049
-            foreach ($post_images as $image) {
1050
-                if ($image->height >= 400) {
1051
-                    $spacer_height = 0;
1052
-                } else {
1053
-                    $spacer_height = ((400 - $image->height) / 2);
1054
-                }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $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;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
-                $slides++;
1060
-            }
1061
-        }// endfore
1062
-    }
992
+		$preview_post_images = array();
993
+		if ($preview_get_images) {
994
+			foreach ($preview_get_images as $row) {
995
+				$preview_post_images[] = $row->src;
996
+			}
997
+		}
998
+		if (!empty($preview_post_images)) {
999
+			$post->post_images = implode(',', $preview_post_images);
1000
+		}
1001
+	}
1002
+
1003
+	if ($preview) {
1004
+		$post_images = array();
1005
+		if (isset($post->post_images) && !empty($post->post_images)) {
1006
+			$post->post_images = trim($post->post_images, ",");
1007
+			$post_images = explode(",", $post->post_images);
1008
+		}
1009
+
1010
+		$main_slides = '';
1011
+		$nav_slides = '';
1012
+		$slides = 0;
1013
+
1014
+		if (!empty($post_images)) {
1015
+			foreach ($post_images as $image) {
1016
+				if (!empty($image)) {
1017
+					$sizes = getimagesize(trim($image));
1018
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
+
1021
+					if ($image && $width && $height) {
1022
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+					}
1024
+
1025
+					if (isset($image->src)) {
1026
+						if ($image->height >= 400) {
1027
+							$spacer_height = 0;
1028
+						} else {
1029
+							$spacer_height = ((400 - $image->height) / 2);
1030
+						}
1031
+
1032
+						$image_title = isset($image->title) ? $image->title : '';
1033
+
1034
+						$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;" />';
1035
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
+						$slides++;
1038
+					}
1039
+				}
1040
+			}// endfore
1041
+		} //end if
1042
+	} else {
1043
+		$main_slides = '';
1044
+		$nav_slides = '';
1045
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
+		$slides = 0;
1047
+
1048
+		if (!empty($post_images)) {
1049
+			foreach ($post_images as $image) {
1050
+				if ($image->height >= 400) {
1051
+					$spacer_height = 0;
1052
+				} else {
1053
+					$spacer_height = ((400 - $image->height) / 2);
1054
+				}
1055
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+				$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;" />';
1057
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
+				$slides++;
1060
+			}
1061
+		}// endfore
1062
+	}
1063 1063
 
1064
-    if (!empty($post_images)) {
1065
-        ?>
1064
+	if (!empty($post_images)) {
1065
+		?>
1066 1066
         <div class="geodir_flex-container">
1067 1067
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1068 1068
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
             <?php } ?>
1076 1076
         </div>
1077 1077
     <?php
1078
-    }
1078
+	}
1079 1079
 }
1080 1080
 
1081 1081
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1090,176 +1090,176 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+	global $preview, $post;?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096
-    $taxonomies = array();
1097
-
1098
-    $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
1099
-
1100
-    if ($preview && !$is_backend_preview) {
1101
-        $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1103
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
-    } else {
1105
-        $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1107
-    }
1096
+	$taxonomies = array();
1097
+
1098
+	$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
1099
+
1100
+	if ($preview && !$is_backend_preview) {
1101
+		$post_type = $post->listing_type;
1102
+		$post_taxonomy = $post_type . 'category';
1103
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
+	} else {
1105
+		$post_type = $post->post_type;
1106
+		$post_taxonomy = $post_type . 'category';
1107
+	}
1108 1108
 //{	
1109
-    $post_type_info = get_post_type_object($post_type);
1110
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
-
1112
-    if (!empty($post->post_tags)) {
1113
-
1114
-        if (taxonomy_exists($post_type . '_tags')):
1115
-            $links = array();
1116
-            $terms = array();
1117
-            // to limit post tags
1118
-            $post_tags = trim($post->post_tags, ",");
1119
-            $post_id = isset($post->ID) ? $post->ID : '';
1120
-            /**
1121
-             * Filter the post tags.
1122
-             *
1123
-             * Allows you to filter the post tags output on the details page of a post.
1124
-             *
1125
-             * @since 1.0.0
1126
-             * @param string $post_tags A comma seperated list of tags.
1127
-             * @param int $post_id The current post id.
1128
-             */
1129
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
-
1131
-            $post->post_tags = $post_tags;
1132
-            $post_tags = explode(",", trim($post->post_tags, ","));
1133
-
1134
-            foreach ($post_tags as $post_term) {
1135
-
1136
-                // fix slug creation order for tags & location
1137
-                $post_term = trim($post_term);
1138
-
1139
-                $priority_location = false;
1140
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1141
-                    $term = get_term_by('name', $post_term, $post_type . '_tags');
1142
-                } else {
1143
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1144
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1145
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1146
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1147
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1148
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1149
-                    if ($match_country || $match_region || $match_city) {
1150
-                        $priority_location = true;
1151
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1152
-                    } else {
1153
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1154
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1155
-                    }
1156
-                }
1157
-
1158
-                if (!is_wp_error($term) && is_object($term)) {
1159
-
1160
-                    // fix tag link on detail page
1161
-                    if ($priority_location) {
1162
-
1163
-                        $tag_link = "<a href=''>$post_term</a>";
1164
-                        /**
1165
-                         * Filter the tag name on the details page.
1166
-                         *
1167
-                         * @since 1.5.6
1168
-                         * @param string $tag_link The tag link html.
1169
-                         * @param object $term The tag term object.
1170
-                         */
1171
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
-                        $links[] = $tag_link;
1173
-                    } else {
1174
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
-                        /** This action is documented in geodirectory-template_actions.php */
1176
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
-                        $links[] = $tag_link;
1178
-                    }
1179
-                    $terms[] = $term;
1180
-                }
1181
-                //
1182
-            }
1183
-            if (!isset($listing_label)) {
1184
-                $listing_label = '';
1185
-            }
1186
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
-        endif;
1188
-
1189
-    }
1190
-
1191
-    if (!empty($post->{$post_taxonomy})) {
1192
-        $links = array();
1193
-        $terms = array();
1194
-        $termsOrdered = array();
1195
-        if (!is_array($post->{$post_taxonomy})) {
1196
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1197
-        } else {
1198
-            $post_term = $post->{$post_taxonomy};
1109
+	$post_type_info = get_post_type_object($post_type);
1110
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
+
1112
+	if (!empty($post->post_tags)) {
1113
+
1114
+		if (taxonomy_exists($post_type . '_tags')):
1115
+			$links = array();
1116
+			$terms = array();
1117
+			// to limit post tags
1118
+			$post_tags = trim($post->post_tags, ",");
1119
+			$post_id = isset($post->ID) ? $post->ID : '';
1120
+			/**
1121
+			 * Filter the post tags.
1122
+			 *
1123
+			 * Allows you to filter the post tags output on the details page of a post.
1124
+			 *
1125
+			 * @since 1.0.0
1126
+			 * @param string $post_tags A comma seperated list of tags.
1127
+			 * @param int $post_id The current post id.
1128
+			 */
1129
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
+
1131
+			$post->post_tags = $post_tags;
1132
+			$post_tags = explode(",", trim($post->post_tags, ","));
1133
+
1134
+			foreach ($post_tags as $post_term) {
1135
+
1136
+				// fix slug creation order for tags & location
1137
+				$post_term = trim($post_term);
1138
+
1139
+				$priority_location = false;
1140
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1141
+					$term = get_term_by('name', $post_term, $post_type . '_tags');
1142
+				} else {
1143
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1144
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1145
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1146
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1147
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1148
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1149
+					if ($match_country || $match_region || $match_city) {
1150
+						$priority_location = true;
1151
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1152
+					} else {
1153
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1154
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1155
+					}
1156
+				}
1157
+
1158
+				if (!is_wp_error($term) && is_object($term)) {
1159
+
1160
+					// fix tag link on detail page
1161
+					if ($priority_location) {
1162
+
1163
+						$tag_link = "<a href=''>$post_term</a>";
1164
+						/**
1165
+						 * Filter the tag name on the details page.
1166
+						 *
1167
+						 * @since 1.5.6
1168
+						 * @param string $tag_link The tag link html.
1169
+						 * @param object $term The tag term object.
1170
+						 */
1171
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
+						$links[] = $tag_link;
1173
+					} else {
1174
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
+						/** This action is documented in geodirectory-template_actions.php */
1176
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
+						$links[] = $tag_link;
1178
+					}
1179
+					$terms[] = $term;
1180
+				}
1181
+				//
1182
+			}
1183
+			if (!isset($listing_label)) {
1184
+				$listing_label = '';
1185
+			}
1186
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
+		endif;
1188
+
1189
+	}
1190
+
1191
+	if (!empty($post->{$post_taxonomy})) {
1192
+		$links = array();
1193
+		$terms = array();
1194
+		$termsOrdered = array();
1195
+		if (!is_array($post->{$post_taxonomy})) {
1196
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1197
+		} else {
1198
+			$post_term = $post->{$post_taxonomy};
1199 1199
 			
1200 1200
 			if ($preview && !$is_backend_preview) {
1201 1201
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1202 1202
 			}
1203
-        }
1204
-
1205
-        $post_term = array_unique($post_term);
1206
-        if (!empty($post_term)) {
1207
-            foreach ($post_term as $post_term) {
1208
-                $post_term = trim($post_term);
1209
-
1210
-                if ($post_term != ''):
1211
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1212
-
1213
-                    if (is_object($term)) {
1214
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
-                        /**
1216
-                         * Filter the category name on the details page.
1217
-                         *
1218
-                         * @since 1.5.6
1219
-                         * @param string $term_link The link html to the category.
1220
-                         * @param object $term The category term object.
1221
-                         */
1222
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
-                        $links[] = $term_link;
1224
-                        $terms[] = $term;
1225
-                    }
1226
-                endif;
1227
-            }
1228
-            // order alphabetically
1229
-            asort($links);
1230
-            foreach (array_keys($links) as $key) {
1231
-                $termsOrdered[$key] = $terms[$key];
1232
-            }
1233
-            $terms = $termsOrdered;
1203
+		}
1204
+
1205
+		$post_term = array_unique($post_term);
1206
+		if (!empty($post_term)) {
1207
+			foreach ($post_term as $post_term) {
1208
+				$post_term = trim($post_term);
1209
+
1210
+				if ($post_term != ''):
1211
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1212
+
1213
+					if (is_object($term)) {
1214
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
+						/**
1216
+						 * Filter the category name on the details page.
1217
+						 *
1218
+						 * @since 1.5.6
1219
+						 * @param string $term_link The link html to the category.
1220
+						 * @param object $term The category term object.
1221
+						 */
1222
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
+						$links[] = $term_link;
1224
+						$terms[] = $term;
1225
+					}
1226
+				endif;
1227
+			}
1228
+			// order alphabetically
1229
+			asort($links);
1230
+			foreach (array_keys($links) as $key) {
1231
+				$termsOrdered[$key] = $terms[$key];
1232
+			}
1233
+			$terms = $termsOrdered;
1234 1234
 
1235
-        }
1235
+		}
1236 1236
 
1237
-        if (!isset($listing_label)) {
1238
-            $listing_label = '';
1239
-        }
1240
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1237
+		if (!isset($listing_label)) {
1238
+			$listing_label = '';
1239
+		}
1240
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1241 1241
 
1242
-    }
1242
+	}
1243 1243
 
1244
-    /**
1245
-     * Filter the taxonomies array before output.
1246
-     *
1247
-     * @since 1.5.9
1248
-     * @param array $taxonomies The array of cats and tags.
1249
-     * @param string $post_type The post type being output.
1250
-     * @param string $listing_label The post type label.
1251
-     * @param string $listing_label The post type label with ucwords function.
1252
-     */
1253
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1244
+	/**
1245
+	 * Filter the taxonomies array before output.
1246
+	 *
1247
+	 * @since 1.5.9
1248
+	 * @param array $taxonomies The array of cats and tags.
1249
+	 * @param string $post_type The post type being output.
1250
+	 * @param string $listing_label The post type label.
1251
+	 * @param string $listing_label The post type label with ucwords function.
1252
+	 */
1253
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1254 1254
 
1255
-    if (isset($taxonomies[$post_taxonomy])) {
1256
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
-    }
1255
+	if (isset($taxonomies[$post_taxonomy])) {
1256
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
+	}
1258 1258
 
1259
-    if (isset($taxonomies[$post_type . '_tags']))
1260
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1259
+	if (isset($taxonomies[$post_type . '_tags']))
1260
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1261 1261
 
1262
-    ?>
1262
+	?>
1263 1263
     </p><?php
1264 1264
 }
1265 1265
 
@@ -1281,127 +1281,127 @@  discard block
 block discarded – undo
1281 1281
 function geodir_action_details_micordata($post='')
1282 1282
 {
1283 1283
 
1284
-    global $preview;
1285
-    if(empty($post)){global $post;}
1286
-    if ($preview || !geodir_is_page('detail')) {
1287
-        return;
1288
-    }
1289
-
1290
-    // url
1291
-    $c_url = geodir_curPageURL();
1292
-
1293
-    // post reviews
1294
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1295
-    if (empty($post_reviews)) {
1296
-        $reviews = '';
1297
-    } else {
1298
-        foreach ($post_reviews as $review) {
1299
-            $reviews[] = array(
1300
-                "@type" => "Review",
1301
-                "author" => $review->comment_author,
1302
-                "datePublished" => $review->comment_date,
1303
-                "description" => $review->comment_content,
1304
-                "reviewRating" => array(
1305
-                    "@type" => "Rating",
1306
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1308
-                    "worstRating" => "1"
1309
-                )
1310
-            );
1311
-        }
1312
-
1313
-    }
1314
-
1315
-    // post images
1316
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1317
-    if (empty($post_images)) {
1318
-        $images = '';
1319
-    } else {
1320
-        $i_arr = array();
1321
-        foreach ($post_images as $img) {
1322
-            $i_arr[] = $img->src;
1323
-        }
1324
-
1325
-        if (count($i_arr) == 1) {
1326
-            $images = $i_arr[0];
1327
-        } else {
1328
-            $images = $i_arr;
1329
-        }
1330
-
1331
-    }
1332
-    //print_r($post);
1333
-    // external links
1334
-    $external_links =  array();
1335
-    $external_links[] = $post->geodir_website;
1336
-    $external_links[] = $post->geodir_twitter;
1337
-    $external_links[] = $post->geodir_facebook;
1338
-    $external_links = array_filter($external_links);
1339
-
1340
-    if(!empty($external_links)){
1341
-        $external_links = array_values($external_links);
1342
-    }
1343
-
1344
-    // reviews
1345
-    $comment_count = geodir_get_review_count_total($post->ID);
1346
-    $post_avgratings = geodir_get_post_rating($post->ID);
1347
-
1348
-    // schema type
1349
-    $schema_type = 'LocalBusiness';
1350
-    if(isset($post->default_category) && $post->default_category){
1351
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1352
-        if($cat_schema){$schema_type = $cat_schema;}
1353
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1354
-    }
1355
-
1356
-    $schema = array();
1357
-    $schema['@context'] = "http://schema.org";
1358
-    $schema['@type'] = $schema_type;
1359
-    $schema['name'] = $post->post_name;
1360
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1361
-    $schema['telephone'] = $post->geodir_contact;
1362
-    $schema['url'] = $c_url;
1363
-    $schema['sameAs'] = $external_links;
1364
-    $schema['image'] = $images;
1365
-    $schema['address'] = array(
1366
-        "@type" => "PostalAddress",
1367
-        "streetAddress" => $post->post_address,
1368
-        "addressLocality" => $post->post_city,
1369
-        "addressRegion" => $post->post_region,
1370
-        "addressCountry" => $post->post_country,
1371
-        "postalCode" => $post->post_zip
1372
-    );
1373
-
1374
-    if($post->post_latitude && $post->post_longitude) {
1375
-        $schema['geo'] = array(
1376
-            "@type" => "GeoCoordinates",
1377
-            "latitude" => $post->post_latitude,
1378
-            "longitude" => $post->post_longitude
1379
-        );
1380
-    }
1381
-
1382
-    if($post_avgratings) {
1383
-        $schema['aggregateRating'] = array(
1384
-            "@type" => "AggregateRating",
1385
-            "ratingValue" => $post_avgratings,
1386
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1387
-            "worstRating" => "1",
1388
-            "ratingCount" => $comment_count
1389
-        );
1390
-    }
1391
-    $schema['review'] = $reviews;
1392
-
1393
-    /**
1394
-     * Allow the schema JSON-LD info to be filtered.
1395
-     *
1396
-     * @since 1.5.4
1397
-     * @since 1.5.7 Added $post variable.
1398
-     * @param array $schema The array of schema data to be filtered.
1399
-     * @param object $post The post object.
1400
-     */
1401
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1402
-
1403
-
1404
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1284
+	global $preview;
1285
+	if(empty($post)){global $post;}
1286
+	if ($preview || !geodir_is_page('detail')) {
1287
+		return;
1288
+	}
1289
+
1290
+	// url
1291
+	$c_url = geodir_curPageURL();
1292
+
1293
+	// post reviews
1294
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1295
+	if (empty($post_reviews)) {
1296
+		$reviews = '';
1297
+	} else {
1298
+		foreach ($post_reviews as $review) {
1299
+			$reviews[] = array(
1300
+				"@type" => "Review",
1301
+				"author" => $review->comment_author,
1302
+				"datePublished" => $review->comment_date,
1303
+				"description" => $review->comment_content,
1304
+				"reviewRating" => array(
1305
+					"@type" => "Rating",
1306
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1308
+					"worstRating" => "1"
1309
+				)
1310
+			);
1311
+		}
1312
+
1313
+	}
1314
+
1315
+	// post images
1316
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1317
+	if (empty($post_images)) {
1318
+		$images = '';
1319
+	} else {
1320
+		$i_arr = array();
1321
+		foreach ($post_images as $img) {
1322
+			$i_arr[] = $img->src;
1323
+		}
1324
+
1325
+		if (count($i_arr) == 1) {
1326
+			$images = $i_arr[0];
1327
+		} else {
1328
+			$images = $i_arr;
1329
+		}
1330
+
1331
+	}
1332
+	//print_r($post);
1333
+	// external links
1334
+	$external_links =  array();
1335
+	$external_links[] = $post->geodir_website;
1336
+	$external_links[] = $post->geodir_twitter;
1337
+	$external_links[] = $post->geodir_facebook;
1338
+	$external_links = array_filter($external_links);
1339
+
1340
+	if(!empty($external_links)){
1341
+		$external_links = array_values($external_links);
1342
+	}
1343
+
1344
+	// reviews
1345
+	$comment_count = geodir_get_review_count_total($post->ID);
1346
+	$post_avgratings = geodir_get_post_rating($post->ID);
1347
+
1348
+	// schema type
1349
+	$schema_type = 'LocalBusiness';
1350
+	if(isset($post->default_category) && $post->default_category){
1351
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1352
+		if($cat_schema){$schema_type = $cat_schema;}
1353
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1354
+	}
1355
+
1356
+	$schema = array();
1357
+	$schema['@context'] = "http://schema.org";
1358
+	$schema['@type'] = $schema_type;
1359
+	$schema['name'] = $post->post_name;
1360
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1361
+	$schema['telephone'] = $post->geodir_contact;
1362
+	$schema['url'] = $c_url;
1363
+	$schema['sameAs'] = $external_links;
1364
+	$schema['image'] = $images;
1365
+	$schema['address'] = array(
1366
+		"@type" => "PostalAddress",
1367
+		"streetAddress" => $post->post_address,
1368
+		"addressLocality" => $post->post_city,
1369
+		"addressRegion" => $post->post_region,
1370
+		"addressCountry" => $post->post_country,
1371
+		"postalCode" => $post->post_zip
1372
+	);
1373
+
1374
+	if($post->post_latitude && $post->post_longitude) {
1375
+		$schema['geo'] = array(
1376
+			"@type" => "GeoCoordinates",
1377
+			"latitude" => $post->post_latitude,
1378
+			"longitude" => $post->post_longitude
1379
+		);
1380
+	}
1381
+
1382
+	if($post_avgratings) {
1383
+		$schema['aggregateRating'] = array(
1384
+			"@type" => "AggregateRating",
1385
+			"ratingValue" => $post_avgratings,
1386
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1387
+			"worstRating" => "1",
1388
+			"ratingCount" => $comment_count
1389
+		);
1390
+	}
1391
+	$schema['review'] = $reviews;
1392
+
1393
+	/**
1394
+	 * Allow the schema JSON-LD info to be filtered.
1395
+	 *
1396
+	 * @since 1.5.4
1397
+	 * @since 1.5.7 Added $post variable.
1398
+	 * @param array $schema The array of schema data to be filtered.
1399
+	 * @param object $post The post object.
1400
+	 */
1401
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1402
+
1403
+
1404
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1405 1405
 
1406 1406
 }
1407 1407
 
@@ -1419,7 +1419,7 @@  discard block
 block discarded – undo
1419 1419
  */
1420 1420
 function geodir_action_details_next_prev()
1421 1421
 {
1422
-    ?>
1422
+	?>
1423 1423
     <div class="geodir-pos_navigation clearfix">
1424 1424
     <div
1425 1425
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1437,15 +1437,15 @@  discard block
 block discarded – undo
1437 1437
  */
1438 1438
 function geodir_action_before_single_post()
1439 1439
 {
1440
-    global $post;
1441
-    /**
1442
-     * Called at the very start of the details page output, before the title section.
1443
-     *
1444
-     * @since 1.0.0
1445
-     * @param object $post The current post object.
1446
-     * @global WP_Post|null $post The current post, if available.
1447
-     */
1448
-    do_action('geodir_before_single_post', $post); // extra action	
1440
+	global $post;
1441
+	/**
1442
+	 * Called at the very start of the details page output, before the title section.
1443
+	 *
1444
+	 * @since 1.0.0
1445
+	 * @param object $post The current post object.
1446
+	 * @global WP_Post|null $post The current post, if available.
1447
+	 */
1448
+	do_action('geodir_before_single_post', $post); // extra action	
1449 1449
 }
1450 1450
 
1451 1451
 /**
@@ -1456,13 +1456,13 @@  discard block
 block discarded – undo
1456 1456
  */
1457 1457
 function geodir_action_after_single_post($post)
1458 1458
 {
1459
-    /**
1460
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1461
-     *
1462
-     * @since 1.0.0
1463
-     * @param object $post The current post object.
1464
-     */
1465
-    do_action('geodir_after_single_post', $post); // extra action	
1459
+	/**
1460
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1461
+	 *
1462
+	 * @since 1.0.0
1463
+	 * @param object $post The current post object.
1464
+	 */
1465
+	do_action('geodir_after_single_post', $post); // extra action	
1466 1466
 }
1467 1467
 
1468 1468
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1488,167 +1488,167 @@  discard block
 block discarded – undo
1488 1488
  */
1489 1489
 function geodir_action_listings_title()
1490 1490
 {
1491
-    global $wp, $term;
1491
+	global $wp, $term;
1492 1492
 
1493
-    $gd_post_type = geodir_get_current_posttype();
1494
-    $post_type_info = get_post_type_object($gd_post_type);
1493
+	$gd_post_type = geodir_get_current_posttype();
1494
+	$post_type_info = get_post_type_object($gd_post_type);
1495 1495
 
1496
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1497
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1498
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1499
-    }
1496
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1497
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1498
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1499
+	}
1500 1500
 
1501
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1502
-    $single_name = $post_type_info->labels->singular_name;
1501
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1502
+	$single_name = $post_type_info->labels->singular_name;
1503 1503
 
1504
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1504
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1505 1505
 
1506
-    $gd_country = get_query_var('gd_country');
1507
-    $gd_region = get_query_var('gd_region');
1508
-    $gd_city = get_query_var('gd_city');
1506
+	$gd_country = get_query_var('gd_country');
1507
+	$gd_region = get_query_var('gd_region');
1508
+	$gd_city = get_query_var('gd_city');
1509 1509
 
1510
-    if (!empty($term)) {
1511
-        $location_name = '';
1512
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1513
-            if ($gd_country != '') {
1514
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1515
-            }
1516
-
1517
-            if ($gd_region != '') {
1518
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1519
-            }
1520
-
1521
-            if ($gd_city != '') {
1522
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1523
-            }
1524
-        }
1525
-
1526
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1527
-        if (!empty($current_term)) {
1528
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1529
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1530
-                $location_last_char = substr($location_name, -1);
1531
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1532
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1533
-            } else {
1534
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1535
-            }
1536
-        } else {
1537
-            if (count($taxonomy) > 1) {
1538
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1539
-
1540
-                if (!empty($current_term)) {
1541
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1542
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1543
-                        $location_last_char = substr($location_name, -1);
1544
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1545
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1546
-                    } else {
1547
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1548
-                    }
1549
-                }
1550
-            }
1551
-        }
1552
-
1553
-    } else {
1554
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1555
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1556
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1557
-
1558
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1559
-
1560
-        if (function_exists('get_actual_location_name')) {
1561
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1562
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1563
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1564
-        }
1565
-
1566
-        if ($gd_city != '') {
1567
-            if ($gd_city_actual != '') {
1568
-                $gd_city = $gd_city_actual;
1569
-            } else {
1570
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1571
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1572
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1573
-            }
1574
-
1575
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1576
-        } else if ($gd_region != '') {
1577
-            if ($gd_region_actual != '') {
1578
-                $gd_region = $gd_region_actual;
1579
-            } else {
1580
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1581
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1582
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1583
-            }
1584
-
1585
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1586
-        } else if ($gd_country != '') {
1587
-            if ($gd_country_actual != '') {
1588
-                $gd_country = $gd_country_actual;
1589
-            } else {
1590
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1591
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1592
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1593
-            }
1594
-
1595
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1596
-        }
1597
-    }
1598
-
1599
-    if (is_search()) {
1600
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1601
-    }
1602
-    /** This action is documented in geodirectory_template_actions.php */
1603
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1604
-    /** This action is documented in geodirectory_template_actions.php */
1605
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1606
-
1607
-
1608
-    $title = $list_title;
1609
-    if(geodir_is_page('pt')){
1610
-        $gd_page = 'pt';
1611
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1612
-    }
1613
-    elseif(geodir_is_page('listing')){
1614
-        $gd_page = 'listing';
1615
-        global $wp_query;
1616
-        $current_term = $wp_query->get_queried_object();
1617
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1618
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1619
-        }else{
1620
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1621
-        }
1510
+	if (!empty($term)) {
1511
+		$location_name = '';
1512
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1513
+			if ($gd_country != '') {
1514
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1515
+			}
1622 1516
 
1623
-    }
1624
-    elseif(geodir_is_page('author')){
1625
-        $gd_page = 'author';
1626
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1627
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1628
-        }else{
1629
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1630
-        }
1517
+			if ($gd_region != '') {
1518
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1519
+			}
1631 1520
 
1632
-    }
1521
+			if ($gd_city != '') {
1522
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1523
+			}
1524
+		}
1525
+
1526
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1527
+		if (!empty($current_term)) {
1528
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1529
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1530
+				$location_last_char = substr($location_name, -1);
1531
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1532
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1533
+			} else {
1534
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1535
+			}
1536
+		} else {
1537
+			if (count($taxonomy) > 1) {
1538
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1539
+
1540
+				if (!empty($current_term)) {
1541
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1542
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1543
+						$location_last_char = substr($location_name, -1);
1544
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1545
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1546
+					} else {
1547
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1548
+					}
1549
+				}
1550
+			}
1551
+		}
1552
+
1553
+	} else {
1554
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1555
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1556
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1557
+
1558
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1559
+
1560
+		if (function_exists('get_actual_location_name')) {
1561
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1562
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1563
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1564
+		}
1565
+
1566
+		if ($gd_city != '') {
1567
+			if ($gd_city_actual != '') {
1568
+				$gd_city = $gd_city_actual;
1569
+			} else {
1570
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1571
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1572
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1573
+			}
1633 1574
 
1575
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1576
+		} else if ($gd_region != '') {
1577
+			if ($gd_region_actual != '') {
1578
+				$gd_region = $gd_region_actual;
1579
+			} else {
1580
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1581
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1582
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1583
+			}
1634 1584
 
1635
-    /**
1636
-     * Filter page title to replace variables.
1637
-     *
1638
-     * @since 1.5.4
1639
-     * @param string $title The page title including variables.
1640
-     * @param string $gd_page The GeoDirectory page type if any.
1641
-     */
1642
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1585
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1586
+		} else if ($gd_country != '') {
1587
+			if ($gd_country_actual != '') {
1588
+				$gd_country = $gd_country_actual;
1589
+			} else {
1590
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1591
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1592
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1593
+			}
1643 1594
 
1644
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1645
-        /**
1646
-         * Filter the listing page title.
1647
-         *
1648
-         * @since 1.0.0
1649
-         * @param string $list_title The title for the category page.
1650
-         */
1651
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1595
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1596
+		}
1597
+	}
1598
+
1599
+	if (is_search()) {
1600
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1601
+	}
1602
+	/** This action is documented in geodirectory_template_actions.php */
1603
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1604
+	/** This action is documented in geodirectory_template_actions.php */
1605
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1606
+
1607
+
1608
+	$title = $list_title;
1609
+	if(geodir_is_page('pt')){
1610
+		$gd_page = 'pt';
1611
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1612
+	}
1613
+	elseif(geodir_is_page('listing')){
1614
+		$gd_page = 'listing';
1615
+		global $wp_query;
1616
+		$current_term = $wp_query->get_queried_object();
1617
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1618
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1619
+		}else{
1620
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1621
+		}
1622
+
1623
+	}
1624
+	elseif(geodir_is_page('author')){
1625
+		$gd_page = 'author';
1626
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1627
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1628
+		}else{
1629
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1630
+		}
1631
+
1632
+	}
1633
+
1634
+
1635
+	/**
1636
+	 * Filter page title to replace variables.
1637
+	 *
1638
+	 * @since 1.5.4
1639
+	 * @param string $title The page title including variables.
1640
+	 * @param string $gd_page The GeoDirectory page type if any.
1641
+	 */
1642
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1643
+
1644
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1645
+		/**
1646
+		 * Filter the listing page title.
1647
+		 *
1648
+		 * @since 1.0.0
1649
+		 * @param string $list_title The title for the category page.
1650
+		 */
1651
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1652 1652
 }
1653 1653
 
1654 1654
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1661,33 +1661,33 @@  discard block
 block discarded – undo
1661 1661
  */
1662 1662
 function geodir_action_listings_description()
1663 1663
 {
1664
-    global $wp_query;
1665
-    $current_term = $wp_query->get_queried_object();
1666
-
1667
-    $gd_post_type = geodir_get_current_posttype();
1668
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1669
-
1670
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1671
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1672
-        if ($term_desc && !$saved_data) {
1673
-            $saved_data = $term_desc;
1674
-        }
1675
-        /**
1676
-         * Apply the core filter `the_content` filter to the variable string.
1677
-         *
1678
-         * This is a WordPress core filter that does many things.
1679
-         *
1680
-         * @since 1.0.0
1681
-         * @param string $var The string to apply the filter to.
1682
-         */
1683
-        $cat_description = apply_filters('the_content', $saved_data);
1684
-        if ($cat_description) {
1685
-            ?>
1664
+	global $wp_query;
1665
+	$current_term = $wp_query->get_queried_object();
1666
+
1667
+	$gd_post_type = geodir_get_current_posttype();
1668
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1669
+
1670
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1671
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1672
+		if ($term_desc && !$saved_data) {
1673
+			$saved_data = $term_desc;
1674
+		}
1675
+		/**
1676
+		 * Apply the core filter `the_content` filter to the variable string.
1677
+		 *
1678
+		 * This is a WordPress core filter that does many things.
1679
+		 *
1680
+		 * @since 1.0.0
1681
+		 * @param string $var The string to apply the filter to.
1682
+		 */
1683
+		$cat_description = apply_filters('the_content', $saved_data);
1684
+		if ($cat_description) {
1685
+			?>
1686 1686
 
1687 1687
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1688
-        }
1688
+		}
1689 1689
 
1690
-    }
1690
+	}
1691 1691
 }
1692 1692
 
1693 1693
 // action for adding the listings page top widget area
@@ -1706,11 +1706,11 @@  discard block
 block discarded – undo
1706 1706
  */
1707 1707
 function geodir_action_geodir_sidebar_listings_top()
1708 1708
 {
1709
-    if (get_option('geodir_show_listing_top_section')) { ?>
1709
+	if (get_option('geodir_show_listing_top_section')) { ?>
1710 1710
         <div
1711 1711
             class="<?php
1712
-            /** This action is documented in geodirectory_template_actions.php */
1713
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1712
+			/** This action is documented in geodirectory_template_actions.php */
1713
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1714 1714
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1715 1715
         </div><!-- clearfix ends here-->
1716 1716
     <?php }
@@ -1733,35 +1733,35 @@  discard block
 block discarded – undo
1733 1733
  */
1734 1734
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1735 1735
 {
1736
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1737
-        $width_css = 'style="width:' . $width . '%;"';
1738
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1739
-        $width_css = 'style="width:' . $width . '%;"';
1740
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1741
-        $width_css = 'style="width:' . $width . '%;"';
1742
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1743
-        $width_css = 'style="width:' . $width . '%;"';
1744
-    } else {
1745
-        $width_css = '';
1746
-    }
1747
-
1748
-    $tc = get_option('theme_compatibility_setting');
1749
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1750
-        $text = $tc['geodir_sidebar_left_open_replace'];
1751
-    } else {
1752
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1753
-    }
1754
-
1755
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1756
-        $id = $tc['geodir_sidebar_left_open_id'];
1757
-    }
1758
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1759
-        $class = $tc['geodir_sidebar_left_open_class'];
1760
-    }
1761
-
1762
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1763
-
1764
-    echo $text;
1736
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1737
+		$width_css = 'style="width:' . $width . '%;"';
1738
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1739
+		$width_css = 'style="width:' . $width . '%;"';
1740
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1741
+		$width_css = 'style="width:' . $width . '%;"';
1742
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1743
+		$width_css = 'style="width:' . $width . '%;"';
1744
+	} else {
1745
+		$width_css = '';
1746
+	}
1747
+
1748
+	$tc = get_option('theme_compatibility_setting');
1749
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1750
+		$text = $tc['geodir_sidebar_left_open_replace'];
1751
+	} else {
1752
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1753
+	}
1754
+
1755
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1756
+		$id = $tc['geodir_sidebar_left_open_id'];
1757
+	}
1758
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1759
+		$class = $tc['geodir_sidebar_left_open_class'];
1760
+	}
1761
+
1762
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1763
+
1764
+	echo $text;
1765 1765
 }
1766 1766
 
1767 1767
 // action for adding the primary div closing tag
@@ -1777,13 +1777,13 @@  discard block
 block discarded – undo
1777 1777
  */
1778 1778
 function geodir_action_sidebar_left_close($type = '')
1779 1779
 {
1780
-    $tc = get_option('theme_compatibility_setting');
1781
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1782
-        $text = $tc['geodir_sidebar_left_close_replace'];
1783
-    } else {
1784
-        $text = '</aside><!-- sidebar ends here-->';
1785
-    }
1786
-    echo $text;
1780
+	$tc = get_option('theme_compatibility_setting');
1781
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1782
+		$text = $tc['geodir_sidebar_left_close_replace'];
1783
+	} else {
1784
+		$text = '</aside><!-- sidebar ends here-->';
1785
+	}
1786
+	echo $text;
1787 1787
 }
1788 1788
 
1789 1789
 /**
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
  */
1797 1797
 function geodir_listing_left_section()
1798 1798
 {
1799
-    if (get_option('geodir_show_listing_left_section')) { ?>
1799
+	if (get_option('geodir_show_listing_left_section')) { ?>
1800 1800
         <div class="geodir-content-left geodir-sidebar-wrap">
1801 1801
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1802 1802
         </div><!-- end geodir-content-left -->
@@ -1814,20 +1814,20 @@  discard block
 block discarded – undo
1814 1814
  */
1815 1815
 function geodir_action_listings_sidebar_left()
1816 1816
 {
1817
-    if (get_option('geodir_show_listing_left_section')) {
1818
-        /** This action is documented in geodirectory_template_actions.php */
1819
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1820
-        /**
1821
-         * Calls the listings page (category) left sidebar content.
1822
-         *
1823
-         * All the content for the listings page left sidebar is added via this hook.
1824
-         *
1825
-         * @since 1.0.0
1826
-         */
1827
-        do_action('geodir_listings_sidebar_left_inside');
1828
-        /** This action is documented in geodirectory_template_actions.php */
1829
-        do_action('geodir_sidebar_left_close', 'listings-page');
1830
-    }
1817
+	if (get_option('geodir_show_listing_left_section')) {
1818
+		/** This action is documented in geodirectory_template_actions.php */
1819
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1820
+		/**
1821
+		 * Calls the listings page (category) left sidebar content.
1822
+		 *
1823
+		 * All the content for the listings page left sidebar is added via this hook.
1824
+		 *
1825
+		 * @since 1.0.0
1826
+		 */
1827
+		do_action('geodir_listings_sidebar_left_inside');
1828
+		/** This action is documented in geodirectory_template_actions.php */
1829
+		do_action('geodir_sidebar_left_close', 'listings-page');
1830
+	}
1831 1831
 }
1832 1832
 
1833 1833
 /**
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
  */
1841 1841
 function geodir_listing_right_section()
1842 1842
 {
1843
-    if (get_option('geodir_show_listing_right_section')) { ?>
1843
+	if (get_option('geodir_show_listing_right_section')) { ?>
1844 1844
         <div class="geodir-content-right geodir-sidebar-wrap">
1845 1845
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1846 1846
         </div><!-- end geodir-content-right -->
@@ -1858,20 +1858,20 @@  discard block
 block discarded – undo
1858 1858
  */
1859 1859
 function geodir_action_listings_sidebar_right()
1860 1860
 {
1861
-    if (get_option('geodir_show_listing_right_section')) {
1862
-        /** This action is documented in geodirectory_template_actions.php */
1863
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1864
-        /**
1865
-         * Calls the listings page (category) right sidebar content.
1866
-         *
1867
-         * All the content for the listings page right sidebar is added via this hook.
1868
-         *
1869
-         * @since 1.0.0
1870
-         */
1871
-        do_action('geodir_listings_sidebar_right_inside');
1872
-        /** This action is documented in geodirectory_template_actions.php */
1873
-        do_action('geodir_sidebar_right_close', 'listings-page');
1874
-    }
1861
+	if (get_option('geodir_show_listing_right_section')) {
1862
+		/** This action is documented in geodirectory_template_actions.php */
1863
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1864
+		/**
1865
+		 * Calls the listings page (category) right sidebar content.
1866
+		 *
1867
+		 * All the content for the listings page right sidebar is added via this hook.
1868
+		 *
1869
+		 * @since 1.0.0
1870
+		 */
1871
+		do_action('geodir_listings_sidebar_right_inside');
1872
+		/** This action is documented in geodirectory_template_actions.php */
1873
+		do_action('geodir_sidebar_right_close', 'listings-page');
1874
+	}
1875 1875
 }
1876 1876
 
1877 1877
 
@@ -1888,23 +1888,23 @@  discard block
 block discarded – undo
1888 1888
  */
1889 1889
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1890 1890
 {
1891
-    $tc = get_option('theme_compatibility_setting');
1892
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1893
-        $text = $tc['geodir_main_content_open_replace'];
1894
-    } else {
1895
-        $text = '<main id="[id]" class="[class]" role="main">';
1896
-    }
1891
+	$tc = get_option('theme_compatibility_setting');
1892
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1893
+		$text = $tc['geodir_main_content_open_replace'];
1894
+	} else {
1895
+		$text = '<main id="[id]" class="[class]" role="main">';
1896
+	}
1897 1897
 
1898
-    if (!empty($tc['geodir_main_content_open_id'])) {
1899
-        $id = $tc['geodir_main_content_open_id'];
1900
-    }
1901
-    if (!empty($tc['geodir_main_content_open_class'])) {
1902
-        $class = $tc['geodir_main_content_open_class'];
1903
-    }
1898
+	if (!empty($tc['geodir_main_content_open_id'])) {
1899
+		$id = $tc['geodir_main_content_open_id'];
1900
+	}
1901
+	if (!empty($tc['geodir_main_content_open_class'])) {
1902
+		$class = $tc['geodir_main_content_open_class'];
1903
+	}
1904 1904
 
1905
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1905
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1906 1906
 
1907
-    echo $text;
1907
+	echo $text;
1908 1908
 }
1909 1909
 
1910 1910
 // action for adding the primary div closing tag
@@ -1917,13 +1917,13 @@  discard block
 block discarded – undo
1917 1917
  */
1918 1918
 function geodir_action_main_content_close()
1919 1919
 {
1920
-    $tc = get_option('theme_compatibility_setting');
1921
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1922
-        $text = $tc['geodir_main_content_close_replace'];
1923
-    } else {
1924
-        $text = '</main><!-- main ends here-->';
1925
-    }
1926
-    echo $text;
1920
+	$tc = get_option('theme_compatibility_setting');
1921
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1922
+		$text = $tc['geodir_main_content_close_replace'];
1923
+	} else {
1924
+		$text = '</main><!-- main ends here-->';
1925
+	}
1926
+	echo $text;
1927 1927
 }
1928 1928
 
1929 1929
 /**
@@ -1935,14 +1935,14 @@  discard block
 block discarded – undo
1935 1935
  */
1936 1936
 function geodir_action_listings_content_inside()
1937 1937
 {
1938
-    global $gridview_columns;
1939
-    $listing_view = get_option('geodir_listing_view');
1940
-    if (strstr($listing_view, 'gridview')) {
1941
-        $gridview_columns = $listing_view;
1942
-        $listing_view_exp = explode('_', $listing_view);
1943
-        $listing_view = $listing_view_exp[0];
1944
-    }
1945
-    geodir_get_template_part('listing', 'listview');
1938
+	global $gridview_columns;
1939
+	$listing_view = get_option('geodir_listing_view');
1940
+	if (strstr($listing_view, 'gridview')) {
1941
+		$gridview_columns = $listing_view;
1942
+		$listing_view_exp = explode('_', $listing_view);
1943
+		$listing_view = $listing_view_exp[0];
1944
+	}
1945
+	geodir_get_template_part('listing', 'listview');
1946 1946
 }
1947 1947
 
1948 1948
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1958,47 +1958,47 @@  discard block
 block discarded – undo
1958 1958
  */
1959 1959
 function geodir_action_listings_content()
1960 1960
 {
1961
-    /**
1962
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1963
-     *
1964
-     * @since 1.0.0
1965
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1966
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1967
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1968
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1969
-     */
1970
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1971
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1972
-    echo '<div class="clearfix '.$extra_class.'">';
1973
-    /**
1974
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1975
-     *
1976
-     * @since 1.0.0
1977
-     */
1978
-    do_action('geodir_before_listing');
1979
-    echo '</div>';
1980
-
1981
-    /**
1982
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
1983
-     *
1984
-     * @since 1.0.0
1985
-     */
1986
-    do_action('geodir_listings_content_inside');
1987
-
1988
-    /**
1989
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1990
-     *
1991
-     * @since 1.0.0
1992
-     */
1993
-    do_action('geodir_after_listing');
1994
-
1995
-    /**
1996
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1997
-     *
1998
-     * @since 1.0.0
1999
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2000
-     */
2001
-    do_action('geodir_main_content_close', 'listings-page');
1961
+	/**
1962
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1963
+	 *
1964
+	 * @since 1.0.0
1965
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1966
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1967
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1968
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1969
+	 */
1970
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1971
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1972
+	echo '<div class="clearfix '.$extra_class.'">';
1973
+	/**
1974
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1975
+	 *
1976
+	 * @since 1.0.0
1977
+	 */
1978
+	do_action('geodir_before_listing');
1979
+	echo '</div>';
1980
+
1981
+	/**
1982
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
1983
+	 *
1984
+	 * @since 1.0.0
1985
+	 */
1986
+	do_action('geodir_listings_content_inside');
1987
+
1988
+	/**
1989
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1990
+	 *
1991
+	 * @since 1.0.0
1992
+	 */
1993
+	do_action('geodir_after_listing');
1994
+
1995
+	/**
1996
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1997
+	 *
1998
+	 * @since 1.0.0
1999
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2000
+	 */
2001
+	do_action('geodir_main_content_close', 'listings-page');
2002 2002
 }
2003 2003
 
2004 2004
 
@@ -2013,10 +2013,10 @@  discard block
 block discarded – undo
2013 2013
  */
2014 2014
 function geodir_action_sidebar_listings_bottom_section()
2015 2015
 {
2016
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2016
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2017 2017
         <div class="<?php
2018
-            /** This action is documented in geodirectory_template_actions.php */
2019
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2018
+			/** This action is documented in geodirectory_template_actions.php */
2019
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2020 2020
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2021 2021
         </div><!-- clearfix ends here-->
2022 2022
     <?php }
@@ -2036,38 +2036,38 @@  discard block
 block discarded – undo
2036 2036
  */
2037 2037
 function geodir_action_add_listing_page_title()
2038 2038
 {
2039
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2040
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2041
-    /** This action is documented in geodirectory_template_actions.php */
2042
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2043
-    /** This action is documented in geodirectory_template_actions.php */
2044
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2045
-
2046
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2047
-
2048
-    if(geodir_is_page('add-listing')){
2049
-        $gd_page = 'add-listing';
2050
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2051
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2052
-        }elseif(isset($listing_type)){
2053
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2054
-        }
2039
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2040
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2041
+	/** This action is documented in geodirectory_template_actions.php */
2042
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2043
+	/** This action is documented in geodirectory_template_actions.php */
2044
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2045
+
2046
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2047
+
2048
+	if(geodir_is_page('add-listing')){
2049
+		$gd_page = 'add-listing';
2050
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2051
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2052
+		}elseif(isset($listing_type)){
2053
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2054
+		}
2055 2055
 
2056
-    }
2056
+	}
2057 2057
 
2058 2058
 
2059
-    /**
2060
-     * Filter page title to replace variables.
2061
-     *
2062
-     * @since 1.5.4
2063
-     * @param string $title The page title including variables.
2064
-     * @param string $gd_page The GeoDirectory page type if any.
2065
-     */
2066
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2059
+	/**
2060
+	 * Filter page title to replace variables.
2061
+	 *
2062
+	 * @since 1.5.4
2063
+	 * @param string $title The page title including variables.
2064
+	 * @param string $gd_page The GeoDirectory page type if any.
2065
+	 */
2066
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2067 2067
 
2068
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2069
-    echo $title;
2070
-    echo '</h1></header>';
2068
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2069
+	echo $title;
2070
+	echo '</h1></header>';
2071 2071
 }
2072 2072
 
2073 2073
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2098,63 +2098,63 @@  discard block
 block discarded – undo
2098 2098
  */
2099 2099
 function geodir_action_add_listing_form()
2100 2100
 {
2101
-    global $cat_display, $post_cat, $current_user, $gd_session;
2102
-    $page_id = get_the_ID();
2103
-    $post = '';
2104
-    $title = '';
2105
-    $desc = '';
2106
-    $kw_tags = '';
2107
-    $required_msg = '';
2108
-    $submit_button = '';
2109
-
2110
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2111
-
2112
-    $thumb_img_arr = array();
2113
-    $curImages = '';
2114
-
2115
-    if (isset($_REQUEST['backandedit'])) {
2116
-        global $post;
2117
-        $post = (object)$gd_session->get('listing');
2118
-        $listing_type = $post->listing_type;
2119
-        $title = $post->post_title;
2120
-        $desc = $post->post_desc;
2121
-        $post_cat = $post->post_category;
2122
-
2123
-        $kw_tags = $post->post_tags;
2124
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2125
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2126
-        global $post, $post_images;
2127
-
2128
-        $post = geodir_get_post_info($_REQUEST['pid']);
2129
-        $thumb_img_arr = geodir_get_images($post->ID);
2130
-        if ($thumb_img_arr) {
2131
-            foreach ($thumb_img_arr as $post_img) {
2132
-                $curImages .= $post_img->src . ',';
2133
-            }
2134
-        }
2101
+	global $cat_display, $post_cat, $current_user, $gd_session;
2102
+	$page_id = get_the_ID();
2103
+	$post = '';
2104
+	$title = '';
2105
+	$desc = '';
2106
+	$kw_tags = '';
2107
+	$required_msg = '';
2108
+	$submit_button = '';
2109
+
2110
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2111
+
2112
+	$thumb_img_arr = array();
2113
+	$curImages = '';
2114
+
2115
+	if (isset($_REQUEST['backandedit'])) {
2116
+		global $post;
2117
+		$post = (object)$gd_session->get('listing');
2118
+		$listing_type = $post->listing_type;
2119
+		$title = $post->post_title;
2120
+		$desc = $post->post_desc;
2121
+		$post_cat = $post->post_category;
2122
+
2123
+		$kw_tags = $post->post_tags;
2124
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2125
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2126
+		global $post, $post_images;
2127
+
2128
+		$post = geodir_get_post_info($_REQUEST['pid']);
2129
+		$thumb_img_arr = geodir_get_images($post->ID);
2130
+		if ($thumb_img_arr) {
2131
+			foreach ($thumb_img_arr as $post_img) {
2132
+				$curImages .= $post_img->src . ',';
2133
+			}
2134
+		}
2135 2135
 
2136
-        $listing_type = $post->post_type;
2137
-        $title = $post->post_title;
2138
-        $desc = $post->post_content;
2139
-        $kw_tags = $post->post_tags;
2140
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2141
-    } else {
2142
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2143
-    }
2136
+		$listing_type = $post->post_type;
2137
+		$title = $post->post_title;
2138
+		$desc = $post->post_content;
2139
+		$kw_tags = $post->post_tags;
2140
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2141
+	} else {
2142
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2143
+	}
2144 2144
 
2145
-    if ($current_user->ID != '0') {
2146
-        $user_login = true;
2147
-    }
2145
+	if ($current_user->ID != '0') {
2146
+		$user_login = true;
2147
+	}
2148 2148
 
2149
-    $post_type_info = geodir_get_posttype_info($listing_type);
2149
+	$post_type_info = geodir_get_posttype_info($listing_type);
2150 2150
 
2151
-    print_r($post_type_info);
2151
+	print_r($post_type_info);
2152 2152
 
2153
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2153
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2154 2154
 
2155 2155
 
2156 2156
 
2157
-    ?>
2157
+	?>
2158 2158
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2159 2159
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2160 2160
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2165,27 +2165,27 @@  discard block
 block discarded – undo
2165 2165
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2166 2166
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2167 2167
         <?php
2168
-        } 
2169
-        /**
2170
-         * Called at the very top of the add listing page form for frontend.
2171
-         *
2172
-         * This is called just before the "Enter Listing Details" text.
2173
-         *
2174
-         * @since 1.0.0
2175
-         */
2176
-        do_action('geodir_before_detail_fields');
2177
-        ?>
2168
+		} 
2169
+		/**
2170
+		 * Called at the very top of the add listing page form for frontend.
2171
+		 *
2172
+		 * This is called just before the "Enter Listing Details" text.
2173
+		 *
2174
+		 * @since 1.0.0
2175
+		 */
2176
+		do_action('geodir_before_detail_fields');
2177
+		?>
2178 2178
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2179 2179
         <?php
2180
-        /**
2181
-         * Called at the top of the add listing page form for frontend.
2182
-         *
2183
-         * This is called after the "Enter Listing Details" text.
2184
-         *
2185
-         * @since 1.0.0
2186
-         */
2187
-        do_action('geodir_before_main_form_fields');
2188
-        ?>
2180
+		/**
2181
+		 * Called at the top of the add listing page form for frontend.
2182
+		 *
2183
+		 * This is called after the "Enter Listing Details" text.
2184
+		 *
2185
+		 * @since 1.0.0
2186
+		 */
2187
+		do_action('geodir_before_main_form_fields');
2188
+		?>
2189 2189
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2190 2190
             <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
2191 2191
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
@@ -2193,57 +2193,57 @@  discard block
 block discarded – undo
2193 2193
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2194 2194
         </div>
2195 2195
         <?php
2196
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2197
-
2198
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2199
-        $desc_limit = '';
2200
-        /**
2201
-         * Filter the add listing description field character limit number.
2202
-         *
2203
-         * @since 1.0.0
2204
-         * @param int $desc_limit The amount of characters to limit the description to.
2205
-         */
2206
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2207
-        /**
2208
-         * Filter the add listing description field text.
2209
-         *
2210
-         * @since 1.0.0
2211
-         * @param string $desc The text for the description field.
2212
-         * @param int $desc_limit The character limit number if any.
2213
-         */
2214
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2215
-        $desc_limit_msg = '';
2216
-        /**
2217
-         * Filter the add listing description limit message.
2218
-         *
2219
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2220
-         *
2221
-         * @since 1.0.0
2222
-         * @param string $desc_limit_msg The limit message string if any.
2223
-         * @param int $desc_limit The character limit numer if any.
2224
-         */
2225
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2196
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2197
+
2198
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2199
+		$desc_limit = '';
2200
+		/**
2201
+		 * Filter the add listing description field character limit number.
2202
+		 *
2203
+		 * @since 1.0.0
2204
+		 * @param int $desc_limit The amount of characters to limit the description to.
2205
+		 */
2206
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2207
+		/**
2208
+		 * Filter the add listing description field text.
2209
+		 *
2210
+		 * @since 1.0.0
2211
+		 * @param string $desc The text for the description field.
2212
+		 * @param int $desc_limit The character limit number if any.
2213
+		 */
2214
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2215
+		$desc_limit_msg = '';
2216
+		/**
2217
+		 * Filter the add listing description limit message.
2218
+		 *
2219
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2220
+		 *
2221
+		 * @since 1.0.0
2222
+		 * @param string $desc_limit_msg The limit message string if any.
2223
+		 * @param int $desc_limit The character limit numer if any.
2224
+		 */
2225
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2226 2226
         
2227
-        $desc_class = '';
2228
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2229
-            /**
2230
-             * Called on the add listing page form for frontend just before the description field.
2231
-             *
2232
-             * @since 1.0.0
2233
-             */
2234
-            do_action('geodir_before_description_field');
2227
+		$desc_class = '';
2228
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2229
+			/**
2230
+			 * Called on the add listing page form for frontend just before the description field.
2231
+			 *
2232
+			 * @since 1.0.0
2233
+			 */
2234
+			do_action('geodir_before_description_field');
2235 2235
             
2236
-            $desc_class = ' required_field';
2237
-        } else {
2238
-            $desc_class = ' hidden';
2239
-        }
2240
-        ?>
2236
+			$desc_class = ' required_field';
2237
+		} else {
2238
+			$desc_class = ' hidden';
2239
+		}
2240
+		?>
2241 2241
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2242 2242
             <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2243 2243
             <?php
2244
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2245
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2246
-            ?>
2244
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2245
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2246
+			?>
2247 2247
                 <div class="editor" field_id="post_desc" field_type="editor">
2248 2248
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2249 2249
                 </div>
@@ -2257,56 +2257,56 @@  discard block
 block discarded – undo
2257 2257
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2258 2258
         </div>
2259 2259
         <?php
2260
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2261
-            /**
2262
-             * Called on the add listing page form for frontend just after the description field.
2263
-             *
2264
-             * @since 1.0.0
2265
-             */
2266
-            do_action('geodir_after_description_field');
2267
-        }
2260
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2261
+			/**
2262
+			 * Called on the add listing page form for frontend just after the description field.
2263
+			 *
2264
+			 * @since 1.0.0
2265
+			 */
2266
+			do_action('geodir_after_description_field');
2267
+		}
2268 2268
         
2269
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2270
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2271
-        $kw_tags_msg = TAGKW_MSG;
2272
-        /**
2273
-         * Filter the add listing tags character limit.
2274
-         *
2275
-         * @since 1.0.0
2276
-         * @param int $kw_tags_count The character count limit if any.
2277
-         */
2278
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2279
-        /**
2280
-         * Filter the add listing tags field value.
2281
-         *
2282
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2283
-         *
2284
-         * @since 1.0.0
2285
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2286
-         * @param int $kw_tags_count The character count limit if any.
2287
-         */
2288
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2289
-        /**
2290
-         * Filter the add listing tags field message text.
2291
-         *
2292
-         * @since 1.0.0
2293
-         * @param string $kw_tags_msg The message shown under the field.
2294
-         * @param int $kw_tags_count The character count limit if any.
2295
-         */
2296
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2269
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2270
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2271
+		$kw_tags_msg = TAGKW_MSG;
2272
+		/**
2273
+		 * Filter the add listing tags character limit.
2274
+		 *
2275
+		 * @since 1.0.0
2276
+		 * @param int $kw_tags_count The character count limit if any.
2277
+		 */
2278
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2279
+		/**
2280
+		 * Filter the add listing tags field value.
2281
+		 *
2282
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2283
+		 *
2284
+		 * @since 1.0.0
2285
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2286
+		 * @param int $kw_tags_count The character count limit if any.
2287
+		 */
2288
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2289
+		/**
2290
+		 * Filter the add listing tags field message text.
2291
+		 *
2292
+		 * @since 1.0.0
2293
+		 * @param string $kw_tags_msg The message shown under the field.
2294
+		 * @param int $kw_tags_count The character count limit if any.
2295
+		 */
2296
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2297 2297
         
2298
-        $tags_class = '';
2299
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2300
-            /**
2301
-             * Called on the add listing page form for frontend just before the tags field.
2302
-             *
2303
-             * @since 1.0.0
2304
-             */
2305
-            do_action('geodir_before_listing_tags_field');
2306
-        } else {
2307
-            $tags_class = ' hidden';
2308
-        }
2309
-        ?>
2298
+		$tags_class = '';
2299
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2300
+			/**
2301
+			 * Called on the add listing page form for frontend just before the tags field.
2302
+			 *
2303
+			 * @since 1.0.0
2304
+			 */
2305
+			do_action('geodir_before_listing_tags_field');
2306
+		} else {
2307
+			$tags_class = ' hidden';
2308
+		}
2309
+		?>
2310 2310
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2311 2311
             <label><?php echo TAGKW_TEXT; ?></label>
2312 2312
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2314,90 +2314,90 @@  discard block
 block discarded – undo
2314 2314
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2315 2315
         </div>
2316 2316
         <?php
2317
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2318
-            /**
2319
-             * Called on the add listing page form for frontend just after the tags field.
2320
-             *
2321
-             * @since 1.0.0
2322
-             */
2323
-            do_action('geodir_after_listing_tags_field');
2324
-        }
2317
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2318
+			/**
2319
+			 * Called on the add listing page form for frontend just after the tags field.
2320
+			 *
2321
+			 * @since 1.0.0
2322
+			 */
2323
+			do_action('geodir_after_listing_tags_field');
2324
+		}
2325 2325
         
2326
-        $package_info = array();
2327
-        $package_info = geodir_post_package_info($package_info, $post);
2326
+		$package_info = array();
2327
+		$package_info = geodir_post_package_info($package_info, $post);
2328 2328
         
2329
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2329
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2330 2330
         
2331
-        // adjust values here
2332
-        $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
2333
-
2334
-        $multiple = true; // allow multiple files upload
2331
+		// adjust values here
2332
+		$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
2335 2333
 
2336
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2334
+		$multiple = true; // allow multiple files upload
2337 2335
 
2338
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2336
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2339 2337
 
2340
-        $thumb_img_arr = array();
2341
-        $totImg = 0;
2342
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2343
-            $post = (object)$gd_session->get('listing');
2344
-            if (isset($post->post_images))
2345
-                $curImages = trim($post->post_images, ",");
2338
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2346 2339
 
2340
+		$thumb_img_arr = array();
2341
+		$totImg = 0;
2342
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2343
+			$post = (object)$gd_session->get('listing');
2344
+			if (isset($post->post_images))
2345
+				$curImages = trim($post->post_images, ",");
2347 2346
 
2348
-            if ($curImages != '') {
2349
-                $curImages_array = explode(',', $curImages);
2350
-                $totImg = count($curImages_array);
2351
-            }
2352 2347
 
2353
-            $listing_type = $post->listing_type;
2348
+			if ($curImages != '') {
2349
+				$curImages_array = explode(',', $curImages);
2350
+				$totImg = count($curImages_array);
2351
+			}
2354 2352
 
2355
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2356
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2357
-            $listing_type = $post->post_type;
2358
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2353
+			$listing_type = $post->listing_type;
2359 2354
 
2360
-        } else {
2361
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2362
-        }
2355
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2356
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2357
+			$listing_type = $post->post_type;
2358
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2363 2359
 
2360
+		} else {
2361
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2362
+		}
2364 2363
 
2365
-        if (!empty($thumb_img_arr)) {
2366
-            foreach ($thumb_img_arr as $img) {
2367
-                //$curImages = $img->src.",";
2368
-            }
2369 2364
 
2370
-            $totImg = count((array)$thumb_img_arr);
2371
-        }
2365
+		if (!empty($thumb_img_arr)) {
2366
+			foreach ($thumb_img_arr as $img) {
2367
+				//$curImages = $img->src.",";
2368
+			}
2372 2369
 
2373
-        if ($curImages != '')
2374
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2375
-        else
2376
-            $svalue = '';
2377
-
2378
-        $image_limit = $package_info->image_limit;
2379
-        $show_image_input_box = ($image_limit != '0');
2380
-        /**
2381
-         * Filter to be able to show/hide the image upload section of the add listing form.
2382
-         *
2383
-         * @since 1.0.0
2384
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2385
-         * @param string $listing_type The custom post type slug.
2386
-         */
2387
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2388
-        if ($show_image_input_box) {
2389
-            ?>
2370
+			$totImg = count((array)$thumb_img_arr);
2371
+		}
2372
+
2373
+		if ($curImages != '')
2374
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2375
+		else
2376
+			$svalue = '';
2377
+
2378
+		$image_limit = $package_info->image_limit;
2379
+		$show_image_input_box = ($image_limit != '0');
2380
+		/**
2381
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2382
+		 *
2383
+		 * @since 1.0.0
2384
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2385
+		 * @param string $listing_type The custom post type slug.
2386
+		 */
2387
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2388
+		if ($show_image_input_box) {
2389
+			?>
2390 2390
 
2391 2391
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2392 2392
                 <?php if ($image_limit == 1) {
2393
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2394
-                } ?>
2393
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2394
+				} ?>
2395 2395
                 <?php if ($image_limit > 1) {
2396
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2397
-                } ?>
2396
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2397
+				} ?>
2398 2398
                 <?php if ($image_limit == '') {
2399
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2400
-                } ?>
2399
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2400
+				} ?>
2401 2401
             </h5>
2402 2402
 
2403 2403
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2435,12 +2435,12 @@  discard block
 block discarded – undo
2435 2435
         <?php } ?>
2436 2436
 
2437 2437
         <?php
2438
-        /**
2439
-         * Called on the add listing page form for frontend just after the image upload field.
2440
-         *
2441
-         * @since 1.0.0
2442
-         */
2443
-        do_action('geodir_after_main_form_fields');?>
2438
+		/**
2439
+		 * Called on the add listing page form for frontend just after the image upload field.
2440
+		 *
2441
+		 * @since 1.0.0
2442
+		 */
2443
+		do_action('geodir_after_main_form_fields');?>
2444 2444
 
2445 2445
 
2446 2446
         <!-- add captcha code -->
@@ -2469,7 +2469,7 @@  discard block
 block discarded – undo
2469 2469
 
2470 2470
     </form>
2471 2471
     <?php
2472
-    wp_reset_query();
2472
+	wp_reset_query();
2473 2473
 }
2474 2474
 
2475 2475
 /**
@@ -2480,7 +2480,7 @@  discard block
 block discarded – undo
2480 2480
  */
2481 2481
 function geodir_add_listing_sidebar_widget_area()
2482 2482
 {
2483
-    dynamic_sidebar('geodir_add_listing_sidebar');
2483
+	dynamic_sidebar('geodir_add_listing_sidebar');
2484 2484
 }
2485 2485
 
2486 2486
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2495,16 +2495,16 @@  discard block
 block discarded – undo
2495 2495
  */
2496 2496
 function geodir_action_add_listing_sidebar()
2497 2497
 {
2498
-    /** This action is documented in geodirectory_template_actions.php */
2499
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2500
-    /**
2501
-     * This is used to add the content to the add listing page sidebar.
2502
-     *
2503
-     * @since 1.0.0
2504
-     */
2505
-    do_action('geodir_add_listing_sidebar_inside');
2506
-    /** This action is documented in geodirectory_template_actions.php */
2507
-    do_action('geodir_sidebar_right_close', 'details-page');
2498
+	/** This action is documented in geodirectory_template_actions.php */
2499
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2500
+	/**
2501
+	 * This is used to add the content to the add listing page sidebar.
2502
+	 *
2503
+	 * @since 1.0.0
2504
+	 */
2505
+	do_action('geodir_add_listing_sidebar_inside');
2506
+	/** This action is documented in geodirectory_template_actions.php */
2507
+	do_action('geodir_sidebar_right_close', 'details-page');
2508 2508
 }
2509 2509
 
2510 2510
 ###############################################
@@ -2521,11 +2521,11 @@  discard block
 block discarded – undo
2521 2521
  */
2522 2522
 function geodir_action_geodir_sidebar_signup_top()
2523 2523
 {
2524
-    ?>
2524
+	?>
2525 2525
     <div
2526 2526
         class="<?php
2527
-        /** This action is documented in geodirectory_template_actions.php */
2528
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2527
+		/** This action is documented in geodirectory_template_actions.php */
2528
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2529 2529
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2530 2530
     </div><!-- clearfix ends here-->
2531 2531
 <?php
@@ -2544,9 +2544,9 @@  discard block
 block discarded – undo
2544 2544
 function geodir_action_signup_forms()
2545 2545
 {
2546 2546
 
2547
-    global $user_login;
2547
+	global $user_login;
2548 2548
 
2549
-    ?>
2549
+	?>
2550 2550
     <script type="text/javascript">
2551 2551
         <?php if ( $user_login ) { ?>
2552 2552
         setTimeout(function () {
@@ -2582,65 +2582,65 @@  discard block
 block discarded – undo
2582 2582
         <?php } ?>
2583 2583
     </script><?php
2584 2584
 
2585
-    global $errors;
2586
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2587
-        $errors->add('claim_login', LOGIN_CLAIM);
2588
-
2589
-    if (!empty($errors)) {
2590
-        foreach ($errors as $errorsObj) {
2591
-            foreach ($errorsObj as $key => $val) {
2592
-                for ($i = 0; $i < count($val); $i++) {
2593
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2594
-                    $registration_error_msg = 1;
2595
-                }
2596
-            }
2597
-        }
2598
-    }
2585
+	global $errors;
2586
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2587
+		$errors->add('claim_login', LOGIN_CLAIM);
2588
+
2589
+	if (!empty($errors)) {
2590
+		foreach ($errors as $errorsObj) {
2591
+			foreach ($errorsObj as $key => $val) {
2592
+				for ($i = 0; $i < count($val); $i++) {
2593
+					echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2594
+					$registration_error_msg = 1;
2595
+				}
2596
+			}
2597
+		}
2598
+	}
2599 2599
 
2600
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2601
-        ?>
2600
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2601
+		?>
2602 2602
 
2603 2603
         <div class="login_form">
2604 2604
             <?php
2605
-            /**
2606
-             * Contains login form template.
2607
-             *
2608
-             * @since 1.0.0
2609
-             */
2610
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2605
+			/**
2606
+			 * Contains login form template.
2607
+			 *
2608
+			 * @since 1.0.0
2609
+			 */
2610
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2611 2611
         </div>
2612 2612
 
2613 2613
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2614 2614
 
2615 2615
         <div class="registration_form">
2616 2616
             <?php
2617
-            /**
2618
-             * Contains registration form template.
2619
-             *
2620
-             * @since 1.0.0
2621
-             */
2622
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2617
+			/**
2618
+			 * Contains registration form template.
2619
+			 *
2620
+			 * @since 1.0.0
2621
+			 */
2622
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2623 2623
         </div>
2624 2624
 
2625 2625
     <?php } else { ?>
2626 2626
 
2627 2627
         <div class="login_form_l">
2628 2628
             <?php
2629
-            /**
2630
-             * Contains login form template.
2631
-             *
2632
-             * @since 1.0.0
2633
-             */
2634
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2629
+			/**
2630
+			 * Contains login form template.
2631
+			 *
2632
+			 * @since 1.0.0
2633
+			 */
2634
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2635 2635
         </div>
2636 2636
         <div class="registration_form_r">
2637 2637
             <?php
2638
-            /**
2639
-             * Contains registration form template.
2640
-             *
2641
-             * @since 1.0.0
2642
-             */
2643
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2638
+			/**
2639
+			 * Contains registration form template.
2640
+			 *
2641
+			 * @since 1.0.0
2642
+			 */
2643
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2644 2644
         </div>
2645 2645
 
2646 2646
     <?php }?>
@@ -2671,66 +2671,66 @@  discard block
 block discarded – undo
2671 2671
  */
2672 2672
 function geodir_action_author_page_title()
2673 2673
 {
2674
-    global $term;
2674
+	global $term;
2675 2675
 
2676
-    $gd_post_type = geodir_get_current_posttype();
2677
-    $post_type_info = get_post_type_object($gd_post_type);
2676
+	$gd_post_type = geodir_get_current_posttype();
2677
+	$post_type_info = get_post_type_object($gd_post_type);
2678 2678
 
2679
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2680
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2681
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2682
-    }
2679
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2680
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2681
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2682
+	}
2683 2683
 
2684
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2685
-    $single_name = $post_type_info->labels->singular_name;
2684
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2685
+	$single_name = $post_type_info->labels->singular_name;
2686 2686
 
2687
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2687
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2688 2688
 
2689
-    if (!empty($term)) {
2690
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2691
-        if (!empty($current_term))
2692
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2693
-    }
2689
+	if (!empty($term)) {
2690
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2691
+		if (!empty($current_term))
2692
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2693
+	}
2694 2694
 
2695 2695
 
2696
-    if (is_search()) {
2697
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2696
+	if (is_search()) {
2697
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2698 2698
 
2699
-    }
2700
-    /** This action is documented in geodirectory_template_actions.php */
2701
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2702
-    /** This action is documented in geodirectory_template_actions.php */
2703
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2699
+	}
2700
+	/** This action is documented in geodirectory_template_actions.php */
2701
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2702
+	/** This action is documented in geodirectory_template_actions.php */
2703
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2704 2704
 
2705
-    $title = $list_title;
2706
-    if(geodir_is_page('author')){
2707
-        $gd_page = 'author';
2708
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2709
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2710
-        }else{
2711
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2712
-        }
2705
+	$title = $list_title;
2706
+	if(geodir_is_page('author')){
2707
+		$gd_page = 'author';
2708
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2709
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2710
+		}else{
2711
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2712
+		}
2713 2713
 
2714
-    }
2714
+	}
2715 2715
 
2716 2716
 
2717
-    /**
2718
-     * Filter page title to replace variables.
2719
-     *
2720
-     * @since 1.5.4
2721
-     * @param string $title The page title including variables.
2722
-     * @param string $gd_page The GeoDirectory page type if any.
2723
-     */
2724
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2717
+	/**
2718
+	 * Filter page title to replace variables.
2719
+	 *
2720
+	 * @since 1.5.4
2721
+	 * @param string $title The page title including variables.
2722
+	 * @param string $gd_page The GeoDirectory page type if any.
2723
+	 */
2724
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2725 2725
 
2726
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2727
-        /**
2728
-         * Filter the author page title text.
2729
-         *
2730
-         * @since 1.0.0
2731
-         * @param string $list_title The title for the page.
2732
-         */
2733
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2726
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2727
+		/**
2728
+		 * Filter the author page title text.
2729
+		 *
2730
+		 * @since 1.0.0
2731
+		 * @param string $list_title The title for the page.
2732
+		 */
2733
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2734 2734
 }
2735 2735
 
2736 2736
 
@@ -2748,11 +2748,11 @@  discard block
 block discarded – undo
2748 2748
  */
2749 2749
 function geodir_action_geodir_sidebar_author_top()
2750 2750
 {
2751
-    if (get_option('geodir_show_author_top_section')) { ?>
2751
+	if (get_option('geodir_show_author_top_section')) { ?>
2752 2752
         <div
2753 2753
             class="<?php
2754
-            /** This action is documented in geodirectory_template_actions.php */
2755
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2754
+			/** This action is documented in geodirectory_template_actions.php */
2755
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2756 2756
             <?php dynamic_sidebar('geodir_author_top'); ?>
2757 2757
         </div><!-- clearfix ends here-->
2758 2758
     <?php }
@@ -2768,7 +2768,7 @@  discard block
 block discarded – undo
2768 2768
  */
2769 2769
 function geodir_author_left_section()
2770 2770
 {
2771
-    if (get_option('geodir_show_author_left_section')) { ?>
2771
+	if (get_option('geodir_show_author_left_section')) { ?>
2772 2772
         <div class="geodir-content-left geodir-sidebar-wrap">
2773 2773
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2774 2774
         </div><!-- end geodir-content-left -->
@@ -2789,19 +2789,19 @@  discard block
 block discarded – undo
2789 2789
  */
2790 2790
 function geodir_action_author_sidebar_left()
2791 2791
 {
2792
-    if (get_option('geodir_show_author_left_section')) {
2792
+	if (get_option('geodir_show_author_left_section')) {
2793 2793
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2794
-        /** This action is documented in geodirectory_template_actions.php */
2795
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2796
-        /**
2797
-         * This is used to add the content to the author page left sidebar (if active).
2798
-         *
2799
-         * @since 1.0.0
2800
-         */
2801
-        do_action('geodir_author_sidebar_left_inside');
2802
-        /** This action is documented in geodirectory_template_actions.php */
2803
-        do_action('geodir_sidebar_left_close', 'author-page');
2804
-    }
2794
+		/** This action is documented in geodirectory_template_actions.php */
2795
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2796
+		/**
2797
+		 * This is used to add the content to the author page left sidebar (if active).
2798
+		 *
2799
+		 * @since 1.0.0
2800
+		 */
2801
+		do_action('geodir_author_sidebar_left_inside');
2802
+		/** This action is documented in geodirectory_template_actions.php */
2803
+		do_action('geodir_sidebar_left_close', 'author-page');
2804
+	}
2805 2805
 }
2806 2806
 
2807 2807
 /**
@@ -2814,7 +2814,7 @@  discard block
 block discarded – undo
2814 2814
  */
2815 2815
 function geodir_author_right_section()
2816 2816
 {
2817
-    if (get_option('geodir_show_author_right_section')) { ?>
2817
+	if (get_option('geodir_show_author_right_section')) { ?>
2818 2818
         <div class="geodir-content-right geodir-sidebar-wrap">
2819 2819
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2820 2820
         </div><!-- end geodir-content-right -->
@@ -2834,18 +2834,18 @@  discard block
 block discarded – undo
2834 2834
  */
2835 2835
 function geodir_action_author_sidebar_right()
2836 2836
 {
2837
-    if (get_option('geodir_show_author_right_section')) {
2838
-        /** This action is documented in geodirectory_template_actions.php */
2839
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2840
-        /**
2841
-         * This is used to add the content to the author page right sidebar (if active).
2842
-         *
2843
-         * @since 1.0.0
2844
-         */
2845
-        do_action('geodir_author_sidebar_right_inside');
2846
-        /** This action is documented in geodirectory_template_actions.php */
2847
-        do_action('geodir_sidebar_right_close', 'author-page');
2848
-    }
2837
+	if (get_option('geodir_show_author_right_section')) {
2838
+		/** This action is documented in geodirectory_template_actions.php */
2839
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2840
+		/**
2841
+		 * This is used to add the content to the author page right sidebar (if active).
2842
+		 *
2843
+		 * @since 1.0.0
2844
+		 */
2845
+		do_action('geodir_author_sidebar_right_inside');
2846
+		/** This action is documented in geodirectory_template_actions.php */
2847
+		do_action('geodir_sidebar_right_close', 'author-page');
2848
+	}
2849 2849
 }
2850 2850
 
2851 2851
 /**
@@ -2857,14 +2857,14 @@  discard block
 block discarded – undo
2857 2857
  */
2858 2858
 function geodir_action_author_content_inside()
2859 2859
 {
2860
-    global $gridview_columns;
2861
-    $listing_view = get_option('geodir_author_view');
2862
-    if (strstr($listing_view, 'gridview')) {
2863
-        $gridview_columns = $listing_view;
2864
-        $listing_view_exp = explode('_', $listing_view);
2865
-        $listing_view = $listing_view_exp[0];
2866
-    }
2867
-    geodir_get_template_part('listing', 'listview');
2860
+	global $gridview_columns;
2861
+	$listing_view = get_option('geodir_author_view');
2862
+	if (strstr($listing_view, 'gridview')) {
2863
+		$gridview_columns = $listing_view;
2864
+		$listing_view_exp = explode('_', $listing_view);
2865
+		$listing_view = $listing_view_exp[0];
2866
+	}
2867
+	geodir_get_template_part('listing', 'listview');
2868 2868
 }
2869 2869
 
2870 2870
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2879,22 +2879,22 @@  discard block
 block discarded – undo
2879 2879
  */
2880 2880
 function geodir_action_author_content()
2881 2881
 {
2882
-    /** This action is documented in geodirectory_template_actions.php */
2883
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2884
-    echo '<div class="clearfix">';
2885
-    /** This action is documented in geodirectory_template_actions.php */
2886
-    do_action('geodir_before_listing');
2887
-    echo '</div>';
2888
-    /**
2889
-     * This is used to add the content to the author page main content.
2890
-     *
2891
-     * @since 1.0.0
2892
-     */
2893
-    do_action('geodir_author_content_inside');
2894
-    /** This action is documented in geodirectory_template_actions.php */
2895
-    do_action('geodir_after_listing');
2896
-    /** This action is documented in geodirectory_template_actions.php */
2897
-    do_action('geodir_main_content_close', 'author-page');
2882
+	/** This action is documented in geodirectory_template_actions.php */
2883
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2884
+	echo '<div class="clearfix">';
2885
+	/** This action is documented in geodirectory_template_actions.php */
2886
+	do_action('geodir_before_listing');
2887
+	echo '</div>';
2888
+	/**
2889
+	 * This is used to add the content to the author page main content.
2890
+	 *
2891
+	 * @since 1.0.0
2892
+	 */
2893
+	do_action('geodir_author_content_inside');
2894
+	/** This action is documented in geodirectory_template_actions.php */
2895
+	do_action('geodir_after_listing');
2896
+	/** This action is documented in geodirectory_template_actions.php */
2897
+	do_action('geodir_main_content_close', 'author-page');
2898 2898
 }
2899 2899
 
2900 2900
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2908,11 +2908,11 @@  discard block
 block discarded – undo
2908 2908
  */
2909 2909
 function geodir_action_sidebar_author_bottom_section()
2910 2910
 {
2911
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2911
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2912 2912
         <div
2913 2913
             class="<?php
2914
-            /** This action is documented in geodirectory_template_actions.php */
2915
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2914
+			/** This action is documented in geodirectory_template_actions.php */
2915
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2916 2916
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2917 2917
         </div><!-- clearfix ends here-->
2918 2918
     <?php }
@@ -2931,23 +2931,23 @@  discard block
 block discarded – undo
2931 2931
  */
2932 2932
 function geodir_action_search_page_title()
2933 2933
 {
2934
-    $gd_post_type = geodir_get_current_posttype();
2935
-    $post_type_info = get_post_type_object($gd_post_type);
2934
+	$gd_post_type = geodir_get_current_posttype();
2935
+	$post_type_info = get_post_type_object($gd_post_type);
2936 2936
 
2937
-    $pt_name = '';
2938
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2937
+	$pt_name = '';
2938
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2939 2939
 
2940
-    if (is_search()) {
2941
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2940
+	if (is_search()) {
2941
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2942 2942
 
2943
-    }
2944
-    /** This action is documented in geodirectory_template_actions.php */
2945
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2946
-    /** This action is documented in geodirectory_template_actions.php */
2947
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2948
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2949
-        /** This action is documented in geodirectory_template_actions.php */
2950
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2943
+	}
2944
+	/** This action is documented in geodirectory_template_actions.php */
2945
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2946
+	/** This action is documented in geodirectory_template_actions.php */
2947
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2948
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2949
+		/** This action is documented in geodirectory_template_actions.php */
2950
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2951 2951
 }
2952 2952
 
2953 2953
 // action for adding the listings page top widget area
@@ -2963,11 +2963,11 @@  discard block
 block discarded – undo
2963 2963
  */
2964 2964
 function geodir_action_geodir_sidebar_search_top()
2965 2965
 {
2966
-    if (get_option('geodir_show_search_top_section')) { ?>
2966
+	if (get_option('geodir_show_search_top_section')) { ?>
2967 2967
         <div
2968 2968
             class="<?php
2969
-            /** This action is documented in geodirectory_template_actions.php */
2970
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2969
+			/** This action is documented in geodirectory_template_actions.php */
2970
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2971 2971
             <?php dynamic_sidebar('geodir_search_top'); ?>
2972 2972
         </div><!-- clearfix ends here-->
2973 2973
     <?php }
@@ -2983,7 +2983,7 @@  discard block
 block discarded – undo
2983 2983
  */
2984 2984
 function geodir_search_left_section()
2985 2985
 {
2986
-    if (get_option('geodir_show_search_left_section')) { ?>
2986
+	if (get_option('geodir_show_search_left_section')) { ?>
2987 2987
         <div class="geodir-content-left geodir-sidebar-wrap">
2988 2988
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
2989 2989
         </div><!-- end geodir-content-left -->
@@ -3003,19 +3003,19 @@  discard block
 block discarded – undo
3003 3003
  */
3004 3004
 function geodir_action_search_sidebar_left()
3005 3005
 {
3006
-    if (get_option('geodir_show_search_left_section')) {
3006
+	if (get_option('geodir_show_search_left_section')) {
3007 3007
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3008
-        /** This action is documented in geodirectory_template_actions.php */
3009
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3010
-        /**
3011
-         * This is used to add the content to the search page left sidebar (if active).
3012
-         *
3013
-         * @since 1.0.0
3014
-         */
3015
-        do_action('geodir_search_sidebar_left_inside');
3016
-        /** This action is documented in geodirectory_template_actions.php */
3017
-        do_action('geodir_sidebar_left_close', 'search-page');
3018
-    }
3008
+		/** This action is documented in geodirectory_template_actions.php */
3009
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3010
+		/**
3011
+		 * This is used to add the content to the search page left sidebar (if active).
3012
+		 *
3013
+		 * @since 1.0.0
3014
+		 */
3015
+		do_action('geodir_search_sidebar_left_inside');
3016
+		/** This action is documented in geodirectory_template_actions.php */
3017
+		do_action('geodir_sidebar_left_close', 'search-page');
3018
+	}
3019 3019
 }
3020 3020
 
3021 3021
 /**
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
  */
3029 3029
 function geodir_search_right_section()
3030 3030
 {
3031
-    if (get_option('geodir_show_search_right_section')) { ?>
3031
+	if (get_option('geodir_show_search_right_section')) { ?>
3032 3032
         <div class="geodir-content-right geodir-sidebar-wrap">
3033 3033
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3034 3034
         </div><!-- end geodir-content-right -->
@@ -3048,18 +3048,18 @@  discard block
 block discarded – undo
3048 3048
  */
3049 3049
 function geodir_action_search_sidebar_right()
3050 3050
 {
3051
-    if (get_option('geodir_show_search_right_section')) {
3052
-        /** This action is documented in geodirectory_template_actions.php */
3053
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3054
-        /**
3055
-         * This is used to add the content to the search page right sidebar (if active).
3056
-         *
3057
-         * @since 1.0.0
3058
-         */
3059
-        do_action('geodir_search_sidebar_right_inside');
3060
-        /** This action is documented in geodirectory_template_actions.php */
3061
-        do_action('geodir_sidebar_right_close', 'search-page');
3062
-    }
3051
+	if (get_option('geodir_show_search_right_section')) {
3052
+		/** This action is documented in geodirectory_template_actions.php */
3053
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3054
+		/**
3055
+		 * This is used to add the content to the search page right sidebar (if active).
3056
+		 *
3057
+		 * @since 1.0.0
3058
+		 */
3059
+		do_action('geodir_search_sidebar_right_inside');
3060
+		/** This action is documented in geodirectory_template_actions.php */
3061
+		do_action('geodir_sidebar_right_close', 'search-page');
3062
+	}
3063 3063
 }
3064 3064
 
3065 3065
 
@@ -3074,11 +3074,11 @@  discard block
 block discarded – undo
3074 3074
  */
3075 3075
 function geodir_action_sidebar_search_bottom_section()
3076 3076
 {
3077
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3077
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3078 3078
         <div
3079 3079
             class="<?php
3080
-            /** This action is documented in geodirectory_template_actions.php */
3081
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3080
+			/** This action is documented in geodirectory_template_actions.php */
3081
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3082 3082
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3083 3083
         </div><!-- clearfix ends here-->
3084 3084
     <?php }
@@ -3093,14 +3093,14 @@  discard block
 block discarded – undo
3093 3093
  */
3094 3094
 function geodir_action_search_content_inside()
3095 3095
 {
3096
-    global $gridview_columns;
3097
-    $listing_view = get_option('geodir_search_view');
3098
-    if (strstr($listing_view, 'gridview')) {
3099
-        $gridview_columns = $listing_view;
3100
-        $listing_view_exp = explode('_', $listing_view);
3101
-        $listing_view = $listing_view_exp[0];
3102
-    }
3103
-    geodir_get_template_part('listing', 'listview');
3096
+	global $gridview_columns;
3097
+	$listing_view = get_option('geodir_search_view');
3098
+	if (strstr($listing_view, 'gridview')) {
3099
+		$gridview_columns = $listing_view;
3100
+		$listing_view_exp = explode('_', $listing_view);
3101
+		$listing_view = $listing_view_exp[0];
3102
+	}
3103
+	geodir_get_template_part('listing', 'listview');
3104 3104
 }
3105 3105
 
3106 3106
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3116,22 +3116,22 @@  discard block
 block discarded – undo
3116 3116
  */
3117 3117
 function geodir_action_search_content()
3118 3118
 {
3119
-    /** This action is documented in geodirectory_template_actions.php */
3120
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3121
-    echo '<div class="clearfix">';
3122
-    /** This action is documented in geodirectory_template_actions.php */
3123
-    do_action('geodir_before_listing');
3124
-    echo '</div>';
3125
-    /**
3126
-     * This is used to add the content to the search page main content.
3127
-     *
3128
-     * @since 1.0.0
3129
-     */
3130
-    do_action('geodir_search_content_inside');
3131
-    /** This action is documented in geodirectory_template_actions.php */
3132
-    do_action('geodir_after_listing');
3133
-    /** This action is documented in geodirectory_template_actions.php */
3134
-    do_action('geodir_main_content_close', 'search-page');
3119
+	/** This action is documented in geodirectory_template_actions.php */
3120
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3121
+	echo '<div class="clearfix">';
3122
+	/** This action is documented in geodirectory_template_actions.php */
3123
+	do_action('geodir_before_listing');
3124
+	echo '</div>';
3125
+	/**
3126
+	 * This is used to add the content to the search page main content.
3127
+	 *
3128
+	 * @since 1.0.0
3129
+	 */
3130
+	do_action('geodir_search_content_inside');
3131
+	/** This action is documented in geodirectory_template_actions.php */
3132
+	do_action('geodir_after_listing');
3133
+	/** This action is documented in geodirectory_template_actions.php */
3134
+	do_action('geodir_main_content_close', 'search-page');
3135 3135
 }
3136 3136
 
3137 3137
 ###############################################
@@ -3154,11 +3154,11 @@  discard block
 block discarded – undo
3154 3154
  */
3155 3155
 function geodir_action_geodir_sidebar_home_top()
3156 3156
 {
3157
-    if (get_option('geodir_show_home_top_section')) { ?>
3157
+	if (get_option('geodir_show_home_top_section')) { ?>
3158 3158
         <div
3159 3159
             class="<?php
3160
-            /** This action is documented in geodirectory_template_actions.php */
3161
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3160
+			/** This action is documented in geodirectory_template_actions.php */
3161
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3162 3162
             <?php dynamic_sidebar('geodir_home_top'); ?>
3163 3163
         </div><!-- clearfix ends here-->
3164 3164
     <?php }
@@ -3174,7 +3174,7 @@  discard block
 block discarded – undo
3174 3174
  */
3175 3175
 function geodir_home_left_section()
3176 3176
 {
3177
-    if (get_option('geodir_show_home_left_section')) { ?>
3177
+	if (get_option('geodir_show_home_left_section')) { ?>
3178 3178
         <div class="geodir-content-left geodir-sidebar-wrap">
3179 3179
             <?php dynamic_sidebar('geodir_home_left'); ?>
3180 3180
         </div><!-- end geodir-content-left -->
@@ -3196,19 +3196,19 @@  discard block
 block discarded – undo
3196 3196
  */
3197 3197
 function geodir_action_home_sidebar_left()
3198 3198
 {
3199
-    if (get_option('geodir_show_home_left_section')) {
3199
+	if (get_option('geodir_show_home_left_section')) {
3200 3200
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3201
-        /** This action is documented in geodirectory_template_actions.php */
3202
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3203
-        /**
3204
-         * This is used to add the content to the home page left sidebar (if active).
3205
-         *
3206
-         * @since 1.0.0
3207
-         */
3208
-        do_action('geodir_home_sidebar_left_inside');
3209
-        /** This action is documented in geodirectory_template_actions.php */
3210
-        do_action('geodir_sidebar_left_close', 'home-page');
3211
-    }
3201
+		/** This action is documented in geodirectory_template_actions.php */
3202
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3203
+		/**
3204
+		 * This is used to add the content to the home page left sidebar (if active).
3205
+		 *
3206
+		 * @since 1.0.0
3207
+		 */
3208
+		do_action('geodir_home_sidebar_left_inside');
3209
+		/** This action is documented in geodirectory_template_actions.php */
3210
+		do_action('geodir_sidebar_left_close', 'home-page');
3211
+	}
3212 3212
 }
3213 3213
 
3214 3214
 /**
@@ -3221,7 +3221,7 @@  discard block
 block discarded – undo
3221 3221
  */
3222 3222
 function geodir_home_right_section()
3223 3223
 {
3224
-    if (get_option('geodir_show_home_right_section')) { ?>
3224
+	if (get_option('geodir_show_home_right_section')) { ?>
3225 3225
         <div class="geodir-content-right geodir-sidebar-wrap">
3226 3226
             <?php dynamic_sidebar('geodir_home_right'); ?>
3227 3227
         </div><!-- end geodir-content-right -->
@@ -3242,18 +3242,18 @@  discard block
 block discarded – undo
3242 3242
  */
3243 3243
 function geodir_action_home_sidebar_right()
3244 3244
 {
3245
-    if (get_option('geodir_show_home_right_section')) {
3246
-        /** This action is documented in geodirectory_template_actions.php */
3247
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3248
-        /**
3249
-         * This is used to add the content to the home page right sidebar (if active).
3250
-         *
3251
-         * @since 1.0.0
3252
-         */
3253
-        do_action('geodir_home_sidebar_right_inside');
3254
-        /** This action is documented in geodirectory_template_actions.php */
3255
-        do_action('geodir_sidebar_right_close', 'home-page');
3256
-    }
3245
+	if (get_option('geodir_show_home_right_section')) {
3246
+		/** This action is documented in geodirectory_template_actions.php */
3247
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3248
+		/**
3249
+		 * This is used to add the content to the home page right sidebar (if active).
3250
+		 *
3251
+		 * @since 1.0.0
3252
+		 */
3253
+		do_action('geodir_home_sidebar_right_inside');
3254
+		/** This action is documented in geodirectory_template_actions.php */
3255
+		do_action('geodir_sidebar_right_close', 'home-page');
3256
+	}
3257 3257
 }
3258 3258
 
3259 3259
 /**
@@ -3264,7 +3264,7 @@  discard block
 block discarded – undo
3264 3264
  */
3265 3265
 function geodir_action_home_content_inside()
3266 3266
 {
3267
-    dynamic_sidebar('geodir_home_content');
3267
+	dynamic_sidebar('geodir_home_content');
3268 3268
 }
3269 3269
 
3270 3270
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3279,28 +3279,28 @@  discard block
 block discarded – undo
3279 3279
  */
3280 3280
 function geodir_action_home_content()
3281 3281
 {
3282
-    /** This action is documented in geodirectory_template_actions.php */
3283
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3284
-    /**
3285
-     * This called before the home page main content.
3286
-     *
3287
-     * @since 1.0.0
3288
-     */
3289
-    do_action('geodir_before_home_content');
3290
-    /**
3291
-     * This is used to add the content to the home page main content.
3292
-     *
3293
-     * @since 1.0.0
3294
-     */
3295
-    do_action('geodir_home_content_inside');
3296
-    /**
3297
-     * This is called after the homepage main content.
3298
-     *
3299
-     * @since 1.0.0
3300
-     */
3301
-    do_action('geodir_after_home_content');
3302
-    /** This action is documented in geodirectory_template_actions.php */
3303
-    do_action('geodir_main_content_close', 'home-page');
3282
+	/** This action is documented in geodirectory_template_actions.php */
3283
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3284
+	/**
3285
+	 * This called before the home page main content.
3286
+	 *
3287
+	 * @since 1.0.0
3288
+	 */
3289
+	do_action('geodir_before_home_content');
3290
+	/**
3291
+	 * This is used to add the content to the home page main content.
3292
+	 *
3293
+	 * @since 1.0.0
3294
+	 */
3295
+	do_action('geodir_home_content_inside');
3296
+	/**
3297
+	 * This is called after the homepage main content.
3298
+	 *
3299
+	 * @since 1.0.0
3300
+	 */
3301
+	do_action('geodir_after_home_content');
3302
+	/** This action is documented in geodirectory_template_actions.php */
3303
+	do_action('geodir_main_content_close', 'home-page');
3304 3304
 }
3305 3305
 
3306 3306
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3315,11 +3315,11 @@  discard block
 block discarded – undo
3315 3315
  */
3316 3316
 function geodir_action_sidebar_home_bottom_section()
3317 3317
 {
3318
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3318
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3319 3319
         <div
3320 3320
             class="<?php
3321
-            /** This action is documented in geodirectory_template_actions.php */
3322
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3321
+			/** This action is documented in geodirectory_template_actions.php */
3322
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3323 3323
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3324 3324
         </div><!-- clearfix ends here-->
3325 3325
     <?php }
@@ -3347,13 +3347,13 @@  discard block
 block discarded – undo
3347 3347
  */
3348 3348
 function geodir_filter_listing_page_title($list_title)
3349 3349
 {
3350
-    if (is_search() && trim(get_search_query()) == '') {
3351
-        $gd_post_type = geodir_get_current_posttype();
3352
-        $post_type_info = get_post_type_object($gd_post_type);
3350
+	if (is_search() && trim(get_search_query()) == '') {
3351
+		$gd_post_type = geodir_get_current_posttype();
3352
+		$post_type_info = get_post_type_object($gd_post_type);
3353 3353
 
3354
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3355
-    }
3356
-    return $list_title;
3354
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3355
+	}
3356
+	return $list_title;
3357 3357
 }
3358 3358
 
3359 3359
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3368,61 +3368,61 @@  discard block
 block discarded – undo
3368 3368
  * @param string $gd_page The geodirectory page type. Default null.
3369 3369
  */
3370 3370
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3371
-    global $post;
3371
+	global $post;
3372 3372
         
3373
-    $gd_page_id = NULL;
3374
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3375
-        $gd_page_id = geodir_home_page_id();
3376
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3377
-        $gd_page_id = geodir_preview_page_id();
3378
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3379
-        $gd_page_id = geodir_add_listing_page_id();
3380
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3381
-        $gd_page_id = geodir_success_page_id();
3382
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3383
-        $gd_page_id = geodir_location_page_id();
3384
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3385
-        $gd_page_id = geodir_info_page_id();
3386
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3387
-        $gd_page_id = geodir_login_page_id();
3388
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3389
-        $gd_page_id = geodir_payment_checkout_page_id();
3390
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3391
-        $gd_page_id = geodir_payment_invoices_page_id();
3392
-    }
3373
+	$gd_page_id = NULL;
3374
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3375
+		$gd_page_id = geodir_home_page_id();
3376
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3377
+		$gd_page_id = geodir_preview_page_id();
3378
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3379
+		$gd_page_id = geodir_add_listing_page_id();
3380
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3381
+		$gd_page_id = geodir_success_page_id();
3382
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3383
+		$gd_page_id = geodir_location_page_id();
3384
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3385
+		$gd_page_id = geodir_info_page_id();
3386
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3387
+		$gd_page_id = geodir_login_page_id();
3388
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3389
+		$gd_page_id = geodir_payment_checkout_page_id();
3390
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3391
+		$gd_page_id = geodir_payment_invoices_page_id();
3392
+	}
3393 3393
     
3394
-    if (!$gd_page_id > 0) {
3395
-        return;
3396
-    }
3394
+	if (!$gd_page_id > 0) {
3395
+		return;
3396
+	}
3397 3397
     
3398
-    $display = 'before';
3399
-    /**
3400
-     * Filter the position to display the page content.
3401
-     *
3402
-     * @since 1.6.3
3403
-     *
3404
-     * @param string $display Position to add the post content.
3405
-     * @param string $gd_page The geodirectory page type.
3406
-     */
3407
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3398
+	$display = 'before';
3399
+	/**
3400
+	 * Filter the position to display the page content.
3401
+	 *
3402
+	 * @since 1.6.3
3403
+	 *
3404
+	 * @param string $display Position to add the post content.
3405
+	 * @param string $gd_page The geodirectory page type.
3406
+	 */
3407
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3408 3408
     
3409
-    if ($position !== $display) {
3410
-        return;
3411
-    }
3409
+	if ($position !== $display) {
3410
+		return;
3411
+	}
3412 3412
         
3413
-    $gd_post = $post;
3413
+	$gd_post = $post;
3414 3414
     
3415
-    setup_postdata(get_post($gd_page_id));
3415
+	setup_postdata(get_post($gd_page_id));
3416 3416
     
3417
-    if (get_the_content()) {
3418
-        ?>
3417
+	if (get_the_content()) {
3418
+		?>
3419 3419
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3420 3420
         <?php
3421
-    }
3421
+	}
3422 3422
     
3423
-    $post = $gd_post;
3424
-    if (!empty($gd_post) && is_object($gd_post)) {
3425
-        setup_postdata($gd_post);
3426
-    }
3423
+	$post = $gd_post;
3424
+	if (!empty($gd_post) && is_object($gd_post)) {
3425
+		setup_postdata($gd_post);
3426
+	}
3427 3427
 }
3428 3428
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3429 3429
\ No newline at end of file
Please login to merge, or discard this patch.