Passed
Push — master ( 6f1fdc...e7a217 )
by Stiofan
15:48
created
geodirectory_template_actions.php 1 patch
Indentation   +1728 added lines, -1728 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,59 +2098,59 @@  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
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2151
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2152 2152
 
2153
-    ?>
2153
+	?>
2154 2154
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2155 2155
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2156 2156
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2161,27 +2161,27 @@  discard block
 block discarded – undo
2161 2161
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2162 2162
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2163 2163
         <?php
2164
-        } 
2165
-        /**
2166
-         * Called at the very top of the add listing page form for frontend.
2167
-         *
2168
-         * This is called just before the "Enter Listing Details" text.
2169
-         *
2170
-         * @since 1.0.0
2171
-         */
2172
-        do_action('geodir_before_detail_fields');
2173
-        ?>
2164
+		} 
2165
+		/**
2166
+		 * Called at the very top of the add listing page form for frontend.
2167
+		 *
2168
+		 * This is called just before the "Enter Listing Details" text.
2169
+		 *
2170
+		 * @since 1.0.0
2171
+		 */
2172
+		do_action('geodir_before_detail_fields');
2173
+		?>
2174 2174
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2175 2175
         <?php
2176
-        /**
2177
-         * Called at the top of the add listing page form for frontend.
2178
-         *
2179
-         * This is called after the "Enter Listing Details" text.
2180
-         *
2181
-         * @since 1.0.0
2182
-         */
2183
-        do_action('geodir_before_main_form_fields');
2184
-        ?>
2176
+		/**
2177
+		 * Called at the top of the add listing page form for frontend.
2178
+		 *
2179
+		 * This is called after the "Enter Listing Details" text.
2180
+		 *
2181
+		 * @since 1.0.0
2182
+		 */
2183
+		do_action('geodir_before_main_form_fields');
2184
+		?>
2185 2185
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2186 2186
             <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
2187 2187
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
@@ -2189,57 +2189,57 @@  discard block
 block discarded – undo
2189 2189
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2190 2190
         </div>
2191 2191
         <?php
2192
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2193
-
2194
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2195
-        $desc_limit = '';
2196
-        /**
2197
-         * Filter the add listing description field character limit number.
2198
-         *
2199
-         * @since 1.0.0
2200
-         * @param int $desc_limit The amount of characters to limit the description to.
2201
-         */
2202
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2203
-        /**
2204
-         * Filter the add listing description field text.
2205
-         *
2206
-         * @since 1.0.0
2207
-         * @param string $desc The text for the description field.
2208
-         * @param int $desc_limit The character limit number if any.
2209
-         */
2210
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2211
-        $desc_limit_msg = '';
2212
-        /**
2213
-         * Filter the add listing description limit message.
2214
-         *
2215
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2216
-         *
2217
-         * @since 1.0.0
2218
-         * @param string $desc_limit_msg The limit message string if any.
2219
-         * @param int $desc_limit The character limit numer if any.
2220
-         */
2221
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2192
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2193
+
2194
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2195
+		$desc_limit = '';
2196
+		/**
2197
+		 * Filter the add listing description field character limit number.
2198
+		 *
2199
+		 * @since 1.0.0
2200
+		 * @param int $desc_limit The amount of characters to limit the description to.
2201
+		 */
2202
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2203
+		/**
2204
+		 * Filter the add listing description field text.
2205
+		 *
2206
+		 * @since 1.0.0
2207
+		 * @param string $desc The text for the description field.
2208
+		 * @param int $desc_limit The character limit number if any.
2209
+		 */
2210
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2211
+		$desc_limit_msg = '';
2212
+		/**
2213
+		 * Filter the add listing description limit message.
2214
+		 *
2215
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2216
+		 *
2217
+		 * @since 1.0.0
2218
+		 * @param string $desc_limit_msg The limit message string if any.
2219
+		 * @param int $desc_limit The character limit numer if any.
2220
+		 */
2221
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2222 2222
         
2223
-        $desc_class = '';
2224
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2225
-            /**
2226
-             * Called on the add listing page form for frontend just before the description field.
2227
-             *
2228
-             * @since 1.0.0
2229
-             */
2230
-            do_action('geodir_before_description_field');
2223
+		$desc_class = '';
2224
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2225
+			/**
2226
+			 * Called on the add listing page form for frontend just before the description field.
2227
+			 *
2228
+			 * @since 1.0.0
2229
+			 */
2230
+			do_action('geodir_before_description_field');
2231 2231
             
2232
-            $desc_class = ' required_field';
2233
-        } else {
2234
-            $desc_class = ' hidden';
2235
-        }
2236
-        ?>
2232
+			$desc_class = ' required_field';
2233
+		} else {
2234
+			$desc_class = ' hidden';
2235
+		}
2236
+		?>
2237 2237
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2238 2238
             <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2239 2239
             <?php
2240
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2241
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2242
-            ?>
2240
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2241
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2242
+			?>
2243 2243
                 <div class="editor" field_id="post_desc" field_type="editor">
2244 2244
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2245 2245
                 </div>
@@ -2253,56 +2253,56 @@  discard block
 block discarded – undo
2253 2253
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2254 2254
         </div>
2255 2255
         <?php
2256
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2257
-            /**
2258
-             * Called on the add listing page form for frontend just after the description field.
2259
-             *
2260
-             * @since 1.0.0
2261
-             */
2262
-            do_action('geodir_after_description_field');
2263
-        }
2256
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2257
+			/**
2258
+			 * Called on the add listing page form for frontend just after the description field.
2259
+			 *
2260
+			 * @since 1.0.0
2261
+			 */
2262
+			do_action('geodir_after_description_field');
2263
+		}
2264 2264
         
