Test Failed
Push — master ( 8bc267...c75bcd )
by
unknown
22:28
created
geodirectory_template_actions.php 1 patch
Indentation   +1811 added lines, -1811 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,107 +275,107 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
278
+	$tc = get_option('theme_compatibility_setting');
279 279
 //print_r($tc);
280
-    if (empty($tc)) {
281
-        return;
282
-    }
283
-
284
-    //php
285
-    if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
-    }
288
-
289
-    //geodir_full_page_class
290
-    if (!empty($tc['geodir_full_page_class_filter'])) {
291
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
-    }
293
-
294
-    //widget before filter
295
-    if (!empty($tc['geodir_before_widget_filter'])) {
296
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
-    }
298
-
299
-    //widget after filter
300
-    if (!empty($tc['geodir_after_widget_filter'])) {
301
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
-    }
303
-
304
-    //widget before title filter
305
-    if (!empty($tc['geodir_before_title_filter'])) {
306
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
-    }
308
-
309
-    //widget before title filter
310
-    if (!empty($tc['geodir_after_title_filter'])) {
311
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
-    }
313
-
314
-    //menu li class
315
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
316
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
-    }
318
-
319
-    //menu ul class
320
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
-    }
323
-
324
-    //menu sub li class
325
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
-    }
328
-
329
-    //menu a class
330
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
331
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
-    }
333
-
334
-    //menu sub a class
335
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
-    }
338
-
339
-    //location menu li class
340
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
-    }
343
-
344
-    //location menu sub ul class
345
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
-    }
348
-
349
-    //location menu sub li class
350
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
-    }
353
-
354
-    //location menu a class
355
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
-    }
358
-
359
-    // compat styles
360
-    if (!empty($tc['geodir_theme_compat_css'])) {
361
-        add_action('wp_head', 'gd_compat_styles');
362
-    }
363
-
364
-    // compat js
365
-    if (!empty($tc['geodir_theme_compat_js'])) {
366
-        add_action('wp_footer', 'gd_compat_script');
367
-    }
368
-
369
-
370
-    // geodir_top_content_add
371
-    if (!empty($tc['geodir_top_content_add'])) {
372
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
-    }
374
-
375
-    // geodir_before_main_content_add
376
-    if (!empty($tc['geodir_before_main_content_add'])) {
377
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
-    }
280
+	if (empty($tc)) {
281
+		return;
282
+	}
283
+
284
+	//php
285
+	if (!empty($tc['geodir_theme_compat_code'])) {
286
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
+	}
288
+
289
+	//geodir_full_page_class
290
+	if (!empty($tc['geodir_full_page_class_filter'])) {
291
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
+	}
293
+
294
+	//widget before filter
295
+	if (!empty($tc['geodir_before_widget_filter'])) {
296
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
+	}
298
+
299
+	//widget after filter
300
+	if (!empty($tc['geodir_after_widget_filter'])) {
301
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
+	}
303
+
304
+	//widget before title filter
305
+	if (!empty($tc['geodir_before_title_filter'])) {
306
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
+	}
308
+
309
+	//widget before title filter
310
+	if (!empty($tc['geodir_after_title_filter'])) {
311
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
+	}
313
+
314
+	//menu li class
315
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
316
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
+	}
318
+
319
+	//menu ul class
320
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
+	}
323
+
324
+	//menu sub li class
325
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
+	}
328
+
329
+	//menu a class
330
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
331
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
+	}
333
+
334
+	//menu sub a class
335
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
+	}
338
+
339
+	//location menu li class
340
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
+	}
343
+
344
+	//location menu sub ul class
345
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
+	}
348
+
349
+	//location menu sub li class
350
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
+	}
353
+
354
+	//location menu a class
355
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
+	}
358
+
359
+	// compat styles
360
+	if (!empty($tc['geodir_theme_compat_css'])) {
361
+		add_action('wp_head', 'gd_compat_styles');
362
+	}
363
+
364
+	// compat js
365
+	if (!empty($tc['geodir_theme_compat_js'])) {
366
+		add_action('wp_footer', 'gd_compat_script');
367
+	}
368
+
369
+
370
+	// geodir_top_content_add
371
+	if (!empty($tc['geodir_top_content_add'])) {
372
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
+	}
374
+
375
+	// geodir_before_main_content_add
376
+	if (!empty($tc['geodir_before_main_content_add'])) {
377
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
+	}
379 379
 
380 380
 
381 381
 }
@@ -398,23 +398,23 @@  discard block
 block discarded – undo
398 398
  */
399 399
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
400 400
 {
401
-    $tc = get_option('theme_compatibility_setting');
402
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
403
-        $text = $tc['geodir_wrapper_open_replace'];
404
-    } else {
405
-        $text = '<div id="[id]" class="[class]">';
406
-    }
401
+	$tc = get_option('theme_compatibility_setting');
402
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
403
+		$text = $tc['geodir_wrapper_open_replace'];
404
+	} else {
405
+		$text = '<div id="[id]" class="[class]">';
406
+	}
407 407
 
408
-    if (!empty($tc['geodir_wrapper_open_id'])) {
409
-        $id = $tc['geodir_wrapper_open_id'];
410
-    }
411
-    if (!empty($tc['geodir_wrapper_open_class'])) {
412
-        $class = $tc['geodir_wrapper_open_class'];
413
-    }
408
+	if (!empty($tc['geodir_wrapper_open_id'])) {
409
+		$id = $tc['geodir_wrapper_open_id'];
410
+	}
411
+	if (!empty($tc['geodir_wrapper_open_class'])) {
412
+		$class = $tc['geodir_wrapper_open_class'];
413
+	}
414 414
 
415
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
416 416
 
417
-    echo $text;
417
+	echo $text;
418 418
 }
419 419
 
420 420
 // action for adding the wrapperdiv closing tag
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
  */
430 430
 function geodir_action_wrapper_close($type = '')
431 431
 {
432
-    $tc = get_option('theme_compatibility_setting');
433
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
434
-        $text = $tc['geodir_wrapper_close_replace'];
435
-    } else {
436
-        $text = '</div><!-- wrapper ends here-->';
437
-    }
432
+	$tc = get_option('theme_compatibility_setting');
433
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
434
+		$text = $tc['geodir_wrapper_close_replace'];
435
+	} else {
436
+		$text = '</div><!-- wrapper ends here-->';
437
+	}
438 438
 
439
-    echo $text;
439
+	echo $text;
440 440
 }
441 441
 
442 442
 // action for adding the content div opening tag
@@ -452,35 +452,35 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
457
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
459
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
461
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
463
-    } else {
464
-        $width_css = '';
465
-    }
466
-
467
-    $tc = get_option('theme_compatibility_setting');
468
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
-        $text = $tc['geodir_wrapper_content_open_replace'];
470
-    } else {
471
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
-    }
473
-
474
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
-        $id = $tc['geodir_wrapper_content_open_id'];
476
-    }
477
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
-        $class = $tc['geodir_wrapper_content_open_class'];
479
-    }
480
-
481
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
-
483
-    echo $text;
455
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
+		$width_css = 'style="width:' . $width . '%;"';
457
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
+		$width_css = 'style="width:' . $width . '%;"';
459
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
+		$width_css = 'style="width:' . $width . '%;"';
461
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
+		$width_css = 'style="width:' . $width . '%;"';
463
+	} else {
464
+		$width_css = '';
465
+	}
466
+
467
+	$tc = get_option('theme_compatibility_setting');
468
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
+		$text = $tc['geodir_wrapper_content_open_replace'];
470
+	} else {
471
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
+	}
473
+
474
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
+		$id = $tc['geodir_wrapper_content_open_id'];
476
+	}
477
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
+		$class = $tc['geodir_wrapper_content_open_class'];
479
+	}
480
+
481
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
+
483
+	echo $text;
484 484
 }
485 485
 
486 486
 // action for adding the primary div closing tag
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_action_wrapper_content_close($type = '')
496 496
 {
497
-    $tc = get_option('theme_compatibility_setting');
498
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
-        $text = $tc['geodir_wrapper_content_close_replace'];
500
-    } else {
501
-        $text = '</div><!-- content ends here-->';
502
-    }
503
-    echo $text;
497
+	$tc = get_option('theme_compatibility_setting');
498
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
+		$text = $tc['geodir_wrapper_content_close_replace'];
500
+	} else {
501
+		$text = '</div><!-- content ends here-->';
502
+	}
503
+	echo $text;
504 504
 }
505 505
 
506 506
 // action for adding the <article> opening tag
@@ -518,24 +518,24 @@  discard block
 block discarded – undo
518 518
  */
519 519
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
520 520
 {
521
-    $class = implode(" ", $class);
522
-    $tc = get_option('theme_compatibility_setting');
523
-    if (!empty($tc['geodir_article_open_replace'])) {
524
-        $text = $tc['geodir_article_open_replace'];
525
-    } else {
526
-        $text = '<article  id="[id]" class="[class]" >';
527
-    }
521
+	$class = implode(" ", $class);
522
+	$tc = get_option('theme_compatibility_setting');
523
+	if (!empty($tc['geodir_article_open_replace'])) {
524
+		$text = $tc['geodir_article_open_replace'];
525
+	} else {
526
+		$text = '<article  id="[id]" class="[class]" >';
527
+	}
528 528
 
529
-    if (!empty($tc['geodir_article_open_id'])) {
530
-        $id = $tc['geodir_article_open_id'];
531
-    }
532
-    if (!empty($tc['geodir_article_open_class'])) {
533
-        $class = $tc['geodir_article_open_class'];
534
-    }
529
+	if (!empty($tc['geodir_article_open_id'])) {
530
+		$id = $tc['geodir_article_open_id'];
531
+	}
532
+	if (!empty($tc['geodir_article_open_class'])) {
533
+		$class = $tc['geodir_article_open_class'];
534
+	}
535 535
 
536
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
537 537
 
538
-    echo $text;
538
+	echo $text;
539 539
 }
540 540
 
541 541
 // action for adding the primary div closing tag
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_action_article_close($type = '')
551 551
 {
552
-    $tc = get_option('theme_compatibility_setting');
553
-    if (!empty($tc['geodir_article_close_replace'])) {
554
-        $text = $tc['geodir_article_close_replace'];
555
-    } else {
556
-        $text = '</article><!-- article ends here-->';
557
-    }
558
-    echo $text;
552
+	$tc = get_option('theme_compatibility_setting');
553
+	if (!empty($tc['geodir_article_close_replace'])) {
554
+		$text = $tc['geodir_article_close_replace'];
555
+	} else {
556
+		$text = '</article><!-- article ends here-->';
557
+	}
558
+	echo $text;
559 559
 }
560 560
 
561 561
 // action for adding the sidebar opening tag
@@ -572,35 +572,35 @@  discard block
 block discarded – undo
572 572
  */
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
577
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
579
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
581
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
583
-    } else {
584
-        $width_css = '';
585
-    }
586
-
587
-    $tc = get_option('theme_compatibility_setting');
588
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
-        $text = $tc['geodir_sidebar_right_open_replace'];
590
-    } else {
591
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
-    }
593
-
594
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
-        $id = $tc['geodir_sidebar_right_open_id'];
596
-    }
597
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
-        $class = $tc['geodir_sidebar_right_open_class'];
599
-    }
600
-
601
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
-
603
-    echo $text;
575
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
+		$width_css = 'style="width:' . $width . '%;"';
577
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
+		$width_css = 'style="width:' . $width . '%;"';
579
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
+		$width_css = 'style="width:' . $width . '%;"';
581
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
+		$width_css = 'style="width:' . $width . '%;"';
583
+	} else {
584
+		$width_css = '';
585
+	}
586
+
587
+	$tc = get_option('theme_compatibility_setting');
588
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
+		$text = $tc['geodir_sidebar_right_open_replace'];
590
+	} else {
591
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
+	}
593
+
594
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
+		$id = $tc['geodir_sidebar_right_open_id'];
596
+	}
597
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
+		$class = $tc['geodir_sidebar_right_open_class'];
599
+	}
600
+
601
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
+
603
+	echo $text;
604 604
 }
605 605
 
606 606
 // action for adding the primary div closing tag
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_action_sidebar_right_close($type = '')
616 616
 {
617
-    $tc = get_option('theme_compatibility_setting');
618
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
-        $text = $tc['geodir_sidebar_right_close_replace'];
620
-    } else {
621
-        $text = '</aside><!-- sidebar ends here-->';
622
-    }
623
-    echo $text;
617
+	$tc = get_option('theme_compatibility_setting');
618
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
+		$text = $tc['geodir_sidebar_right_close_replace'];
620
+	} else {
621
+		$text = '</aside><!-- sidebar ends here-->';
622
+	}
623
+	echo $text;
624 624
 }
625 625
 
626 626
 
@@ -641,121 +641,121 @@  discard block
 block discarded – undo
641 641
  */
642 642
 function geodir_action_geodir_set_preview_post()
643 643
 {
644
-    global $post, $preview, $gd_session;
645
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
-    if (!$preview || $is_backend_preview) {
647
-        return;
648
-    }// bail if not previewing
649
-
650
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
-
652
-    $fields_info = geodir_get_custom_fields_type($listing_type);
653
-
654
-    foreach ($_REQUEST as $pkey => $pval) {
655
-        if ($pkey == 'geodir_video') {
656
-            $tags = '<iframe>';
657
-        } else if ($pkey == 'post_desc') {
658
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
-        } else if (is_array($_REQUEST[$pkey])) {
662
-            $tags = 'skip_field';
663
-        } else {
664
-            $tags = '';
665
-        }
666
-        /**
667
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
-         *
669
-         * @since 1.0.0
670
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
-         */
673
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
-
675
-        if ($tags != 'skip_field') {
676
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
-        }
678
-    }
679
-
680
-    $post = (object)$_REQUEST;
681
-
682
-
683
-    if (isset($post->video)) {
684
-        $post->video = stripslashes($post->video);
685
-    }
686
-
687
-    if (isset($post->Video2)) {
688
-        $post->Video2 = stripslashes($post->Video2);
689
-    }
690
-
691
-    $post_type = $post->listing_type;
692
-    $post_type_info = get_post_type_object($post_type);
693
-
694
-    $listing_label = $post_type_info->labels->singular_name;
695
-
696
-    $term_icon = '';
697
-
698
-    if (!empty($post->post_category)) {
699
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
700
-
701
-            if ($post_term != '' && !is_array($post_term)) {
702
-                $post_term = explode(',', trim($post_term, ','));
703
-            }
644
+	global $post, $preview, $gd_session;
645
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
+	if (!$preview || $is_backend_preview) {
647
+		return;
648
+	}// bail if not previewing
649
+
650
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
+
652
+	$fields_info = geodir_get_custom_fields_type($listing_type);
653
+
654
+	foreach ($_REQUEST as $pkey => $pval) {
655
+		if ($pkey == 'geodir_video') {
656
+			$tags = '<iframe>';
657
+		} else if ($pkey == 'post_desc') {
658
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
+		} else if (is_array($_REQUEST[$pkey])) {
662
+			$tags = 'skip_field';
663
+		} else {
664
+			$tags = '';
665
+		}
666
+		/**
667
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
+		 *
669
+		 * @since 1.0.0
670
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
+		 */
673
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
+
675
+		if ($tags != 'skip_field') {
676
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
+		}
678
+	}
679
+
680
+	$post = (object)$_REQUEST;
681
+
682
+
683
+	if (isset($post->video)) {
684
+		$post->video = stripslashes($post->video);
685
+	}
686
+
687
+	if (isset($post->Video2)) {
688
+		$post->Video2 = stripslashes($post->Video2);
689
+	}
690
+
691
+	$post_type = $post->listing_type;
692
+	$post_type_info = get_post_type_object($post_type);
693
+
694
+	$listing_label = $post_type_info->labels->singular_name;
695
+
696
+	$term_icon = '';
697
+
698
+	if (!empty($post->post_category)) {
699
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
700
+
701
+			if ($post_term != '' && !is_array($post_term)) {
702
+				$post_term = explode(',', trim($post_term, ','));
703
+			}
704 704
 
705
-            if (is_array($post_term)) {
706
-                $post_term = array_unique($post_term);
707
-            }
705
+			if (is_array($post_term)) {
706
+				$post_term = array_unique($post_term);
707
+			}
708 708
 
709
-            if (!empty($post_term)) {
710
-                foreach ($post_term as $cat_id) {
711
-                    $cat_id = trim($cat_id);
712
-
713
-                    if ($cat_id != '') {
714
-                        $term_icon = get_option('geodir_default_marker_icon');
715
-
716
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
720
-                                break;
721
-                            }
722
-                        }
723
-                    }
724
-                }
725
-            }
726
-        }
727
-    }
709
+			if (!empty($post_term)) {
710
+				foreach ($post_term as $cat_id) {
711
+					$cat_id = trim($cat_id);
712
+
713
+					if ($cat_id != '') {
714
+						$term_icon = get_option('geodir_default_marker_icon');
715
+
716
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
+									$term_icon = $term_icon_url['src'];
720
+								break;
721
+							}
722
+						}
723
+					}
724
+				}
725
+			}
726
+		}
727
+	}
728 728
 
729
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
729
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
731 731
 
732
-    $srcharr = array("'", "/", "-", '"', '\\');
733
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
732
+	$srcharr = array("'", "/", "-", '"', '\\');
733
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
734 734
 
735
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
735
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
736 736
 
737
-    $json = '{';
738
-    $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
743
-    $json .= '}';
737
+	$json = '{';
738
+	$json .= '"post_preview": "1",';
739
+	$json .= '"t": "' . $json_title . '",';
740
+	$json .= '"lt": "' . $post_latitude . '",';
741
+	$json .= '"ln": "' . $post_longitude . '",';
742
+	$json .= '"i":"' . $term_icon . '"';
743
+	$json .= '}';
744 744
 
745
-    $post->marker_json = $json;
745
+	$post->marker_json = $json;
746 746
 
747
-    $gd_session->set('listing', $_REQUEST);
747
+	$gd_session->set('listing', $_REQUEST);
748 748
 
749
-    // we need to define a few things to trick the setup_postdata
750
-    if (!isset($post->ID)) {
751
-        $post->ID = '';
752
-        $post->post_author = '';
753
-        $post->post_date = '';
754
-        $post->post_content = '';
755
-        $post->default_category = '';
756
-        $post->post_type = '';
757
-    }
758
-    setup_postdata($post);
749
+	// we need to define a few things to trick the setup_postdata
750
+	if (!isset($post->ID)) {
751
+		$post->ID = '';
752
+		$post->post_author = '';
753
+		$post->post_date = '';
754
+		$post->post_content = '';
755
+		$post->default_category = '';
756
+		$post->post_type = '';
757
+	}
758
+	setup_postdata($post);
759 759
 }
760 760
 
761 761
 /**
@@ -767,15 +767,15 @@  discard block
 block discarded – undo
767 767
  */
768 768
 function geodir_action_geodir_preview_code()
769 769
 {
770
-    global $preview;
770
+	global $preview;
771 771
 
772
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
773 773
 
774
-    if (!$preview || $is_backend_preview) {
775
-        return;
776
-    }// bail if not previewing
774
+	if (!$preview || $is_backend_preview) {
775
+		return;
776
+	}// bail if not previewing
777 777
 
778
-    geodir_get_template_part('preview', 'buttons');
778
+	geodir_get_template_part('preview', 'buttons');
779 779
 }
780 780
 
781 781
 // action for adding the details page top widget area
@@ -791,20 +791,20 @@  discard block
 block discarded – undo
791 791
  */
792 792
 function geodir_action_geodir_sidebar_detail_top($class = '')