2265
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2266
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2267
-        $kw_tags_msg = TAGKW_MSG;
2268
-        /**
2269
-         * Filter the add listing tags character limit.
2270
-         *
2271
-         * @since 1.0.0
2272
-         * @param int $kw_tags_count The character count limit if any.
2273
-         */
2274
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2275
-        /**
2276
-         * Filter the add listing tags field value.
2277
-         *
2278
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2279
-         *
2280
-         * @since 1.0.0
2281
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2282
-         * @param int $kw_tags_count The character count limit if any.
2283
-         */
2284
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2285
-        /**
2286
-         * Filter the add listing tags field message text.
2287
-         *
2288
-         * @since 1.0.0
2289
-         * @param string $kw_tags_msg The message shown under the field.
2290
-         * @param int $kw_tags_count The character count limit if any.
2291
-         */
2292
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2265
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2266
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2267
+		$kw_tags_msg = TAGKW_MSG;
2268
+		/**
2269
+		 * Filter the add listing tags character limit.
2270
+		 *
2271
+		 * @since 1.0.0
2272
+		 * @param int $kw_tags_count The character count limit if any.
2273
+		 */
2274
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2275
+		/**
2276
+		 * Filter the add listing tags field value.
2277
+		 *
2278
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2279
+		 *
2280
+		 * @since 1.0.0
2281
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2282
+		 * @param int $kw_tags_count The character count limit if any.
2283
+		 */
2284
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2285
+		/**
2286
+		 * Filter the add listing tags field message text.
2287
+		 *
2288
+		 * @since 1.0.0
2289
+		 * @param string $kw_tags_msg The message shown under the field.
2290
+		 * @param int $kw_tags_count The character count limit if any.
2291
+		 */
2292
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2293 2293
         
2294
-        $tags_class = '';
2295
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2296
-            /**
2297
-             * Called on the add listing page form for frontend just before the tags field.
2298
-             *
2299
-             * @since 1.0.0
2300
-             */
2301
-            do_action('geodir_before_listing_tags_field');
2302
-        } else {
2303
-            $tags_class = ' hidden';
2304
-        }
2305
-        ?>
2294
+		$tags_class = '';
2295
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2296
+			/**
2297
+			 * Called on the add listing page form for frontend just before the tags field.
2298
+			 *
2299
+			 * @since 1.0.0
2300
+			 */
2301
+			do_action('geodir_before_listing_tags_field');
2302
+		} else {
2303
+			$tags_class = ' hidden';
2304
+		}
2305
+		?>
2306 2306
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2307 2307
             <label><?php echo TAGKW_TEXT; ?></label>
2308 2308
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2310,90 +2310,90 @@  discard block
 block discarded – undo
2310 2310
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2311 2311
         </div>
2312 2312
         <?php
2313
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2314
-            /**
2315
-             * Called on the add listing page form for frontend just after the tags field.
2316
-             *
2317
-             * @since 1.0.0
2318
-             */
2319
-            do_action('geodir_after_listing_tags_field');
2320
-        }
2313
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2314
+			/**
2315
+			 * Called on the add listing page form for frontend just after the tags field.
2316
+			 *
2317
+			 * @since 1.0.0
2318
+			 */
2319
+			do_action('geodir_after_listing_tags_field');
2320
+		}
2321 2321
         
2322
-        $package_info = array();
2323
-        $package_info = geodir_post_package_info($package_info, $post);
2322
+		$package_info = array();
2323
+		$package_info = geodir_post_package_info($package_info, $post);
2324 2324
         
2325
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2325
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2326 2326
         
2327
-        // adjust values here
2328
-        $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
2329
-
2330
-        $multiple = true; // allow multiple files upload
2327
+		// adjust values here
2328
+		$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
2331 2329
 
2332
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2330
+		$multiple = true; // allow multiple files upload
2333 2331
 
2334
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2332
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2335 2333
 
2336
-        $thumb_img_arr = array();
2337
-        $totImg = 0;
2338
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2339
-            $post = (object)$gd_session->get('listing');
2340
-            if (isset($post->post_images))
2341
-                $curImages = trim($post->post_images, ",");
2334
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2342 2335
 
2336
+		$thumb_img_arr = array();
2337
+		$totImg = 0;
2338
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2339
+			$post = (object)$gd_session->get('listing');
2340
+			if (isset($post->post_images))
2341
+				$curImages = trim($post->post_images, ",");
2343 2342
 
2344
-            if ($curImages != '') {
2345
-                $curImages_array = explode(',', $curImages);
2346
-                $totImg = count($curImages_array);
2347
-            }
2348 2343
 
2349
-            $listing_type = $post->listing_type;
2344
+			if ($curImages != '') {
2345
+				$curImages_array = explode(',', $curImages);
2346
+				$totImg = count($curImages_array);
2347
+			}
2350 2348
 
2351
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2352
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2353
-            $listing_type = $post->post_type;
2354
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2349
+			$listing_type = $post->listing_type;
2355 2350
 
2356
-        } else {
2357
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2358
-        }
2351
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2352
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2353
+			$listing_type = $post->post_type;
2354
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2359 2355
 
2356
+		} else {
2357
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2358
+		}
2360 2359
 
2361
-        if (!empty($thumb_img_arr)) {
2362
-            foreach ($thumb_img_arr as $img) {
2363
-                //$curImages = $img->src.",";
2364
-            }
2365 2360
 
2366
-            $totImg = count((array)$thumb_img_arr);
2367
-        }
2361
+		if (!empty($thumb_img_arr)) {
2362
+			foreach ($thumb_img_arr as $img) {
2363
+				//$curImages = $img->src.",";
2364
+			}
2368 2365
 
2369
-        if ($curImages != '')
2370
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2371
-        else
2372
-            $svalue = '';
2373
-
2374
-        $image_limit = $package_info->image_limit;
2375
-        $show_image_input_box = ($image_limit != '0');
2376
-        /**
2377
-         * Filter to be able to show/hide the image upload section of the add listing form.
2378
-         *
2379
-         * @since 1.0.0
2380
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2381
-         * @param string $listing_type The custom post type slug.
2382
-         */
2383
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2384
-        if ($show_image_input_box) {
2385
-            ?>
2366
+			$totImg = count((array)$thumb_img_arr);
2367
+		}
2368
+
2369
+		if ($curImages != '')
2370
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2371
+		else
2372
+			$svalue = '';
2373
+
2374
+		$image_limit = $package_info->image_limit;
2375
+		$show_image_input_box = ($image_limit != '0');
2376
+		/**
2377
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2378
+		 *
2379
+		 * @since 1.0.0
2380
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2381
+		 * @param string $listing_type The custom post type slug.
2382
+		 */
2383
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2384
+		if ($show_image_input_box) {
2385
+			?>
2386 2386
 
2387 2387
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2388 2388
                 <?php if ($image_limit == 1) {
2389
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2390
-                } ?>
2389
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2390
+				} ?>
2391 2391
                 <?php if ($image_limit > 1) {
2392
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2393
-                } ?>
2392
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2393
+				} ?>
2394 2394
                 <?php if ($image_limit == '') {
2395
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2396
-                } ?>
2395
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2396
+				} ?>
2397 2397
             </h5>