793 793
 {
794
-    if (get_option('geodir_show_detail_top_section')) { ?>
794
+	if (get_option('geodir_show_detail_top_section')) { ?>
795 795
         <div
796 796
             class="<?php
797
-            /**
798
-             * Filter the div class for the wrapper of the full width widget areas.
799
-             *
800
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
-             *
802
-             * @since 1.0.0
803
-             * @param string $class The class of the div.
804
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
-             */
807
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
797
+			/**
798
+			 * Filter the div class for the wrapper of the full width widget areas.
799
+			 *
800
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
801
+			 *
802
+			 * @since 1.0.0
803
+			 * @param string $class The class of the div.
804
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
805
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
+			 */
807
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
808 808
             <?php dynamic_sidebar('geodir_detail_top'); ?>
809 809
         </div>
810 810
     <?php }
@@ -828,11 +828,11 @@  discard block
 block discarded – undo
828 828
  */
829 829
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
830 830
 {
831
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
831
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
832 832
         <div
833 833
             class="<?php
834
-            /** This action is documented in geodirectory_template_actions.php */
835
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
834
+			/** This action is documented in geodirectory_template_actions.php */
835
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
836 836
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
837 837
         </div><!-- clearfix ends here-->
838 838
     <?php }
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
  */
847 847
 function geodir_details_sidebar_widget_area()
848 848
 {
849
-    dynamic_sidebar('geodir_detail_sidebar');
849
+	dynamic_sidebar('geodir_detail_sidebar');
850 850
 }
851 851
 
852 852
 /**
@@ -857,12 +857,12 @@  discard block
 block discarded – undo
857 857
  */
858 858
 function geodir_details_sidebar_place_details()
859 859
 {
860
-    /**
861
-     * Used to add items to the details page sidebar.
862
-     *
863
-     * @since 1.0.0
864
-     */
865
-    do_action('geodir_detail_page_sidebar');
860
+	/**
861
+	 * Used to add items to the details page sidebar.
862
+	 *
863
+	 * @since 1.0.0
864
+	 */
865
+	do_action('geodir_detail_page_sidebar');
866 866
 }
867 867
 
868 868
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -877,68 +877,68 @@  discard block
 block discarded – undo
877 877
  */
878 878
 function geodir_action_details_sidebar()
879 879
 {
880
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
-    if (get_option('geodir_detail_sidebar_left_section')) {
882
-        /**
883
-         * Called before the details page left sidebar is opened.
884
-         *
885
-         * This is used to add opening wrapper HTML to the details page left sidebar.
886
-         *
887
-         * @since 1.0.0
888
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
-         */
893
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
-        ?>
880
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
+	if (get_option('geodir_detail_sidebar_left_section')) {
882
+		/**
883
+		 * Called before the details page left sidebar is opened.
884
+		 *
885
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
886
+		 *
887
+		 * @since 1.0.0
888
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
+		 */
893
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
+		?>
895 895
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
896
-        /**
897
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
-         *
899
-         * This is used to add all info to the details page sidebars.
900
-         *
901
-         * @since 1.0.0
902
-         */
903
-        do_action('geodir_detail_sidebar_inside');
904
-        ?></div><!-- end geodir-content-left --><?php
905
-        /**
906
-         * Called after the details page left sidebar.
907
-         *
908
-         * This is used to add closing wrapper HTML to the details page left sidebar.
909
-         *
910
-         * @since 1.0.0
911
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
-         */
913
-        do_action('geodir_sidebar_left_close', 'details-page');
914
-    } else {
915
-        /**
916
-         * Called before the details page right sidebar is opened.
917
-         *
918
-         * This is used to add opening wrapper HTML to the details page right sidebar.
919
-         *
920
-         * @since 1.0.0
921
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
-         */
926
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
-        ?>
896
+		/**
897
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
+		 *
899
+		 * This is used to add all info to the details page sidebars.
900
+		 *
901
+		 * @since 1.0.0
902
+		 */
903
+		do_action('geodir_detail_sidebar_inside');
904
+		?></div><!-- end geodir-content-left --><?php
905
+		/**
906
+		 * Called after the details page left sidebar.
907
+		 *
908
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
909
+		 *
910
+		 * @since 1.0.0
911
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
+		 */
913
+		do_action('geodir_sidebar_left_close', 'details-page');
914
+	} else {
915
+		/**
916
+		 * Called before the details page right sidebar is opened.
917
+		 *
918
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
919
+		 *
920
+		 * @since 1.0.0
921
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
+		 */
926
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
+		?>
928 928
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
929
-        /** This action is documented in geodirectory_template_actions.php */
930
-        do_action('geodir_detail_sidebar_inside');
931
-        ?></div><!-- end geodir-content-right --><?php
932
-        /**
933
-         * Called after the details page right sidebar.
934
-         *
935
-         * This is used to add closing wrapper HTML to the details page right sidebar.
936
-         *
937
-         * @since 1.0.0
938
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
-         */
940
-        do_action('geodir_sidebar_right_close', 'details-page');
941
-    }
929
+		/** This action is documented in geodirectory_template_actions.php */
930
+		do_action('geodir_detail_sidebar_inside');
931
+		?></div><!-- end geodir-content-right --><?php
932
+		/**
933
+		 * Called after the details page right sidebar.
934
+		 *
935
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
936
+		 *
937
+		 * @since 1.0.0
938
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
+		 */
940
+		do_action('geodir_sidebar_right_close', 'details-page');
941
+	}
942 942
 }
943 943
 
944 944
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -952,21 +952,21 @@  discard block
 block discarded – undo
952 952
  */
953 953
 function geodir_action_page_title()
954 954
 {
955
-    /**
956
-     * Filter the page title HTML h1 class.
957
-     *
958
-     * @since 1.0.0
959
-     * @param string $class The class to use. Default is 'entry-title fn'.
960
-     */
961
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
-    /**
963
-     * Filter the page title HTML header wrapper class.
964
-     *
965
-     * @since 1.0.0
966
-     * @param string $class The class to use. Default is 'entry-header'.
967
-     */
968
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
955
+	/**
956
+	 * Filter the page title HTML h1 class.
957
+	 *
958
+	 * @since 1.0.0
959
+	 * @param string $class The class to use. Default is 'entry-title fn'.
960
+	 */
961
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
+	/**
963
+	 * Filter the page title HTML header wrapper class.
964
+	 *
965
+	 * @since 1.0.0
966
+	 * @param string $class The class to use. Default is 'entry-header'.
967
+	 */
968
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
970 970
 }
971 971
 
972 972
 
@@ -983,94 +983,94 @@  discard block
 block discarded – undo
983 983
  */
984 984
 function geodir_action_details_slider()
985 985
 {
986
-    global $preview, $post;
986
+	global $preview, $post;
987 987
 
988
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
989 989
 
990
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
990
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
992 992
 
993
-        $preview_post_images = array();
994
-        if ($preview_get_images) {
995
-            foreach ($preview_get_images as $row) {
996
-                $preview_post_images[] = $row->src;
997
-            }
998
-        }
999
-        if (!empty($preview_post_images)) {
1000
-            $post->post_images = implode(',', $preview_post_images);
1001
-        }
1002
-    }
1003
-
1004
-    if ($preview) {
1005
-        $post_images = array();
1006
-        if (isset($post->post_images) && !empty($post->post_images)) {
1007
-            $post->post_images = trim($post->post_images, ",");
1008
-            $post_images = explode(",", $post->post_images);
1009
-        }
1010
-
1011
-        $main_slides = '';
1012
-        $nav_slides = '';
1013
-        $slides = 0;
1014
-
1015
-        if (!empty($post_images)) {
1016
-            foreach ($post_images as $image) {
1017
-                if (!empty($image)) {
1018
-                    $sizes = getimagesize(trim($image));
1019
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
-
1022
-                    if ($image && $width && $height) {
1023
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
-                    }
1025
-
1026
-                    if (isset($image->src)) {
1027
-                        if ($image->height >= 400) {
1028
-                            $spacer_height = 0;
1029
-                        } else {
1030
-                            $spacer_height = ((400 - $image->height) / 2);
1031
-                        }
1032
-
1033
-                        $image_title = isset($image->title) ? $image->title : '';
1034
-
1035
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1036
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
-                        $slides++;
1039
-                    }
1040
-                }
1041
-            }// endfore
1042
-        } //end if
1043
-    } else {
1044
-        $main_slides = '';
1045
-        $nav_slides = '';
1046
-        /**
1047
-         * Filter if default images should show on the details page.
1048
-         *
1049
-         * @param bool $use_default_image Default false.
1050
-         * @since 1.6.16
1051
-         */
1052
-        $use_default_image = apply_filters('geodir_details_default_image_show', false);
1053
-        $post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1054
-        $slides = 0;
1055
-
1056
-        if (!empty($post_images)) {
1057
-            foreach ($post_images as $image) {
1058
-                if ($image->height >= 400) {
1059
-                    $spacer_height = 0;
1060
-                } else {
1061
-                    $spacer_height = ((400 - $image->height) / 2);
1062
-                }
1063
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1064
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1065
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1066
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1067
-                $slides++;
1068
-            }
1069
-        }// endfore
1070
-    }
993
+		$preview_post_images = array();
994
+		if ($preview_get_images) {
995
+			foreach ($preview_get_images as $row) {
996
+				$preview_post_images[] = $row->src;
997
+			}
998
+		}
999
+		if (!empty($preview_post_images)) {
1000
+			$post->post_images = implode(',', $preview_post_images);
1001
+		}
1002
+	}
1003
+
1004
+	if ($preview) {
1005
+		$post_images = array();
1006
+		if (isset($post->post_images) && !empty($post->post_images)) {
1007
+			$post->post_images = trim($post->post_images, ",");
1008
+			$post_images = explode(",", $post->post_images);
1009
+		}
1010
+
1011
+		$main_slides = '';
1012
+		$nav_slides = '';
1013
+		$slides = 0;
1014
+
1015
+		if (!empty($post_images)) {
1016
+			foreach ($post_images as $image) {
1017
+				if (!empty($image)) {
1018
+					$sizes = getimagesize(trim($image));
1019
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
+
1022
+					if ($image && $width && $height) {
1023
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
+					}
1025
+
1026
+					if (isset($image->src)) {
1027
+						if ($image->height >= 400) {
1028
+							$spacer_height = 0;
1029
+						} else {
1030
+							$spacer_height = ((400 - $image->height) / 2);
1031
+						}
1032
+
1033
+						$image_title = isset($image->title) ? $image->title : '';
1034
+
1035
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1036
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
+						$slides++;
1039
+					}
1040
+				}
1041
+			}// endfore
1042
+		} //end if
1043
+	} else {
1044
+		$main_slides = '';
1045
+		$nav_slides = '';
1046
+		/**
1047
+		 * Filter if default images should show on the details page.
1048
+		 *
1049
+		 * @param bool $use_default_image Default false.
1050
+		 * @since 1.6.16
1051
+		 */
1052
+		$use_default_image = apply_filters('geodir_details_default_image_show', false);
1053
+		$post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1054
+		$slides = 0;
1055
+
1056
+		if (!empty($post_images)) {
1057
+			foreach ($post_images as $image) {
1058
+				if ($image->height >= 400) {
1059
+					$spacer_height = 0;
1060
+				} else {
1061
+					$spacer_height = ((400 - $image->height) / 2);
1062
+				}
1063
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1064
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1065
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1066
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1067
+				$slides++;
1068
+			}
1069
+		}// endfore
1070
+	}
1071 1071
 
1072
-    if (!empty($post_images)) {
1073
-        ?>
1072
+	if (!empty($post_images)) {
1073
+		?>
1074 1074
         <div class="geodir_flex-container">
1075 1075
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1076 1076
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
             <?php } ?>
1084 1084
         </div>
1085 1085
     <?php
1086
-    }
1086
+	}
1087 1087
 }
1088 1088
 
1089 1089
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1098,177 +1098,177 @@  discard block
 block discarded – undo
1098 1098
  */
1099 1099
 function geodir_action_details_taxonomies()
1100 1100
 {
1101
-    global $preview, $post;?>
1101
+	global $preview, $post;?>
1102 1102
     <p class="geodir_post_taxomomies clearfix">
1103 1103
     <?php
1104
-    $taxonomies = array();
1105
-
1106
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1107
-
1108
-    if ($preview && !$is_backend_preview) {
1109
-        $post_type = $post->listing_type;
1110
-        $post_taxonomy = $post_type . 'category';
1111
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1112
-    } else {
1113
-        $post_type = $post->post_type;
1114
-        $post_taxonomy = $post_type . 'category';
1115
-    }
1104
+	$taxonomies = array();
1105
+
1106
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1107
+
1108
+	if ($preview && !$is_backend_preview) {
1109
+		$post_type = $post->listing_type;
1110
+		$post_taxonomy = $post_type . 'category';
1111
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1112
+	} else {
1113
+		$post_type = $post->post_type;
1114
+		$post_taxonomy = $post_type . 'category';
1115
+	}
1116 1116
 //{	
1117
-    $post_type_info = get_post_type_object($post_type);
1118
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1119
-
1120
-    if (!empty($post->post_tags)) {
1121
-
1122
-        if (taxonomy_exists($post_type . '_tags')):
1123
-            $links = array();
1124
-            $terms = array();
1125
-            // to limit post tags
1126
-            $post_tags = trim($post->post_tags, ",");
1127
-            $post_id = isset($post->ID) ? $post->ID : '';
1128
-            /**
1129
-             * Filter the post tags.
1130
-             *
1131
-             * Allows you to filter the post tags output on the details page of a post.
1132
-             *
1133
-             * @since 1.0.0
1134
-             * @param string $post_tags A comma seperated list of tags.
1135
-             * @param int $post_id The current post id.
1136
-             */
1137
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1138
-
1139
-            $post->post_tags = $post_tags;
1140
-            $post_tags = explode(",", trim($post->post_tags, ","));
1141
-
1142
-
1143
-            foreach ($post_tags as $post_term) {
1144
-
1145
-                // fix slug creation order for tags & location
1146
-                $post_term = trim($post_term);
1147
-
1148
-                $priority_location = false;
1149
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1150
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1151
-                } else {
1152
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1153
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1154
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1155
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1156
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1157
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1158
-                    if ($match_country || $match_region || $match_city) {
1159
-                        $priority_location = true;
1160
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1161
-                    } else {
1162
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1163
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1164
-                    }
1165
-                }
1166
-
1167
-                if (!is_wp_error($term) && is_object($term)) {
1168
-
1169
-                    // fix tag link on detail page
1170
-                    if ($priority_location) {
1171
-
1172
-                        $tag_link = "<a href=''>$post_term</a>";
1173
-                        /**
1174
-                         * Filter the tag name on the details page.
1175
-                         *
1176
-                         * @since 1.5.6
1177
-                         * @param string $tag_link The tag link html.
1178
-                         * @param object $term The tag term object.
1179
-                         */
1180
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1181
-                        $links[] = $tag_link;
1182
-                    } else {
1183
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1184
-                        /** This action is documented in geodirectory-template_actions.php */
1185
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1186
-                        $links[] = $tag_link;
1187
-                    }
1188
-                    $terms[] = $term;
1189
-                }
1190
-                //
1191
-            }
1192
-            if (!isset($listing_label)) {
1193
-                $listing_label = '';
1194
-            }
1195
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1196
-        endif;
1197
-
1198
-    }
1199
-
1200
-    if (!empty($post->{$post_taxonomy})) {
1201
-        $links = array();
1202
-        $terms = array();
1203
-        $termsOrdered = array();
1204
-        if (!is_array($post->{$post_taxonomy})) {
1205
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1206
-        } else {
1207
-            $post_term = $post->{$post_taxonomy};
1117
+	$post_type_info = get_post_type_object($post_type);
1118
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1119
+
1120
+	if (!empty($post->post_tags)) {
1121
+
1122
+		if (taxonomy_exists($post_type . '_tags')):
1123
+			$links = array();
1124
+			$terms = array();
1125
+			// to limit post tags
1126
+			$post_tags = trim($post->post_tags, ",");
1127
+			$post_id = isset($post->ID) ? $post->ID : '';
1128
+			/**
1129
+			 * Filter the post tags.
1130
+			 *
1131
+			 * Allows you to filter the post tags output on the details page of a post.
1132
+			 *
1133
+			 * @since 1.0.0
1134
+			 * @param string $post_tags A comma seperated list of tags.
1135
+			 * @param int $post_id The current post id.
1136
+			 */
1137
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1138
+
1139
+			$post->post_tags = $post_tags;
1140
+			$post_tags = explode(",", trim($post->post_tags, ","));
1141
+
1142
+
1143
+			foreach ($post_tags as $post_term) {
1144
+
1145
+				// fix slug creation order for tags & location
1146
+				$post_term = trim($post_term);
1147
+
1148
+				$priority_location = false;
1149
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1150
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1151
+				} else {
1152
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1153
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1154
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1155
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1156
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1157
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1158
+					if ($match_country || $match_region || $match_city) {
1159
+						$priority_location = true;
1160
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1161
+					} else {
1162
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1163
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1164
+					}
1165
+				}
1166
+
1167
+				if (!is_wp_error($term) && is_object($term)) {
1168
+
1169
+					// fix tag link on detail page
1170
+					if ($priority_location) {
1171
+
1172
+						$tag_link = "<a href=''>$post_term</a>";
1173
+						/**
1174
+						 * Filter the tag name on the details page.
1175
+						 *
1176
+						 * @since 1.5.6
1177
+						 * @param string $tag_link The tag link html.
1178
+						 * @param object $term The tag term object.
1179
+						 */
1180
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1181
+						$links[] = $tag_link;
1182
+					} else {
1183
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1184
+						/** This action is documented in geodirectory-template_actions.php */
1185
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1186
+						$links[] = $tag_link;
1187
+					}
1188
+					$terms[] = $term;
1189
+				}
1190
+				//
1191
+			}
1192
+			if (!isset($listing_label)) {
1193
+				$listing_label = '';
1194
+			}
1195
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1196
+		endif;
1197
+
1198
+	}
1199
+
1200
+	if (!empty($post->{$post_taxonomy})) {
1201
+		$links = array();
1202
+		$terms = array();
1203
+		$termsOrdered = array();
1204
+		if (!is_array($post->{$post_taxonomy})) {
1205
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1206
+		} else {
1207
+			$post_term = $post->{$post_taxonomy};
1208 1208
 			
1209 1209
 			if ($preview && !$is_backend_preview) {
1210 1210
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1211 1211
 			}
1212
-        }
1213
-
1214
-        $post_term = array_unique($post_term);
1215
-        if (!empty($post_term)) {
1216
-            foreach ($post_term as $post_term) {
1217
-                $post_term = trim($post_term);
1218
-
1219
-                if ($post_term != ''):
1220
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1221
-
1222
-                    if (is_object($term)) {
1223
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1224
-                        /**
1225
-                         * Filter the category name on the details page.
1226
-                         *
1227
-                         * @since 1.5.6
1228
-                         * @param string $term_link The link html to the category.
1229
-                         * @param object $term The category term object.
1230
-                         */
1231
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1232
-                        $links[] = $term_link;
1233
-                        $terms[] = $term;
1234
-                    }
1235
-                endif;
1236
-            }
1237
-            // order alphabetically
1238
-            asort($links);
1239
-            foreach (array_keys($links) as $key) {
1240
-                $termsOrdered[$key] = $terms[$key];
1241
-            }
1242
-            $terms = $termsOrdered;
1212
+		}
1213
+
1214
+		$post_term = array_unique($post_term);
1215
+		if (!empty($post_term)) {
1216
+			foreach ($post_term as $post_term) {
1217
+				$post_term = trim($post_term);
1218
+
1219
+				if ($post_term != ''):
1220
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1221
+
1222
+					if (is_object($term)) {
1223
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1224
+						/**
1225
+						 * Filter the category name on the details page.
1226
+						 *
1227
+						 * @since 1.5.6
1228
+						 * @param string $term_link The link html to the category.
1229
+						 * @param object $term The category term object.
1230
+						 */
1231
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1232
+						$links[] = $term_link;
1233
+						$terms[] = $term;
1234
+					}
1235
+				endif;
1236
+			}
1237
+			// order alphabetically
1238
+			asort($links);
1239
+			foreach (array_keys($links) as $key) {
1240
+				$termsOrdered[$key] = $terms[$key];
1241
+			}
1242
+			$terms = $termsOrdered;
1243 1243
 
1244
-        }
1244
+		}
1245 1245
 
1246
-        if (!isset($listing_label)) {
1247
-            $listing_label = '';
1248
-        }
1249
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1246
+		if (!isset($listing_label)) {
1247
+			$listing_label = '';
1248
+		}
1249
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1250 1250
 
1251
-    }
1251
+	}
1252 1252
 
1253
-    /**
1254
-     * Filter the taxonomies array before output.
1255
-     *
1256
-     * @since 1.5.9
1257
-     * @param array $taxonomies The array of cats and tags.
1258
-     * @param string $post_type The post type being output.
1259
-     * @param string $listing_label The post type label.
1260
-     * @param string $listing_label The post type label with ucwords function.
1261
-     */
1262
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1253
+	/**
1254
+	 * Filter the taxonomies array before output.
1255
+	 *
1256
+	 * @since 1.5.9
1257
+	 * @param array $taxonomies The array of cats and tags.
1258
+	 * @param string $post_type The post type being output.
1259
+	 * @param string $listing_label The post type label.
1260
+	 * @param string $listing_label The post type label with ucwords function.
1261
+	 */
1262
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1263 1263
 
1264
-    if (isset($taxonomies[$post_taxonomy])) {
1265
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266
-    }
1264
+	if (isset($taxonomies[$post_taxonomy])) {
1265
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266
+	}
1267 1267
 
1268
-    if (isset($taxonomies[$post_type . '_tags']))
1269
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1268
+	if (isset($taxonomies[$post_type . '_tags']))
1269
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1270 1270
 
1271
-    ?>
1271
+	?>
1272 1272
     </p><?php
1273 1273
 }
1274 1274
 
@@ -1290,140 +1290,140 @@  discard block
 block discarded – undo
1290 1290
 function geodir_action_details_micordata($post='')