2398 2398
 
2399 2399
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2431,12 +2431,12 @@  discard block
 block discarded – undo
2431 2431
         <?php } ?>
2432 2432
 
2433 2433
         <?php
2434
-        /**
2435
-         * Called on the add listing page form for frontend just after the image upload field.
2436
-         *
2437
-         * @since 1.0.0
2438
-         */
2439
-        do_action('geodir_after_main_form_fields');?>
2434
+		/**
2435
+		 * Called on the add listing page form for frontend just after the image upload field.
2436
+		 *
2437
+		 * @since 1.0.0
2438
+		 */
2439
+		do_action('geodir_after_main_form_fields');?>
2440 2440
 
2441 2441
 
2442 2442
         <!-- add captcha code -->
@@ -2465,7 +2465,7 @@  discard block
 block discarded – undo
2465 2465
 
2466 2466
     </form>
2467 2467
     <?php
2468
-    wp_reset_query();
2468
+	wp_reset_query();
2469 2469
 }
2470 2470
 
2471 2471
 /**
@@ -2476,7 +2476,7 @@  discard block
 block discarded – undo
2476 2476
  */
2477 2477
 function geodir_add_listing_sidebar_widget_area()
2478 2478
 {
2479
-    dynamic_sidebar('geodir_add_listing_sidebar');
2479
+	dynamic_sidebar('geodir_add_listing_sidebar');
2480 2480
 }
2481 2481
 
2482 2482
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2491,16 +2491,16 @@  discard block
 block discarded – undo
2491 2491
  */
2492 2492
 function geodir_action_add_listing_sidebar()
2493 2493
 {
2494
-    /** This action is documented in geodirectory_template_actions.php */
2495
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2496
-    /**
2497
-     * This is used to add the content to the add listing page sidebar.
2498
-     *
2499
-     * @since 1.0.0
2500
-     */
2501
-    do_action('geodir_add_listing_sidebar_inside');
2502
-    /** This action is documented in geodirectory_template_actions.php */
2503
-    do_action('geodir_sidebar_right_close', 'details-page');
2494
+	/** This action is documented in geodirectory_template_actions.php */
2495
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2496
+	/**
2497
+	 * This is used to add the content to the add listing page sidebar.
2498
+	 *
2499
+	 * @since 1.0.0
2500
+	 */
2501
+	do_action('geodir_add_listing_sidebar_inside');
2502
+	/** This action is documented in geodirectory_template_actions.php */
2503
+	do_action('geodir_sidebar_right_close', 'details-page');
2504 2504
 }
2505 2505
 
2506 2506
 ###############################################
@@ -2517,11 +2517,11 @@  discard block
 block discarded – undo
2517 2517
  */
2518 2518
 function geodir_action_geodir_sidebar_signup_top()
2519 2519
 {
2520
-    ?>
2520
+	?>
2521 2521
     <div
2522 2522
         class="<?php
2523
-        /** This action is documented in geodirectory_template_actions.php */
2524
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2523
+		/** This action is documented in geodirectory_template_actions.php */
2524
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2525 2525
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2526 2526
     </div><!-- clearfix ends here-->
2527 2527
 <?php
@@ -2540,9 +2540,9 @@  discard block
 block discarded – undo
2540 2540
 function geodir_action_signup_forms()
2541 2541
 {
2542 2542
 
2543
-    global $user_login;
2543
+	global $user_login;
2544 2544
 
2545
-    ?>
2545
+	?>
2546 2546
     <script type="text/javascript">
2547 2547
         <?php if ( $user_login ) { ?>
2548 2548
         setTimeout(function () {
@@ -2578,65 +2578,65 @@  discard block
 block discarded – undo
2578 2578
         <?php } ?>
2579 2579
     </script><?php
2580 2580
 
2581
-    global $errors;
2582
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2583
-        $errors->add('claim_login', LOGIN_CLAIM);
2584
-
2585
-    if (!empty($errors)) {
2586
-        foreach ($errors as $errorsObj) {
2587
-            foreach ($errorsObj as $key => $val) {
2588
-                for ($i = 0; $i < count($val); $i++) {
2589
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2590
-                    $registration_error_msg = 1;
2591
-                }
2592
-            }
2593
-        }
2594
-    }
2581
+	global $errors;
2582
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2583
+		$errors->add('claim_login', LOGIN_CLAIM);
2584
+
2585
+	if (!empty($errors)) {
2586
+		foreach ($errors as $errorsObj) {
2587
+			foreach ($errorsObj as $key => $val) {
2588
+				for ($i = 0; $i < count($val); $i++) {
2589
+					echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2590
+					$registration_error_msg = 1;
2591
+				}
2592
+			}
2593
+		}
2594
+	}
2595 2595
 
2596
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2597
-        ?>
2596
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2597
+		?>
2598 2598
 
2599 2599
         <div class="login_form">
2600 2600
             <?php
2601
-            /**
2602
-             * Contains login form template.
2603
-             *
2604
-             * @since 1.0.0
2605
-             */
2606
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2601
+			/**
2602
+			 * Contains login form template.
2603
+			 *
2604
+			 * @since 1.0.0
2605
+			 */
2606
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2607 2607
         </div>
2608 2608
 
2609 2609
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2610 2610
 
2611 2611
         <div class="registration_form">
2612 2612
             <?php
2613
-            /**
2614
-             * Contains registration form template.
2615
-             *
2616
-             * @since 1.0.0
2617
-             */
2618
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2613
+			/**
2614
+			 * Contains registration form template.
2615
+			 *
2616
+			 * @since 1.0.0
2617
+			 */
2618
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2619 2619
         </div>
2620 2620
 
2621 2621
     <?php } else { ?>
2622 2622
 
2623 2623
         <div class="login_form_l">
2624 2624
             <?php
2625
-            /**
2626
-             * Contains login form template.
2627
-             *
2628
-             * @since 1.0.0
2629
-             */
2630
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2625
+			/**
2626
+			 * Contains login form template.
2627
+			 *
2628
+			 * @since 1.0.0
2629
+			 */
2630
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2631 2631
         </div>
2632 2632
         <div class="registration_form_r">
2633 2633
             <?php
2634
-            /**
2635
-             * Contains registration form template.
2636
-             *
2637
-             * @since 1.0.0
2638
-             */
2639
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2634
+			/**
2635
+			 * Contains registration form template.
2636
+			 *
2637
+			 * @since 1.0.0
2638
+			 */
2639
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2640 2640
         </div>
2641 2641
 
2642 2642
     <?php }?>
@@ -2667,66 +2667,66 @@  discard block
 block discarded – undo
2667 2667
  */
2668 2668
 function geodir_action_author_page_title()
2669 2669
 {
2670
-    global $term;
2670
+	global $term;
2671 2671
 
2672
-    $gd_post_type = geodir_get_current_posttype();
2673
-    $post_type_info = get_post_type_object($gd_post_type);
2672
+	$gd_post_type = geodir_get_current_posttype();
2673
+	$post_type_info = get_post_type_object($gd_post_type);
2674 2674
 
2675
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2676
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2677
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2678
-    }
2675
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2676
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2677
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2678
+	}
2679 2679
 
2680
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2681
-    $single_name = $post_type_info->labels->singular_name;
2680
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2681
+	$single_name = $post_type_info->labels->singular_name;
2682 2682
 
2683
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2683
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2684 2684
 
2685
-    if (!empty($term)) {
2686
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2687
-        if (!empty($current_term))
2688
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2689
-    }
2685
+	if (!empty($term)) {
2686
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2687
+		if (!empty($current_term))
2688
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2689
+	}
2690 2690
 
2691 2691
 
2692
-    if (is_search()) {
2693
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2692
+	if (is_search()) {
2693
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2694 2694
 
2695
-    }
2696
-    /** This action is documented in geodirectory_template_actions.php */
2697
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2698
-    /** This action is documented in geodirectory_template_actions.php */
2699
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2695
+	}
2696
+	/** This action is documented in geodirectory_template_actions.php */
2697
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2698
+	/** This action is documented in geodirectory_template_actions.php */
2699
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2700 2700
 
2701
-    $title = $list_title;
2702
-    if(geodir_is_page('author')){
2703
-        $gd_page = 'author';
2704
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2705
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2706
-        }else{
2707
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2708
-        }
2701
+	$title = $list_title;
2702
+	if(geodir_is_page('author')){
2703
+		$gd_page = 'author';
2704
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2705
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2706
+		}else{
2707
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2708
+		}
2709 2709
 
2710
-    }
2710
+	}
2711 2711
 