1291 1291
 {
1292 1292
 
1293
-    global $preview;
1294
-    if(empty($post)){global $post;}
1295
-    if ($preview || !geodir_is_page('detail')) {
1296
-        return;
1297
-    }
1298
-
1299
-    // url
1300
-    $c_url = geodir_curPageURL();
1301
-
1302
-    // post reviews
1303
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1304
-    if (empty($post_reviews)) {
1305
-        $reviews = '';
1306
-    } else {
1307
-        foreach ($post_reviews as $review) {
1308
-            $reviews[] = array(
1309
-                "@type" => "Review",
1310
-                "author" => $review->comment_author,
1311
-                "datePublished" => $review->comment_date,
1312
-                "description" => $review->comment_content,
1313
-                "reviewRating" => array(
1314
-                    "@type" => "Rating",
1315
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1316
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1317
-                    "worstRating" => "1"
1318
-                )
1319
-            );
1320
-        }
1321
-
1322
-    }
1323
-
1324
-    // post images
1325
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1326
-    if (empty($post_images)) {
1327
-        $images = '';
1328
-    } else {
1329
-        $i_arr = array();
1330
-        foreach ($post_images as $img) {
1331
-            $i_arr[] = $img->src;
1332
-        }
1333
-
1334
-        if (count($i_arr) == 1) {
1335
-            $images = $i_arr[0];
1336
-        } else {
1337
-            $images = $i_arr;
1338
-        }
1339
-
1340
-    }
1341
-    //print_r($post);
1342
-    // external links
1343
-    $external_links =  array();
1344
-    $external_links[] = $post->geodir_website;
1345
-    $external_links[] = $post->geodir_twitter;
1346
-    $external_links[] = $post->geodir_facebook;
1347
-    $external_links = array_filter($external_links);
1348
-
1349
-    if(!empty($external_links)){
1350
-        $external_links = array_values($external_links);
1351
-    }
1352
-
1353
-    // reviews
1354
-    $comment_count = geodir_get_review_count_total($post->ID);
1355
-    $post_avgratings = geodir_get_post_rating($post->ID);
1356
-
1357
-    // schema type
1358
-    $schema_type = 'LocalBusiness';
1359
-    if(isset($post->default_category) && $post->default_category){
1360
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1361
-        if($cat_schema){$schema_type = $cat_schema;}
1362
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1363
-    }
1364
-
1365
-    $schema = array();
1366
-    $schema['@context'] = "https://schema.org";
1367
-    $schema['@type'] = $schema_type;
1368
-    $schema['name'] = $post->post_title;
1369
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1370
-    $schema['telephone'] = $post->geodir_contact;
1371
-    $schema['url'] = $c_url;
1372
-    $schema['sameAs'] = $external_links;
1373
-    $schema['image'] = $images;
1374
-    $schema['address'] = array(
1375
-        "@type" => "PostalAddress",
1376
-        "streetAddress" => $post->post_address,
1377
-        "addressLocality" => $post->post_city,
1378
-        "addressRegion" => $post->post_region,
1379
-        "addressCountry" => $post->post_country,
1380
-        "postalCode" => $post->post_zip
1381
-    );
1382
-
1383
-    if($post->post_latitude && $post->post_longitude) {
1384
-        $schema['geo'] = array(
1385
-            "@type" => "GeoCoordinates",
1386
-            "latitude" => $post->post_latitude,
1387
-            "longitude" => $post->post_longitude
1388
-        );
1389
-    }
1390
-
1391
-    if($post_avgratings) {
1392
-        $schema['aggregateRating'] = array(
1393
-            "@type" => "AggregateRating",
1394
-            "ratingValue" => $post_avgratings,
1395
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1396
-            "worstRating" => "1",
1397
-            "ratingCount" => $comment_count
1398
-        );
1399
-    }
1400
-    $schema['review'] = $reviews;
1401
-
1402
-    /**
1403
-     * Allow the schema JSON-LD info to be filtered.
1404
-     *
1405
-     * @since 1.5.4
1406
-     * @since 1.5.7 Added $post variable.
1407
-     * @param array $schema The array of schema data to be filtered.
1408
-     * @param object $post The post object.
1409
-     */
1410
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1411
-
1412
-
1413
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1414
-
1415
-
1416
-    $uploads = wp_upload_dir();
1417
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1418
-
1419
-    /**
1420
-     * Show facebook open graph meta info
1421
-     *
1422
-     * @since 1.6.6
1423
-     * @param string $facebook_og The open graph html to be filtered.
1424
-     * @param object $post The post object.
1425
-     */
1426
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1293
+	global $preview;
1294
+	if(empty($post)){global $post;}
1295
+	if ($preview || !geodir_is_page('detail')) {
1296
+		return;
1297
+	}
1298
+
1299
+	// url
1300
+	$c_url = geodir_curPageURL();
1301
+
1302
+	// post reviews
1303
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1304
+	if (empty($post_reviews)) {
1305
+		$reviews = '';
1306
+	} else {
1307
+		foreach ($post_reviews as $review) {
1308
+			$reviews[] = array(
1309
+				"@type" => "Review",
1310
+				"author" => $review->comment_author,
1311
+				"datePublished" => $review->comment_date,
1312
+				"description" => $review->comment_content,
1313
+				"reviewRating" => array(
1314
+					"@type" => "Rating",
1315
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1316
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1317
+					"worstRating" => "1"
1318
+				)
1319
+			);
1320
+		}
1321
+
1322
+	}
1323
+
1324
+	// post images
1325
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1326
+	if (empty($post_images)) {
1327
+		$images = '';
1328
+	} else {
1329
+		$i_arr = array();
1330
+		foreach ($post_images as $img) {
1331
+			$i_arr[] = $img->src;
1332
+		}
1333
+
1334
+		if (count($i_arr) == 1) {
1335
+			$images = $i_arr[0];
1336
+		} else {
1337
+			$images = $i_arr;
1338
+		}
1339
+
1340
+	}
1341
+	//print_r($post);
1342
+	// external links
1343
+	$external_links =  array();
1344
+	$external_links[] = $post->geodir_website;
1345
+	$external_links[] = $post->geodir_twitter;
1346
+	$external_links[] = $post->geodir_facebook;
1347
+	$external_links = array_filter($external_links);
1348
+
1349
+	if(!empty($external_links)){
1350
+		$external_links = array_values($external_links);
1351
+	}
1352
+
1353
+	// reviews
1354
+	$comment_count = geodir_get_review_count_total($post->ID);
1355
+	$post_avgratings = geodir_get_post_rating($post->ID);
1356
+
1357
+	// schema type
1358
+	$schema_type = 'LocalBusiness';
1359
+	if(isset($post->default_category) && $post->default_category){
1360
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1361
+		if($cat_schema){$schema_type = $cat_schema;}
1362
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1363
+	}
1364
+
1365
+	$schema = array();
1366
+	$schema['@context'] = "https://schema.org";
1367
+	$schema['@type'] = $schema_type;
1368
+	$schema['name'] = $post->post_title;
1369
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1370
+	$schema['telephone'] = $post->geodir_contact;
1371
+	$schema['url'] = $c_url;
1372
+	$schema['sameAs'] = $external_links;
1373
+	$schema['image'] = $images;
1374
+	$schema['address'] = array(
1375
+		"@type" => "PostalAddress",
1376
+		"streetAddress" => $post->post_address,
1377
+		"addressLocality" => $post->post_city,
1378
+		"addressRegion" => $post->post_region,
1379
+		"addressCountry" => $post->post_country,
1380
+		"postalCode" => $post->post_zip
1381
+	);
1382
+
1383
+	if($post->post_latitude && $post->post_longitude) {
1384
+		$schema['geo'] = array(
1385
+			"@type" => "GeoCoordinates",
1386
+			"latitude" => $post->post_latitude,
1387
+			"longitude" => $post->post_longitude
1388
+		);
1389
+	}
1390
+
1391
+	if($post_avgratings) {
1392
+		$schema['aggregateRating'] = array(
1393
+			"@type" => "AggregateRating",
1394
+			"ratingValue" => $post_avgratings,
1395
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1396
+			"worstRating" => "1",
1397
+			"ratingCount" => $comment_count
1398
+		);
1399
+	}
1400
+	$schema['review'] = $reviews;
1401
+
1402
+	/**
1403
+	 * Allow the schema JSON-LD info to be filtered.
1404
+	 *
1405
+	 * @since 1.5.4
1406
+	 * @since 1.5.7 Added $post variable.
1407
+	 * @param array $schema The array of schema data to be filtered.
1408
+	 * @param object $post The post object.
1409
+	 */
1410
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1411
+
1412
+
1413
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1414
+
1415
+
1416
+	$uploads = wp_upload_dir();
1417
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1418
+
1419
+	/**
1420
+	 * Show facebook open graph meta info
1421
+	 *
1422
+	 * @since 1.6.6
1423
+	 * @param string $facebook_og The open graph html to be filtered.
1424
+	 * @param object $post The post object.
1425
+	 */
1426
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1427 1427
 
1428 1428
 
1429 1429
 
@@ -1443,7 +1443,7 @@  discard block
 block discarded – undo
1443 1443
  */
1444 1444
 function geodir_action_details_next_prev()
1445 1445
 {
1446
-    ?>
1446
+	?>
1447 1447
     <div class="geodir-pos_navigation clearfix">
1448 1448
     <div
1449 1449
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1461,15 +1461,15 @@  discard block
 block discarded – undo
1461 1461
  */
1462 1462
 function geodir_action_before_single_post()
1463 1463
 {
1464
-    global $post;
1465
-    /**
1466
-     * Called at the very start of the details page output, before the title section.
1467
-     *
1468
-     * @since 1.0.0
1469
-     * @param object $post The current post object.
1470
-     * @global WP_Post|null $post The current post, if available.
1471
-     */
1472
-    do_action('geodir_before_single_post', $post); // extra action	
1464
+	global $post;
1465
+	/**
1466
+	 * Called at the very start of the details page output, before the title section.
1467
+	 *
1468
+	 * @since 1.0.0
1469
+	 * @param object $post The current post object.
1470
+	 * @global WP_Post|null $post The current post, if available.
1471
+	 */
1472
+	do_action('geodir_before_single_post', $post); // extra action	
1473 1473
 }
1474 1474
 
1475 1475
 /**
@@ -1480,13 +1480,13 @@  discard block
 block discarded – undo
1480 1480
  */
1481 1481
 function geodir_action_after_single_post($post)
1482 1482
 {
1483
-    /**
1484
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1485
-     *
1486
-     * @since 1.0.0
1487
-     * @param object $post The current post object.
1488
-     */
1489
-    do_action('geodir_after_single_post', $post); // extra action	
1483
+	/**
1484
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1485
+	 *
1486
+	 * @since 1.0.0
1487
+	 * @param object $post The current post object.
1488
+	 */
1489
+	do_action('geodir_after_single_post', $post); // extra action	
1490 1490
 }
1491 1491
 
1492 1492
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1512,168 +1512,168 @@  discard block
 block discarded – undo
1512 1512
  */
1513 1513
 function geodir_action_listings_title()
1514 1514
 {
1515
-    global $wp, $term;
1515
+	global $wp, $term;
1516 1516
 
1517
-    $gd_post_type = geodir_get_current_posttype();
1518
-    $post_type_info = get_post_type_object($gd_post_type);
1517
+	$gd_post_type = geodir_get_current_posttype();
1518
+	$post_type_info = get_post_type_object($gd_post_type);
1519 1519
 
1520
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1521
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1522
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1523
-    }
1520
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1521
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1522
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1523
+	}
1524 1524
 
1525
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1526
-    $single_name = $post_type_info->labels->singular_name;
1525
+	$list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1526
+	$single_name = $post_type_info->labels->singular_name;
1527 1527
 
1528
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1528
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1529 1529
 
1530
-    $gd_country = get_query_var('gd_country');
1531
-    $gd_region = get_query_var('gd_region');
1532
-    $gd_city = get_query_var('gd_city');
1530
+	$gd_country = get_query_var('gd_country');
1531
+	$gd_region = get_query_var('gd_region');
1532
+	$gd_city = get_query_var('gd_city');
1533 1533
 
1534
-    if (!empty($term)) {
1535
-        $location_name = '';
1536
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1537
-            if ($gd_country != '') {
1538
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1539
-            }
1540
-
1541
-            if ($gd_region != '') {
1542
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1543
-            }
1544
-
1545
-            if ($gd_city != '') {
1546
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1547
-            }
1548
-        }
1549
-
1550
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1551
-        if (!empty($current_term)) {
1552
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1553
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1554
-                $location_last_char = substr($location_name, -1);
1555
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1556
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1557
-            } else {
1558
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1559
-            }
1560
-        } else {
1561
-            if (count($taxonomy) > 1) {
1562
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1563
-
1564
-                if (!empty($current_term)) {
1565
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1566
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1567
-                        $location_last_char = substr($location_name, -1);
1568
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1569
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1570
-                    } else {
1571
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1572
-                    }
1573
-                }
1574
-            }
1575
-        }
1576
-
1577
-    } else {
1578
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1579
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1580
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1581
-
1582
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1583
-
1584
-        if (function_exists('get_actual_location_name')) {
1585
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1586
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1587
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1588
-        }
1589
-
1590
-        if ($gd_city != '') {
1591
-            if ($gd_city_actual != '') {
1592
-                $gd_city = $gd_city_actual;
1593
-            } else {
1594
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1595
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1596
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1597
-            }
1598
-
1599
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1600
-        } else if ($gd_region != '') {
1601
-            if ($gd_region_actual != '') {
1602
-                $gd_region = $gd_region_actual;
1603
-            } else {
1604
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1605
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1606
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1607
-            }
1608
-
1609
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1610
-        } else if ($gd_country != '') {
1611
-            if ($gd_country_actual != '') {
1612
-                $gd_country = $gd_country_actual;
1613
-            } else {
1614
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1615
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1616
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1617
-            }
1618
-
1619
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1620
-        }
1621
-    }
1622
-
1623
-    if (is_search()) {
1624
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1625
-    }
1626
-    /** This action is documented in geodirectory_template_actions.php */
1627
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1628
-    /** This action is documented in geodirectory_template_actions.php */
1629
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1630
-
1631
-
1632
-    $title = $list_title;
1633
-    $gd_page = '';
1634
-    if(geodir_is_page('pt')){
1635
-        $gd_page = 'pt';
1636
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1637
-    }
1638
-    elseif(geodir_is_page('listing')){
1639
-        $gd_page = 'listing';
1640
-        global $wp_query;
1641
-        $current_term = $wp_query->get_queried_object();
1642
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1643
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1644
-        }else{
1645
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1646
-        }
1534
+	if (!empty($term)) {
1535
+		$location_name = '';
1536
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1537
+			if ($gd_country != '') {
1538
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1539
+			}
1647 1540
 
1648
-    }
1649
-    elseif(geodir_is_page('author')){
1650
-        $gd_page = 'author';
1651
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1652
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1653
-        }else{
1654
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1655
-        }
1541
+			if ($gd_region != '') {
1542
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1543
+			}
1656 1544
 
1657
-    }
1545
+			if ($gd_city != '') {
1546
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1547
+			}
1548
+		}
1549
+
1550
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1551
+		if (!empty($current_term)) {
1552
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1553
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1554
+				$location_last_char = substr($location_name, -1);
1555
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1556
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1557
+			} else {
1558
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1559
+			}
1560
+		} else {
1561
+			if (count($taxonomy) > 1) {
1562
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1563
+
1564
+				if (!empty($current_term)) {
1565
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1566
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1567
+						$location_last_char = substr($location_name, -1);
1568
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1569
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1570
+					} else {
1571
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1572
+					}
1573
+				}
1574
+			}
1575
+		}
1576
+
1577
+	} else {
1578
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1579
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1580
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1581
+
1582
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1583
+
1584
+		if (function_exists('get_actual_location_name')) {
1585
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1586
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1587
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1588
+		}
1589
+
1590
+		if ($gd_city != '') {
1591
+			if ($gd_city_actual != '') {
1592
+				$gd_city = $gd_city_actual;
1593
+			} else {
1594
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1595
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1596
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1597
+			}
1658 1598
 
1599
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1600
+		} else if ($gd_region != '') {
1601
+			if ($gd_region_actual != '') {
1602
+				$gd_region = $gd_region_actual;
1603
+			} else {
1604
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1605
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1606
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1607
+			}
1659 1608
 
1660
-    /**
1661
-     * Filter page title to replace variables.
1662
-     *
1663
-     * @since 1.5.4
1664
-     * @param string $title The page title including variables.
1665
-     * @param string $gd_page The GeoDirectory page type if any.
1666
-     */
1667
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1609
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1610
+		} else if ($gd_country != '') {
1611
+			if ($gd_country_actual != '') {
1612
+				$gd_country = $gd_country_actual;
1613
+			} else {
1614
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1615
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1616
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1617
+			}
1668 1618
 
1669
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1670
-        /**
1671
-         * Filter the listing page title.
1672
-         *
1673
-         * @since 1.0.0
1674
-         * @param string $list_title The title for the category page.
1675
-         */
1676
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1619
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1620
+		}
1621
+	}
1622
+
1623
+	if (is_search()) {
1624
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1625
+	}
1626
+	/** This action is documented in geodirectory_template_actions.php */
1627
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1628
+	/** This action is documented in geodirectory_template_actions.php */
1629
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1630
+
1631
+
1632
+	$title = $list_title;
1633
+	$gd_page = '';
1634
+	if(geodir_is_page('pt')){
1635
+		$gd_page = 'pt';
1636
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1637
+	}
1638
+	elseif(geodir_is_page('listing')){
1639
+		$gd_page = 'listing';
1640
+		global $wp_query;
1641
+		$current_term = $wp_query->get_queried_object();
1642
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1643
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1644
+		}else{
1645
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1646
+		}
1647
+
1648
+	}
1649
+	elseif(geodir_is_page('author')){
1650
+		$gd_page = 'author';
1651
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1652
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1653
+		}else{
1654
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1655
+		}
1656
+
1657
+	}
1658
+
1659
+
1660
+	/**
1661
+	 * Filter page title to replace variables.
1662
+	 *
1663
+	 * @since 1.5.4
1664
+	 * @param string $title The page title including variables.
1665
+	 * @param string $gd_page The GeoDirectory page type if any.
1666
+	 */
1667
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1668
+
1669
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1670
+		/**
1671
+		 * Filter the listing page title.
1672
+		 *
1673
+		 * @since 1.0.0
1674
+		 * @param string $list_title The title for the category page.
1675
+		 */
1676
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1677 1677
 }
1678 1678
 
1679 1679
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1686,46 +1686,46 @@  discard block
 block discarded – undo
1686 1686
  */
1687 1687
 function geodir_action_listings_description()
1688 1688
 {
1689
-    global $wp_query;
1690
-    $current_term = $wp_query->get_queried_object();
1689
+	global $wp_query;
1690
+	$current_term = $wp_query->get_queried_object();
1691 1691
 
1692
-    $gd_post_type = geodir_get_current_posttype();
1693
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1692
+	$gd_post_type = geodir_get_current_posttype();
1693
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1694 1694
 
1695
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1696
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1697
-        if ($term_desc && !$saved_data) {
1698
-            $saved_data = $term_desc;
1699
-        }
1695
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1696
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1697
+		if ($term_desc && !$saved_data) {
1698
+			$saved_data = $term_desc;
1699
+		}
1700 1700
 
1701
-        // stop payment manager filtering content length
1702
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1703
-        if ( false !== $filter_priority ) {
1704
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1705
-        }
1701
+		// stop payment manager filtering content length
1702
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1703
+		if ( false !== $filter_priority ) {
1704
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1705
+		}
1706 1706
 
1707
-        /**
1708
-         * Apply the core filter `the_content` filter to the variable string.
1709
-         *
1710
-         * This is a WordPress core filter that does many things.
1711
-         *
1712
-         * @since 1.0.0
1713
-         * @param string $var The string to apply the filter to.
1714
-         */
1715
-        $cat_description = apply_filters('the_content', $saved_data);
1707
+		/**
1708
+		 * Apply the core filter `the_content` filter to the variable string.
1709
+		 *
1710
+		 * This is a WordPress core filter that does many things.
1711
+		 *
1712
+		 * @since 1.0.0
1713
+		 * @param string $var The string to apply the filter to.
1714
+		 */
1715
+		$cat_description = apply_filters('the_content', $saved_data);
1716 1716
 
1717 1717
 
1718
-        if ( false !== $filter_priority ) {
1719
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1720
-        }
1718
+		if ( false !== $filter_priority ) {
1719
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1720
+		}
1721 1721
 
1722
-        if ($cat_description) {
1723
-            ?>
1722
+		if ($cat_description) {
1723
+			?>
1724 1724
 
1725 1725
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1726
-        }
1726
+		}
1727 1727
 
1728
-    }
1728
+	}
1729 1729
 }
1730 1730
 
1731 1731
 // action for adding the listings page top widget area
@@ -1744,11 +1744,11 @@  discard block
 block discarded – undo
1744 1744
  */
1745 1745
 function geodir_action_geodir_sidebar_listings_top()
1746 1746
 {
1747
-    if (get_option('geodir_show_listing_top_section')) { ?>
1747
+	if (get_option('geodir_show_listing_top_section')) { ?>
1748 1748
         <div
1749 1749
             class="<?php
1750
-            /** This action is documented in geodirectory_template_actions.php */
1751
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1750
+			/** This action is documented in geodirectory_template_actions.php */
1751
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1752 1752
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1753 1753
         </div><!-- clearfix ends here-->
1754 1754
     <?php }
@@ -1771,35 +1771,35 @@  discard block
 block discarded – undo
1771 1771
  */
1772 1772
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1773 1773
 {
1774
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1775
-        $width_css = 'style="width:' . $width . '%;"';
1776
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1777
-        $width_css = 'style="width:' . $width . '%;"';
1778
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1779
-        $width_css = 'style="width:' . $width . '%;"';
1780
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1781
-        $width_css = 'style="width:' . $width . '%;"';
1782
-    } else {
1783
-        $width_css = '';
1784
-    }
1785
-
1786
-    $tc = get_option('theme_compatibility_setting');
1787
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1788
-        $text = $tc['geodir_sidebar_left_open_replace'];
1789
-    } else {
1790
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1791
-    }
1792
-
1793
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1794
-        $id = $tc['geodir_sidebar_left_open_id'];
1795
-    }
1796
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1797
-        $class = $tc['geodir_sidebar_left_open_class'];
1798
-    }
1799
-
1800
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1801
-
1802
-    echo $text;
1774
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1775
+		$width_css = 'style="width:' . $width . '%;"';
1776
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1777
+		$width_css = 'style="width:' . $width . '%;"';
1778
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1779
+		$width_css = 'style="width:' . $width . '%;"';
1780
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1781
+		$width_css = 'style="width:' . $width . '%;"';
1782
+	} else {
1783
+		$width_css = '';
1784
+	}
1785
+
1786
+	$tc = get_option('theme_compatibility_setting');
1787
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1788
+		$text = $tc['geodir_sidebar_left_open_replace'];
1789
+	} else {
1790
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1791
+	}
1792
+
1793
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1794
+		$id = $tc['geodir_sidebar_left_open_id'];
1795
+	}
1796
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1797
+		$class = $tc['geodir_sidebar_left_open_class'];
1798
+	}
1799
+
1800
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1801
+
1802
+	echo $text;
1803 1803
 }
1804 1804
 
1805 1805
 // action for adding the primary div closing tag
@@ -1815,13 +1815,13 @@  discard block
 block discarded – undo
1815 1815
  */
1816 1816
 function geodir_action_sidebar_left_close($type = '')
1817 1817
 {
1818
-    $tc = get_option('theme_compatibility_setting');
1819
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1820
-        $text = $tc['geodir_sidebar_left_close_replace'];
1821
-    } else {
1822
-        $text = '</aside><!-- sidebar ends here-->';
1823
-    }
1824
-    echo $text;
1818
+	$tc = get_option('theme_compatibility_setting');
1819
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1820
+		$text = $tc['geodir_sidebar_left_close_replace'];
1821
+	} else {
1822
+		$text = '</aside><!-- sidebar ends here-->';
1823
+	}
1824
+	echo $text;
1825 1825
 }
1826 1826
 
1827 1827
 /**
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
  */
1835 1835
 function geodir_listing_left_section()
1836 1836
 {
1837
-    if (get_option('geodir_show_listing_left_section')) { ?>
1837
+	if (get_option('geodir_show_listing_left_section')) { ?>
1838 1838
         <div class="geodir-content-left geodir-sidebar-wrap">
1839 1839
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1840 1840
         </div><!-- end geodir-content-left -->
@@ -1852,20 +1852,20 @@  discard block
 block discarded – undo
1852 1852
  */
1853 1853
 function geodir_action_listings_sidebar_left()
1854 1854
 {
1855
-    if (get_option('geodir_show_listing_left_section')) {
1856
-        /** This action is documented in geodirectory_template_actions.php */
1857
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1858
-        /**
1859
-         * Calls the listings page (category) left sidebar content.
1860
-         *
1861
-         * All the content for the listings page left sidebar is added via this hook.
1862
-         *
1863
-         * @since 1.0.0
1864
-         */
1865
-        do_action('geodir_listings_sidebar_left_inside');
1866
-        /** This action is documented in geodirectory_template_actions.php */
1867
-        do_action('geodir_sidebar_left_close', 'listings-page');
1868
-    }
1855
+	if (get_option('geodir_show_listing_left_section')) {
1856
+		/** This action is documented in geodirectory_template_actions.php */
1857
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1858
+		/**
1859
+		 * Calls the listings page (category) left sidebar content.
1860
+		 *
1861
+		 * All the content for the listings page left sidebar is added via this hook.
1862
+		 *
1863
+		 * @since 1.0.0
1864
+		 */
1865
+		do_action('geodir_listings_sidebar_left_inside');
1866
+		/** This action is documented in geodirectory_template_actions.php */
1867
+		do_action('geodir_sidebar_left_close', 'listings-page');
1868
+	}
1869 1869
 }
1870 1870
 
1871 1871
 /**
@@ -1878,7 +1878,7 @@  discard block
 block discarded – undo
1878 1878
  */
1879 1879
 function geodir_listing_right_section()
1880 1880
 {
1881
-    if (get_option('geodir_show_listing_right_section')) { ?>
1881
+	if (get_option('geodir_show_listing_right_section')) { ?>
1882 1882
         <div class="geodir-content-right geodir-sidebar-wrap">
1883 1883
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1884 1884
         </div><!-- end geodir-content-right -->
@@ -1896,20 +1896,20 @@  discard block
 block discarded – undo
1896 1896
  */
1897 1897
 function geodir_action_listings_sidebar_right()
1898 1898
 {
1899
-    if (get_option('geodir_show_listing_right_section')) {
1900
-        /** This action is documented in geodirectory_template_actions.php */
1901
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1902
-        /**
1903
-         * Calls the listings page (category) right sidebar content.
1904
-         *
1905
-         * All the content for the listings page right sidebar is added via this hook.
1906
-         *
1907
-         * @since 1.0.0
1908
-         */
1909
-        do_action('geodir_listings_sidebar_right_inside');
1910
-        /** This action is documented in geodirectory_template_actions.php */
1911
-        do_action('geodir_sidebar_right_close', 'listings-page');
1912
-    }
1899
+	if (get_option('geodir_show_listing_right_section')) {
1900
+		/** This action is documented in geodirectory_template_actions.php */
1901
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1902
+		/**
1903
+		 * Calls the listings page (category) right sidebar content.
1904
+		 *
1905
+		 * All the content for the listings page right sidebar is added via this hook.
1906
+		 *
1907
+		 * @since 1.0.0
1908
+		 */
1909
+		do_action('geodir_listings_sidebar_right_inside');
1910
+		/** This action is documented in geodirectory_template_actions.php */
1911
+		do_action('geodir_sidebar_right_close', 'listings-page');
1912
+	}
1913 1913
 }
1914 1914
 
1915 1915
 
@@ -1926,23 +1926,23 @@  discard block
 block discarded – undo
1926 1926
  */
1927 1927
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1928 1928
 {
1929
-    $tc = get_option('theme_compatibility_setting');
1930
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1931
-        $text = $tc['geodir_main_content_open_replace'];
1932
-    } else {
1933
-        $text = '<main id="[id]" class="[class]" role="main">';
1934
-    }
1929
+	$tc = get_option('theme_compatibility_setting');
1930
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1931
+		$text = $tc['geodir_main_content_open_replace'];
1932
+	} else {
1933
+		$text = '<main id="[id]" class="[class]" role="main">';
1934
+	}
1935 1935
 
1936
-    if (!empty($tc['geodir_main_content_open_id'])) {
1937
-        $id = $tc['geodir_main_content_open_id'];
1938
-    }
1939
-    if (!empty($tc['geodir_main_content_open_class'])) {
1940
-        $class = $tc['geodir_main_content_open_class'];
1941
-    }
1936
+	if (!empty($tc['geodir_main_content_open_id'])) {
1937
+		$id = $tc['geodir_main_content_open_id'];
1938
+	}
1939
+	if (!empty($tc['geodir_main_content_open_class'])) {
1940
+		$class = $tc['geodir_main_content_open_class'];
1941
+	}
1942 1942
 
1943
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1943
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1944 1944
 
1945
-    echo $text;
1945
+	echo $text;
1946 1946
 }
1947 1947
 
1948 1948
 // action for adding the primary div closing tag
@@ -1955,13 +1955,13 @@  discard block
 block discarded – undo
1955 1955
  */
1956 1956
 function geodir_action_main_content_close()
1957 1957
 {
1958
-    $tc = get_option('theme_compatibility_setting');
1959
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1960
-        $text = $tc['geodir_main_content_close_replace'];
1961
-    } else {
1962
-        $text = '</main><!-- main ends here-->';
1963
-    }
1964
-    echo $text;
1958
+	$tc = get_option('theme_compatibility_setting');
1959
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1960
+		$text = $tc['geodir_main_content_close_replace'];
1961
+	} else {
1962
+		$text = '</main><!-- main ends here-->';
1963
+	}
1964
+	echo $text;
1965 1965
 }
1966 1966
 
1967 1967
 /**
@@ -1973,14 +1973,14 @@  discard block
 block discarded – undo
1973 1973
  */
1974 1974
 function geodir_action_listings_content_inside()
1975 1975
 {
1976
-    global $gridview_columns;
1977
-    $listing_view = get_option('geodir_listing_view');
1978
-    if (strstr($listing_view, 'gridview')) {
1979
-        $gridview_columns = $listing_view;
1980
-        $listing_view_exp = explode('_', $listing_view);
1981
-        $listing_view = $listing_view_exp[0];
1982
-    }
1983
-    geodir_get_template_part('listing', 'listview');
1976
+	global $gridview_columns;
1977
+	$listing_view = get_option('geodir_listing_view');
1978
+	if (strstr($listing_view, 'gridview')) {
1979
+		$gridview_columns = $listing_view;
1980
+		$listing_view_exp = explode('_', $listing_view);
1981
+		$listing_view = $listing_view_exp[0];
1982
+	}
1983
+	geodir_get_template_part('listing', 'listview');
1984 1984
 }
1985 1985
 
1986 1986
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1996,47 +1996,47 @@  discard block
 block discarded – undo
1996 1996
  */
1997 1997
 function geodir_action_listings_content()
1998 1998
 {
1999
-    /**
2000
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2001
-     *
2002
-     * @since 1.0.0
2003
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2004
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
2005
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2006
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2007
-     */
2008
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2009
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2010
-    echo '<div class="clearfix '.$extra_class.'">';
2011
-    /**
2012
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2013
-     *
2014
-     * @since 1.0.0
2015
-     */
2016
-    do_action('geodir_before_listing');
2017
-    echo '</div>';
2018
-
2019
-    /**
2020
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2021
-     *
2022
-     * @since 1.0.0
2023
-     */
2024
-    do_action('geodir_listings_content_inside');
2025
-
2026
-    /**
2027
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2028
-     *
2029
-     * @since 1.0.0
2030
-     */
2031
-    do_action('geodir_after_listing');
2032
-
2033
-    /**
2034
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2035
-     *
2036
-     * @since 1.0.0
2037
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2038
-     */
2039
-    do_action('geodir_main_content_close', 'listings-page');
1999
+	/**
2000
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2001
+	 *
2002
+	 * @since 1.0.0
2003
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2004
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
2005
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2006
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2007
+	 */
2008
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2009
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2010
+	echo '<div class="clearfix '.$extra_class.'">';
2011
+	/**
2012
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2013
+	 *
2014
+	 * @since 1.0.0
2015
+	 */
2016
+	do_action('geodir_before_listing');
2017
+	echo '</div>';
2018
+
2019
+	/**
2020
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2021
+	 *
2022
+	 * @since 1.0.0
2023
+	 */
2024
+	do_action('geodir_listings_content_inside');
2025
+
2026
+	/**
2027
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2028
+	 *
2029
+	 * @since 1.0.0
2030
+	 */
2031
+	do_action('geodir_after_listing');
2032
+
2033
+	/**
2034
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2035
+	 *
2036
+	 * @since 1.0.0
2037
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2038
+	 */
2039
+	do_action('geodir_main_content_close', 'listings-page');
2040 2040
 }
2041 2041
 
2042 2042
 
@@ -2051,10 +2051,10 @@  discard block
 block discarded – undo
2051 2051
  */
2052 2052
 function geodir_action_sidebar_listings_bottom_section()
2053 2053
 {
2054
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2054
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2055 2055
         <div class="<?php
2056
-            /** This action is documented in geodirectory_template_actions.php */
2057
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2056
+			/** This action is documented in geodirectory_template_actions.php */
2057
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2058 2058
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2059 2059
         </div><!-- clearfix ends here-->
2060 2060
     <?php }
@@ -2074,38 +2074,38 @@  discard block
 block discarded – undo
2074 2074
  */
2075 2075
 function geodir_action_add_listing_page_title()
2076 2076
 {
2077
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2078
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2079
-    /** This action is documented in geodirectory_template_actions.php */
2080
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2081
-    /** This action is documented in geodirectory_template_actions.php */
2082
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2083
-
2084
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2085
-
2086
-    if(geodir_is_page('add-listing')){
2087
-        $gd_page = 'add-listing';
2088
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2089
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2090
-        }elseif(isset($listing_type)){
2091
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2092
-        }
2077
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2078
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2079
+	/** This action is documented in geodirectory_template_actions.php */
2080
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2081
+	/** This action is documented in geodirectory_template_actions.php */
2082
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2083
+
2084
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2085
+
2086
+	if(geodir_is_page('add-listing')){
2087
+		$gd_page = 'add-listing';
2088
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2089
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2090
+		}elseif(isset($listing_type)){
2091
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2092
+		}
2093 2093
 
2094
-    }
2094
+	}
2095 2095
 
2096 2096
 
2097
-    /**
2098
-     * Filter page title to replace variables.
2099
-     *
2100
-     * @since 1.5.4
2101
-     * @param string $title The page title including variables.
2102
-     * @param string $gd_page The GeoDirectory page type if any.
2103
-     */
2104
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2097
+	/**
2098
+	 * Filter page title to replace variables.
2099
+	 *
2100
+	 * @since 1.5.4
2101
+	 * @param string $title The page title including variables.
2102
+	 * @param string $gd_page The GeoDirectory page type if any.
2103
+	 */
2104
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2105 2105
 
2106
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2107
-    echo $title;
2108
-    echo '</h1></header>';
2106
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2107
+	echo $title;
2108
+	echo '</h1></header>';
2109 2109
 }
2110 2110
 
2111 2111
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2136,61 +2136,61 @@  discard block
 block discarded – undo
2136 2136
  */
2137 2137
 function geodir_action_add_listing_form()
2138 2138
 {
2139
-    global $cat_display, $post_cat, $current_user, $gd_session;
2140
-    $page_id = get_the_ID();
2141
-    $post = '';
2142
-    $title = '';
2143
-    $desc = '';
2144
-    $kw_tags = '';
2145
-    $required_msg = '';
2146
-    $submit_button = '';
2147
-
2148
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2149
-
2150
-    $thumb_img_arr = array();
2151
-    $curImages = '';
2152
-
2153
-    if (isset($_REQUEST['backandedit'])) {
2154
-        global $post;
2155
-        $post = (object)$gd_session->get('listing');
2156
-        $listing_type = $post->listing_type;
2157
-        $title = $post->post_title;
2158
-        $desc = $post->post_desc;
2159
-        $post_cat = $post->post_category;
2160
-
2161
-        $kw_tags = $post->post_tags;
2162
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2163
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2164
-        global $post, $post_images;
2165
-
2166
-        $post = geodir_get_post_info($_REQUEST['pid']);
2167
-        $thumb_img_arr = geodir_get_images($post->ID);
2168
-        if ($thumb_img_arr) {
2169
-            foreach ($thumb_img_arr as $post_img) {
2170
-                $curImages .= $post_img->src . ',';
2171
-            }
2172
-        }
2139
+	global $cat_display, $post_cat, $current_user, $gd_session;
2140
+	$page_id = get_the_ID();
2141
+	$post = '';
2142
+	$title = '';
2143
+	$desc = '';
2144
+	$kw_tags = '';
2145
+	$required_msg = '';
2146
+	$submit_button = '';
2147
+
2148
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2149
+
2150
+	$thumb_img_arr = array();
2151
+	$curImages = '';
2152
+
2153
+	if (isset($_REQUEST['backandedit'])) {
2154
+		global $post;
2155
+		$post = (object)$gd_session->get('listing');
2156
+		$listing_type = $post->listing_type;
2157
+		$title = $post->post_title;
2158
+		$desc = $post->post_desc;
2159
+		$post_cat = $post->post_category;
2160
+
2161
+		$kw_tags = $post->post_tags;
2162
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2163
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2164
+		global $post, $post_images;
2165
+
2166
+		$post = geodir_get_post_info($_REQUEST['pid']);
2167
+		$thumb_img_arr = geodir_get_images($post->ID);
2168
+		if ($thumb_img_arr) {
2169
+			foreach ($thumb_img_arr as $post_img) {
2170
+				$curImages .= $post_img->src . ',';
2171
+			}
2172
+		}
2173 2173
 
2174
-        $listing_type = $post->post_type;
2175
-        $title = $post->post_title;
2176
-        $desc = $post->post_content;
2177
-        $kw_tags = $post->post_tags;
2178
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2179
-    } else {
2180
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2181
-    }
2174
+		$listing_type = $post->post_type;
2175
+		$title = $post->post_title;
2176
+		$desc = $post->post_content;
2177
+		$kw_tags = $post->post_tags;
2178
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2179
+	} else {
2180
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2181
+	}
2182 2182
 
2183
-    if ($current_user->ID != '0') {
2184
-        $user_login = true;
2185
-    }
2183
+	if ($current_user->ID != '0') {
2184
+		$user_login = true;
2185
+	}
2186 2186
 
2187
-    $post_type_info = geodir_get_posttype_info($listing_type);
2187
+	$post_type_info = geodir_get_posttype_info($listing_type);
2188 2188
 
2189
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2189
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2190 2190
     
2191
-    $package_info = array();
2192
-    $package_info = geodir_post_package_info($package_info, $post);
2193
-    ?>
2191
+	$package_info = array();
2192
+	$package_info = geodir_post_package_info($package_info, $post);
2193
+	?>
2194 2194
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2195 2195
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2196 2196
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2201,114 +2201,114 @@  discard block
 block discarded – undo
2201 2201
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2202 2202
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2203 2203
         <?php
2204
-        } 
2205
-        /**
2206
-         * Called at the very top of the add listing page form for frontend.
2207
-         *
2208
-         * This is called just before the "Enter Listing Details" text.
2209
-         *
2210
-         * @since 1.0.0
2211
-         */
2212
-        do_action('geodir_before_detail_fields');
2213
-        ?>
2204
+		} 
2205
+		/**
2206
+		 * Called at the very top of the add listing page form for frontend.
2207
+		 *
2208
+		 * This is called just before the "Enter Listing Details" text.
2209
+		 *
2210
+		 * @since 1.0.0
2211
+		 */
2212
+		do_action('geodir_before_detail_fields');
2213
+		?>
2214 2214
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2215 2215
         <?php
2216
-        /**
2217
-         * Called at the top of the add listing page form for frontend.
2218
-         *
2219
-         * This is called after the "Enter Listing Details" text.
2220
-         *
2221
-         * @since 1.0.0
2222
-         */
2223
-        do_action('geodir_before_main_form_fields');
2224
-        ?>
2216
+		/**
2217
+		 * Called at the top of the add listing page form for frontend.
2218
+		 *
2219
+		 * This is called after the "Enter Listing Details" text.
2220
+		 *
2221
+		 * @since 1.0.0
2222
+		 */
2223
+		do_action('geodir_before_main_form_fields');
2224
+		?>
2225 2225
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2226 2226
             <label><?php
2227
-                /**
2228
-                 * Filter the add listing page title input label.
2229
-                 *
2230
-                 * @since 1.6.11
2231
-                 * @param string $title The title to be output.
2232
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2233
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2234
-                 */
2235
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2227
+				/**
2228
+				 * Filter the add listing page title input label.
2229
+				 *
2230
+				 * @since 1.6.11
2231
+				 * @param string $title The title to be output.
2232
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2233
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2234
+				 */
2235
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2236 2236
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2237 2237
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2238 2238
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2239 2239
         </div>
2240 2240
         <?php
2241
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2242
-        $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2243
-        /**
2244
-         * Filter whether to show or don't show the editor.
2245
-         *
2246
-         * @since 1.6.16
2247
-         * @param bool $show_editor If true the editor will be available for description field.
2248
-         * @param object $package_info The listing package.
2249
-         * @param string $listing_type The current post type.
2250
-         * @param object $post The current post object.
2251
-         */
2252
-        $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2253
-
2254
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2255
-        $desc_limit = '';
2256
-        /**
2257
-         * Filter the add listing description field character limit number.
2258
-         *
2259
-         * @since 1.0.0
2260
-         * @param int $desc_limit The amount of characters to limit the description to.
2261
-         */
2262
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2263
-        /**
2264
-         * Filter the add listing description field text.
2265
-         *
2266
-         * @since 1.0.0
2267
-         * @param string $desc The text for the description field.
2268
-         * @param int $desc_limit The character limit number if any.
2269
-         */
2270
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2271
-        $desc_limit_msg = '';
2272
-        /**
2273
-         * Filter the add listing description limit message.
2274
-         *
2275
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2276
-         *
2277
-         * @since 1.0.0
2278
-         * @param string $desc_limit_msg The limit message string if any.
2279
-         * @param int $desc_limit The character limit numer if any.
2280
-         */
2281
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2241
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2242
+		$show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2243
+		/**
2244
+		 * Filter whether to show or don't show the editor.
2245
+		 *
2246
+		 * @since 1.6.16
2247
+		 * @param bool $show_editor If true the editor will be available for description field.
2248
+		 * @param object $package_info The listing package.
2249
+		 * @param string $listing_type The current post type.
2250
+		 * @param object $post The current post object.
2251
+		 */
2252
+		$show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2253
+
2254
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2255
+		$desc_limit = '';
2256
+		/**
2257
+		 * Filter the add listing description field character limit number.
2258
+		 *
2259
+		 * @since 1.0.0
2260
+		 * @param int $desc_limit The amount of characters to limit the description to.
2261
+		 */
2262
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2263
+		/**
2264
+		 * Filter the add listing description field text.
2265
+		 *
2266
+		 * @since 1.0.0
2267
+		 * @param string $desc The text for the description field.
2268
+		 * @param int $desc_limit The character limit number if any.
2269
+		 */
2270
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2271
+		$desc_limit_msg = '';
2272
+		/**
2273
+		 * Filter the add listing description limit message.
2274
+		 *
2275
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2276
+		 *
2277
+		 * @since 1.0.0
2278
+		 * @param string $desc_limit_msg The limit message string if any.
2279
+		 * @param int $desc_limit The character limit numer if any.
2280
+		 */
2281
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2282 2282
         
2283
-        $desc_class = '';
2284
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2285
-            /**
2286
-             * Called on the add listing page form for frontend just before the description field.
2287
-             *
2288
-             * @since 1.0.0
2289
-             */
2290
-            do_action('geodir_before_description_field');
2283
+		$desc_class = '';
2284
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2285
+			/**
2286
+			 * Called on the add listing page form for frontend just before the description field.
2287
+			 *
2288
+			 * @since 1.0.0
2289
+			 */
2290
+			do_action('geodir_before_description_field');
2291 2291
             
2292
-            $desc_class = ' required_field';
2293
-        } else {
2294
-            $desc_class = ' hidden';
2295
-        }
2296
-        ?>
2292
+			$desc_class = ' required_field';
2293
+		} else {
2294
+			$desc_class = ' hidden';
2295
+		}
2296
+		?>
2297 2297
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2298 2298
             <label><?php
2299
-                /**
2300
-                 * Filter the add listing page description input label.
2301
-                 *
2302
-                 * @since 1.6.11
2303
-                 * @param string $title The title to be output.
2304
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2305
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2306
-                 */
2307
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2299
+				/**
2300
+				 * Filter the add listing page description input label.
2301
+				 *
2302
+				 * @since 1.6.11
2303
+				 * @param string $title The title to be output.
2304
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2305
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2306
+				 */
2307
+				echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2308 2308
             <?php
2309
-            if ($show_editor) {
2310
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2311
-            ?>
2309
+			if ($show_editor) {
2310
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2311
+			?>
2312 2312
                 <div class="editor" field_id="post_desc" field_type="editor">
2313 2313
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2314 2314
                 </div>
@@ -2322,56 +2322,56 @@  discard block
 block discarded – undo
2322 2322
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2323 2323
         </div>
2324 2324
         <?php
2325
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2326
-            /**
2327
-             * Called on the add listing page form for frontend just after the description field.
2328
-             *
2329
-             * @since 1.0.0
2330
-             */
2331
-            do_action('geodir_after_description_field');
2332
-        }
2325
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2326
+			/**
2327
+			 * Called on the add listing page form for frontend just after the description field.
2328
+			 *
2329
+			 * @since 1.0.0
2330
+			 */
2331
+			do_action('geodir_after_description_field');
2332
+		}
2333 2333
         
2334
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2335
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2336
-        $kw_tags_msg = TAGKW_MSG;
2337
-        /**
2338
-         * Filter the add listing tags character limit.
2339
-         *
2340
-         * @since 1.0.0
2341
-         * @param int $kw_tags_count The character count limit if any.
2342
-         */
2343
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2344
-        /**
2345
-         * Filter the add listing tags field value.
2346
-         *
2347
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2348
-         *
2349
-         * @since 1.0.0
2350
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2351
-         * @param int $kw_tags_count The character count limit if any.
2352
-         */
2353
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2354
-        /**
2355
-         * Filter the add listing tags field message text.
2356
-         *
2357
-         * @since 1.0.0
2358
-         * @param string $kw_tags_msg The message shown under the field.
2359
-         * @param int $kw_tags_count The character count limit if any.
2360
-         */
2361
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2334
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2335
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2336
+		$kw_tags_msg = TAGKW_MSG;
2337
+		/**
2338
+		 * Filter the add listing tags character limit.
2339
+		 *
2340
+		 * @since 1.0.0
2341
+		 * @param int $kw_tags_count The character count limit if any.
2342
+		 */
2343
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2344
+		/**
2345
+		 * Filter the add listing tags field value.
2346
+		 *
2347
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2348
+		 *
2349
+		 * @since 1.0.0
2350
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2351
+		 * @param int $kw_tags_count The character count limit if any.
2352
+		 */
2353
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2354
+		/**
2355
+		 * Filter the add listing tags field message text.
2356
+		 *
2357
+		 * @since 1.0.0
2358
+		 * @param string $kw_tags_msg The message shown under the field.
2359
+		 * @param int $kw_tags_count The character count limit if any.
2360
+		 */
2361
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2362 2362
         