2712 2712
 
2713
-    /**
2714
-     * Filter page title to replace variables.
2715
-     *
2716
-     * @since 1.5.4
2717
-     * @param string $title The page title including variables.
2718
-     * @param string $gd_page The GeoDirectory page type if any.
2719
-     */
2720
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2713
+	/**
2714
+	 * Filter page title to replace variables.
2715
+	 *
2716
+	 * @since 1.5.4
2717
+	 * @param string $title The page title including variables.
2718
+	 * @param string $gd_page The GeoDirectory page type if any.
2719
+	 */
2720
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2721 2721
 
2722
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2723
-        /**
2724
-         * Filter the author page title text.
2725
-         *
2726
-         * @since 1.0.0
2727
-         * @param string $list_title The title for the page.
2728
-         */
2729
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2722
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2723
+		/**
2724
+		 * Filter the author page title text.
2725
+		 *
2726
+		 * @since 1.0.0
2727
+		 * @param string $list_title The title for the page.
2728
+		 */
2729
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2730 2730
 }
2731 2731
 
2732 2732
 
@@ -2744,11 +2744,11 @@  discard block
 block discarded – undo
2744 2744
  */
2745 2745
 function geodir_action_geodir_sidebar_author_top()
2746 2746
 {
2747
-    if (get_option('geodir_show_author_top_section')) { ?>
2747
+	if (get_option('geodir_show_author_top_section')) { ?>
2748 2748
         <div
2749 2749
             class="<?php
2750
-            /** This action is documented in geodirectory_template_actions.php */
2751
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2750
+			/** This action is documented in geodirectory_template_actions.php */
2751
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2752 2752
             <?php dynamic_sidebar('geodir_author_top'); ?>
2753 2753
         </div><!-- clearfix ends here-->
2754 2754
     <?php }
@@ -2764,7 +2764,7 @@  discard block
 block discarded – undo
2764 2764
  */
2765 2765
 function geodir_author_left_section()
2766 2766
 {
2767
-    if (get_option('geodir_show_author_left_section')) { ?>
2767
+	if (get_option('geodir_show_author_left_section')) { ?>
2768 2768
         <div class="geodir-content-left geodir-sidebar-wrap">
2769 2769
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2770 2770
         </div><!-- end geodir-content-left -->
@@ -2785,19 +2785,19 @@  discard block
 block discarded – undo
2785 2785
  */
2786 2786
 function geodir_action_author_sidebar_left()
2787 2787
 {
2788
-    if (get_option('geodir_show_author_left_section')) {
2788
+	if (get_option('geodir_show_author_left_section')) {
2789 2789
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2790
-        /** This action is documented in geodirectory_template_actions.php */
2791
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2792
-        /**
2793
-         * This is used to add the content to the author page left sidebar (if active).
2794
-         *
2795
-         * @since 1.0.0
2796
-         */
2797
-        do_action('geodir_author_sidebar_left_inside');
2798
-        /** This action is documented in geodirectory_template_actions.php */
2799
-        do_action('geodir_sidebar_left_close', 'author-page');
2800
-    }
2790
+		/** This action is documented in geodirectory_template_actions.php */
2791
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2792
+		/**
2793
+		 * This is used to add the content to the author page left sidebar (if active).
2794
+		 *
2795
+		 * @since 1.0.0
2796
+		 */
2797
+		do_action('geodir_author_sidebar_left_inside');
2798
+		/** This action is documented in geodirectory_template_actions.php */
2799
+		do_action('geodir_sidebar_left_close', 'author-page');
2800
+	}
2801 2801
 }
2802 2802
 
2803 2803
 /**
@@ -2810,7 +2810,7 @@  discard block
 block discarded – undo
2810 2810
  */
2811 2811
 function geodir_author_right_section()
2812 2812
 {
2813
-    if (get_option('geodir_show_author_right_section')) { ?>
2813
+	if (get_option('geodir_show_author_right_section')) { ?>
2814 2814
         <div class="geodir-content-right geodir-sidebar-wrap">
2815 2815
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2816 2816
         </div><!-- end geodir-content-right -->
@@ -2830,18 +2830,18 @@  discard block
 block discarded – undo
2830 2830
  */
2831 2831
 function geodir_action_author_sidebar_right()
2832 2832
 {
2833
-    if (get_option('geodir_show_author_right_section')) {
2834
-        /** This action is documented in geodirectory_template_actions.php */
2835
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2836
-        /**
2837
-         * This is used to add the content to the author page right sidebar (if active).
2838
-         *
2839
-         * @since 1.0.0
2840
-         */
2841
-        do_action('geodir_author_sidebar_right_inside');
2842
-        /** This action is documented in geodirectory_template_actions.php */
2843
-        do_action('geodir_sidebar_right_close', 'author-page');
2844
-    }
2833
+	if (get_option('geodir_show_author_right_section')) {
2834
+		/** This action is documented in geodirectory_template_actions.php */
2835
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2836
+		/**
2837
+		 * This is used to add the content to the author page right sidebar (if active).
2838
+		 *
2839
+		 * @since 1.0.0
2840
+		 */
2841
+		do_action('geodir_author_sidebar_right_inside');
2842
+		/** This action is documented in geodirectory_template_actions.php */
2843
+		do_action('geodir_sidebar_right_close', 'author-page');
2844
+	}
2845 2845
 }
2846 2846
 
2847 2847
 /**
@@ -2853,14 +2853,14 @@  discard block
 block discarded – undo
2853 2853
  */
2854 2854
 function geodir_action_author_content_inside()
2855 2855
 {
2856
-    global $gridview_columns;
2857
-    $listing_view = get_option('geodir_author_view');
2858
-    if (strstr($listing_view, 'gridview')) {
2859
-        $gridview_columns = $listing_view;
2860
-        $listing_view_exp = explode('_', $listing_view);
2861
-        $listing_view = $listing_view_exp[0];
2862
-    }
2863
-    geodir_get_template_part('listing', 'listview');
2856
+	global $gridview_columns;
2857
+	$listing_view = get_option('geodir_author_view');
2858
+	if (strstr($listing_view, 'gridview')) {
2859
+		$gridview_columns = $listing_view;
2860
+		$listing_view_exp = explode('_', $listing_view);
2861
+		$listing_view = $listing_view_exp[0];
2862
+	}
2863
+	geodir_get_template_part('listing', 'listview');
2864 2864
 }
2865 2865
 
2866 2866
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2875,22 +2875,22 @@  discard block
 block discarded – undo
2875 2875
  */
2876 2876
 function geodir_action_author_content()
2877 2877
 {
2878
-    /** This action is documented in geodirectory_template_actions.php */
2879
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2880
-    echo '<div class="clearfix">';
2881
-    /** This action is documented in geodirectory_template_actions.php */
2882
-    do_action('geodir_before_listing');
2883
-    echo '</div>';
2884
-    /**
2885
-     * This is used to add the content to the author page main content.
2886
-     *
2887
-     * @since 1.0.0
2888
-     */
2889
-    do_action('geodir_author_content_inside');
2890
-    /** This action is documented in geodirectory_template_actions.php */
2891
-    do_action('geodir_after_listing');
2892
-    /** This action is documented in geodirectory_template_actions.php */
2893
-    do_action('geodir_main_content_close', 'author-page');
2878
+	/** This action is documented in geodirectory_template_actions.php */
2879
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2880
+	echo '<div class="clearfix">';
2881
+	/** This action is documented in geodirectory_template_actions.php */
2882
+	do_action('geodir_before_listing');
2883
+	echo '</div>';
2884
+	/**
2885
+	 * This is used to add the content to the author page main content.
2886
+	 *
2887
+	 * @since 1.0.0
2888
+	 */
2889
+	do_action('geodir_author_content_inside');
2890
+	/** This action is documented in geodirectory_template_actions.php */
2891
+	do_action('geodir_after_listing');
2892
+	/** This action is documented in geodirectory_template_actions.php */
2893
+	do_action('geodir_main_content_close', 'author-page');
2894 2894
 }
2895 2895
 
2896 2896
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2904,11 +2904,11 @@  discard block
 block discarded – undo
2904 2904
  */
2905 2905
 function geodir_action_sidebar_author_bottom_section()
2906 2906
 {
2907
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2907
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2908 2908
         <div
2909 2909
             class="<?php
2910
-            /** This action is documented in geodirectory_template_actions.php */
2911
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2910
+			/** This action is documented in geodirectory_template_actions.php */
2911
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2912 2912
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2913 2913
         </div><!-- clearfix ends here-->
2914 2914
     <?php }
@@ -2927,23 +2927,23 @@  discard block
 block discarded – undo
2927 2927
  */
2928 2928
 function geodir_action_search_page_title()
2929 2929
 {
2930
-    $gd_post_type = geodir_get_current_posttype();
2931
-    $post_type_info = get_post_type_object($gd_post_type);
2930
+	$gd_post_type = geodir_get_current_posttype();
2931
+	$post_type_info = get_post_type_object($gd_post_type);
2932 2932
 
2933
-    $pt_name = '';
2934
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2933
+	$pt_name = '';
2934
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2935 2935
 
2936
-    if (is_search()) {
2937
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2936
+	if (is_search()) {
2937
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2938 2938
 
2939
-    }
2940
-    /** This action is documented in geodirectory_template_actions.php */
2941
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2942
-    /** This action is documented in geodirectory_template_actions.php */
2943
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2944
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2945
-        /** This action is documented in geodirectory_template_actions.php */
2946
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2939
+	}
2940
+	/** This action is documented in geodirectory_template_actions.php */
2941
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2942
+	/** This action is documented in geodirectory_template_actions.php */
2943
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2944
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2945
+		/** This action is documented in geodirectory_template_actions.php */
2946
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2947 2947
 }
2948 2948
 
2949 2949
 // action for adding the listings page top widget area
@@ -2959,11 +2959,11 @@  discard block
 block discarded – undo
2959 2959
  */
2960 2960
 function geodir_action_geodir_sidebar_search_top()
2961 2961
 {
2962
-    if (get_option('geodir_show_search_top_section')) { ?>
2962
+	if (get_option('geodir_show_search_top_section')) { ?>
2963 2963
         <div
2964 2964
             class="<?php
2965
-            /** This action is documented in geodirectory_template_actions.php */
2966
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2965
+			/** This action is documented in geodirectory_template_actions.php */
2966
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2967 2967
             <?php dynamic_sidebar('geodir_search_top'); ?>
2968 2968
         </div><!-- clearfix ends here-->
2969 2969
     <?php }
@@ -2979,7 +2979,7 @@  discard block
 block discarded – undo
2979 2979
  */
2980 2980
 function geodir_search_left_section()
2981 2981
 {
2982
-    if (get_option('geodir_show_search_left_section')) { ?>
2982
+	if (get_option('geodir_show_search_left_section')) { ?>
2983 2983
         <div class="geodir-content-left geodir-sidebar-wrap">
2984 2984
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
2985 2985
         </div><!-- end geodir-content-left -->
@@ -2999,19 +2999,19 @@  discard block
 block discarded – undo
2999 2999
  */
3000 3000
 function geodir_action_search_sidebar_left()
3001 3001
 {
3002
-    if (get_option('geodir_show_search_left_section')) {
3002
+	if (get_option('geodir_show_search_left_section')) {
3003 3003
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3004
-        /** This action is documented in geodirectory_template_actions.php */
3005
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3006
-        /**
3007
-         * This is used to add the content to the search page left sidebar (if active).
3008
-         *
3009
-         * @since 1.0.0
3010
-         */
3011
-        do_action('geodir_search_sidebar_left_inside');
3012
-        /** This action is documented in geodirectory_template_actions.php */
3013
-        do_action('geodir_sidebar_left_close', 'search-page');
3014
-    }
3004
+		/** This action is documented in geodirectory_template_actions.php */
3005
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3006
+		/**
3007
+		 * This is used to add the content to the search page left sidebar (if active).
3008
+		 *
3009
+		 * @since 1.0.0
3010
+		 */
3011
+		do_action('geodir_search_sidebar_left_inside');
3012
+		/** This action is documented in geodirectory_template_actions.php */
3013
+		do_action('geodir_sidebar_left_close', 'search-page');
3014
+	}
3015 3015
 }
3016 3016
 
3017 3017
 /**
@@ -3024,7 +3024,7 @@  discard block
 block discarded – undo
3024 3024
  */
3025 3025
 function geodir_search_right_section()
3026 3026
 {
3027
-    if (get_option('geodir_show_search_right_section')) { ?>
3027
+	if (get_option('geodir_show_search_right_section')) { ?>
3028 3028
         <div class="geodir-content-right geodir-sidebar-wrap">
3029 3029
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3030 3030
         </div><!-- end geodir-content-right -->
@@ -3044,18 +3044,18 @@  discard block
 block discarded – undo
3044 3044
  */
3045 3045
 function geodir_action_search_sidebar_right()
3046 3046
 {
3047
-    if (get_option('geodir_show_search_right_section')) {
3048
-        /** This action is documented in geodirectory_template_actions.php */
3049
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3050
-        /**
3051
-         * This is used to add the content to the search page right sidebar (if active).
3052
-         *
3053
-         * @since 1.0.0
3054
-         */
3055
-        do_action('geodir_search_sidebar_right_inside');
3056
-        /** This action is documented in geodirectory_template_actions.php */
3057
-        do_action('geodir_sidebar_right_close', 'search-page');
3058
-    }
3047
+	if (get_option('geodir_show_search_right_section')) {
3048
+		/** This action is documented in geodirectory_template_actions.php */
3049
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3050
+		/**
3051
+		 * This is used to add the content to the search page right sidebar (if active).
3052
+		 *
3053
+		 * @since 1.0.0
3054
+		 */
3055
+		do_action('geodir_search_sidebar_right_inside');
3056
+		/** This action is documented in geodirectory_template_actions.php */
3057
+		do_action('geodir_sidebar_right_close', 'search-page');
3058
+	}
3059 3059
 }
3060 3060
 
3061 3061
 
@@ -3070,11 +3070,11 @@  discard block
 block discarded – undo
3070 3070
  */
3071 3071
 function geodir_action_sidebar_search_bottom_section()
3072 3072
 {
3073
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3073
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3074 3074
         <div
3075 3075
             class="<?php
3076
-            /** This action is documented in geodirectory_template_actions.php */
3077
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3076
+			/** This action is documented in geodirectory_template_actions.php */
3077
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3078 3078
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3079 3079
         </div><!-- clearfix ends here-->
3080 3080
     <?php }
@@ -3089,14 +3089,14 @@  discard block
 block discarded – undo
3089 3089
  */
3090 3090
 function geodir_action_search_content_inside()
3091 3091
 {
3092
-    global $gridview_columns;
3093
-    $listing_view = get_option('geodir_search_view');
3094
-    if (strstr($listing_view, 'gridview')) {
3095
-        $gridview_columns = $listing_view;
3096
-        $listing_view_exp = explode('_', $listing_view);
3097
-        $listing_view = $listing_view_exp[0];
3098
-    }
3099
-    geodir_get_template_part('listing', 'listview');
3092
+	global $gridview_columns;
3093
+	$listing_view = get_option('geodir_search_view');
3094
+	if (strstr($listing_view, 'gridview')) {
3095
+		$gridview_columns = $listing_view;
3096
+		$listing_view_exp = explode('_', $listing_view);
3097
+		$listing_view = $listing_view_exp[0];
3098
+	}
3099
+	geodir_get_template_part('listing', 'listview');
3100 3100
 }
3101 3101
 
3102 3102
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3112,22 +3112,22 @@  discard block
 block discarded – undo
3112 3112
  */
3113 3113
 function geodir_action_search_content()
3114 3114
 {
3115
-    /** This action is documented in geodirectory_template_actions.php */
3116
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3117
-    echo '<div class="clearfix">';
3118
-    /** This action is documented in geodirectory_template_actions.php */
3119
-    do_action('geodir_before_listing');
3120
-    echo '</div>';
3121
-    /**
3122
-     * This is used to add the content to the search page main content.
3123
-     *
3124
-     * @since 1.0.0
3125
-     */
3126
-    do_action('geodir_search_content_inside');
3127
-    /** This action is documented in geodirectory_template_actions.php */
3128
-    do_action('geodir_after_listing');
3129
-    /** This action is documented in geodirectory_template_actions.php */
3130
-    do_action('geodir_main_content_close', 'search-page');
3115
+	/** This action is documented in geodirectory_template_actions.php */
3116
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3117
+	echo '<div class="clearfix">';
3118
+	/** This action is documented in geodirectory_template_actions.php */
3119
+	do_action('geodir_before_listing');
3120
+	echo '</div>';
3121
+	/**
3122
+	 * This is used to add the content to the search page main content.
3123
+	 *
3124
+	 * @since 1.0.0
3125
+	 */
3126
+	do_action('geodir_search_content_inside');
3127
+	/** This action is documented in geodirectory_template_actions.php */
3128
+	do_action('geodir_after_listing');
3129
+	/** This action is documented in geodirectory_template_actions.php */
3130
+	do_action('geodir_main_content_close', 'search-page');
3131 3131
 }
3132 3132
 
3133 3133
 ###############################################
@@ -3150,11 +3150,11 @@  discard block
 block discarded – undo
3150 3150
  */
3151 3151
 function geodir_action_geodir_sidebar_home_top()
3152 3152
 {
3153
-    if (get_option('geodir_show_home_top_section')) { ?>
3153
+	if (get_option('geodir_show_home_top_section')) { ?>
3154 3154
         <div
3155 3155
             class="<?php
3156
-            /** This action is documented in geodirectory_template_actions.php */
3157
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3156
+			/** This action is documented in geodirectory_template_actions.php */
3157
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3158 3158
             <?php dynamic_sidebar('geodir_home_top'); ?>
3159 3159
         </div><!-- clearfix ends here-->
3160 3160
     <?php }
@@ -3170,7 +3170,7 @@  discard block
 block discarded – undo
3170 3170
  */
3171 3171
 function geodir_home_left_section()
3172 3172
 {
3173
-    if (get_option('geodir_show_home_left_section')) { ?>
3173
+	if (get_option('geodir_show_home_left_section')) { ?>
3174 3174
         <div class="geodir-content-left geodir-sidebar-wrap">
3175 3175
             <?php dynamic_sidebar('geodir_home_left'); ?>
3176 3176
         </div><!-- end geodir-content-left -->
@@ -3192,19 +3192,19 @@  discard block
 block discarded – undo
3192 3192
  */
3193 3193
 function geodir_action_home_sidebar_left()
3194 3194
 {
3195
-    if (get_option('geodir_show_home_left_section')) {
3195
+	if (get_option('geodir_show_home_left_section')) {
3196 3196
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3197
-        /** This action is documented in geodirectory_template_actions.php */
3198
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3199
-        /**
3200
-         * This is used to add the content to the home page left sidebar (if active).
3201
-         *
3202
-         * @since 1.0.0
3203
-         */
3204
-        do_action('geodir_home_sidebar_left_inside');
3205
-        /** This action is documented in geodirectory_template_actions.php */
3206
-        do_action('geodir_sidebar_left_close', 'home-page');
3207
-    }
3197
+		/** This action is documented in geodirectory_template_actions.php */
3198
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3199
+		/**
3200
+		 * This is used to add the content to the home page left sidebar (if active).
3201
+		 *
3202
+		 * @since 1.0.0
3203
+		 */
3204
+		do_action('geodir_home_sidebar_left_inside');
3205
+		/** This action is documented in geodirectory_template_actions.php */
3206
+		do_action('geodir_sidebar_left_close', 'home-page');
3207
+	}
3208 3208
 }
3209 3209
 
3210 3210
 /**
@@ -3217,7 +3217,7 @@  discard block
 block discarded – undo
3217 3217
  */
3218 3218
 function geodir_home_right_section()
3219 3219
 {
3220
-    if (get_option('geodir_show_home_right_section')) { ?>
3220
+	if (get_option('geodir_show_home_right_section')) { ?>
3221 3221
         <div class="geodir-content-right geodir-sidebar-wrap">
3222 3222
             <?php dynamic_sidebar('geodir_home_right'); ?>
3223 3223
         </div><!-- end geodir-content-right -->
@@ -3238,18 +3238,18 @@  discard block
 block discarded – undo
3238 3238
  */
3239 3239
 function geodir_action_home_sidebar_right()
3240 3240
 {
3241
-    if (get_option('geodir_show_home_right_section')) {
3242
-        /** This action is documented in geodirectory_template_actions.php */
3243
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3244
-        /**
3245
-         * This is used to add the content to the home page right sidebar (if active).
3246
-         *
3247
-         * @since 1.0.0
3248
-         */
3249
-        do_action('geodir_home_sidebar_right_inside');
3250
-        /** This action is documented in geodirectory_template_actions.php */
3251
-        do_action('geodir_sidebar_right_close', 'home-page');
3252
-    }
3241
+	if (get_option('geodir_show_home_right_section')) {
3242
+		/** This action is documented in geodirectory_template_actions.php */
3243
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3244
+		/**
3245
+		 * This is used to add the content to the home page right sidebar (if active).
3246
+		 *
3247
+		 * @since 1.0.0
3248
+		 */
3249
+		do_action('geodir_home_sidebar_right_inside');
3250
+		/** This action is documented in geodirectory_template_actions.php */
3251
+		do_action('geodir_sidebar_right_close', 'home-page');
3252
+	}
3253 3253
 }
3254 3254
 
3255 3255
 /**
@@ -3260,7 +3260,7 @@  discard block
 block discarded – undo
3260 3260
  */
3261 3261
 function geodir_action_home_content_inside()
3262 3262
 {
3263
-    dynamic_sidebar('geodir_home_content');
3263
+	dynamic_sidebar('geodir_home_content');
3264 3264
 }
3265 3265
 
3266 3266
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3275,28 +3275,28 @@  discard block
 block discarded – undo
3275 3275
  */
3276 3276
 function geodir_action_home_content()
3277 3277
 {
3278
-    /** This action is documented in geodirectory_template_actions.php */
3279
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3280
-    /**
3281
-     * This called before the home page main content.
3282
-     *
3283
-     * @since 1.0.0
3284
-     */
3285
-    do_action('geodir_before_home_content');
3286
-    /**
3287
-     * This is used to add the content to the home page main content.
3288
-     *
3289
-     * @since 1.0.0
3290
-     */
3291
-    do_action('geodir_home_content_inside');
3292
-    /**
3293
-     * This is called after the homepage main content.
3294
-     *
3295
-     * @since 1.0.0
3296
-     */
3297
-    do_action('geodir_after_home_content');
3298
-    /** This action is documented in geodirectory_template_actions.php */
3299
-    do_action('geodir_main_content_close', 'home-page');
3278
+	/** This action is documented in geodirectory_template_actions.php */
3279
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3280
+	/**
3281
+	 * This called before the home page main content.
3282
+	 *
3283
+	 * @since 1.0.0
3284
+	 */
3285
+	do_action('geodir_before_home_content');
3286
+	/**
3287
+	 * This is used to add the content to the home page main content.
3288
+	 *
3289
+	 * @since 1.0.0
3290
+	 */
3291
+	do_action('geodir_home_content_inside');
3292
+	/**
3293
+	 * This is called after the homepage main content.
3294
+	 *
3295
+	 * @since 1.0.0
3296
+	 */
3297
+	do_action('geodir_after_home_content');
3298
+	/** This action is documented in geodirectory_template_actions.php */
3299
+	do_action('geodir_main_content_close', 'home-page');
3300 3300
 }
3301 3301
 
3302 3302
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3311,11 +3311,11 @@  discard block
 block discarded – undo
3311 3311
  */
3312 3312
 function geodir_action_sidebar_home_bottom_section()
3313 3313
 {
3314
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3314
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3315 3315
         <div
3316 3316
             class="<?php
3317
-            /** This action is documented in geodirectory_template_actions.php */
3318
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3317
+			/** This action is documented in geodirectory_template_actions.php */
3318
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3319 3319
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3320 3320
         </div><!-- clearfix ends here-->
3321 3321
     <?php }
@@ -3343,13 +3343,13 @@  discard block
 block discarded – undo
3343 3343
  */
3344 3344
 function geodir_filter_listing_page_title($list_title)
3345 3345
 {
3346
-    if (is_search() && trim(get_search_query()) == '') {
3347
-        $gd_post_type = geodir_get_current_posttype();
3348
-        $post_type_info = get_post_type_object($gd_post_type);
3346
+	if (is_search() && trim(get_search_query()) == '') {
3347
+		$gd_post_type = geodir_get_current_posttype();
3348
+		$post_type_info = get_post_type_object($gd_post_type);
3349 3349
 
3350
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3351
-    }
3352
-    return $list_title;
3350
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3351
+	}
3352
+	return $list_title;
3353 3353
 }
3354 3354
 
3355 3355
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3364,61 +3364,61 @@  discard block
 block discarded – undo
3364 3364
  * @param string $gd_page The geodirectory page type. Default null.
3365 3365
  */
3366 3366
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3367
-    global $post;
3367
+	global $post;
3368 3368
         
3369
-    $gd_page_id = NULL;
3370
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3371
-        $gd_page_id = geodir_home_page_id();
3372
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3373
-        $gd_page_id = geodir_preview_page_id();
3374
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3375
-        $gd_page_id = geodir_add_listing_page_id();
3376
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3377
-        $gd_page_id = geodir_success_page_id();
3378
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3379
-        $gd_page_id = geodir_location_page_id();
3380
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3381
-        $gd_page_id = geodir_info_page_id();
3382
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3383
-        $gd_page_id = geodir_login_page_id();
3384
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3385
-        $gd_page_id = geodir_payment_checkout_page_id();
3386
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3387
-        $gd_page_id = geodir_payment_invoices_page_id();
3388
-    }
3369
+	$gd_page_id = NULL;
3370
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3371
+		$gd_page_id = geodir_home_page_id();
3372
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3373
+		$gd_page_id = geodir_preview_page_id();
3374
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3375
+		$gd_page_id = geodir_add_listing_page_id();
3376
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3377
+		$gd_page_id = geodir_success_page_id();
3378
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3379
+		$gd_page_id = geodir_location_page_id();
3380
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3381
+		$gd_page_id = geodir_info_page_id();
3382
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3383
+		$gd_page_id = geodir_login_page_id();
3384
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3385
+		$gd_page_id = geodir_payment_checkout_page_id();
3386
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3387
+		$gd_page_id = geodir_payment_invoices_page_id();
3388
+	}
3389 3389
     
3390
-    if (!$gd_page_id > 0) {
3391
-        return;
3392
-    }
3390
+	if (!$gd_page_id > 0) {
3391
+		return;
3392
+	}
3393 3393
     
3394
-    $display = 'before';
3395
-    /**
3396
-     * Filter the position to display the page content.
3397
-     *
3398
-     * @since 1.6.3
3399
-     *
3400
-     * @param string $display Position to add the post content.
3401
-     * @param string $gd_page The geodirectory page type.
3402
-     */
3403
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3394
+	$display = 'before';
3395
+	/**
3396
+	 * Filter the position to display the page content.
3397
+	 *
3398
+	 * @since 1.6.3
3399
+	 *
3400
+	 * @param string $display Position to add the post content.
3401
+	 * @param string $gd_page The geodirectory page type.
3402
+	 */
3403
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3404 3404
     
3405
-    if ($position !== $display) {
3406
-        return;
3407
-    }
3405
+	if ($position !== $display) {
3406
+		return;
3407
+	}
3408 3408
         
3409
-    $gd_post = $post;
3409
+	$gd_post = $post;
3410 3410
     
3411
-    setup_postdata(get_post($gd_page_id));
3411
+	setup_postdata(get_post($gd_page_id));
3412 3412
     
3413
-    if (get_the_content()) {
3414
-        ?>
3413
+	if (get_the_content()) {
3414
+		?>
3415 3415
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3416 3416
         <?php
3417
-    }
3417
+	}
3418 3418
     
3419
-    $post = $gd_post;
3420
-    if (!empty($gd_post) && is_object($gd_post)) {
3421
-        setup_postdata($gd_post);
3422
-    }
3419
+	$post = $gd_post;
3420
+	if (!empty($gd_post) && is_object($gd_post)) {
3421
+		setup_postdata($gd_post);
3422
+	}
3423 3423
 }
3424 3424
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3425 3425
\ No newline at end of file
Please login to merge, or discard this patch.