2363
-        $tags_class = '';
2364
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2365
-            /**
2366
-             * Called on the add listing page form for frontend just before the tags field.
2367
-             *
2368
-             * @since 1.0.0
2369
-             */
2370
-            do_action('geodir_before_listing_tags_field');
2371
-        } else {
2372
-            $tags_class = ' hidden';
2373
-        }
2374
-        ?>
2363
+		$tags_class = '';
2364
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2365
+			/**
2366
+			 * Called on the add listing page form for frontend just before the tags field.
2367
+			 *
2368
+			 * @since 1.0.0
2369
+			 */
2370
+			do_action('geodir_before_listing_tags_field');
2371
+		} else {
2372
+			$tags_class = ' hidden';
2373
+		}
2374
+		?>
2375 2375
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2376 2376
             <label><?php echo TAGKW_TEXT; ?></label>
2377 2377
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2379,90 +2379,90 @@  discard block
 block discarded – undo
2379 2379
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2380 2380
         </div>
2381 2381
         <?php
2382
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2383
-            /**
2384
-             * Called on the add listing page form for frontend just after the tags field.
2385
-             *
2386
-             * @since 1.0.0
2387
-             */
2388
-            do_action('geodir_after_listing_tags_field');
2389
-        }
2382
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2383
+			/**
2384
+			 * Called on the add listing page form for frontend just after the tags field.
2385
+			 *
2386
+			 * @since 1.0.0
2387
+			 */
2388
+			do_action('geodir_after_listing_tags_field');
2389
+		}
2390 2390
         
2391
-        $package_info = array();
2392
-        $package_info = geodir_post_package_info($package_info, $post);
2391
+		$package_info = array();
2392
+		$package_info = geodir_post_package_info($package_info, $post);
2393 2393
         
2394
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2394
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2395 2395
         
2396
-        // adjust values here
2397
-        $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
2398
-
2399
-        $multiple = true; // allow multiple files upload
2396
+		// adjust values here
2397
+		$id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2400 2398
 
2401
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2399
+		$multiple = true; // allow multiple files upload
2402 2400
 
2403
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2401
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2404 2402
 
2405
-        $thumb_img_arr = array();
2406
-        $totImg = 0;
2407
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2408
-            $post = (object)$gd_session->get('listing');
2409
-            if (isset($post->post_images))
2410
-                $curImages = trim($post->post_images, ",");
2403
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2411 2404
 
2405
+		$thumb_img_arr = array();
2406
+		$totImg = 0;
2407
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2408
+			$post = (object)$gd_session->get('listing');
2409
+			if (isset($post->post_images))
2410
+				$curImages = trim($post->post_images, ",");
2412 2411
 
2413
-            if ($curImages != '') {
2414
-                $curImages_array = explode(',', $curImages);
2415
-                $totImg = count($curImages_array);
2416
-            }
2417 2412
 
2418
-            $listing_type = $post->listing_type;
2413
+			if ($curImages != '') {
2414
+				$curImages_array = explode(',', $curImages);
2415
+				$totImg = count($curImages_array);
2416
+			}
2419 2417
 
2420
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2421
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2422
-            $listing_type = $post->post_type;
2423
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2418
+			$listing_type = $post->listing_type;
2424 2419
 
2425
-        } else {
2426
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2427
-        }
2420
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2421
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2422
+			$listing_type = $post->post_type;
2423
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2428 2424
 
2425
+		} else {
2426
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2427
+		}
2429 2428
 
2430
-        if (!empty($thumb_img_arr)) {
2431
-            foreach ($thumb_img_arr as $img) {
2432
-                //$curImages = $img->src.",";
2433
-            }
2434 2429
 
2435
-            $totImg = count((array)$thumb_img_arr);
2436
-        }
2430
+		if (!empty($thumb_img_arr)) {
2431
+			foreach ($thumb_img_arr as $img) {
2432
+				//$curImages = $img->src.",";
2433
+			}
2437 2434
 
2438
-        if ($curImages != '')
2439
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2440
-        else
2441
-            $svalue = '';
2442
-
2443
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2444
-        $show_image_input_box = ($image_limit != '0');
2445
-        /**
2446
-         * Filter to be able to show/hide the image upload section of the add listing form.
2447
-         *
2448
-         * @since 1.0.0
2449
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2450
-         * @param string $listing_type The custom post type slug.
2451
-         */
2452
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2453
-        if ($show_image_input_box) {
2454
-            ?>
2435
+			$totImg = count((array)$thumb_img_arr);
2436
+		}
2437
+
2438
+		if ($curImages != '')
2439
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2440
+		else
2441
+			$svalue = '';
2442
+
2443
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2444
+		$show_image_input_box = ($image_limit != '0');
2445
+		/**
2446
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2447
+		 *
2448
+		 * @since 1.0.0
2449
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2450
+		 * @param string $listing_type The custom post type slug.
2451
+		 */
2452
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2453
+		if ($show_image_input_box) {
2454
+			?>
2455 2455
 
2456 2456
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2457 2457
                 <?php if ($image_limit == 1) {
2458
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2459
-                } ?>
2458
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2459
+				} ?>
2460 2460
                 <?php if ($image_limit > 1) {
2461
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2462
-                } ?>
2461
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2462
+				} ?>
2463 2463
                 <?php if ($image_limit == '') {
2464
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2465
-                } ?>
2464
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2465
+				} ?>
2466 2466
             </h5>
2467 2467
 
2468 2468
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2500,12 +2500,12 @@  discard block
 block discarded – undo
2500 2500
         <?php } ?>
2501 2501
 
2502 2502
         <?php
2503
-        /**
2504
-         * Called on the add listing page form for frontend just after the image upload field.
2505
-         *
2506
-         * @since 1.0.0
2507
-         */
2508
-        do_action('geodir_after_main_form_fields');?>
2503
+		/**
2504
+		 * Called on the add listing page form for frontend just after the image upload field.
2505
+		 *
2506
+		 * @since 1.0.0
2507
+		 */
2508
+		do_action('geodir_after_main_form_fields');?>
2509 2509
 
2510 2510
 
2511 2511
         <!-- add captcha code -->
@@ -2534,7 +2534,7 @@  discard block
 block discarded – undo
2534 2534
 
2535 2535
     </form>
2536 2536
     <?php
2537
-    wp_reset_query();
2537
+	wp_reset_query();
2538 2538
 }
2539 2539
 
2540 2540
 /**
@@ -2545,7 +2545,7 @@  discard block
 block discarded – undo
2545 2545
  */
2546 2546
 function geodir_add_listing_sidebar_widget_area()
2547 2547
 {
2548
-    dynamic_sidebar('geodir_add_listing_sidebar');
2548
+	dynamic_sidebar('geodir_add_listing_sidebar');
2549 2549
 }
2550 2550
 
2551 2551
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2560,16 +2560,16 @@  discard block
 block discarded – undo
2560 2560
  */
2561 2561
 function geodir_action_add_listing_sidebar()
2562 2562
 {
2563
-    /** This action is documented in geodirectory_template_actions.php */
2564
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2565
-    /**
2566
-     * This is used to add the content to the add listing page sidebar.
2567
-     *
2568
-     * @since 1.0.0
2569
-     */
2570
-    do_action('geodir_add_listing_sidebar_inside');
2571
-    /** This action is documented in geodirectory_template_actions.php */
2572
-    do_action('geodir_sidebar_right_close', 'details-page');
2563
+	/** This action is documented in geodirectory_template_actions.php */
2564
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2565
+	/**
2566
+	 * This is used to add the content to the add listing page sidebar.
2567
+	 *
2568
+	 * @since 1.0.0
2569
+	 */
2570
+	do_action('geodir_add_listing_sidebar_inside');
2571
+	/** This action is documented in geodirectory_template_actions.php */
2572
+	do_action('geodir_sidebar_right_close', 'details-page');
2573 2573
 }
2574 2574
 
2575 2575
 ###############################################
@@ -2586,11 +2586,11 @@  discard block
 block discarded – undo
2586 2586
  */
2587 2587
 function geodir_action_geodir_sidebar_signup_top()
2588 2588
 {
2589
-    ?>
2589
+	?>
2590 2590
     <div
2591 2591
         class="<?php
2592
-        /** This action is documented in geodirectory_template_actions.php */
2593
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2592
+		/** This action is documented in geodirectory_template_actions.php */
2593
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2594 2594
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2595 2595
     </div><!-- clearfix ends here-->
2596 2596
 <?php
@@ -2609,9 +2609,9 @@  discard block
 block discarded – undo
2609 2609
 function geodir_action_signup_forms()
2610 2610
 {
2611 2611
 
2612
-    global $user_login;
2612
+	global $user_login;
2613 2613
 
2614
-    ?>
2614
+	?>
2615 2615
     <script type="text/javascript">
2616 2616
         <?php if ( $user_login ) { ?>
2617 2617
         setTimeout(function () {
@@ -2647,65 +2647,65 @@  discard block
 block discarded – undo
2647 2647
         <?php } ?>
2648 2648
     </script><?php
2649 2649
 
2650
-    global $errors;
2651
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2652
-        $errors->add('claim_login', LOGIN_CLAIM);
2653
-
2654
-    if (!empty($errors)) {
2655
-        foreach ($errors as $errorsObj) {
2656
-            foreach ($errorsObj as $key => $val) {
2657
-                for ($i = 0; $i < count($val); $i++) {
2658
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2659
-                    $registration_error_msg = 1;
2660
-                }
2661
-            }
2662
-        }
2663
-    }
2650
+	global $errors;
2651
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2652
+		$errors->add('claim_login', LOGIN_CLAIM);
2653
+
2654
+	if (!empty($errors)) {
2655
+		foreach ($errors as $errorsObj) {
2656
+			foreach ($errorsObj as $key => $val) {
2657
+				for ($i = 0; $i < count($val); $i++) {
2658
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2659
+					$registration_error_msg = 1;
2660
+				}
2661
+			}
2662
+		}
2663
+	}
2664 2664
 
2665
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2666
-        ?>
2665
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2666
+		?>
2667 2667
 
2668 2668
         <div class="login_form">
2669 2669
             <?php
2670
-            /**
2671
-             * Contains login form template.
2672
-             *
2673
-             * @since 1.0.0
2674
-             */
2675
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2670
+			/**
2671
+			 * Contains login form template.
2672
+			 *
2673
+			 * @since 1.0.0
2674
+			 */
2675
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2676 2676
         </div>
2677 2677
 
2678 2678
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2679 2679
 
2680 2680
         <div class="registration_form">
2681 2681
             <?php
2682
-            /**
2683
-             * Contains registration form template.
2684
-             *
2685
-             * @since 1.0.0
2686
-             */
2687
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2682
+			/**
2683
+			 * Contains registration form template.
2684
+			 *
2685
+			 * @since 1.0.0
2686
+			 */
2687
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2688 2688
         </div>
2689 2689
 
2690 2690
     <?php } else { ?>
2691 2691
 
2692 2692
         <div class="login_form_l">
2693 2693
             <?php
2694
-            /**
2695
-             * Contains login form template.
2696
-             *
2697
-             * @since 1.0.0
2698
-             */
2699
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2694
+			/**
2695
+			 * Contains login form template.
2696
+			 *
2697
+			 * @since 1.0.0
2698
+			 */
2699
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2700 2700
         </div>
2701 2701
         <div class="registration_form_r">
2702 2702
             <?php
2703
-            /**
2704
-             * Contains registration form template.
2705
-             *
2706
-             * @since 1.0.0
2707
-             */
2708
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2703
+			/**
2704
+			 * Contains registration form template.
2705
+			 *
2706
+			 * @since 1.0.0
2707
+			 */
2708
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2709 2709
         </div>
2710 2710
 
2711 2711
     <?php }?>
@@ -2736,66 +2736,66 @@  discard block
 block discarded – undo
2736 2736
  */
2737 2737
 function geodir_action_author_page_title()
2738 2738
 {
2739
-    global $term;
2739
+	global $term;
2740 2740
 
2741
-    $gd_post_type = geodir_get_current_posttype();
2742
-    $post_type_info = get_post_type_object($gd_post_type);
2741
+	$gd_post_type = geodir_get_current_posttype();
2742
+	$post_type_info = get_post_type_object($gd_post_type);
2743 2743
 
2744
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2745
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2746
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2747
-    }
2744
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2745
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2746
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2747
+	}
2748 2748
 
2749
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2750
-    $single_name = $post_type_info->labels->singular_name;
2749
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2750
+	$single_name = $post_type_info->labels->singular_name;
2751 2751
 
2752
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2752
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2753 2753
 
2754
-    if (!empty($term)) {
2755
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2756
-        if (!empty($current_term))
2757
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2758
-    }
2754
+	if (!empty($term)) {
2755
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2756
+		if (!empty($current_term))
2757
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2758
+	}
2759 2759
 
2760 2760
 
2761
-    if (is_search()) {
2762
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2761
+	if (is_search()) {
2762
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2763 2763
 
2764
-    }
2765
-    /** This action is documented in geodirectory_template_actions.php */
2766
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2767
-    /** This action is documented in geodirectory_template_actions.php */
2768
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2764
+	}
2765
+	/** This action is documented in geodirectory_template_actions.php */
2766
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2767
+	/** This action is documented in geodirectory_template_actions.php */
2768
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2769 2769
 
2770
-    $title = $list_title;
2771
-    if(geodir_is_page('author')){
2772
-        $gd_page = 'author';
2773
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2774
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2775
-        }else{
2776
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2777
-        }
2770
+	$title = $list_title;
2771
+	if(geodir_is_page('author')){
2772
+		$gd_page = 'author';
2773
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2774
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2775
+		}else{
2776
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2777
+		}
2778 2778
 
2779
-    }
2779
+	}
2780 2780
 
2781 2781
 
2782
-    /**
2783
-     * Filter page title to replace variables.
2784
-     *
2785
-     * @since 1.5.4
2786
-     * @param string $title The page title including variables.
2787
-     * @param string $gd_page The GeoDirectory page type if any.
2788
-     */
2789
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2782
+	/**
2783
+	 * Filter page title to replace variables.
2784
+	 *
2785
+	 * @since 1.5.4
2786
+	 * @param string $title The page title including variables.
2787
+	 * @param string $gd_page The GeoDirectory page type if any.
2788
+	 */
2789
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2790 2790
 
2791
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2792
-        /**
2793
-         * Filter the author page title text.
2794
-         *
2795
-         * @since 1.0.0
2796
-         * @param string $list_title The title for the page.
2797
-         */
2798
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2791
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2792
+		/**
2793
+		 * Filter the author page title text.
2794
+		 *
2795
+		 * @since 1.0.0
2796
+		 * @param string $list_title The title for the page.
2797
+		 */
2798
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2799 2799
 }
2800 2800
 
2801 2801
 
@@ -2813,11 +2813,11 @@  discard block
 block discarded – undo
2813 2813
  */
2814 2814
 function geodir_action_geodir_sidebar_author_top()
2815 2815
 {
2816
-    if (get_option('geodir_show_author_top_section')) { ?>
2816
+	if (get_option('geodir_show_author_top_section')) { ?>
2817 2817
         <div
2818 2818
             class="<?php
2819
-            /** This action is documented in geodirectory_template_actions.php */
2820
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2819
+			/** This action is documented in geodirectory_template_actions.php */
2820
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2821 2821
             <?php dynamic_sidebar('geodir_author_top'); ?>
2822 2822
         </div><!-- clearfix ends here-->
2823 2823
     <?php }
@@ -2833,7 +2833,7 @@  discard block
 block discarded – undo
2833 2833
  */
2834 2834
 function geodir_author_left_section()
2835 2835
 {
2836
-    if (get_option('geodir_show_author_left_section')) { ?>
2836
+	if (get_option('geodir_show_author_left_section')) { ?>
2837 2837
         <div class="geodir-content-left geodir-sidebar-wrap">
2838 2838
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2839 2839
         </div><!-- end geodir-content-left -->
@@ -2854,19 +2854,19 @@  discard block
 block discarded – undo
2854 2854
  */
2855 2855
 function geodir_action_author_sidebar_left()
2856 2856
 {
2857
-    if (get_option('geodir_show_author_left_section')) {
2857
+	if (get_option('geodir_show_author_left_section')) {
2858 2858
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2859
-        /** This action is documented in geodirectory_template_actions.php */
2860
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2861
-        /**
2862
-         * This is used to add the content to the author page left sidebar (if active).
2863
-         *
2864
-         * @since 1.0.0
2865
-         */
2866
-        do_action('geodir_author_sidebar_left_inside');
2867
-        /** This action is documented in geodirectory_template_actions.php */
2868
-        do_action('geodir_sidebar_left_close', 'author-page');
2869
-    }
2859
+		/** This action is documented in geodirectory_template_actions.php */
2860
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2861
+		/**
2862
+		 * This is used to add the content to the author page left sidebar (if active).
2863
+		 *
2864
+		 * @since 1.0.0
2865
+		 */
2866
+		do_action('geodir_author_sidebar_left_inside');
2867
+		/** This action is documented in geodirectory_template_actions.php */
2868
+		do_action('geodir_sidebar_left_close', 'author-page');
2869
+	}
2870 2870
 }
2871 2871
 
2872 2872
 /**
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
  */
2880 2880
 function geodir_author_right_section()
2881 2881
 {
2882
-    if (get_option('geodir_show_author_right_section')) { ?>
2882
+	if (get_option('geodir_show_author_right_section')) { ?>
2883 2883
         <div class="geodir-content-right geodir-sidebar-wrap">
2884 2884
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2885 2885
         </div><!-- end geodir-content-right -->
@@ -2899,18 +2899,18 @@  discard block
 block discarded – undo
2899 2899
  */
2900 2900
 function geodir_action_author_sidebar_right()
2901 2901
 {
2902
-    if (get_option('geodir_show_author_right_section')) {
2903
-        /** This action is documented in geodirectory_template_actions.php */
2904
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2905
-        /**
2906
-         * This is used to add the content to the author page right sidebar (if active).
2907
-         *
2908
-         * @since 1.0.0
2909
-         */
2910
-        do_action('geodir_author_sidebar_right_inside');
2911
-        /** This action is documented in geodirectory_template_actions.php */
2912
-        do_action('geodir_sidebar_right_close', 'author-page');
2913
-    }
2902
+	if (get_option('geodir_show_author_right_section')) {
2903
+		/** This action is documented in geodirectory_template_actions.php */
2904
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2905
+		/**
2906
+		 * This is used to add the content to the author page right sidebar (if active).
2907
+		 *
2908
+		 * @since 1.0.0
2909
+		 */
2910
+		do_action('geodir_author_sidebar_right_inside');
2911
+		/** This action is documented in geodirectory_template_actions.php */
2912
+		do_action('geodir_sidebar_right_close', 'author-page');
2913
+	}
2914 2914
 }
2915 2915
 
2916 2916
 /**
@@ -2922,14 +2922,14 @@  discard block
 block discarded – undo
2922 2922
  */
2923 2923
 function geodir_action_author_content_inside()
2924 2924
 {
2925
-    global $gridview_columns;
2926
-    $listing_view = get_option('geodir_author_view');
2927
-    if (strstr($listing_view, 'gridview')) {
2928
-        $gridview_columns = $listing_view;
2929
-        $listing_view_exp = explode('_', $listing_view);
2930
-        $listing_view = $listing_view_exp[0];
2931
-    }
2932
-    geodir_get_template_part('listing', 'listview');
2925
+	global $gridview_columns;
2926
+	$listing_view = get_option('geodir_author_view');
2927
+	if (strstr($listing_view, 'gridview')) {
2928
+		$gridview_columns = $listing_view;
2929
+		$listing_view_exp = explode('_', $listing_view);
2930
+		$listing_view = $listing_view_exp[0];
2931
+	}
2932
+	geodir_get_template_part('listing', 'listview');
2933 2933
 }
2934 2934
 
2935 2935
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2944,22 +2944,22 @@  discard block
 block discarded – undo
2944 2944
  */
2945 2945
 function geodir_action_author_content()
2946 2946
 {
2947
-    /** This action is documented in geodirectory_template_actions.php */
2948
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2949
-    echo '<div class="clearfix">';
2950
-    /** This action is documented in geodirectory_template_actions.php */
2951
-    do_action('geodir_before_listing');
2952
-    echo '</div>';
2953
-    /**
2954
-     * This is used to add the content to the author page main content.
2955
-     *
2956
-     * @since 1.0.0
2957
-     */
2958
-    do_action('geodir_author_content_inside');
2959
-    /** This action is documented in geodirectory_template_actions.php */
2960
-    do_action('geodir_after_listing');
2961
-    /** This action is documented in geodirectory_template_actions.php */
2962
-    do_action('geodir_main_content_close', 'author-page');
2947
+	/** This action is documented in geodirectory_template_actions.php */
2948
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2949
+	echo '<div class="clearfix">';
2950
+	/** This action is documented in geodirectory_template_actions.php */
2951
+	do_action('geodir_before_listing');
2952
+	echo '</div>';
2953
+	/**
2954
+	 * This is used to add the content to the author page main content.
2955
+	 *
2956
+	 * @since 1.0.0
2957
+	 */
2958
+	do_action('geodir_author_content_inside');
2959
+	/** This action is documented in geodirectory_template_actions.php */
2960
+	do_action('geodir_after_listing');
2961
+	/** This action is documented in geodirectory_template_actions.php */
2962
+	do_action('geodir_main_content_close', 'author-page');
2963 2963
 }
2964 2964
 
2965 2965
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2973,11 +2973,11 @@  discard block
 block discarded – undo
2973 2973
  */
2974 2974
 function geodir_action_sidebar_author_bottom_section()
2975 2975
 {
2976
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2976
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2977 2977
         <div
2978 2978
             class="<?php
2979
-            /** This action is documented in geodirectory_template_actions.php */
2980
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2979
+			/** This action is documented in geodirectory_template_actions.php */
2980
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2981 2981
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2982 2982
         </div><!-- clearfix ends here-->
2983 2983
     <?php }
@@ -2996,23 +2996,23 @@  discard block
 block discarded – undo
2996 2996
  */
2997 2997
 function geodir_action_search_page_title()
2998 2998
 {
2999
-    $gd_post_type = geodir_get_current_posttype();
3000
-    $post_type_info = get_post_type_object($gd_post_type);
2999
+	$gd_post_type = geodir_get_current_posttype();
3000
+	$post_type_info = get_post_type_object($gd_post_type);
3001 3001
 
3002
-    $pt_name = '';
3003
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3002
+	$pt_name = '';
3003
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3004 3004
 
3005
-    if (is_search()) {
3006
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3005
+	if (is_search()) {
3006
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3007 3007
 
3008
-    }
3009
-    /** This action is documented in geodirectory_template_actions.php */
3010
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3011
-    /** This action is documented in geodirectory_template_actions.php */
3012
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3013
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3014
-        /** This action is documented in geodirectory_template_actions.php */
3015
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3008
+	}
3009
+	/** This action is documented in geodirectory_template_actions.php */
3010
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
3011
+	/** This action is documented in geodirectory_template_actions.php */
3012
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3013
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3014
+		/** This action is documented in geodirectory_template_actions.php */
3015
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3016 3016
 }
3017 3017
 
3018 3018
 // action for adding the listings page top widget area
@@ -3028,11 +3028,11 @@  discard block
 block discarded – undo
3028 3028
  */
3029 3029
 function geodir_action_geodir_sidebar_search_top()
3030 3030
 {
3031
-    if (get_option('geodir_show_search_top_section')) { ?>
3031
+	if (get_option('geodir_show_search_top_section')) { ?>
3032 3032
         <div
3033 3033
             class="<?php
3034
-            /** This action is documented in geodirectory_template_actions.php */
3035
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3034
+			/** This action is documented in geodirectory_template_actions.php */
3035
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3036 3036
             <?php dynamic_sidebar('geodir_search_top'); ?>
3037 3037
         </div><!-- clearfix ends here-->
3038 3038
     <?php }
@@ -3048,7 +3048,7 @@  discard block
 block discarded – undo
3048 3048
  */
3049 3049
 function geodir_search_left_section()
3050 3050
 {
3051
-    if (get_option('geodir_show_search_left_section')) { ?>
3051
+	if (get_option('geodir_show_search_left_section')) { ?>
3052 3052
         <div class="geodir-content-left geodir-sidebar-wrap">
3053 3053
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3054 3054
         </div><!-- end geodir-content-left -->
@@ -3068,19 +3068,19 @@  discard block
 block discarded – undo
3068 3068
  */
3069 3069
 function geodir_action_search_sidebar_left()
3070 3070
 {
3071
-    if (get_option('geodir_show_search_left_section')) {
3071
+	if (get_option('geodir_show_search_left_section')) {
3072 3072
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3073
-        /** This action is documented in geodirectory_template_actions.php */
3074
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3075
-        /**
3076
-         * This is used to add the content to the search page left sidebar (if active).
3077
-         *
3078
-         * @since 1.0.0
3079
-         */
3080
-        do_action('geodir_search_sidebar_left_inside');
3081
-        /** This action is documented in geodirectory_template_actions.php */
3082
-        do_action('geodir_sidebar_left_close', 'search-page');
3083
-    }
3073
+		/** This action is documented in geodirectory_template_actions.php */
3074
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3075
+		/**
3076
+		 * This is used to add the content to the search page left sidebar (if active).
3077
+		 *
3078
+		 * @since 1.0.0
3079
+		 */
3080
+		do_action('geodir_search_sidebar_left_inside');
3081
+		/** This action is documented in geodirectory_template_actions.php */
3082
+		do_action('geodir_sidebar_left_close', 'search-page');
3083
+	}
3084 3084
 }
3085 3085
 
3086 3086
 /**
@@ -3093,7 +3093,7 @@  discard block
 block discarded – undo
3093 3093
  */
3094 3094
 function geodir_search_right_section()
3095 3095
 {
3096
-    if (get_option('geodir_show_search_right_section')) { ?>
3096
+	if (get_option('geodir_show_search_right_section')) { ?>
3097 3097
         <div class="geodir-content-right geodir-sidebar-wrap">
3098 3098
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3099 3099
         </div><!-- end geodir-content-right -->
@@ -3113,18 +3113,18 @@  discard block
 block discarded – undo
3113 3113
  */
3114 3114
 function geodir_action_search_sidebar_right()
3115 3115
 {
3116
-    if (get_option('geodir_show_search_right_section')) {
3117
-        /** This action is documented in geodirectory_template_actions.php */
3118
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3119
-        /**
3120
-         * This is used to add the content to the search page right sidebar (if active).
3121
-         *
3122
-         * @since 1.0.0
3123
-         */
3124
-        do_action('geodir_search_sidebar_right_inside');
3125
-        /** This action is documented in geodirectory_template_actions.php */
3126
-        do_action('geodir_sidebar_right_close', 'search-page');
3127
-    }
3116
+	if (get_option('geodir_show_search_right_section')) {
3117
+		/** This action is documented in geodirectory_template_actions.php */
3118
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3119
+		/**
3120
+		 * This is used to add the content to the search page right sidebar (if active).
3121
+		 *
3122
+		 * @since 1.0.0
3123
+		 */
3124
+		do_action('geodir_search_sidebar_right_inside');
3125
+		/** This action is documented in geodirectory_template_actions.php */
3126
+		do_action('geodir_sidebar_right_close', 'search-page');
3127
+	}
3128 3128
 }
3129 3129
 
3130 3130
 
@@ -3139,11 +3139,11 @@  discard block
 block discarded – undo
3139 3139
  */
3140 3140
 function geodir_action_sidebar_search_bottom_section()
3141 3141
 {
3142
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3142
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3143 3143
         <div
3144 3144
             class="<?php
3145
-            /** This action is documented in geodirectory_template_actions.php */
3146
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3145
+			/** This action is documented in geodirectory_template_actions.php */
3146
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3147 3147
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3148 3148
         </div><!-- clearfix ends here-->
3149 3149
     <?php }
@@ -3158,14 +3158,14 @@  discard block
 block discarded – undo
3158 3158
  */
3159 3159
 function geodir_action_search_content_inside()
3160 3160
 {
3161
-    global $gridview_columns;
3162
-    $listing_view = get_option('geodir_search_view');
3163
-    if (strstr($listing_view, 'gridview')) {
3164
-        $gridview_columns = $listing_view;
3165
-        $listing_view_exp = explode('_', $listing_view);
3166
-        $listing_view = $listing_view_exp[0];
3167
-    }
3168
-    geodir_get_template_part('listing', 'listview');
3161
+	global $gridview_columns;
3162
+	$listing_view = get_option('geodir_search_view');
3163
+	if (strstr($listing_view, 'gridview')) {
3164
+		$gridview_columns = $listing_view;
3165
+		$listing_view_exp = explode('_', $listing_view);
3166
+		$listing_view = $listing_view_exp[0];
3167
+	}
3168
+	geodir_get_template_part('listing', 'listview');
3169 3169
 }
3170 3170
 
3171 3171
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3181,22 +3181,22 @@  discard block
 block discarded – undo
3181 3181
  */
3182 3182
 function geodir_action_search_content()
3183 3183
 {
3184
-    /** This action is documented in geodirectory_template_actions.php */
3185
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3186
-    echo '<div class="clearfix">';
3187
-    /** This action is documented in geodirectory_template_actions.php */
3188
-    do_action('geodir_before_listing');
3189
-    echo '</div>';
3190
-    /**
3191
-     * This is used to add the content to the search page main content.
3192
-     *
3193
-     * @since 1.0.0
3194
-     */
3195
-    do_action('geodir_search_content_inside');
3196
-    /** This action is documented in geodirectory_template_actions.php */
3197
-    do_action('geodir_after_listing');
3198
-    /** This action is documented in geodirectory_template_actions.php */
3199
-    do_action('geodir_main_content_close', 'search-page');
3184
+	/** This action is documented in geodirectory_template_actions.php */
3185
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3186
+	echo '<div class="clearfix">';
3187
+	/** This action is documented in geodirectory_template_actions.php */
3188
+	do_action('geodir_before_listing');
3189
+	echo '</div>';
3190
+	/**
3191
+	 * This is used to add the content to the search page main content.
3192
+	 *
3193
+	 * @since 1.0.0
3194
+	 */
3195
+	do_action('geodir_search_content_inside');
3196
+	/** This action is documented in geodirectory_template_actions.php */
3197
+	do_action('geodir_after_listing');
3198
+	/** This action is documented in geodirectory_template_actions.php */
3199
+	do_action('geodir_main_content_close', 'search-page');
3200 3200
 }
3201 3201
 
3202 3202
 ###############################################
@@ -3219,11 +3219,11 @@  discard block
 block discarded – undo
3219 3219
  */
3220 3220
 function geodir_action_geodir_sidebar_home_top()
3221 3221
 {
3222
-    if (get_option('geodir_show_home_top_section')) { ?>
3222
+	if (get_option('geodir_show_home_top_section')) { ?>
3223 3223
         <div
3224 3224
             class="<?php
3225
-            /** This action is documented in geodirectory_template_actions.php */
3226
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3225
+			/** This action is documented in geodirectory_template_actions.php */
3226
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3227 3227
             <?php dynamic_sidebar('geodir_home_top'); ?>
3228 3228
         </div><!-- clearfix ends here-->
3229 3229
     <?php }
@@ -3239,7 +3239,7 @@  discard block
 block discarded – undo
3239 3239
  */
3240 3240
 function geodir_home_left_section()
3241 3241
 {
3242
-    if (get_option('geodir_show_home_left_section')) { ?>
3242
+	if (get_option('geodir_show_home_left_section')) { ?>
3243 3243
         <div class="geodir-content-left geodir-sidebar-wrap">
3244 3244
             <?php dynamic_sidebar('geodir_home_left'); ?>
3245 3245
         </div><!-- end geodir-content-left -->
@@ -3261,19 +3261,19 @@  discard block
 block discarded – undo
3261 3261
  */
3262 3262
 function geodir_action_home_sidebar_left()
3263 3263
 {
3264
-    if (get_option('geodir_show_home_left_section')) {
3264
+	if (get_option('geodir_show_home_left_section')) {
3265 3265
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3266
-        /** This action is documented in geodirectory_template_actions.php */
3267
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3268
-        /**
3269
-         * This is used to add the content to the home page left sidebar (if active).
3270
-         *
3271
-         * @since 1.0.0
3272
-         */
3273
-        do_action('geodir_home_sidebar_left_inside');
3274
-        /** This action is documented in geodirectory_template_actions.php */
3275
-        do_action('geodir_sidebar_left_close', 'home-page');
3276
-    }
3266
+		/** This action is documented in geodirectory_template_actions.php */
3267
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3268
+		/**
3269
+		 * This is used to add the content to the home page left sidebar (if active).
3270
+		 *
3271
+		 * @since 1.0.0
3272
+		 */
3273
+		do_action('geodir_home_sidebar_left_inside');
3274
+		/** This action is documented in geodirectory_template_actions.php */
3275
+		do_action('geodir_sidebar_left_close', 'home-page');
3276
+	}
3277 3277
 }
3278 3278
 
3279 3279
 /**
@@ -3286,7 +3286,7 @@  discard block
 block discarded – undo
3286 3286
  */
3287 3287
 function geodir_home_right_section()
3288 3288
 {
3289
-    if (get_option('geodir_show_home_right_section')) { ?>
3289
+	if (get_option('geodir_show_home_right_section')) { ?>
3290 3290
         <div class="geodir-content-right geodir-sidebar-wrap">
3291 3291
             <?php dynamic_sidebar('geodir_home_right'); ?>
3292 3292
         </div><!-- end geodir-content-right -->
@@ -3307,18 +3307,18 @@  discard block
 block discarded – undo
3307 3307
  */
3308 3308
 function geodir_action_home_sidebar_right()
3309 3309
 {
3310
-    if (get_option('geodir_show_home_right_section')) {
3311
-        /** This action is documented in geodirectory_template_actions.php */
3312
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3313
-        /**
3314
-         * This is used to add the content to the home page right sidebar (if active).
3315
-         *
3316
-         * @since 1.0.0
3317
-         */
3318
-        do_action('geodir_home_sidebar_right_inside');
3319
-        /** This action is documented in geodirectory_template_actions.php */
3320
-        do_action('geodir_sidebar_right_close', 'home-page');
3321
-    }
3310
+	if (get_option('geodir_show_home_right_section')) {
3311
+		/** This action is documented in geodirectory_template_actions.php */
3312
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3313
+		/**
3314
+		 * This is used to add the content to the home page right sidebar (if active).
3315
+		 *
3316
+		 * @since 1.0.0
3317
+		 */
3318
+		do_action('geodir_home_sidebar_right_inside');
3319
+		/** This action is documented in geodirectory_template_actions.php */
3320
+		do_action('geodir_sidebar_right_close', 'home-page');
3321
+	}
3322 3322
 }
3323 3323
 
3324 3324
 /**
@@ -3329,7 +3329,7 @@  discard block
 block discarded – undo
3329 3329
  */
3330 3330
 function geodir_action_home_content_inside()
3331 3331
 {
3332
-    dynamic_sidebar('geodir_home_content');
3332
+	dynamic_sidebar('geodir_home_content');
3333 3333
 }
3334 3334
 
3335 3335
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3344,28 +3344,28 @@  discard block
 block discarded – undo
3344 3344
  */
3345 3345
 function geodir_action_home_content()
3346 3346
 {
3347
-    /** This action is documented in geodirectory_template_actions.php */
3348
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3349
-    /**
3350
-     * This called before the home page main content.
3351
-     *
3352
-     * @since 1.0.0
3353
-     */
3354
-    do_action('geodir_before_home_content');
3355
-    /**
3356
-     * This is used to add the content to the home page main content.
3357
-     *
3358
-     * @since 1.0.0
3359
-     */
3360
-    do_action('geodir_home_content_inside');
3361
-    /**
3362
-     * This is called after the homepage main content.
3363
-     *
3364
-     * @since 1.0.0
3365
-     */
3366
-    do_action('geodir_after_home_content');
3367
-    /** This action is documented in geodirectory_template_actions.php */
3368
-    do_action('geodir_main_content_close', 'home-page');
3347
+	/** This action is documented in geodirectory_template_actions.php */
3348
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3349
+	/**
3350
+	 * This called before the home page main content.
3351
+	 *
3352
+	 * @since 1.0.0
3353
+	 */
3354
+	do_action('geodir_before_home_content');
3355
+	/**
3356
+	 * This is used to add the content to the home page main content.
3357
+	 *
3358
+	 * @since 1.0.0
3359
+	 */
3360
+	do_action('geodir_home_content_inside');
3361
+	/**
3362
+	 * This is called after the homepage main content.
3363
+	 *
3364
+	 * @since 1.0.0
3365
+	 */
3366
+	do_action('geodir_after_home_content');
3367
+	/** This action is documented in geodirectory_template_actions.php */
3368
+	do_action('geodir_main_content_close', 'home-page');
3369 3369
 }
3370 3370
 
3371 3371
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3380,11 +3380,11 @@  discard block
 block discarded – undo
3380 3380
  */
3381 3381
 function geodir_action_sidebar_home_bottom_section()
3382 3382
 {
3383
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3383
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3384 3384
         <div
3385 3385
             class="<?php
3386
-            /** This action is documented in geodirectory_template_actions.php */
3387
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3386
+			/** This action is documented in geodirectory_template_actions.php */
3387
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3388 3388
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3389 3389
         </div><!-- clearfix ends here-->
3390 3390
     <?php }
@@ -3412,13 +3412,13 @@  discard block
 block discarded – undo
3412 3412
  */
3413 3413
 function geodir_filter_listing_page_title($list_title)
3414 3414
 {
3415
-    if (is_search() && trim(get_search_query()) == '') {
3416
-        $gd_post_type = geodir_get_current_posttype();
3417
-        $post_type_info = get_post_type_object($gd_post_type);
3415
+	if (is_search() && trim(get_search_query()) == '') {
3416
+		$gd_post_type = geodir_get_current_posttype();
3417
+		$post_type_info = get_post_type_object($gd_post_type);
3418 3418
 
3419
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3420
-    }
3421
-    return $list_title;
3419
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3420
+	}
3421
+	return $list_title;
3422 3422
 }
3423 3423
 
3424 3424
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3433,62 +3433,62 @@  discard block
 block discarded – undo
3433 3433
  * @param string $gd_page The geodirectory page type. Default null.
3434 3434
  */
3435 3435
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3436
-    global $post;
3437
-
3438
-    $gd_page_id = NULL;
3439
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3440
-        $gd_page_id = geodir_home_page_id();
3441
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3442
-        $gd_page_id = geodir_preview_page_id();
3443
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3444
-        $gd_page_id = geodir_add_listing_page_id();
3445
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3446
-        $gd_page_id = geodir_success_page_id();
3447
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3448
-        $gd_page_id = geodir_location_page_id();
3449
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3450
-        $gd_page_id = geodir_info_page_id();
3451
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3452
-        $gd_page_id = geodir_login_page_id();
3453
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3454
-        $gd_page_id = geodir_payment_checkout_page_id();
3455
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3456
-        $gd_page_id = geodir_payment_invoices_page_id();
3457
-    }
3458
-
3459
-    if (!$gd_page_id > 0) {
3460
-        return;
3461
-    }
3436
+	global $post;
3437
+
3438
+	$gd_page_id = NULL;
3439
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3440
+		$gd_page_id = geodir_home_page_id();
3441
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3442
+		$gd_page_id = geodir_preview_page_id();
3443
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3444
+		$gd_page_id = geodir_add_listing_page_id();
3445
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3446
+		$gd_page_id = geodir_success_page_id();
3447
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3448
+		$gd_page_id = geodir_location_page_id();
3449
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3450
+		$gd_page_id = geodir_info_page_id();
3451
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3452
+		$gd_page_id = geodir_login_page_id();
3453
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3454
+		$gd_page_id = geodir_payment_checkout_page_id();
3455
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3456
+		$gd_page_id = geodir_payment_invoices_page_id();
3457
+	}
3458
+
3459
+	if (!$gd_page_id > 0) {
3460
+		return;
3461
+	}
3462 3462
     
3463
-    $display = 'before';
3464
-    /**
3465
-     * Filter the position to display the page content.
3466
-     *
3467
-     * @since 1.6.3
3468
-     *
3469
-     * @param string $display Position to add the post content.
3470
-     * @param string $gd_page The geodirectory page type.
3471
-     */
3472
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3473
-
3474
-    if ($position !== $display) {
3475
-        return;
3476
-    }
3477
-
3478
-    $gd_post = $post;
3463
+	$display = 'before';
3464
+	/**
3465
+	 * Filter the position to display the page content.
3466
+	 *
3467
+	 * @since 1.6.3
3468
+	 *
3469
+	 * @param string $display Position to add the post content.
3470
+	 * @param string $gd_page The geodirectory page type.
3471
+	 */
3472
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3473
+
3474
+	if ($position !== $display) {
3475
+		return;
3476
+	}
3477
+
3478
+	$gd_post = $post;
3479 3479
     
3480
-    setup_postdata(get_post($gd_page_id));
3480
+	setup_postdata(get_post($gd_page_id));
3481 3481
 
3482
-    if (get_the_content()) {
3483
-        ?>
3482
+	if (get_the_content()) {
3483
+		?>
3484 3484
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3485 3485
         <?php
3486
-    }
3486
+	}
3487 3487
 
3488
-    $post = $gd_post;
3489
-    if (!empty($gd_post) && is_object($gd_post)) {
3490
-        setup_postdata($gd_post);
3491
-    }
3488
+	$post = $gd_post;
3489
+	if (!empty($gd_post) && is_object($gd_post)) {
3490
+		setup_postdata($gd_post);
3491
+	}
3492 3492
 
3493 3493
 }
3494 3494
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3495 3495
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/helper_functions.php 2 patches
Indentation   +335 added lines, -335 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
  * @return int|null Return the page ID if present or null if not.
15 15
  */
16 16
 function geodir_add_listing_page_id(){
17
-    $gd_page_id = get_option('geodir_add_listing_page');
17
+	$gd_page_id = get_option('geodir_add_listing_page');
18 18
 
19
-    if (function_exists('icl_object_id')) {
20
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
21
-    }
19
+	if (function_exists('icl_object_id')) {
20
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
21
+	}
22 22
 
23
-    return $gd_page_id;
23
+	return $gd_page_id;
24 24
 }
25 25
 
26 26
 /**
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
  * @return int|null Return the page ID if present or null if not.
32 32
  */
33 33
 function geodir_preview_page_id(){
34
-    $gd_page_id = get_option('geodir_preview_page');
34
+	$gd_page_id = get_option('geodir_preview_page');
35 35
 
36
-    if (function_exists('icl_object_id')) {
37
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
38
-    }
36
+	if (function_exists('icl_object_id')) {
37
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
38
+	}
39 39
 
40
-    return $gd_page_id;
40
+	return $gd_page_id;
41 41
 }
42 42
 
43 43
 /**
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
  * @return int|null Return the page ID if present or null if not.
49 49
  */
50 50
 function geodir_success_page_id(){
51
-    $gd_page_id = get_option('geodir_success_page');
51
+	$gd_page_id = get_option('geodir_success_page');
52 52
 
53
-    if (function_exists('icl_object_id')) {
54
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
55
-    }
53
+	if (function_exists('icl_object_id')) {
54
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
55
+	}
56 56
 
57
-    return $gd_page_id;
57
+	return $gd_page_id;
58 58
 }
59 59
 
60 60
 /**
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
  * @return int|null Return the page ID if present or null if not.
66 66
  */
67 67
 function geodir_location_page_id(){
68
-    $gd_page_id = get_option('geodir_location_page');
68
+	$gd_page_id = get_option('geodir_location_page');
69 69
 
70
-    if (function_exists('icl_object_id')) {
71
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
72
-    }
70
+	if (function_exists('icl_object_id')) {
71
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
72
+	}
73 73
 
74
-    return $gd_page_id;
74
+	return $gd_page_id;
75 75
 }
76 76
 
77 77
 /**
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
  * @return int|null Return the page ID if present or null if not.
83 83
  */
84 84
 function geodir_home_page_id(){
85
-    $gd_page_id = get_option('geodir_home_page');
85
+	$gd_page_id = get_option('geodir_home_page');
86 86
 
87
-    if (function_exists('icl_object_id')) {
88
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
89
-    }
87
+	if (function_exists('icl_object_id')) {
88
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
89
+	}
90 90
 
91
-    return $gd_page_id;
91
+	return $gd_page_id;
92 92
 }
93 93
 
94 94
 /**
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
  * @return int|null Return the page ID if present or null if not.
100 100
  */
101 101
 function geodir_info_page_id(){
102
-    $gd_page_id = get_option('geodir_info_page');
102
+	$gd_page_id = get_option('geodir_info_page');
103 103
 
104
-    if (function_exists('icl_object_id')) {
105
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
106
-    }
104
+	if (function_exists('icl_object_id')) {
105
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
106
+	}
107 107
 
108
-    return $gd_page_id;
108
+	return $gd_page_id;
109 109
 }
110 110
 
111 111
 /**
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
  * @return int|null Return the page ID if present or null if not.
117 117
  */
118 118
 function geodir_login_page_id(){
119
-    $gd_page_id = get_option('geodir_login_page');
119
+	$gd_page_id = get_option('geodir_login_page');
120 120
 
121
-    if (function_exists('icl_object_id')) {
122
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
123
-    }
121
+	if (function_exists('icl_object_id')) {
122
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
123
+	}
124 124
 
125
-    return $gd_page_id;
125
+	return $gd_page_id;
126 126
 }
127 127
 
128 128
 
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
  * @return int|null Return the page ID if present or null if not.
135 135
  */
136 136
 function geodir_login_url($args=array()){
137
-    $gd_page_id = get_option('geodir_login_page');
137
+	$gd_page_id = get_option('geodir_login_page');
138 138
 
139
-    if (function_exists('icl_object_id')) {
140
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
141
-    }
139
+	if (function_exists('icl_object_id')) {
140
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
141
+	}
142 142
 
143
-    if (function_exists('geodir_location_geo_home_link')) {
144
-        remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
145
-    }
143
+	if (function_exists('geodir_location_geo_home_link')) {
144
+		remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
145
+	}
146 146
 
147 147
 	if (defined('ICL_LANGUAGE_CODE')){
148 148
 		$home_url = icl_get_home_url();
@@ -150,35 +150,35 @@  discard block
 block discarded – undo
150 150
 		$home_url = home_url();
151 151
 	}
152 152
 
153
-    if (function_exists('geodir_location_geo_home_link')) {
154
-        add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
155
-    }
156
-
157
-    if($gd_page_id){
158
-        $post = get_post($gd_page_id);
159
-        $slug = $post->post_name;
160
-        //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
161
-        $login_url = trailingslashit($home_url)."$slug/";
162
-    }else{
163
-        $login_url = trailingslashit($home_url)."?geodir_signup=true";
164
-    }
165
-
166
-    if($args){
167
-        $login_url = add_query_arg($args,$login_url );
168
-    }
169
-
170
-    /**
171
-     * Filter the GeoDirectory login page url.
172
-     *
173
-     * This filter can be used to change the GeoDirectory page url.
174
-     *
175
-     * @since 1.5.3
176
-     * @package GeoDirectory
177
-     * @param string $login_url The url of the login page.
178
-     * @param array $args The array of query args used.
179
-     * @param int $gd_page_id The page id of the GD login page.
180
-     */
181
-    return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id);
153
+	if (function_exists('geodir_location_geo_home_link')) {
154
+		add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
155
+	}
156
+
157
+	if($gd_page_id){
158
+		$post = get_post($gd_page_id);
159
+		$slug = $post->post_name;
160
+		//$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
161
+		$login_url = trailingslashit($home_url)."$slug/";
162
+	}else{
163
+		$login_url = trailingslashit($home_url)."?geodir_signup=true";
164
+	}
165
+
166
+	if($args){
167
+		$login_url = add_query_arg($args,$login_url );
168
+	}
169
+
170
+	/**
171
+	 * Filter the GeoDirectory login page url.
172
+	 *
173
+	 * This filter can be used to change the GeoDirectory page url.
174
+	 *
175
+	 * @since 1.5.3
176
+	 * @package GeoDirectory
177
+	 * @param string $login_url The url of the login page.
178
+	 * @param array $args The array of query args used.
179
+	 * @param int $gd_page_id The page id of the GD login page.
180
+	 */
181
+	return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id);
182 182
 }
183 183
 
184 184
 /**
@@ -190,15 +190,15 @@  discard block
 block discarded – undo
190 190
  * @return string Info page url.
191 191
  */
192 192
 function geodir_info_url($args=array()){
193
-    $gd_page_id = get_option('geodir_info_page');
193
+	$gd_page_id = get_option('geodir_info_page');
194 194
 
195
-    if (function_exists('icl_object_id')) {
196
-	    $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
197
-    }
195
+	if (function_exists('icl_object_id')) {
196
+		$gd_page_id =  icl_object_id($gd_page_id, 'page', true);
197
+	}
198 198
 
199
-    if (function_exists('geodir_location_geo_home_link')) {
200
-        remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
201
-    }
199
+	if (function_exists('geodir_location_geo_home_link')) {
200
+		remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
201
+	}
202 202
 
203 203
 	if (defined('ICL_LANGUAGE_CODE')){
204 204
 		$home_url = icl_get_home_url();
@@ -206,24 +206,24 @@  discard block
 block discarded – undo
206 206
 		$home_url = home_url();
207 207
 	}
208 208
 
209
-    if (function_exists('geodir_location_geo_home_link')) {
210
-        add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
211
-    }
209
+	if (function_exists('geodir_location_geo_home_link')) {
210
+		add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
211
+	}
212 212
 
213
-    if($gd_page_id){
214
-        $post = get_post($gd_page_id);
215
-        $slug = $post->post_name;
216
-        //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
217
-        $info_url = trailingslashit($home_url)."$slug/";
218
-    }else{
219
-        $info_url = trailingslashit($home_url);
220
-    }
213
+	if($gd_page_id){
214
+		$post = get_post($gd_page_id);
215
+		$slug = $post->post_name;
216
+		//$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
217
+		$info_url = trailingslashit($home_url)."$slug/";
218
+	}else{
219
+		$info_url = trailingslashit($home_url);
220
+	}
221 221
 
222
-    if($args){
223
-        $info_url = add_query_arg($args,$info_url );
224
-    }
222
+	if($args){
223
+		$info_url = add_query_arg($args,$info_url );
224
+	}
225 225
 
226
-    return $info_url;
226
+	return $info_url;
227 227
 }
228 228
 
229 229
 /**
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
  * @return string Returns converted string.
240 240
  */
241 241
 function geodir_ucwords($string, $charset='UTF-8') {
242
-    if (function_exists('mb_convert_case')) {
243
-        return mb_convert_case($string, MB_CASE_TITLE, $charset);
244
-    } else {
245
-        return ucwords($string);
246
-    }
242
+	if (function_exists('mb_convert_case')) {
243
+		return mb_convert_case($string, MB_CASE_TITLE, $charset);
244
+	} else {
245
+		return ucwords($string);
246
+	}
247 247
 }
248 248
 
249 249
 /**
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
  * @return string Returns converted string.
260 260
  */
261 261
 function geodir_strtolower($string, $charset='UTF-8') {
262
-    if (function_exists('mb_convert_case')) {
263
-        return mb_convert_case($string, MB_CASE_LOWER, $charset);
264
-    } else {
265
-        return strtolower($string);
266
-    }
262
+	if (function_exists('mb_convert_case')) {
263
+		return mb_convert_case($string, MB_CASE_LOWER, $charset);
264
+	} else {
265
+		return strtolower($string);
266
+	}
267 267
 }
268 268
 
269 269
 /**
@@ -279,11 +279,11 @@  discard block
 block discarded – undo
279 279
  * @return string Returns converted string.
280 280
  */
281 281
 function geodir_strtoupper($string, $charset='UTF-8') {
282
-    if (function_exists('mb_convert_case')) {
283
-        return mb_convert_case($string, MB_CASE_UPPER, $charset);
284
-    } else {
285
-        return strtoupper($string);
286
-    }
282
+	if (function_exists('mb_convert_case')) {
283
+		return mb_convert_case($string, MB_CASE_UPPER, $charset);
284
+	} else {
285
+		return strtoupper($string);
286
+	}
287 287
 }
288 288
 
289 289
 /**
@@ -462,11 +462,11 @@  discard block
 block discarded – undo
462 462
  * @package GeoDirectory
463 463
  */
464 464
 function _gd_die_handler() {
465
-    if ( defined( 'GD_TESTING_MODE' ) ) {
466
-        return '_gd_die_handler';
467
-    } else {
468
-        die();
469
-    }
465
+	if ( defined( 'GD_TESTING_MODE' ) ) {
466
+		return '_gd_die_handler';
467
+	} else {
468
+		die();
469
+	}
470 470
 }
471 471
 
472 472
 /**
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
  * @param int $status     Optional. Status code.
482 482
  */
483 483
 function gd_die( $message = '', $title = '', $status = 400 ) {
484
-    add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 );
485
-    add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 );
486
-    wp_die( $message, $title, array( 'response' => $status ));
484
+	add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 );
485
+	add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 );
486
+	wp_die( $message, $title, array( 'response' => $status ));
487 487
 }
488 488
 
489 489
 /*
@@ -652,37 +652,37 @@  discard block
 block discarded – undo
652 652
  * @return string The formatted date.
653 653
  */
654 654
 function geodir_date($date_input, $date_to, $date_from = '') {
655
-    if (empty($date_input) || empty($date_to)) {
656
-        return NULL;
657
-    }
655
+	if (empty($date_input) || empty($date_to)) {
656
+		return NULL;
657
+	}
658 658
     
659
-    $date = '';
660
-    if (!empty($date_from)) {
661
-        $datetime = date_create_from_format($date_from, $date_input);
659
+	$date = '';
660
+	if (!empty($date_from)) {
661
+		$datetime = date_create_from_format($date_from, $date_input);
662 662
         
663
-        if (!empty($datetime)) {
664
-            $date = $datetime->format($date_to);
665
-        }
666
-    }
663
+		if (!empty($datetime)) {
664
+			$date = $datetime->format($date_to);
665
+		}
666
+	}
667 667
     
668
-    if (empty($date)) {
669
-        $date = strpos($date_input, '/') !== false ? str_replace('/', '-', $date_input) : $date_input;
670
-        $date = date_i18n($date_to, strtotime($date));
671
-    }
668
+	if (empty($date)) {
669
+		$date = strpos($date_input, '/') !== false ? str_replace('/', '-', $date_input) : $date_input;
670
+		$date = date_i18n($date_to, strtotime($date));
671
+	}
672 672
     
673
-    $date = geodir_maybe_untranslate_date($date);
674
-    /**
675
-     * Filter the the date format conversion.
676
-     *
677
-     * @since 1.6.7
678
-     * @package GeoDirectory
679
-     *
680
-     * @param string $date The date string.
681
-     * @param string $date_input The date input.
682
-     * @param string $date_to The destination date format.
683
-     * @param string $date_from The source date format.
684
-     */
685
-    return apply_filters('geodir_date', $date, $date_input, $date_to, $date_from);
673
+	$date = geodir_maybe_untranslate_date($date);
674
+	/**
675
+	 * Filter the the date format conversion.
676
+	 *
677
+	 * @since 1.6.7
678
+	 * @package GeoDirectory
679
+	 *
680
+	 * @param string $date The date string.
681
+	 * @param string $date_input The date input.
682
+	 * @param string $date_to The destination date format.
683
+	 * @param string $date_from The source date format.
684
+	 */
685
+	return apply_filters('geodir_date', $date, $date_input, $date_to, $date_from);
686 686
 }
687 687
 
688 688
 /**
@@ -707,91 +707,91 @@  discard block
 block discarded – undo
707 707
  * @return string Trimmed string.
708 708
  */
709 709
 function geodir_excerpt($text, $length = 100, array $options = []) {
710
-    if (!(int)$length > 0) {
711
-        return $text;
712
-    }
713
-    $default = [
714
-        'ellipsis' => '', 'exact' => true, 'html' => true, 'trimWidth' => false,
715
-    ];
716
-    if (!empty($options['html']) && strtolower(mb_internal_encoding()) === 'utf-8') {
717
-        $default['ellipsis'] = "";
718
-    }
719
-    $options += $default;
720
-
721
-    $prefix = '';
722
-    $suffix = $options['ellipsis'];
723
-
724
-    if ($options['html']) {
725
-        $ellipsisLength = geodir_strlen(strip_tags($options['ellipsis']), $options);
726
-
727
-        $truncateLength = 0;
728
-        $totalLength = 0;
729
-        $openTags = [];
730
-        $truncate = '';
731
-
732
-        preg_match_all('/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);
733
-        foreach ($tags as $tag) {
734
-            $contentLength = geodir_strlen($tag[3], $options);
735
-
736
-            if ($truncate === '') {
737
-                if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/i', $tag[2])) {
738
-                    if (preg_match('/<[\w]+[^>]*>/', $tag[0])) {
739
-                        array_unshift($openTags, $tag[2]);
740
-                    } elseif (preg_match('/<\/([\w]+)[^>]*>/', $tag[0], $closeTag)) {
741
-                        $pos = array_search($closeTag[1], $openTags);
742
-                        if ($pos !== false) {
743
-                            array_splice($openTags, $pos, 1);
744
-                        }
745
-                    }
746
-                }
747
-
748
-                $prefix .= $tag[1];
749
-
750
-                if ($totalLength + $contentLength + $ellipsisLength > $length) {
751
-                    $truncate = $tag[3];
752
-                    $truncateLength = $length - $totalLength;
753
-                } else {
754
-                    $prefix .= $tag[3];
755
-                }
756
-            }
757
-
758
-            $totalLength += $contentLength;
759
-            if ($totalLength > $length) {
760
-                break;
761
-            }
762
-        }
763
-
764
-        if ($totalLength <= $length) {
765
-            return $text;
766
-        }
767
-
768
-        $text = $truncate;
769
-        $length = $truncateLength;
770
-
771
-        foreach ($openTags as $tag) {
772
-            $suffix .= '</' . $tag . '>';
773
-        }
774
-    } else {
775
-        if (geodir_strlen($text, $options) <= $length) {
776
-            return $text;
777
-        }
778
-        $ellipsisLength = geodir_strlen($options['ellipsis'], $options);
779
-    }
780
-
781
-    $result = geodir_substr($text, 0, $length - $ellipsisLength, $options);
782
-
783
-    if (!$options['exact']) {
784
-        if (geodir_substr($text, $length - $ellipsisLength, 1, $options) !== ' ') {
785
-            $result = geodir_remove_last_word($result);
786
-        }
787
-
788
-        // Do not need to count ellipsis in the cut, if result is empty.
789
-        if (!strlen($result)) {
790
-            $result = geodir_substr($text, 0, $length, $options);
791
-        }
792
-    }
793
-
794
-    return $prefix . $result . $suffix;
710
+	if (!(int)$length > 0) {
711
+		return $text;
712
+	}
713
+	$default = [
714
+		'ellipsis' => '', 'exact' => true, 'html' => true, 'trimWidth' => false,
715
+	];
716
+	if (!empty($options['html']) && strtolower(mb_internal_encoding()) === 'utf-8') {
717
+		$default['ellipsis'] = "";
718
+	}
719
+	$options += $default;
720
+
721
+	$prefix = '';
722
+	$suffix = $options['ellipsis'];
723
+
724
+	if ($options['html']) {
725
+		$ellipsisLength = geodir_strlen(strip_tags($options['ellipsis']), $options);
726
+
727
+		$truncateLength = 0;
728
+		$totalLength = 0;
729
+		$openTags = [];
730
+		$truncate = '';
731
+
732
+		preg_match_all('/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);
733
+		foreach ($tags as $tag) {
734
+			$contentLength = geodir_strlen($tag[3], $options);
735
+
736
+			if ($truncate === '') {
737
+				if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/i', $tag[2])) {
738
+					if (preg_match('/<[\w]+[^>]*>/', $tag[0])) {
739
+						array_unshift($openTags, $tag[2]);
740
+					} elseif (preg_match('/<\/([\w]+)[^>]*>/', $tag[0], $closeTag)) {
741
+						$pos = array_search($closeTag[1], $openTags);
742
+						if ($pos !== false) {
743
+							array_splice($openTags, $pos, 1);
744
+						}
745
+					}
746
+				}
747
+
748
+				$prefix .= $tag[1];
749
+
750
+				if ($totalLength + $contentLength + $ellipsisLength > $length) {
751
+					$truncate = $tag[3];
752
+					$truncateLength = $length - $totalLength;
753
+				} else {
754
+					$prefix .= $tag[3];
755
+				}
756
+			}
757
+
758
+			$totalLength += $contentLength;
759
+			if ($totalLength > $length) {
760
+				break;
761
+			}
762
+		}
763
+
764
+		if ($totalLength <= $length) {
765
+			return $text;
766
+		}
767
+
768
+		$text = $truncate;
769
+		$length = $truncateLength;
770
+
771
+		foreach ($openTags as $tag) {
772
+			$suffix .= '</' . $tag . '>';
773
+		}
774
+	} else {
775
+		if (geodir_strlen($text, $options) <= $length) {
776
+			return $text;
777
+		}
778
+		$ellipsisLength = geodir_strlen($options['ellipsis'], $options);
779
+	}
780
+
781
+	$result = geodir_substr($text, 0, $length - $ellipsisLength, $options);
782
+
783
+	if (!$options['exact']) {
784
+		if (geodir_substr($text, $length - $ellipsisLength, 1, $options) !== ' ') {
785
+			$result = geodir_remove_last_word($result);
786
+		}
787
+
788
+		// Do not need to count ellipsis in the cut, if result is empty.
789
+		if (!strlen($result)) {
790
+			$result = geodir_substr($text, 0, $length, $options);
791
+		}
792
+	}
793
+
794
+	return $prefix . $result . $suffix;
795 795
 }
796 796
 
797 797
 /**
@@ -815,28 +815,28 @@  discard block
 block discarded – undo
815 815
  * @return int
816 816
  */
817 817
 function geodir_strlen($text, array $options) {
818
-    if (empty($options['trimWidth'])) {
819
-        $strlen = 'mb_strlen';
820
-    } else {
821
-        $strlen = 'mb_strwidth';
822
-    }
823
-
824
-    if (empty($options['html'])) {
825
-        return $strlen($text);
826
-    }
827
-
828
-    $pattern = '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i';
829
-    $replace = preg_replace_callback(
830
-        $pattern,
831
-        function ($match) use ($strlen) {
832
-            $utf8 = html_entity_decode($match[0], ENT_HTML5 | ENT_QUOTES, 'UTF-8');
833
-
834
-            return str_repeat(' ', $strlen($utf8, 'UTF-8'));
835
-        },
836
-        $text
837
-    );
838
-
839
-    return $strlen($replace);
818
+	if (empty($options['trimWidth'])) {
819
+		$strlen = 'mb_strlen';
820
+	} else {
821
+		$strlen = 'mb_strwidth';
822
+	}
823
+
824
+	if (empty($options['html'])) {
825
+		return $strlen($text);
826
+	}
827
+
828
+	$pattern = '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i';
829
+	$replace = preg_replace_callback(
830
+		$pattern,
831
+		function ($match) use ($strlen) {
832
+			$utf8 = html_entity_decode($match[0], ENT_HTML5 | ENT_QUOTES, 'UTF-8');
833
+
834
+			return str_repeat(' ', $strlen($utf8, 'UTF-8'));
835
+		},
836
+		$text
837
+	);
838
+
839
+	return $strlen($replace);
840 840
 }
841 841
 
842 842
 /**
@@ -857,80 +857,80 @@  discard block
 block discarded – undo
857 857
  * @return string
858 858
  */
859 859
 function geodir_substr($text, $start, $length, array $options) {
860
-    if (empty($options['trimWidth'])) {
861
-        $substr = 'mb_substr';
862
-    } else {
863
-        $substr = 'mb_strimwidth';
864
-    }
865
-
866
-    $maxPosition = geodir_strlen($text, ['trimWidth' => false] + $options);
867
-    if ($start < 0) {
868
-        $start += $maxPosition;
869
-        if ($start < 0) {
870
-            $start = 0;
871
-        }
872
-    }
873
-    if ($start >= $maxPosition) {
874
-        return '';
875
-    }
876
-
877
-    if ($length === null) {
878
-        $length = geodir_strlen($text, $options);
879
-    }
880
-
881
-    if ($length < 0) {
882
-        $text = geodir_substr($text, $start, null, $options);
883
-        $start = 0;
884
-        $length += geodir_strlen($text, $options);
885
-    }
886
-
887
-    if ($length <= 0) {
888
-        return '';
889
-    }
890
-
891
-    if (empty($options['html'])) {
892
-        return (string)$substr($text, $start, $length);
893
-    }
894
-
895
-    $totalOffset = 0;
896
-    $totalLength = 0;
897
-    $result = '';
898
-
899
-    $pattern = '/(&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};)/i';
900
-    $parts = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
901
-    foreach ($parts as $part) {
902
-        $offset = 0;
903
-
904
-        if ($totalOffset < $start) {
905
-            $len = geodir_strlen($part, ['trimWidth' => false] + $options);
906
-            if ($totalOffset + $len <= $start) {
907
-                $totalOffset += $len;
908
-                continue;
909
-            }
910
-
911
-            $offset = $start - $totalOffset;
912
-            $totalOffset = $start;
913
-        }
914
-
915
-        $len = geodir_strlen($part, $options);
916
-        if ($offset !== 0 || $totalLength + $len > $length) {
917
-            if (strpos($part, '&') === 0 && preg_match($pattern, $part) && $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8') ) {
918
-                // Entities cannot be passed substr.
919
-                continue;
920
-            }
921
-
922
-            $part = $substr($part, $offset, $length - $totalLength);
923
-            $len = geodir_strlen($part, $options);
924
-        }
925
-
926
-        $result .= $part;
927
-        $totalLength += $len;
928
-        if ($totalLength >= $length) {
929
-            break;
930
-        }
931
-    }
932
-
933
-    return $result;
860
+	if (empty($options['trimWidth'])) {
861
+		$substr = 'mb_substr';
862
+	} else {
863
+		$substr = 'mb_strimwidth';
864
+	}
865
+
866
+	$maxPosition = geodir_strlen($text, ['trimWidth' => false] + $options);
867
+	if ($start < 0) {
868
+		$start += $maxPosition;
869
+		if ($start < 0) {
870
+			$start = 0;
871
+		}
872
+	}
873
+	if ($start >= $maxPosition) {
874
+		return '';
875
+	}
876
+
877
+	if ($length === null) {
878
+		$length = geodir_strlen($text, $options);
879
+	}
880
+
881
+	if ($length < 0) {
882
+		$text = geodir_substr($text, $start, null, $options);
883
+		$start = 0;
884
+		$length += geodir_strlen($text, $options);
885
+	}
886
+
887
+	if ($length <= 0) {
888
+		return '';
889
+	}
890
+
891
+	if (empty($options['html'])) {
892
+		return (string)$substr($text, $start, $length);
893
+	}
894
+
895
+	$totalOffset = 0;
896
+	$totalLength = 0;
897
+	$result = '';
898
+
899
+	$pattern = '/(&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};)/i';
900
+	$parts = preg_split($pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
901
+	foreach ($parts as $part) {
902
+		$offset = 0;
903
+
904
+		if ($totalOffset < $start) {
905
+			$len = geodir_strlen($part, ['trimWidth' => false] + $options);
906
+			if ($totalOffset + $len <= $start) {
907
+				$totalOffset += $len;
908
+				continue;
909
+			}
910
+
911
+			$offset = $start - $totalOffset;
912
+			$totalOffset = $start;
913
+		}
914
+
915
+		$len = geodir_strlen($part, $options);
916
+		if ($offset !== 0 || $totalLength + $len > $length) {
917
+			if (strpos($part, '&') === 0 && preg_match($pattern, $part) && $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8') ) {
918
+				// Entities cannot be passed substr.
919
+				continue;
920
+			}
921
+
922
+			$part = $substr($part, $offset, $length - $totalLength);
923
+			$len = geodir_strlen($part, $options);
924
+		}
925
+
926
+		$result .= $part;
927
+		$totalLength += $len;
928
+		if ($totalLength >= $length) {
929
+			break;
930
+		}
931
+	}
932
+
933
+	return $result;
934 934
 }
935 935
 
936 936
 /**
@@ -943,21 +943,21 @@  discard block
 block discarded – undo
943 943
  * @return string
944 944
  */
945 945
 function geodir_remove_last_word($text) {
946
-    $spacepos = mb_strrpos($text, ' ');
946
+	$spacepos = mb_strrpos($text, ' ');
947 947
 
948
-    if ($spacepos !== false) {
949
-        $lastWord = mb_strrpos($text, $spacepos);
948
+	if ($spacepos !== false) {
949
+		$lastWord = mb_strrpos($text, $spacepos);
950 950
 
951
-        // Some languages are written without word separation.
952
-        // We recognize a string as a word if it does not contain any full-width characters.
953
-        if (mb_strwidth($lastWord) === mb_strlen($lastWord)) {
954
-            $text = mb_substr($text, 0, $spacepos);
955
-        }
951
+		// Some languages are written without word separation.
952
+		// We recognize a string as a word if it does not contain any full-width characters.
953
+		if (mb_strwidth($lastWord) === mb_strlen($lastWord)) {
954
+			$text = mb_substr($text, 0, $spacepos);
955
+		}
956 956
 
957
-        return $text;
958
-    }
957
+		return $text;
958
+	}
959 959
 
960
-    return '';
960
+	return '';
961 961
 }
962 962
 
963 963
 function geodir_tool_restore_cpt_from_taxonomies(){
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  * @since 1.4.6
14 14
  * @return int|null Return the page ID if present or null if not.
15 15
  */
16
-function geodir_add_listing_page_id(){
16
+function geodir_add_listing_page_id() {
17 17
     $gd_page_id = get_option('geodir_add_listing_page');
18 18
 
19 19
     if (function_exists('icl_object_id')) {
20
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
20
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
21 21
     }
22 22
 
23 23
     return $gd_page_id;
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
  * @since 1.4.6
31 31
  * @return int|null Return the page ID if present or null if not.
32 32
  */
33
-function geodir_preview_page_id(){
33
+function geodir_preview_page_id() {
34 34
     $gd_page_id = get_option('geodir_preview_page');
35 35
 
36 36
     if (function_exists('icl_object_id')) {
37
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
37
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
38 38
     }
39 39
 
40 40
     return $gd_page_id;
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
  * @since 1.4.6
48 48
  * @return int|null Return the page ID if present or null if not.
49 49
  */
50
-function geodir_success_page_id(){
50
+function geodir_success_page_id() {
51 51
     $gd_page_id = get_option('geodir_success_page');
52 52
 
53 53
     if (function_exists('icl_object_id')) {
54
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
54
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
55 55
     }
56 56
 
57 57
     return $gd_page_id;
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
  * @since 1.4.6
65 65
  * @return int|null Return the page ID if present or null if not.
66 66
  */
67
-function geodir_location_page_id(){
67
+function geodir_location_page_id() {
68 68
     $gd_page_id = get_option('geodir_location_page');
69 69
 
70 70
     if (function_exists('icl_object_id')) {
71
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
71
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
72 72
     }
73 73
 
74 74
     return $gd_page_id;
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
  * @since 1.5.4
82 82
  * @return int|null Return the page ID if present or null if not.
83 83
  */
84
-function geodir_home_page_id(){
84
+function geodir_home_page_id() {
85 85
     $gd_page_id = get_option('geodir_home_page');
86 86
 
87 87
     if (function_exists('icl_object_id')) {
88
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
88
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
89 89
     }
90 90
 
91 91
     return $gd_page_id;
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
  * @since 1.5.3
99 99
  * @return int|null Return the page ID if present or null if not.
100 100
  */
101
-function geodir_info_page_id(){
101
+function geodir_info_page_id() {
102 102
     $gd_page_id = get_option('geodir_info_page');
103 103
 
104 104
     if (function_exists('icl_object_id')) {
105
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
105
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
106 106
     }
107 107
 
108 108
     return $gd_page_id;
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
  * @since 1.5.3
116 116
  * @return int|null Return the page ID if present or null if not.
117 117
  */
118
-function geodir_login_page_id(){
118
+function geodir_login_page_id() {
119 119
     $gd_page_id = get_option('geodir_login_page');
120 120
 
121 121
     if (function_exists('icl_object_id')) {
122
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
122
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
123 123
     }
124 124
 
125 125
     return $gd_page_id;
@@ -133,20 +133,20 @@  discard block
 block discarded – undo
133 133
  * @since 1.5.3
134 134
  * @return int|null Return the page ID if present or null if not.
135 135
  */
136
-function geodir_login_url($args=array()){
136
+function geodir_login_url($args = array()) {
137 137
     $gd_page_id = get_option('geodir_login_page');
138 138
 
139 139
     if (function_exists('icl_object_id')) {
140
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
140
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
141 141
     }
142 142
 
143 143
     if (function_exists('geodir_location_geo_home_link')) {
144 144
         remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
145 145
     }
146 146
 
147
-	if (defined('ICL_LANGUAGE_CODE')){
147
+	if (defined('ICL_LANGUAGE_CODE')) {
148 148
 		$home_url = icl_get_home_url();
149
-	}else{
149
+	} else {
150 150
 		$home_url = home_url();
151 151
 	}
152 152
 
@@ -154,17 +154,17 @@  discard block
 block discarded – undo
154 154
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
155 155
     }
156 156
 
157
-    if($gd_page_id){
157
+    if ($gd_page_id) {
158 158
         $post = get_post($gd_page_id);
159 159
         $slug = $post->post_name;
160 160
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
161 161
         $login_url = trailingslashit($home_url)."$slug/";
162
-    }else{
162
+    } else {
163 163
         $login_url = trailingslashit($home_url)."?geodir_signup=true";
164 164
     }
165 165
 
166
-    if($args){
167
-        $login_url = add_query_arg($args,$login_url );
166
+    if ($args) {
167
+        $login_url = add_query_arg($args, $login_url);
168 168
     }
169 169
 
170 170
     /**
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      * @param array $args The array of query args used.
179 179
      * @param int $gd_page_id The page id of the GD login page.
180 180
      */
181
-    return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id);
181
+    return apply_filters('geodir_login_url', $login_url, $args, $gd_page_id);
182 182
 }
183 183
 
184 184
 /**
@@ -189,20 +189,20 @@  discard block
 block discarded – undo
189 189
  * @since 1.5.16 Added WPML lang code to url.
190 190
  * @return string Info page url.
191 191
  */
192
-function geodir_info_url($args=array()){
192
+function geodir_info_url($args = array()) {
193 193
     $gd_page_id = get_option('geodir_info_page');
194 194
 
195 195
     if (function_exists('icl_object_id')) {
196
-	    $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
196
+	    $gd_page_id = icl_object_id($gd_page_id, 'page', true);
197 197
     }
198 198
 
199 199
     if (function_exists('geodir_location_geo_home_link')) {
200 200
         remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
201 201
     }
202 202
 
203
-	if (defined('ICL_LANGUAGE_CODE')){
203
+	if (defined('ICL_LANGUAGE_CODE')) {
204 204
 		$home_url = icl_get_home_url();
205
-	}else{
205
+	} else {
206 206
 		$home_url = home_url();
207 207
 	}
208 208
 
@@ -210,17 +210,17 @@  discard block
 block discarded – undo
210 210
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
211 211
     }
212 212
 
213
-    if($gd_page_id){
213
+    if ($gd_page_id) {
214 214
         $post = get_post($gd_page_id);
215 215
         $slug = $post->post_name;
216 216
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
217 217
         $info_url = trailingslashit($home_url)."$slug/";
218
-    }else{
218
+    } else {
219 219
         $info_url = trailingslashit($home_url);
220 220
     }
221 221
 
222
-    if($args){
223
-        $info_url = add_query_arg($args,$info_url );
222
+    if ($args) {
223
+        $info_url = add_query_arg($args, $info_url);
224 224
     }
225 225
 
226 226
     return $info_url;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
  * @param string $charset Character set to use for conversion.
239 239
  * @return string Returns converted string.
240 240
  */
241
-function geodir_ucwords($string, $charset='UTF-8') {
241
+function geodir_ucwords($string, $charset = 'UTF-8') {
242 242
     if (function_exists('mb_convert_case')) {
243 243
         return mb_convert_case($string, MB_CASE_TITLE, $charset);
244 244
     } else {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
  * @param string $charset Character set to use for conversion.
259 259
  * @return string Returns converted string.
260 260
  */
261
-function geodir_strtolower($string, $charset='UTF-8') {
261
+function geodir_strtolower($string, $charset = 'UTF-8') {
262 262
     if (function_exists('mb_convert_case')) {
263 263
         return mb_convert_case($string, MB_CASE_LOWER, $charset);
264 264
     } else {
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
  * @param string $charset Character set to use for conversion.
279 279
  * @return string Returns converted string.
280 280
  */
281
-function geodir_strtoupper($string, $charset='UTF-8') {
281
+function geodir_strtoupper($string, $charset = 'UTF-8') {
282 282
     if (function_exists('mb_convert_case')) {
283 283
         return mb_convert_case($string, MB_CASE_UPPER, $charset);
284 284
     } else {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 	
310 310
 	$url = trim($parts[0]);
311 311
 	if ($formatted && $url != '') {
312
-		$url = str_replace( ' ', '%20', $url );
312
+		$url = str_replace(' ', '%20', $url);
313 313
 		$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
314 314
 		
315 315
 		if (0 !== stripos($url, 'mailto:')) {
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
 		
320 320
 		$url = str_replace(';//', '://', $url);
321 321
 		
322
-		if (strpos($url, ':') === false && ! in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
323
-			$url = 'http://' . $url;
322
+		if (strpos($url, ':') === false && !in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
323
+			$url = 'http://'.$url;
324 324
 		}
325 325
 		
326 326
 		$url = wp_kses_normalize_entities($url);
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
  * @package GeoDirectory
463 463
  */
464 464
 function _gd_die_handler() {
465
-    if ( defined( 'GD_TESTING_MODE' ) ) {
465
+    if (defined('GD_TESTING_MODE')) {
466 466
         return '_gd_die_handler';
467 467
     } else {
468 468
         die();
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
  * @param string $title   Optional. Error title.
481 481
  * @param int $status     Optional. Status code.
482 482
  */
483
-function gd_die( $message = '', $title = '', $status = 400 ) {
484
-    add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 );
485
-    add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 );
486
-    wp_die( $message, $title, array( 'response' => $status ));
483
+function gd_die($message = '', $title = '', $status = 400) {
484
+    add_filter('wp_die_ajax_handler', '_gd_die_handler', 10, 3);
485
+    add_filter('wp_die_handler', '_gd_die_handler', 10, 3);
486
+    wp_die($message, $title, array('response' => $status));
487 487
 }
488 488
 
489 489
 /*
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
  * @param string $php_format The PHP date format.
494 494
  * @return string The jQuery format date string.
495 495
  */
496
-function geodir_date_format_php_to_jqueryui( $php_format ) {
496
+function geodir_date_format_php_to_jqueryui($php_format) {
497 497
 	$symbols = array(
498 498
 		// Day
499 499
 		'd' => 'dd',
@@ -533,27 +533,27 @@  discard block
 block discarded – undo
533 533
 	$jqueryui_format = "";
534 534
 	$escaping = false;
535 535
 
536
-	for ( $i = 0; $i < strlen( $php_format ); $i++ ) {
536
+	for ($i = 0; $i < strlen($php_format); $i++) {
537 537
 		$char = $php_format[$i];
538 538
 
539 539
 		// PHP date format escaping character
540
-		if ( $char === '\\' ) {
540
+		if ($char === '\\') {
541 541
 			$i++;
542 542
 
543
-			if ( $escaping ) {
543
+			if ($escaping) {
544 544
 				$jqueryui_format .= $php_format[$i];
545 545
 			} else {
546
-				$jqueryui_format .= '\'' . $php_format[$i];
546
+				$jqueryui_format .= '\''.$php_format[$i];
547 547
 			}
548 548
 
549 549
 			$escaping = true;
550 550
 		} else {
551
-			if ( $escaping ) {
551
+			if ($escaping) {
552 552
 				$jqueryui_format .= "'";
553 553
 				$escaping = false;
554 554
 			}
555 555
 
556
-			if ( isset( $symbols[$char] ) ) {
556
+			if (isset($symbols[$char])) {
557 557
 				$jqueryui_format .= $symbols[$char];
558 558
 			} else {
559 559
 				$jqueryui_format .= $char;
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
  * @return string The untranslated date string.
573 573
  * @since 1.6.5
574 574
  */
575
-function geodir_maybe_untranslate_date($date){
575
+function geodir_maybe_untranslate_date($date) {
576 576
 	$english_long_months = array(
577 577
 		'January',
578 578
 		'February',
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 		'December',
589 589
 	);
590 590
 
591
-	$non_english_long_months  = array(
591
+	$non_english_long_months = array(
592 592
 		__('January'),
593 593
 		__('February'),
594 594
 		__('March'),
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 		__('November'),
603 603
 		__('December'),
604 604
 	);
605
-	$date = str_replace($non_english_long_months,$english_long_months,$date);
605
+	$date = str_replace($non_english_long_months, $english_long_months, $date);
606 606
 
607 607
 
608 608
 	$english_short_months = array(
@@ -621,21 +621,21 @@  discard block
 block discarded – undo
621 621
 	);
622 622
 
623 623
 	$non_english_short_months = array(
624
-		' '._x( 'Jan', 'January abbreviation' ).' ',
625
-		' '._x( 'Feb', 'February abbreviation' ).' ',
626
-		' '._x( 'Mar', 'March abbreviation' ).' ',
627
-		' '._x( 'Apr', 'April abbreviation' ).' ',
628
-		' '._x( 'May', 'May abbreviation' ).' ',
629
-		' '._x( 'Jun', 'June abbreviation' ).' ',
630
-		' '._x( 'Jul', 'July abbreviation' ).' ',
631
-		' '._x( 'Aug', 'August abbreviation' ).' ',
632
-		' '._x( 'Sep', 'September abbreviation' ).' ',
633
-		' '._x( 'Oct', 'October abbreviation' ).' ',
634
-		' '._x( 'Nov', 'November abbreviation' ).' ',
635
-		' '._x( 'Dec', 'December abbreviation' ).' ',
624
+		' '._x('Jan', 'January abbreviation').' ',
625
+		' '._x('Feb', 'February abbreviation').' ',
626
+		' '._x('Mar', 'March abbreviation').' ',
627
+		' '._x('Apr', 'April abbreviation').' ',
628
+		' '._x('May', 'May abbreviation').' ',
629
+		' '._x('Jun', 'June abbreviation').' ',
630
+		' '._x('Jul', 'July abbreviation').' ',
631
+		' '._x('Aug', 'August abbreviation').' ',
632
+		' '._x('Sep', 'September abbreviation').' ',
633
+		' '._x('Oct', 'October abbreviation').' ',
634
+		' '._x('Nov', 'November abbreviation').' ',
635
+		' '._x('Dec', 'December abbreviation').' ',
636 636
 	);
637 637
 
638
-	$date = str_replace($non_english_short_months,$english_short_months,$date);
638
+	$date = str_replace($non_english_short_months, $english_short_months, $date);
639 639
 
640 640
 
641 641
 	return $date;
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
  * @return string Trimmed string.
708 708
  */
709 709
 function geodir_excerpt($text, $length = 100, array $options = []) {
710
-    if (!(int)$length > 0) {
710
+    if (!(int) $length > 0) {
711 711
         return $text;
712 712
     }
713 713
     $default = [
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         $length = $truncateLength;
770 770
 
771 771
         foreach ($openTags as $tag) {
772
-            $suffix .= '</' . $tag . '>';
772
+            $suffix .= '</'.$tag.'>';
773 773
         }
774 774
     } else {
775 775
         if (geodir_strlen($text, $options) <= $length) {
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
         }
792 792
     }
793 793
 
794
-    return $prefix . $result . $suffix;
794
+    return $prefix.$result.$suffix;
795 795
 }
796 796
 
797 797
 /**
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
     $pattern = '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i';
829 829
     $replace = preg_replace_callback(
830 830
         $pattern,
831
-        function ($match) use ($strlen) {
831
+        function($match) use ($strlen) {
832 832
             $utf8 = html_entity_decode($match[0], ENT_HTML5 | ENT_QUOTES, 'UTF-8');
833 833
 
834 834
             return str_repeat(' ', $strlen($utf8, 'UTF-8'));
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
     }
890 890
 
891 891
     if (empty($options['html'])) {
892
-        return (string)$substr($text, $start, $length);
892
+        return (string) $substr($text, $start, $length);
893 893
     }
894 894
 
895 895
     $totalOffset = 0;
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 
915 915
         $len = geodir_strlen($part, $options);
916 916
         if ($offset !== 0 || $totalLength + $len > $length) {
917
-            if (strpos($part, '&') === 0 && preg_match($pattern, $part) && $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8') ) {
917
+            if (strpos($part, '&') === 0 && preg_match($pattern, $part) && $part !== html_entity_decode($part, ENT_HTML5 | ENT_QUOTES, 'UTF-8')) {
918 918
                 // Entities cannot be passed substr.
919 919
                 continue;
920 920
             }
@@ -960,39 +960,39 @@  discard block
 block discarded – undo
960 960
     return '';
961 961
 }
962 962
 
963
-function geodir_tool_restore_cpt_from_taxonomies(){
963
+function geodir_tool_restore_cpt_from_taxonomies() {
964 964
 
965 965
 	$cpts = get_option('geodir_post_types');
966 966
 
967
-	if(!empty($cpts)){return;}
967
+	if (!empty($cpts)) {return; }
968 968
 
969 969
 	$taxonomies = get_option('geodir_taxonomies');
970 970
 
971
-	if(empty($taxonomies)){return;}
971
+	if (empty($taxonomies)) {return; }
972 972
 
973 973
 	$cpts = array();
974 974
 
975
-	foreach($taxonomies as $key => $val){
975
+	foreach ($taxonomies as $key => $val) {
976 976
 
977
-		if(strpos($val['listing_slug'], '/') === false) {
978
-			$cpts[$val['object_type']] = array('cpt'=>$val['object_type'],'slug'=>$val['listing_slug']);
977
+		if (strpos($val['listing_slug'], '/') === false) {
978
+			$cpts[$val['object_type']] = array('cpt'=>$val['object_type'], 'slug'=>$val['listing_slug']);
979 979
 		}
980 980
 
981 981
 	}
982 982
 
983
-	if(empty($cpts)){return;}
983
+	if (empty($cpts)) {return; }
984 984
 
985 985
 
986 986
 	$cpts_restore = $cpts;
987 987
 
988
-	foreach($cpts as $cpt){
988
+	foreach ($cpts as $cpt) {
989 989
 
990 990
 
991
-		$is_custom = $cpt['cpt']=='gd_place' ? 0 : 1;
991
+		$is_custom = $cpt['cpt'] == 'gd_place' ? 0 : 1;
992 992
 
993
-		$cpts_restore[$cpt['cpt']] = array (
993
+		$cpts_restore[$cpt['cpt']] = array(
994 994
 				'labels' =>
995
-					array (
995
+					array(
996 996
 						'name' => $cpt['slug'],
997 997
 						'singular_name' => $cpt['slug'],
998 998
 						'add_new' => 'Add New',
@@ -1020,14 +1020,14 @@  discard block
 block discarded – undo
1020 1020
 				'public' => true,
1021 1021
 				'query_var' => true,
1022 1022
 				'rewrite' =>
1023
-					array (
1023
+					array(
1024 1024
 						'slug' => $cpt['slug'],
1025 1025
 						'with_front' => false,
1026 1026
 						'hierarchical' => true,
1027 1027
 						'feeds' => true,
1028 1028
 					),
1029 1029
 				'supports' =>
1030
-					array (
1030
+					array(
1031 1031
 						0 => 'title',
1032 1032
 						1 => 'editor',
1033 1033
 						2 => 'author',
@@ -1037,14 +1037,14 @@  discard block
 block discarded – undo
1037 1037
 						6 => 'comments',
1038 1038
 					),
1039 1039
 				'taxonomies' =>
1040
-					array (
1040
+					array(
1041 1041
 						0 => $cpt['cpt'].'category',
1042 1042
 						1 => $cpt['cpt'].'_tags',
1043 1043
 					),
1044 1044
 				'is_custom' => $is_custom,
1045 1045
 				'listing_order' => '1',
1046 1046
 				'seo' =>
1047
-					array (
1047
+					array(
1048 1048
 						'meta_keyword' => '',
1049 1049
 						'meta_description' => '',
1050 1050
 					),
@@ -1056,6 +1056,6 @@  discard block
 block discarded – undo
1056 1056
 	}
1057 1057
 
1058 1058
 
1059
-	update_option('geodir_post_types',$cpts_restore);
1059
+	update_option('geodir_post_types', $cpts_restore);
1060 1060
 
1061 1061
 }
Please login to merge, or discard this patch.