Passed
Push — master ( 28da55...e7ab79 )
by Stiofan
22:52
created
geodirectory-templates/geodir-information.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,27 +12,27 @@
 block discarded – undo
12 12
         <div class="clearfix">
13 13
             <div id="geodir_content">
14 14
                 <?php
15
-                /** This action is documented in geodirectory-templates/geodir-home.php */
16
-                do_action('geodir_add_page_content', 'before', 'info-page');
17
-                global $information;
18
-                echo '<h5 class="geodir_information">';
19
-                echo $information;
20
-                echo '</h5>';
21
-                /** This action is documented in geodirectory-templates/geodir-home.php */
22
-                do_action('geodir_add_page_content', 'after', 'info-page');
23
-                ?>
15
+				/** This action is documented in geodirectory-templates/geodir-home.php */
16
+				do_action('geodir_add_page_content', 'before', 'info-page');
17
+				global $information;
18
+				echo '<h5 class="geodir_information">';
19
+				echo $information;
20
+				echo '</h5>';
21
+				/** This action is documented in geodirectory-templates/geodir-home.php */
22
+				do_action('geodir_add_page_content', 'after', 'info-page');
23
+				?>
24 24
             </div>
25 25
             <!-- geodir_content ends here-->
26 26
             <div id="gd-sidebar-wrapper">
27 27
                 <div class="geodir-sidebar-main">
28 28
                     <div class="geodir-gd-sidebar">
29 29
                         <?php
30
-                        /**
31
-                         * Calls the standard sidebar.
32
-                         *
33
-                         * @since 1.0.0
34
-                         */
35
-                        do_action('geodir_sidebar'); ?>
30
+						/**
31
+						 * Calls the standard sidebar.
32
+						 *
33
+						 * @since 1.0.0
34
+						 */
35
+						do_action('geodir_sidebar'); ?>
36 36
                     </div>
37 37
                 </div>
38 38
             </div>
Please login to merge, or discard this patch.
geodirectory_template_actions.php 1 patch
Indentation   +1727 added lines, -1727 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,106 +275,106 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
279
-    if (empty($tc)) {
280
-        return;
281
-    }
278
+	$tc = get_option('theme_compatibility_setting');
279
+	if (empty($tc)) {
280
+		return;
281
+	}
282 282
 
283
-    //php
284
-    if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
-    }
283
+	//php
284
+	if (!empty($tc['geodir_theme_compat_code'])) {
285
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+	}
287 287
 
288
-    //geodir_full_page_class
289
-    if (!empty($tc['geodir_full_page_class_filter'])) {
290
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
-    }
288
+	//geodir_full_page_class
289
+	if (!empty($tc['geodir_full_page_class_filter'])) {
290
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
+	}
292 292
 
293
-    //widget before filter
294
-    if (!empty($tc['geodir_before_widget_filter'])) {
295
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
-    }
293
+	//widget before filter
294
+	if (!empty($tc['geodir_before_widget_filter'])) {
295
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
+	}
297 297
 
298
-    //widget after filter
299
-    if (!empty($tc['geodir_after_widget_filter'])) {
300
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
-    }
298
+	//widget after filter
299
+	if (!empty($tc['geodir_after_widget_filter'])) {
300
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
+	}
302 302
 
303
-    //widget before title filter
304
-    if (!empty($tc['geodir_before_title_filter'])) {
305
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
-    }
303
+	//widget before title filter
304
+	if (!empty($tc['geodir_before_title_filter'])) {
305
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
+	}
307 307
 
308
-    //widget before title filter
309
-    if (!empty($tc['geodir_after_title_filter'])) {
310
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
-    }
308
+	//widget before title filter
309
+	if (!empty($tc['geodir_after_title_filter'])) {
310
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
+	}
312 312
 
313
-    //menu li class
314
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
315
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
-    }
313
+	//menu li class
314
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
315
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
+	}
317 317
 
318
-    //menu ul class
319
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
-    }
318
+	//menu ul class
319
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
+	}
322 322
 
323
-    //menu sub li class
324
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
-    }
323
+	//menu sub li class
324
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
+	}
327 327
 
328
-    //menu a class
329
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
330
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
-    }
328
+	//menu a class
329
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
330
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
+	}
332 332
 
333
-    //menu sub a class
334
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
-    }
333
+	//menu sub a class
334
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
+	}
337 337
 
338
-    //location menu li class
339
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
-    }
338
+	//location menu li class
339
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
+	}
342 342
 
343
-    //location menu sub ul class
344
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
-    }
343
+	//location menu sub ul class
344
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
+	}
347 347
 
348
-    //location menu sub li class
349
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
-    }
348
+	//location menu sub li class
349
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
+	}
352 352
 
353
-    //location menu a class
354
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
-    }
353
+	//location menu a class
354
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
+	}
357 357
 
358
-    // compat styles
359
-    if (!empty($tc['geodir_theme_compat_css'])) {
360
-        add_action('wp_head', 'gd_compat_styles');
361
-    }
358
+	// compat styles
359
+	if (!empty($tc['geodir_theme_compat_css'])) {
360
+		add_action('wp_head', 'gd_compat_styles');
361
+	}
362 362
 
363
-    // compat js
364
-    if (!empty($tc['geodir_theme_compat_js'])) {
365
-        add_action('wp_footer', 'gd_compat_script');
366
-    }
363
+	// compat js
364
+	if (!empty($tc['geodir_theme_compat_js'])) {
365
+		add_action('wp_footer', 'gd_compat_script');
366
+	}
367 367
 
368 368
 
369
-    // geodir_top_content_add
370
-    if (!empty($tc['geodir_top_content_add'])) {
371
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
-    }
369
+	// geodir_top_content_add
370
+	if (!empty($tc['geodir_top_content_add'])) {
371
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
+	}
373 373
 
374
-    // geodir_before_main_content_add
375
-    if (!empty($tc['geodir_before_main_content_add'])) {
376
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
-    }
374
+	// geodir_before_main_content_add
375
+	if (!empty($tc['geodir_before_main_content_add'])) {
376
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
+	}
378 378
 
379 379
 
380 380
 }
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
  */
398 398
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
399 399
 {
400
-    $tc = get_option('theme_compatibility_setting');
401
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
402
-        $text = $tc['geodir_wrapper_open_replace'];
403
-    } else {
404
-        $text = '<div id="[id]" class="[class]">';
405
-    }
400
+	$tc = get_option('theme_compatibility_setting');
401
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
402
+		$text = $tc['geodir_wrapper_open_replace'];
403
+	} else {
404
+		$text = '<div id="[id]" class="[class]">';
405
+	}
406 406
 
407
-    if (!empty($tc['geodir_wrapper_open_id'])) {
408
-        $id = $tc['geodir_wrapper_open_id'];
409
-    }
410
-    if (!empty($tc['geodir_wrapper_open_class'])) {
411
-        $class = $tc['geodir_wrapper_open_class'];
412
-    }
407
+	if (!empty($tc['geodir_wrapper_open_id'])) {
408
+		$id = $tc['geodir_wrapper_open_id'];
409
+	}
410
+	if (!empty($tc['geodir_wrapper_open_class'])) {
411
+		$class = $tc['geodir_wrapper_open_class'];
412
+	}
413 413
 
414
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
414
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415 415
 
416
-    echo $text;
416
+	echo $text;
417 417
 }
418 418
 
419 419
 // action for adding the wrapperdiv closing tag
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
  */
429 429
 function geodir_action_wrapper_close($type = '')
430 430
 {
431
-    $tc = get_option('theme_compatibility_setting');
432
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
433
-        $text = $tc['geodir_wrapper_close_replace'];
434
-    } else {
435
-        $text = '</div><!-- wrapper ends here-->';
436
-    }
431
+	$tc = get_option('theme_compatibility_setting');
432
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
433
+		$text = $tc['geodir_wrapper_close_replace'];
434
+	} else {
435
+		$text = '</div><!-- wrapper ends here-->';
436
+	}
437 437
 
438
-    echo $text;
438
+	echo $text;
439 439
 }
440 440
 
441 441
 // action for adding the content div opening tag
@@ -451,35 +451,35 @@  discard block
 block discarded – undo
451 451
  */
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
456
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
458
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
460
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
462
-    } else {
463
-        $width_css = '';
464
-    }
465
-
466
-    $tc = get_option('theme_compatibility_setting');
467
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
-        $text = $tc['geodir_wrapper_content_open_replace'];
469
-    } else {
470
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
-    }
472
-
473
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
-        $id = $tc['geodir_wrapper_content_open_id'];
475
-    }
476
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
-        $class = $tc['geodir_wrapper_content_open_class'];
478
-    }
479
-
480
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
-
482
-    echo $text;
454
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
+		$width_css = 'style="width:' . $width . '%;"';
456
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
+		$width_css = 'style="width:' . $width . '%;"';
458
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
+		$width_css = 'style="width:' . $width . '%;"';
460
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
+		$width_css = 'style="width:' . $width . '%;"';
462
+	} else {
463
+		$width_css = '';
464
+	}
465
+
466
+	$tc = get_option('theme_compatibility_setting');
467
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
+		$text = $tc['geodir_wrapper_content_open_replace'];
469
+	} else {
470
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
+	}
472
+
473
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
+		$id = $tc['geodir_wrapper_content_open_id'];
475
+	}
476
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
+		$class = $tc['geodir_wrapper_content_open_class'];
478
+	}
479
+
480
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
+
482
+	echo $text;
483 483
 }
484 484
 
485 485
 // action for adding the primary div closing tag
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_action_wrapper_content_close($type = '')
495 495
 {
496
-    $tc = get_option('theme_compatibility_setting');
497
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
-        $text = $tc['geodir_wrapper_content_close_replace'];
499
-    } else {
500
-        $text = '</div><!-- content ends here-->';
501
-    }
502
-    echo $text;
496
+	$tc = get_option('theme_compatibility_setting');
497
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
+		$text = $tc['geodir_wrapper_content_close_replace'];
499
+	} else {
500
+		$text = '</div><!-- content ends here-->';
501
+	}
502
+	echo $text;
503 503
 }
504 504
 
505 505
 // action for adding the <article> opening tag
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
  */
518 518
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
519 519
 {
520
-    $class = implode(" ", $class);
521
-    $tc = get_option('theme_compatibility_setting');
522
-    if (!empty($tc['geodir_article_open_replace'])) {
523
-        $text = $tc['geodir_article_open_replace'];
524
-    } else {
525
-        $text = '<article  id="[id]" class="[class]" >';
526
-    }
520
+	$class = implode(" ", $class);
521
+	$tc = get_option('theme_compatibility_setting');
522
+	if (!empty($tc['geodir_article_open_replace'])) {
523
+		$text = $tc['geodir_article_open_replace'];
524
+	} else {
525
+		$text = '<article  id="[id]" class="[class]" >';
526
+	}
527 527
 
528
-    if (!empty($tc['geodir_article_open_id'])) {
529
-        $id = $tc['geodir_article_open_id'];
530
-    }
531
-    if (!empty($tc['geodir_article_open_class'])) {
532
-        $class = $tc['geodir_article_open_class'];
533
-    }
528
+	if (!empty($tc['geodir_article_open_id'])) {
529
+		$id = $tc['geodir_article_open_id'];
530
+	}
531
+	if (!empty($tc['geodir_article_open_class'])) {
532
+		$class = $tc['geodir_article_open_class'];
533
+	}
534 534
 
535
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
535
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536 536
 
537
-    echo $text;
537
+	echo $text;
538 538
 }
539 539
 
540 540
 // action for adding the primary div closing tag
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
  */
549 549
 function geodir_action_article_close($type = '')
550 550
 {
551
-    $tc = get_option('theme_compatibility_setting');
552
-    if (!empty($tc['geodir_article_close_replace'])) {
553
-        $text = $tc['geodir_article_close_replace'];
554
-    } else {
555
-        $text = '</article><!-- article ends here-->';
556
-    }
557
-    echo $text;
551
+	$tc = get_option('theme_compatibility_setting');
552
+	if (!empty($tc['geodir_article_close_replace'])) {
553
+		$text = $tc['geodir_article_close_replace'];
554
+	} else {
555
+		$text = '</article><!-- article ends here-->';
556
+	}
557
+	echo $text;
558 558
 }
559 559
 
560 560
 // action for adding the sidebar opening tag
@@ -571,35 +571,35 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
576
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
578
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
580
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
582
-    } else {
583
-        $width_css = '';
584
-    }
585
-
586
-    $tc = get_option('theme_compatibility_setting');
587
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
-        $text = $tc['geodir_sidebar_right_open_replace'];
589
-    } else {
590
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
-    }
592
-
593
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
-        $id = $tc['geodir_sidebar_right_open_id'];
595
-    }
596
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
-        $class = $tc['geodir_sidebar_right_open_class'];
598
-    }
599
-
600
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
-
602
-    echo $text;
574
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
+		$width_css = 'style="width:' . $width . '%;"';
576
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
+		$width_css = 'style="width:' . $width . '%;"';
578
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
+		$width_css = 'style="width:' . $width . '%;"';
580
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
+		$width_css = 'style="width:' . $width . '%;"';
582
+	} else {
583
+		$width_css = '';
584
+	}
585
+
586
+	$tc = get_option('theme_compatibility_setting');
587
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
+		$text = $tc['geodir_sidebar_right_open_replace'];
589
+	} else {
590
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
+	}
592
+
593
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
+		$id = $tc['geodir_sidebar_right_open_id'];
595
+	}
596
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
+		$class = $tc['geodir_sidebar_right_open_class'];
598
+	}
599
+
600
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
+
602
+	echo $text;
603 603
 }
604 604
 
605 605
 // action for adding the primary div closing tag
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
  */
614 614
 function geodir_action_sidebar_right_close($type = '')
615 615
 {
616
-    $tc = get_option('theme_compatibility_setting');
617
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
-        $text = $tc['geodir_sidebar_right_close_replace'];
619
-    } else {
620
-        $text = '</aside><!-- sidebar ends here-->';
621
-    }
622
-    echo $text;
616
+	$tc = get_option('theme_compatibility_setting');
617
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
+		$text = $tc['geodir_sidebar_right_close_replace'];
619
+	} else {
620
+		$text = '</aside><!-- sidebar ends here-->';
621
+	}
622
+	echo $text;
623 623
 }
624 624
 
625 625
 
@@ -640,121 +640,121 @@  discard block
 block discarded – undo
640 640
  */
641 641
 function geodir_action_geodir_set_preview_post()
642 642
 {
643
-    global $post, $preview, $gd_session;
644
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
-    if (!$preview || $is_backend_preview) {
646
-        return;
647
-    }// bail if not previewing
648
-
649
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
-
651
-    $fields_info = geodir_get_custom_fields_type($listing_type);
652
-
653
-    foreach ($_REQUEST as $pkey => $pval) {
654
-        if ($pkey == 'geodir_video') {
655
-            $tags = '<iframe>';
656
-        } else if ($pkey == 'post_desc') {
657
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
-        } else if (is_array($_REQUEST[$pkey])) {
661
-            $tags = 'skip_field';
662
-        } else {
663
-            $tags = '';
664
-        }
665
-        /**
666
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
-         *
668
-         * @since 1.0.0
669
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
-         */
672
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
-
674
-        if ($tags != 'skip_field') {
675
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
-        }
677
-    }
678
-
679
-    $post = (object)$_REQUEST;
680
-
681
-
682
-    if (isset($post->video)) {
683
-        $post->video = stripslashes($post->video);
684
-    }
685
-
686
-    if (isset($post->Video2)) {
687
-        $post->Video2 = stripslashes($post->Video2);
688
-    }
689
-
690
-    $post_type = $post->listing_type;
691
-    $post_type_info = get_post_type_object($post_type);
692
-
693
-    $listing_label = $post_type_info->labels->singular_name;
694
-
695
-    $term_icon = '';
696
-
697
-    if (!empty($post->post_category)) {
698
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
699
-
700
-            if ($post_term != '' && !is_array($post_term)) {
701
-                $post_term = explode(',', trim($post_term, ','));
702
-            }
643
+	global $post, $preview, $gd_session;
644
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
+	if (!$preview || $is_backend_preview) {
646
+		return;
647
+	}// bail if not previewing
648
+
649
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
+
651
+	$fields_info = geodir_get_custom_fields_type($listing_type);
652
+
653
+	foreach ($_REQUEST as $pkey => $pval) {
654
+		if ($pkey == 'geodir_video') {
655
+			$tags = '<iframe>';
656
+		} else if ($pkey == 'post_desc') {
657
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
+		} else if (is_array($_REQUEST[$pkey])) {
661
+			$tags = 'skip_field';
662
+		} else {
663
+			$tags = '';
664
+		}
665
+		/**
666
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
+		 *
668
+		 * @since 1.0.0
669
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
+		 */
672
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
+
674
+		if ($tags != 'skip_field') {
675
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
+		}
677
+	}
678
+
679
+	$post = (object)$_REQUEST;
680
+
681
+
682
+	if (isset($post->video)) {
683
+		$post->video = stripslashes($post->video);
684
+	}
685
+
686
+	if (isset($post->Video2)) {
687
+		$post->Video2 = stripslashes($post->Video2);
688
+	}
689
+
690
+	$post_type = $post->listing_type;
691
+	$post_type_info = get_post_type_object($post_type);
692
+
693
+	$listing_label = $post_type_info->labels->singular_name;
694
+
695
+	$term_icon = '';
696
+
697
+	if (!empty($post->post_category)) {
698
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
699
+
700
+			if ($post_term != '' && !is_array($post_term)) {
701
+				$post_term = explode(',', trim($post_term, ','));
702
+			}
703 703
 
704
-            if (is_array($post_term)) {
705
-                $post_term = array_unique($post_term);
706
-            }
704
+			if (is_array($post_term)) {
705
+				$post_term = array_unique($post_term);
706
+			}
707 707
 
708
-            if (!empty($post_term)) {
709
-                foreach ($post_term as $cat_id) {
710
-                    $cat_id = trim($cat_id);
711
-
712
-                    if ($cat_id != '') {
713
-                        $term_icon = get_option('geodir_default_marker_icon');
714
-
715
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
719
-                                break;
720
-                            }
721
-                        }
722
-                    }
723
-                }
724
-            }
725
-        }
726
-    }
708
+			if (!empty($post_term)) {
709
+				foreach ($post_term as $cat_id) {
710
+					$cat_id = trim($cat_id);
711
+
712
+					if ($cat_id != '') {
713
+						$term_icon = get_option('geodir_default_marker_icon');
714
+
715
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
+									$term_icon = $term_icon_url['src'];
719
+								break;
720
+							}
721
+						}
722
+					}
723
+				}
724
+			}
725
+		}
726
+	}
727 727
 
728
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
728
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
730 730
 
731
-    $srcharr = array("'", "/", "-", '"', '\\');
732
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
733 733
 
734
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
734
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
735 735
 
736
-    $json = '{';
737
-    $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
742
-    $json .= '}';
736
+	$json = '{';
737
+	$json .= '"post_preview": "1",';
738
+	$json .= '"t": "' . $json_title . '",';
739
+	$json .= '"lt": "' . $post_latitude . '",';
740
+	$json .= '"ln": "' . $post_longitude . '",';
741
+	$json .= '"i":"' . $term_icon . '"';
742
+	$json .= '}';
743 743
 
744
-    $post->marker_json = $json;
744
+	$post->marker_json = $json;
745 745
 
746
-    $gd_session->set('listing', $_REQUEST);
746
+	$gd_session->set('listing', $_REQUEST);
747 747
 
748
-    // we need to define a few things to trick the setup_postdata
749
-    if (!isset($post->ID)) {
750
-        $post->ID = '';
751
-        $post->post_author = '';
752
-        $post->post_date = '';
753
-        $post->post_content = '';
754
-        $post->default_category = '';
755
-        $post->post_type = '';
756
-    }
757
-    setup_postdata($post);
748
+	// we need to define a few things to trick the setup_postdata
749
+	if (!isset($post->ID)) {
750
+		$post->ID = '';
751
+		$post->post_author = '';
752
+		$post->post_date = '';
753
+		$post->post_content = '';
754
+		$post->default_category = '';
755
+		$post->post_type = '';
756
+	}
757
+	setup_postdata($post);
758 758
 }
759 759
 
760 760
 /**
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
  */
767 767
 function geodir_action_geodir_preview_code()
768 768
 {
769
-    global $preview;
769
+	global $preview;
770 770
 
771
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
771
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772 772
 
773
-    if (!$preview || $is_backend_preview) {
774
-        return;
775
-    }// bail if not previewing
773
+	if (!$preview || $is_backend_preview) {
774
+		return;
775
+	}// bail if not previewing
776 776
 
777
-    geodir_get_template_part('preview', 'buttons');
777
+	geodir_get_template_part('preview', 'buttons');
778 778
 }
779 779
 
780 780
 // action for adding the details page top widget area
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
  */
791 791
 function geodir_action_geodir_sidebar_detail_top($class = '')
792 792
 {
793
-    if (get_option('geodir_show_detail_top_section')) { ?>
793
+	if (get_option('geodir_show_detail_top_section')) { ?>
794 794
         <div
795 795
             class="<?php
796
-            /**
797
-             * Filter the div class for the wrapper of the full width widget areas.
798
-             *
799
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
-             *
801
-             * @since 1.0.0
802
-             * @param string $class The class of the div.
803
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
-             */
806
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
796
+			/**
797
+			 * Filter the div class for the wrapper of the full width widget areas.
798
+			 *
799
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
+			 *
801
+			 * @since 1.0.0
802
+			 * @param string $class The class of the div.
803
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
+			 */
806
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
807 807
             <?php dynamic_sidebar('geodir_detail_top'); ?>
808 808
         </div>
809 809
     <?php }
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
  */
828 828
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
829 829
 {
830
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
830
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
831 831
         <div
832 832
             class="<?php
833
-            /** This action is documented in geodirectory_template_actions.php */
834
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
833
+			/** This action is documented in geodirectory_template_actions.php */
834
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
835 835
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
836 836
         </div><!-- clearfix ends here-->
837 837
     <?php }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  */
846 846
 function geodir_details_sidebar_widget_area()
847 847
 {
848
-    dynamic_sidebar('geodir_detail_sidebar');
848
+	dynamic_sidebar('geodir_detail_sidebar');
849 849
 }
850 850
 
851 851
 /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
  */
857 857
 function geodir_details_sidebar_place_details()
858 858
 {
859
-    /**
860
-     * Used to add items to the details page sidebar.
861
-     *
862
-     * @since 1.0.0
863
-     */
864
-    do_action('geodir_detail_page_sidebar');
859
+	/**
860
+	 * Used to add items to the details page sidebar.
861
+	 *
862
+	 * @since 1.0.0
863
+	 */
864
+	do_action('geodir_detail_page_sidebar');
865 865
 }
866 866
 
867 867
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -876,68 +876,68 @@  discard block
 block discarded – undo
876 876
  */
877 877
 function geodir_action_details_sidebar()
878 878
 {
879
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
-    if (get_option('geodir_detail_sidebar_left_section')) {
881
-        /**
882
-         * Called before the details page left sidebar is opened.
883
-         *
884
-         * This is used to add opening wrapper HTML to the details page left sidebar.
885
-         *
886
-         * @since 1.0.0
887
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
-         */
892
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
-        ?>
879
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
+	if (get_option('geodir_detail_sidebar_left_section')) {
881
+		/**
882
+		 * Called before the details page left sidebar is opened.
883
+		 *
884
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
885
+		 *
886
+		 * @since 1.0.0
887
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
+		 */
892
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
+		?>
894 894
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
895
-        /**
896
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
-         *
898
-         * This is used to add all info to the details page sidebars.
899
-         *
900
-         * @since 1.0.0
901
-         */
902
-        do_action('geodir_detail_sidebar_inside');
903
-        ?></div><!-- end geodir-content-left --><?php
904
-        /**
905
-         * Called after the details page left sidebar.
906
-         *
907
-         * This is used to add closing wrapper HTML to the details page left sidebar.
908
-         *
909
-         * @since 1.0.0
910
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
-         */
912
-        do_action('geodir_sidebar_left_close', 'details-page');
913
-    } else {
914
-        /**
915
-         * Called before the details page right sidebar is opened.
916
-         *
917
-         * This is used to add opening wrapper HTML to the details page right sidebar.
918
-         *
919
-         * @since 1.0.0
920
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
-         */
925
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
-        ?>
895
+		/**
896
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
+		 *
898
+		 * This is used to add all info to the details page sidebars.
899
+		 *
900
+		 * @since 1.0.0
901
+		 */
902
+		do_action('geodir_detail_sidebar_inside');
903
+		?></div><!-- end geodir-content-left --><?php
904
+		/**
905
+		 * Called after the details page left sidebar.
906
+		 *
907
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
908
+		 *
909
+		 * @since 1.0.0
910
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
+		 */
912
+		do_action('geodir_sidebar_left_close', 'details-page');
913
+	} else {
914
+		/**
915
+		 * Called before the details page right sidebar is opened.
916
+		 *
917
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
918
+		 *
919
+		 * @since 1.0.0
920
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
+		 */
925
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
+		?>
927 927
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
928
-        /** This action is documented in geodirectory_template_actions.php */
929
-        do_action('geodir_detail_sidebar_inside');
930
-        ?></div><!-- end geodir-content-right --><?php
931
-        /**
932
-         * Called after the details page right sidebar.
933
-         *
934
-         * This is used to add closing wrapper HTML to the details page right sidebar.
935
-         *
936
-         * @since 1.0.0
937
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
-         */
939
-        do_action('geodir_sidebar_right_close', 'details-page');
940
-    }
928
+		/** This action is documented in geodirectory_template_actions.php */
929
+		do_action('geodir_detail_sidebar_inside');
930
+		?></div><!-- end geodir-content-right --><?php
931
+		/**
932
+		 * Called after the details page right sidebar.
933
+		 *
934
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
935
+		 *
936
+		 * @since 1.0.0
937
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
+		 */
939
+		do_action('geodir_sidebar_right_close', 'details-page');
940
+	}
941 941
 }
942 942
 
943 943
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -951,21 +951,21 @@  discard block
 block discarded – undo
951 951
  */
952 952
 function geodir_action_page_title()
953 953
 {
954
-    /**
955
-     * Filter the page title HTML h1 class.
956
-     *
957
-     * @since 1.0.0
958
-     * @param string $class The class to use. Default is 'entry-title fn'.
959
-     */
960
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
-    /**
962
-     * Filter the page title HTML header wrapper class.
963
-     *
964
-     * @since 1.0.0
965
-     * @param string $class The class to use. Default is 'entry-header'.
966
-     */
967
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
954
+	/**
955
+	 * Filter the page title HTML h1 class.
956
+	 *
957
+	 * @since 1.0.0
958
+	 * @param string $class The class to use. Default is 'entry-title fn'.
959
+	 */
960
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
+	/**
962
+	 * Filter the page title HTML header wrapper class.
963
+	 *
964
+	 * @since 1.0.0
965
+	 * @param string $class The class to use. Default is 'entry-header'.
966
+	 */
967
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -982,87 +982,87 @@  discard block
 block discarded – undo
982 982
  */
983 983
 function geodir_action_details_slider()
984 984
 {
985
-    global $preview, $post;
985
+	global $preview, $post;
986 986
 
987
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
987
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988 988
 
989
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
989
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
991 991
 
992
-        $preview_post_images = array();
993
-        if ($preview_get_images) {
994
-            foreach ($preview_get_images as $row) {
995
-                $preview_post_images[] = $row->src;
996
-            }
997
-        }
998
-        if (!empty($preview_post_images)) {
999
-            $post->post_images = implode(',', $preview_post_images);
1000
-        }
1001
-    }
1002
-
1003
-    if ($preview) {
1004
-        $post_images = array();
1005
-        if (isset($post->post_images) && !empty($post->post_images)) {
1006
-            $post->post_images = trim($post->post_images, ",");
1007
-            $post_images = explode(",", $post->post_images);
1008
-        }
1009
-
1010
-        $main_slides = '';
1011
-        $nav_slides = '';
1012
-        $slides = 0;
1013
-
1014
-        if (!empty($post_images)) {
1015
-            foreach ($post_images as $image) {
1016
-                if (!empty($image)) {
1017
-                    $sizes = getimagesize(trim($image));
1018
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
-
1021
-                    if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
-                    }
1024
-
1025
-                    if (isset($image->src)) {
1026
-                        if ($image->height >= 400) {
1027
-                            $spacer_height = 0;
1028
-                        } else {
1029
-                            $spacer_height = ((400 - $image->height) / 2);
1030
-                        }
1031
-
1032
-                        $image_title = isset($image->title) ? $image->title : '';
1033
-
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
-                        $slides++;
1038
-                    }
1039
-                }
1040
-            }// endfore
1041
-        } //end if
1042
-    } else {
1043
-        $main_slides = '';
1044
-        $nav_slides = '';
1045
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
-        $slides = 0;
1047
-
1048
-        if (!empty($post_images)) {
1049
-            foreach ($post_images as $image) {
1050
-                if ($image->height >= 400) {
1051
-                    $spacer_height = 0;
1052
-                } else {
1053
-                    $spacer_height = ((400 - $image->height) / 2);
1054
-                }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
-                $slides++;
1060
-            }
1061
-        }// endfore
1062
-    }
992
+		$preview_post_images = array();
993
+		if ($preview_get_images) {
994
+			foreach ($preview_get_images as $row) {
995
+				$preview_post_images[] = $row->src;
996
+			}
997
+		}
998
+		if (!empty($preview_post_images)) {
999
+			$post->post_images = implode(',', $preview_post_images);
1000
+		}
1001
+	}
1002
+
1003
+	if ($preview) {
1004
+		$post_images = array();
1005
+		if (isset($post->post_images) && !empty($post->post_images)) {
1006
+			$post->post_images = trim($post->post_images, ",");
1007
+			$post_images = explode(",", $post->post_images);
1008
+		}
1009
+
1010
+		$main_slides = '';
1011
+		$nav_slides = '';
1012
+		$slides = 0;
1013
+
1014
+		if (!empty($post_images)) {
1015
+			foreach ($post_images as $image) {
1016
+				if (!empty($image)) {
1017
+					$sizes = getimagesize(trim($image));
1018
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
+
1021
+					if ($image && $width && $height) {
1022
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+					}
1024
+
1025
+					if (isset($image->src)) {
1026
+						if ($image->height >= 400) {
1027
+							$spacer_height = 0;
1028
+						} else {
1029
+							$spacer_height = ((400 - $image->height) / 2);
1030
+						}
1031
+
1032
+						$image_title = isset($image->title) ? $image->title : '';
1033
+
1034
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
+						$slides++;
1038
+					}
1039
+				}
1040
+			}// endfore
1041
+		} //end if
1042
+	} else {
1043
+		$main_slides = '';
1044
+		$nav_slides = '';
1045
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
+		$slides = 0;
1047
+
1048
+		if (!empty($post_images)) {
1049
+			foreach ($post_images as $image) {
1050
+				if ($image->height >= 400) {
1051
+					$spacer_height = 0;
1052
+				} else {
1053
+					$spacer_height = ((400 - $image->height) / 2);
1054
+				}
1055
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
+				$slides++;
1060
+			}
1061
+		}// endfore
1062
+	}
1063 1063
 
1064
-    if (!empty($post_images)) {
1065
-        ?>
1064
+	if (!empty($post_images)) {
1065
+		?>
1066 1066
         <div class="geodir_flex-container">
1067 1067
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1068 1068
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
             <?php } ?>
1076 1076
         </div>
1077 1077
     <?php
1078
-    }
1078
+	}
1079 1079
 }
1080 1080
 
1081 1081
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1090,176 +1090,176 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+	global $preview, $post;?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096
-    $taxonomies = array();
1097
-
1098
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
-
1100
-    if ($preview && !$is_backend_preview) {
1101
-        $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1103
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
-    } else {
1105
-        $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1107
-    }
1096
+	$taxonomies = array();
1097
+
1098
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
+
1100
+	if ($preview && !$is_backend_preview) {
1101
+		$post_type = $post->listing_type;
1102
+		$post_taxonomy = $post_type . 'category';
1103
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
+	} else {
1105
+		$post_type = $post->post_type;
1106
+		$post_taxonomy = $post_type . 'category';
1107
+	}
1108 1108
 //{	
1109
-    $post_type_info = get_post_type_object($post_type);
1110
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
-
1112
-    if (!empty($post->post_tags)) {
1113
-
1114
-        if (taxonomy_exists($post_type . '_tags')):
1115
-            $links = array();
1116
-            $terms = array();
1117
-            // to limit post tags
1118
-            $post_tags = trim($post->post_tags, ",");
1119
-            $post_id = isset($post->ID) ? $post->ID : '';
1120
-            /**
1121
-             * Filter the post tags.
1122
-             *
1123
-             * Allows you to filter the post tags output on the details page of a post.
1124
-             *
1125
-             * @since 1.0.0
1126
-             * @param string $post_tags A comma seperated list of tags.
1127
-             * @param int $post_id The current post id.
1128
-             */
1129
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
-
1131
-            $post->post_tags = $post_tags;
1132
-            $post_tags = explode(",", trim($post->post_tags, ","));
1133
-
1134
-            foreach ($post_tags as $post_term) {
1135
-
1136
-                // fix slug creation order for tags & location
1137
-                $post_term = trim($post_term);
1138
-
1139
-                $priority_location = false;
1140
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1141
-                    $term = get_term_by('name', $post_term, $post_type . '_tags');
1142
-                } else {
1143
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1144
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1145
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1146
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1147
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1148
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1149
-                    if ($match_country || $match_region || $match_city) {
1150
-                        $priority_location = true;
1151
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1152
-                    } else {
1153
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1154
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1155
-                    }
1156
-                }
1157
-
1158
-                if (!is_wp_error($term) && is_object($term)) {
1159
-
1160
-                    // fix tag link on detail page
1161
-                    if ($priority_location) {
1162
-
1163
-                        $tag_link = "<a href=''>$post_term</a>";
1164
-                        /**
1165
-                         * Filter the tag name on the details page.
1166
-                         *
1167
-                         * @since 1.5.6
1168
-                         * @param string $tag_link The tag link html.
1169
-                         * @param object $term The tag term object.
1170
-                         */
1171
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
-                        $links[] = $tag_link;
1173
-                    } else {
1174
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
-                        /** This action is documented in geodirectory-template_actions.php */
1176
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
-                        $links[] = $tag_link;
1178
-                    }
1179
-                    $terms[] = $term;
1180
-                }
1181
-                //
1182
-            }
1183
-            if (!isset($listing_label)) {
1184
-                $listing_label = '';
1185
-            }
1186
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
-        endif;
1188
-
1189
-    }
1190
-
1191
-    if (!empty($post->{$post_taxonomy})) {
1192
-        $links = array();
1193
-        $terms = array();
1194
-        $termsOrdered = array();
1195
-        if (!is_array($post->{$post_taxonomy})) {
1196
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1197
-        } else {
1198
-            $post_term = $post->{$post_taxonomy};
1109
+	$post_type_info = get_post_type_object($post_type);
1110
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
+
1112
+	if (!empty($post->post_tags)) {
1113
+
1114
+		if (taxonomy_exists($post_type . '_tags')):
1115
+			$links = array();
1116
+			$terms = array();
1117
+			// to limit post tags
1118
+			$post_tags = trim($post->post_tags, ",");
1119
+			$post_id = isset($post->ID) ? $post->ID : '';
1120
+			/**
1121
+			 * Filter the post tags.
1122
+			 *
1123
+			 * Allows you to filter the post tags output on the details page of a post.
1124
+			 *
1125
+			 * @since 1.0.0
1126
+			 * @param string $post_tags A comma seperated list of tags.
1127
+			 * @param int $post_id The current post id.
1128
+			 */
1129
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
+
1131
+			$post->post_tags = $post_tags;
1132
+			$post_tags = explode(",", trim($post->post_tags, ","));
1133
+
1134
+			foreach ($post_tags as $post_term) {
1135
+
1136
+				// fix slug creation order for tags & location
1137
+				$post_term = trim($post_term);
1138
+
1139
+				$priority_location = false;
1140
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1141
+					$term = get_term_by('name', $post_term, $post_type . '_tags');
1142
+				} else {
1143
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1144
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1145
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1146
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1147
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1148
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1149
+					if ($match_country || $match_region || $match_city) {
1150
+						$priority_location = true;
1151
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1152
+					} else {
1153
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1154
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1155
+					}
1156
+				}
1157
+
1158
+				if (!is_wp_error($term) && is_object($term)) {
1159
+
1160
+					// fix tag link on detail page
1161
+					if ($priority_location) {
1162
+
1163
+						$tag_link = "<a href=''>$post_term</a>";
1164
+						/**
1165
+						 * Filter the tag name on the details page.
1166
+						 *
1167
+						 * @since 1.5.6
1168
+						 * @param string $tag_link The tag link html.
1169
+						 * @param object $term The tag term object.
1170
+						 */
1171
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
+						$links[] = $tag_link;
1173
+					} else {
1174
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
+						/** This action is documented in geodirectory-template_actions.php */
1176
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
+						$links[] = $tag_link;
1178
+					}
1179
+					$terms[] = $term;
1180
+				}
1181
+				//
1182
+			}
1183
+			if (!isset($listing_label)) {
1184
+				$listing_label = '';
1185
+			}
1186
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
+		endif;
1188
+
1189
+	}
1190
+
1191
+	if (!empty($post->{$post_taxonomy})) {
1192
+		$links = array();
1193
+		$terms = array();
1194
+		$termsOrdered = array();
1195
+		if (!is_array($post->{$post_taxonomy})) {
1196
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1197
+		} else {
1198
+			$post_term = $post->{$post_taxonomy};
1199 1199
 			
1200 1200
 			if ($preview && !$is_backend_preview) {
1201 1201
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1202 1202
 			}
1203
-        }
1204
-
1205
-        $post_term = array_unique($post_term);
1206
-        if (!empty($post_term)) {
1207
-            foreach ($post_term as $post_term) {
1208
-                $post_term = trim($post_term);
1209
-
1210
-                if ($post_term != ''):
1211
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1212
-
1213
-                    if (is_object($term)) {
1214
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
-                        /**
1216
-                         * Filter the category name on the details page.
1217
-                         *
1218
-                         * @since 1.5.6
1219
-                         * @param string $term_link The link html to the category.
1220
-                         * @param object $term The category term object.
1221
-                         */
1222
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
-                        $links[] = $term_link;
1224
-                        $terms[] = $term;
1225
-                    }
1226
-                endif;
1227
-            }
1228
-            // order alphabetically
1229
-            asort($links);
1230
-            foreach (array_keys($links) as $key) {
1231
-                $termsOrdered[$key] = $terms[$key];
1232
-            }
1233
-            $terms = $termsOrdered;
1203
+		}
1204
+
1205
+		$post_term = array_unique($post_term);
1206
+		if (!empty($post_term)) {
1207
+			foreach ($post_term as $post_term) {
1208
+				$post_term = trim($post_term);
1209
+
1210
+				if ($post_term != ''):
1211
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1212
+
1213
+					if (is_object($term)) {
1214
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
+						/**
1216
+						 * Filter the category name on the details page.
1217
+						 *
1218
+						 * @since 1.5.6
1219
+						 * @param string $term_link The link html to the category.
1220
+						 * @param object $term The category term object.
1221
+						 */
1222
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
+						$links[] = $term_link;
1224
+						$terms[] = $term;
1225
+					}
1226
+				endif;
1227
+			}
1228
+			// order alphabetically
1229
+			asort($links);
1230
+			foreach (array_keys($links) as $key) {
1231
+				$termsOrdered[$key] = $terms[$key];
1232
+			}
1233
+			$terms = $termsOrdered;
1234 1234
 
1235
-        }
1235
+		}
1236 1236
 
1237
-        if (!isset($listing_label)) {
1238
-            $listing_label = '';
1239
-        }
1240
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1237
+		if (!isset($listing_label)) {
1238
+			$listing_label = '';
1239
+		}
1240
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1241 1241
 
1242
-    }
1242
+	}
1243 1243
 
1244
-    /**
1245
-     * Filter the taxonomies array before output.
1246
-     *
1247
-     * @since 1.5.9
1248
-     * @param array $taxonomies The array of cats and tags.
1249
-     * @param string $post_type The post type being output.
1250
-     * @param string $listing_label The post type label.
1251
-     * @param string $listing_label The post type label with ucwords function.
1252
-     */
1253
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1244
+	/**
1245
+	 * Filter the taxonomies array before output.
1246
+	 *
1247
+	 * @since 1.5.9
1248
+	 * @param array $taxonomies The array of cats and tags.
1249
+	 * @param string $post_type The post type being output.
1250
+	 * @param string $listing_label The post type label.
1251
+	 * @param string $listing_label The post type label with ucwords function.
1252
+	 */
1253
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1254 1254
 
1255
-    if (isset($taxonomies[$post_taxonomy])) {
1256
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
-    }
1255
+	if (isset($taxonomies[$post_taxonomy])) {
1256
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
+	}
1258 1258
 
1259
-    if (isset($taxonomies[$post_type . '_tags']))
1260
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1259
+	if (isset($taxonomies[$post_type . '_tags']))
1260
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1261 1261
 
1262
-    ?>
1262
+	?>
1263 1263
     </p><?php
1264 1264
 }
1265 1265
 
@@ -1281,126 +1281,126 @@  discard block
 block discarded – undo
1281 1281
 function geodir_action_details_micordata($post='')
1282 1282
 {
1283 1283
 
1284
-    global $preview;
1285
-    if(empty($post)){global $post;}
1286
-    if ($preview || !geodir_is_page('detail')) {
1287
-        return;
1288
-    }
1289
-
1290
-    // url
1291
-    $c_url = geodir_curPageURL();
1292
-
1293
-    // post reviews
1294
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1295
-    if (empty($post_reviews)) {
1296
-        $reviews = '';
1297
-    } else {
1298
-        foreach ($post_reviews as $review) {
1299
-            $reviews[] = array(
1300
-                "@type" => "Review",
1301
-                "author" => $review->comment_author,
1302
-                "datePublished" => $review->comment_date,
1303
-                "description" => $review->comment_content,
1304
-                "reviewRating" => array(
1305
-                    "@type" => "Rating",
1306
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1308
-                    "worstRating" => "1"
1309
-                )
1310
-            );
1311
-        }
1312
-
1313
-    }
1314
-
1315
-    // post images
1316
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1317
-    if (empty($post_images)) {
1318
-        $images = '';
1319
-    } else {
1320
-        $i_arr = array();
1321
-        foreach ($post_images as $img) {
1322
-            $i_arr[] = $img->src;
1323
-        }
1324
-
1325
-        if (count($i_arr) == 1) {
1326
-            $images = $i_arr[0];
1327
-        } else {
1328
-            $images = $i_arr;
1329
-        }
1330
-
1331
-    }
1332
-    //print_r($post);
1333
-    // external links
1334
-    $external_links =  array();
1335
-    $external_links[] = $post->geodir_website;
1336
-    $external_links[] = $post->geodir_twitter;
1337
-    $external_links[] = $post->geodir_facebook;
1338
-    $external_links = array_filter($external_links);
1339
-
1340
-    if(!empty($external_links)){
1341
-        $external_links = array_values($external_links);
1342
-    }
1343
-
1344
-    // reviews
1345
-    $comment_count = geodir_get_review_count_total($post->ID);
1346
-    $post_avgratings = geodir_get_post_rating($post->ID);
1347
-
1348
-    // schema type
1349
-    $schema_type = 'LocalBusiness';
1350
-    if(isset($post->default_category) && $post->default_category){
1351
-        $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1352
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
-    }
1354
-
1355
-    $schema = array();
1356
-    $schema['@context'] = "http://schema.org";
1357
-    $schema['@type'] = $schema_type;
1358
-    $schema['name'] = $post->post_name;
1359
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1360
-    $schema['telephone'] = $post->geodir_contact;
1361
-    $schema['url'] = $c_url;
1362
-    $schema['sameAs'] = $external_links;
1363
-    $schema['image'] = $images;
1364
-    $schema['address'] = array(
1365
-        "@type" => "PostalAddress",
1366
-        "streetAddress" => $post->post_address,
1367
-        "addressLocality" => $post->post_city,
1368
-        "addressRegion" => $post->post_region,
1369
-        "addressCountry" => $post->post_country,
1370
-        "postalCode" => $post->post_zip
1371
-    );
1372
-
1373
-    if($post->post_latitude && $post->post_longitude) {
1374
-        $schema['geo'] = array(
1375
-            "@type" => "GeoCoordinates",
1376
-            "latitude" => $post->post_latitude,
1377
-            "longitude" => $post->post_longitude
1378
-        );
1379
-    }
1380
-
1381
-    if($post_avgratings) {
1382
-        $schema['aggregateRating'] = array(
1383
-            "@type" => "AggregateRating",
1384
-            "ratingValue" => $post_avgratings,
1385
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1386
-            "worstRating" => "1",
1387
-            "ratingCount" => $comment_count
1388
-        );
1389
-    }
1390
-    $schema['review'] = $reviews;
1391
-
1392
-    /**
1393
-     * Allow the schema JSON-LD info to be filtered.
1394
-     *
1395
-     * @since 1.5.4
1396
-     * @since 1.5.7 Added $post variable.
1397
-     * @param array $schema The array of schema data to be filtered.
1398
-     * @param object $post The post object.
1399
-     */
1400
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1401
-
1402
-
1403
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1284
+	global $preview;
1285
+	if(empty($post)){global $post;}
1286
+	if ($preview || !geodir_is_page('detail')) {
1287
+		return;
1288
+	}
1289
+
1290
+	// url
1291
+	$c_url = geodir_curPageURL();
1292
+
1293
+	// post reviews
1294
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1295
+	if (empty($post_reviews)) {
1296
+		$reviews = '';
1297
+	} else {
1298
+		foreach ($post_reviews as $review) {
1299
+			$reviews[] = array(
1300
+				"@type" => "Review",
1301
+				"author" => $review->comment_author,
1302
+				"datePublished" => $review->comment_date,
1303
+				"description" => $review->comment_content,
1304
+				"reviewRating" => array(
1305
+					"@type" => "Rating",
1306
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1308
+					"worstRating" => "1"
1309
+				)
1310
+			);
1311
+		}
1312
+
1313
+	}
1314
+
1315
+	// post images
1316
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1317
+	if (empty($post_images)) {
1318
+		$images = '';
1319
+	} else {
1320
+		$i_arr = array();
1321
+		foreach ($post_images as $img) {
1322
+			$i_arr[] = $img->src;
1323
+		}
1324
+
1325
+		if (count($i_arr) == 1) {
1326
+			$images = $i_arr[0];
1327
+		} else {
1328
+			$images = $i_arr;
1329
+		}
1330
+
1331
+	}
1332
+	//print_r($post);
1333
+	// external links
1334
+	$external_links =  array();
1335
+	$external_links[] = $post->geodir_website;
1336
+	$external_links[] = $post->geodir_twitter;
1337
+	$external_links[] = $post->geodir_facebook;
1338
+	$external_links = array_filter($external_links);
1339
+
1340
+	if(!empty($external_links)){
1341
+		$external_links = array_values($external_links);
1342
+	}
1343
+
1344
+	// reviews
1345
+	$comment_count = geodir_get_review_count_total($post->ID);
1346
+	$post_avgratings = geodir_get_post_rating($post->ID);
1347
+
1348
+	// schema type
1349
+	$schema_type = 'LocalBusiness';
1350
+	if(isset($post->default_category) && $post->default_category){
1351
+		$schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1352
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
+	}
1354
+
1355
+	$schema = array();
1356
+	$schema['@context'] = "http://schema.org";
1357
+	$schema['@type'] = $schema_type;
1358
+	$schema['name'] = $post->post_name;
1359
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1360
+	$schema['telephone'] = $post->geodir_contact;
1361
+	$schema['url'] = $c_url;
1362
+	$schema['sameAs'] = $external_links;
1363
+	$schema['image'] = $images;
1364
+	$schema['address'] = array(
1365
+		"@type" => "PostalAddress",
1366
+		"streetAddress" => $post->post_address,
1367
+		"addressLocality" => $post->post_city,
1368
+		"addressRegion" => $post->post_region,
1369
+		"addressCountry" => $post->post_country,
1370
+		"postalCode" => $post->post_zip
1371
+	);
1372
+
1373
+	if($post->post_latitude && $post->post_longitude) {
1374
+		$schema['geo'] = array(
1375
+			"@type" => "GeoCoordinates",
1376
+			"latitude" => $post->post_latitude,
1377
+			"longitude" => $post->post_longitude
1378
+		);
1379
+	}
1380
+
1381
+	if($post_avgratings) {
1382
+		$schema['aggregateRating'] = array(
1383
+			"@type" => "AggregateRating",
1384
+			"ratingValue" => $post_avgratings,
1385
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1386
+			"worstRating" => "1",
1387
+			"ratingCount" => $comment_count
1388
+		);
1389
+	}
1390
+	$schema['review'] = $reviews;
1391
+
1392
+	/**
1393
+	 * Allow the schema JSON-LD info to be filtered.
1394
+	 *
1395
+	 * @since 1.5.4
1396
+	 * @since 1.5.7 Added $post variable.
1397
+	 * @param array $schema The array of schema data to be filtered.
1398
+	 * @param object $post The post object.
1399
+	 */
1400
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1401
+
1402
+
1403
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1404 1404
 
1405 1405
 }
1406 1406
 
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
  */
1419 1419
 function geodir_action_details_next_prev()
1420 1420
 {
1421
-    ?>
1421
+	?>
1422 1422
     <div class="geodir-pos_navigation clearfix">
1423 1423
     <div
1424 1424
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1436,15 +1436,15 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_action_before_single_post()
1438 1438
 {
1439
-    global $post;
1440
-    /**
1441
-     * Called at the very start of the details page output, before the title section.
1442
-     *
1443
-     * @since 1.0.0
1444
-     * @param object $post The current post object.
1445
-     * @global WP_Post|null $post The current post, if available.
1446
-     */
1447
-    do_action('geodir_before_single_post', $post); // extra action	
1439
+	global $post;
1440
+	/**
1441
+	 * Called at the very start of the details page output, before the title section.
1442
+	 *
1443
+	 * @since 1.0.0
1444
+	 * @param object $post The current post object.
1445
+	 * @global WP_Post|null $post The current post, if available.
1446
+	 */
1447
+	do_action('geodir_before_single_post', $post); // extra action	
1448 1448
 }
1449 1449
 
1450 1450
 /**
@@ -1455,13 +1455,13 @@  discard block
 block discarded – undo
1455 1455
  */
1456 1456
 function geodir_action_after_single_post($post)
1457 1457
 {
1458
-    /**
1459
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1460
-     *
1461
-     * @since 1.0.0
1462
-     * @param object $post The current post object.
1463
-     */
1464
-    do_action('geodir_after_single_post', $post); // extra action	
1458
+	/**
1459
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1460
+	 *
1461
+	 * @since 1.0.0
1462
+	 * @param object $post The current post object.
1463
+	 */
1464
+	do_action('geodir_after_single_post', $post); // extra action	
1465 1465
 }
1466 1466
 
1467 1467
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1487,167 +1487,167 @@  discard block
 block discarded – undo
1487 1487
  */
1488 1488
 function geodir_action_listings_title()
1489 1489
 {
1490
-    global $wp, $term;
1491
-
1492
-    $gd_post_type = geodir_get_current_posttype();
1493
-    $post_type_info = get_post_type_object($gd_post_type);
1494
-
1495
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1496
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1497
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1498
-    }
1499
-
1500
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1501
-    $single_name = $post_type_info->labels->singular_name;
1502
-
1503
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1504
-
1505
-    $gd_country = get_query_var('gd_country');
1506
-    $gd_region = get_query_var('gd_region');
1507
-    $gd_city = get_query_var('gd_city');
1508
-
1509
-    if (!empty($term)) {
1510
-        $location_name = '';
1511
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1512
-            if ($gd_country != '') {
1513
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1514
-            }
1490
+	global $wp, $term;
1515 1491
 
1516
-            if ($gd_region != '') {
1517
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1518
-            }
1492
+	$gd_post_type = geodir_get_current_posttype();
1493
+	$post_type_info = get_post_type_object($gd_post_type);
1519 1494
 
1520
-            if ($gd_city != '') {
1521
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1522
-            }
1523
-        }
1495
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1496
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1497
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1498
+	}
1524 1499
 
1525
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1526
-        if (!empty($current_term)) {
1527
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1528
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1529
-                $location_last_char = substr($location_name, -1);
1530
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1531
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1532
-            } else {
1533
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1534
-            }
1535
-        } else {
1536
-            if (count($taxonomy) > 1) {
1537
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1538
-
1539
-                if (!empty($current_term)) {
1540
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1541
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1542
-                        $location_last_char = substr($location_name, -1);
1543
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1544
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1545
-                    } else {
1546
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1547
-                    }
1548
-                }
1549
-            }
1550
-        }
1551
-
1552
-    } else {
1553
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1554
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1555
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1556
-
1557
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1558
-
1559
-        if (function_exists('get_actual_location_name')) {
1560
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1561
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1562
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1563
-        }
1564
-
1565
-        if ($gd_city != '') {
1566
-            if ($gd_city_actual != '') {
1567
-                $gd_city = $gd_city_actual;
1568
-            } else {
1569
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1570
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1571
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1572
-            }
1500
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1501
+	$single_name = $post_type_info->labels->singular_name;
1573 1502
 
1574
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1575
-        } else if ($gd_region != '') {
1576
-            if ($gd_region_actual != '') {
1577
-                $gd_region = $gd_region_actual;
1578
-            } else {
1579
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1580
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1581
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1582
-            }
1503
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1583 1504
 
1584
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1585
-        } else if ($gd_country != '') {
1586
-            if ($gd_country_actual != '') {
1587
-                $gd_country = $gd_country_actual;
1588
-            } else {
1589
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1590
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1591
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1592
-            }
1505
+	$gd_country = get_query_var('gd_country');
1506
+	$gd_region = get_query_var('gd_region');
1507
+	$gd_city = get_query_var('gd_city');
1593 1508
 
1594
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1595
-        }
1596
-    }
1597
-
1598
-    if (is_search()) {
1599
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1600
-    }
1601
-    /** This action is documented in geodirectory_template_actions.php */
1602
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1603
-    /** This action is documented in geodirectory_template_actions.php */
1604
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1605
-
1606
-
1607
-    $title = $list_title;
1608
-    if(geodir_is_page('pt')){
1609
-        $gd_page = 'pt';
1610
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1611
-    }
1612
-    elseif(geodir_is_page('listing')){
1613
-        $gd_page = 'listing';
1614
-        global $wp_query;
1615
-        $current_term = $wp_query->get_queried_object();
1616
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1617
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1618
-        }else{
1619
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1620
-        }
1509
+	if (!empty($term)) {
1510
+		$location_name = '';
1511
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1512
+			if ($gd_country != '') {
1513
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1514
+			}
1621 1515
 
1622
-    }
1623
-    elseif(geodir_is_page('author')){
1624
-        $gd_page = 'author';
1625
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1626
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1627
-        }else{
1628
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1629
-        }
1516
+			if ($gd_region != '') {
1517
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1518
+			}
1630 1519
 
1631
-    }
1520
+			if ($gd_city != '') {
1521
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1522
+			}
1523
+		}
1524
+
1525
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1526
+		if (!empty($current_term)) {
1527
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1528
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1529
+				$location_last_char = substr($location_name, -1);
1530
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1531
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1532
+			} else {
1533
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1534
+			}
1535
+		} else {
1536
+			if (count($taxonomy) > 1) {
1537
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1538
+
1539
+				if (!empty($current_term)) {
1540
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1541
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1542
+						$location_last_char = substr($location_name, -1);
1543
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1544
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1545
+					} else {
1546
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1547
+					}
1548
+				}
1549
+			}
1550
+		}
1551
+
1552
+	} else {
1553
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1554
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1555
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1556
+
1557
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1558
+
1559
+		if (function_exists('get_actual_location_name')) {
1560
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1561
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1562
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1563
+		}
1564
+
1565
+		if ($gd_city != '') {
1566
+			if ($gd_city_actual != '') {
1567
+				$gd_city = $gd_city_actual;
1568
+			} else {
1569
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1570
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1571
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1572
+			}
1632 1573
 
1574
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1575
+		} else if ($gd_region != '') {
1576
+			if ($gd_region_actual != '') {
1577
+				$gd_region = $gd_region_actual;
1578
+			} else {
1579
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1580
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1581
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1582
+			}
1633 1583
 
1634
-    /**
1635
-     * Filter page title to replace variables.
1636
-     *
1637
-     * @since 1.5.4
1638
-     * @param string $title The page title including variables.
1639
-     * @param string $gd_page The GeoDirectory page type if any.
1640
-     */
1641
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1584
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1585
+		} else if ($gd_country != '') {
1586
+			if ($gd_country_actual != '') {
1587
+				$gd_country = $gd_country_actual;
1588
+			} else {
1589
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1590
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1591
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1592
+			}
1642 1593
 
1643
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1644
-        /**
1645
-         * Filter the listing page title.
1646
-         *
1647
-         * @since 1.0.0
1648
-         * @param string $list_title The title for the category page.
1649
-         */
1650
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1594
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1595
+		}
1596
+	}
1597
+
1598
+	if (is_search()) {
1599
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1600
+	}
1601
+	/** This action is documented in geodirectory_template_actions.php */
1602
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1603
+	/** This action is documented in geodirectory_template_actions.php */
1604
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1605
+
1606
+
1607
+	$title = $list_title;
1608
+	if(geodir_is_page('pt')){
1609
+		$gd_page = 'pt';
1610
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1611
+	}
1612
+	elseif(geodir_is_page('listing')){
1613
+		$gd_page = 'listing';
1614
+		global $wp_query;
1615
+		$current_term = $wp_query->get_queried_object();
1616
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1617
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1618
+		}else{
1619
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1620
+		}
1621
+
1622
+	}
1623
+	elseif(geodir_is_page('author')){
1624
+		$gd_page = 'author';
1625
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1626
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1627
+		}else{
1628
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1629
+		}
1630
+
1631
+	}
1632
+
1633
+
1634
+	/**
1635
+	 * Filter page title to replace variables.
1636
+	 *
1637
+	 * @since 1.5.4
1638
+	 * @param string $title The page title including variables.
1639
+	 * @param string $gd_page The GeoDirectory page type if any.
1640
+	 */
1641
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1642
+
1643
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1644
+		/**
1645
+		 * Filter the listing page title.
1646
+		 *
1647
+		 * @since 1.0.0
1648
+		 * @param string $list_title The title for the category page.
1649
+		 */
1650
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1651 1651
 }
1652 1652
 
1653 1653
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1660,33 +1660,33 @@  discard block
 block discarded – undo
1660 1660
  */
1661 1661
 function geodir_action_listings_description()
1662 1662
 {
1663
-    global $wp_query;
1664
-    $current_term = $wp_query->get_queried_object();
1665
-
1666
-    $gd_post_type = geodir_get_current_posttype();
1667
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1668
-
1669
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1670
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1671
-        if ($term_desc && !$saved_data) {
1672
-            $saved_data = $term_desc;
1673
-        }
1674
-        /**
1675
-         * Apply the core filter `the_content` filter to the variable string.
1676
-         *
1677
-         * This is a WordPress core filter that does many things.
1678
-         *
1679
-         * @since 1.0.0
1680
-         * @param string $var The string to apply the filter to.
1681
-         */
1682
-        $cat_description = apply_filters('the_content', $saved_data);
1683
-        if ($cat_description) {
1684
-            ?>
1663
+	global $wp_query;
1664
+	$current_term = $wp_query->get_queried_object();
1665
+
1666
+	$gd_post_type = geodir_get_current_posttype();
1667
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1668
+
1669
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1670
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1671
+		if ($term_desc && !$saved_data) {
1672
+			$saved_data = $term_desc;
1673
+		}
1674
+		/**
1675
+		 * Apply the core filter `the_content` filter to the variable string.
1676
+		 *
1677
+		 * This is a WordPress core filter that does many things.
1678
+		 *
1679
+		 * @since 1.0.0
1680
+		 * @param string $var The string to apply the filter to.
1681
+		 */
1682
+		$cat_description = apply_filters('the_content', $saved_data);
1683
+		if ($cat_description) {
1684
+			?>
1685 1685
 
1686 1686
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1687
-        }
1687
+		}
1688 1688
 
1689
-    }
1689
+	}
1690 1690
 }
1691 1691
 
1692 1692
 // action for adding the listings page top widget area
@@ -1705,11 +1705,11 @@  discard block
 block discarded – undo
1705 1705
  */
1706 1706
 function geodir_action_geodir_sidebar_listings_top()
1707 1707
 {
1708
-    if (get_option('geodir_show_listing_top_section')) { ?>
1708
+	if (get_option('geodir_show_listing_top_section')) { ?>
1709 1709
         <div
1710 1710
             class="<?php
1711
-            /** This action is documented in geodirectory_template_actions.php */
1712
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1711
+			/** This action is documented in geodirectory_template_actions.php */
1712
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1713 1713
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1714 1714
         </div><!-- clearfix ends here-->
1715 1715
     <?php }
@@ -1732,35 +1732,35 @@  discard block
 block discarded – undo
1732 1732
  */
1733 1733
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1734 1734
 {
1735
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1736
-        $width_css = 'style="width:' . $width . '%;"';
1737
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1738
-        $width_css = 'style="width:' . $width . '%;"';
1739
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1740
-        $width_css = 'style="width:' . $width . '%;"';
1741
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1742
-        $width_css = 'style="width:' . $width . '%;"';
1743
-    } else {
1744
-        $width_css = '';
1745
-    }
1746
-
1747
-    $tc = get_option('theme_compatibility_setting');
1748
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1749
-        $text = $tc['geodir_sidebar_left_open_replace'];
1750
-    } else {
1751
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1752
-    }
1753
-
1754
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1755
-        $id = $tc['geodir_sidebar_left_open_id'];
1756
-    }
1757
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1758
-        $class = $tc['geodir_sidebar_left_open_class'];
1759
-    }
1760
-
1761
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1762
-
1763
-    echo $text;
1735
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1736
+		$width_css = 'style="width:' . $width . '%;"';
1737
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1738
+		$width_css = 'style="width:' . $width . '%;"';
1739
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1740
+		$width_css = 'style="width:' . $width . '%;"';
1741
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1742
+		$width_css = 'style="width:' . $width . '%;"';
1743
+	} else {
1744
+		$width_css = '';
1745
+	}
1746
+
1747
+	$tc = get_option('theme_compatibility_setting');
1748
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1749
+		$text = $tc['geodir_sidebar_left_open_replace'];
1750
+	} else {
1751
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1752
+	}
1753
+
1754
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1755
+		$id = $tc['geodir_sidebar_left_open_id'];
1756
+	}
1757
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1758
+		$class = $tc['geodir_sidebar_left_open_class'];
1759
+	}
1760
+
1761
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1762
+
1763
+	echo $text;
1764 1764
 }
1765 1765
 
1766 1766
 // action for adding the primary div closing tag
@@ -1776,13 +1776,13 @@  discard block
 block discarded – undo
1776 1776
  */
1777 1777
 function geodir_action_sidebar_left_close($type = '')
1778 1778
 {
1779
-    $tc = get_option('theme_compatibility_setting');
1780
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1781
-        $text = $tc['geodir_sidebar_left_close_replace'];
1782
-    } else {
1783
-        $text = '</aside><!-- sidebar ends here-->';
1784
-    }
1785
-    echo $text;
1779
+	$tc = get_option('theme_compatibility_setting');
1780
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1781
+		$text = $tc['geodir_sidebar_left_close_replace'];
1782
+	} else {
1783
+		$text = '</aside><!-- sidebar ends here-->';
1784
+	}
1785
+	echo $text;
1786 1786
 }
1787 1787
 
1788 1788
 /**
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
  */
1796 1796
 function geodir_listing_left_section()
1797 1797
 {
1798
-    if (get_option('geodir_show_listing_left_section')) { ?>
1798
+	if (get_option('geodir_show_listing_left_section')) { ?>
1799 1799
         <div class="geodir-content-left geodir-sidebar-wrap">
1800 1800
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1801 1801
         </div><!-- end geodir-content-left -->
@@ -1813,20 +1813,20 @@  discard block
 block discarded – undo
1813 1813
  */
1814 1814
 function geodir_action_listings_sidebar_left()
1815 1815
 {
1816
-    if (get_option('geodir_show_listing_left_section')) {
1817
-        /** This action is documented in geodirectory_template_actions.php */
1818
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1819
-        /**
1820
-         * Calls the listings page (category) left sidebar content.
1821
-         *
1822
-         * All the content for the listings page left sidebar is added via this hook.
1823
-         *
1824
-         * @since 1.0.0
1825
-         */
1826
-        do_action('geodir_listings_sidebar_left_inside');
1827
-        /** This action is documented in geodirectory_template_actions.php */
1828
-        do_action('geodir_sidebar_left_close', 'listings-page');
1829
-    }
1816
+	if (get_option('geodir_show_listing_left_section')) {
1817
+		/** This action is documented in geodirectory_template_actions.php */
1818
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1819
+		/**
1820
+		 * Calls the listings page (category) left sidebar content.
1821
+		 *
1822
+		 * All the content for the listings page left sidebar is added via this hook.
1823
+		 *
1824
+		 * @since 1.0.0
1825
+		 */
1826
+		do_action('geodir_listings_sidebar_left_inside');
1827
+		/** This action is documented in geodirectory_template_actions.php */
1828
+		do_action('geodir_sidebar_left_close', 'listings-page');
1829
+	}
1830 1830
 }
1831 1831
 
1832 1832
 /**
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
  */
1840 1840
 function geodir_listing_right_section()
1841 1841
 {
1842
-    if (get_option('geodir_show_listing_right_section')) { ?>
1842
+	if (get_option('geodir_show_listing_right_section')) { ?>
1843 1843
         <div class="geodir-content-right geodir-sidebar-wrap">
1844 1844
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1845 1845
         </div><!-- end geodir-content-right -->
@@ -1857,20 +1857,20 @@  discard block
 block discarded – undo
1857 1857
  */
1858 1858
 function geodir_action_listings_sidebar_right()
1859 1859
 {
1860
-    if (get_option('geodir_show_listing_right_section')) {
1861
-        /** This action is documented in geodirectory_template_actions.php */
1862
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1863
-        /**
1864
-         * Calls the listings page (category) right sidebar content.
1865
-         *
1866
-         * All the content for the listings page right sidebar is added via this hook.
1867
-         *
1868
-         * @since 1.0.0
1869
-         */
1870
-        do_action('geodir_listings_sidebar_right_inside');
1871
-        /** This action is documented in geodirectory_template_actions.php */
1872
-        do_action('geodir_sidebar_right_close', 'listings-page');
1873
-    }
1860
+	if (get_option('geodir_show_listing_right_section')) {
1861
+		/** This action is documented in geodirectory_template_actions.php */
1862
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1863
+		/**
1864
+		 * Calls the listings page (category) right sidebar content.
1865
+		 *
1866
+		 * All the content for the listings page right sidebar is added via this hook.
1867
+		 *
1868
+		 * @since 1.0.0
1869
+		 */
1870
+		do_action('geodir_listings_sidebar_right_inside');
1871
+		/** This action is documented in geodirectory_template_actions.php */
1872
+		do_action('geodir_sidebar_right_close', 'listings-page');
1873
+	}
1874 1874
 }
1875 1875
 
1876 1876
 
@@ -1887,23 +1887,23 @@  discard block
 block discarded – undo
1887 1887
  */
1888 1888
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1889 1889
 {
1890
-    $tc = get_option('theme_compatibility_setting');
1891
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1892
-        $text = $tc['geodir_main_content_open_replace'];
1893
-    } else {
1894
-        $text = '<main id="[id]" class="[class]" role="main">';
1895
-    }
1890
+	$tc = get_option('theme_compatibility_setting');
1891
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1892
+		$text = $tc['geodir_main_content_open_replace'];
1893
+	} else {
1894
+		$text = '<main id="[id]" class="[class]" role="main">';
1895
+	}
1896 1896
 
1897
-    if (!empty($tc['geodir_main_content_open_id'])) {
1898
-        $id = $tc['geodir_main_content_open_id'];
1899
-    }
1900
-    if (!empty($tc['geodir_main_content_open_class'])) {
1901
-        $class = $tc['geodir_main_content_open_class'];
1902
-    }
1897
+	if (!empty($tc['geodir_main_content_open_id'])) {
1898
+		$id = $tc['geodir_main_content_open_id'];
1899
+	}
1900
+	if (!empty($tc['geodir_main_content_open_class'])) {
1901
+		$class = $tc['geodir_main_content_open_class'];
1902
+	}
1903 1903
 
1904
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1904
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1905 1905
 
1906
-    echo $text;
1906
+	echo $text;
1907 1907
 }
1908 1908
 
1909 1909
 // action for adding the primary div closing tag
@@ -1916,13 +1916,13 @@  discard block
 block discarded – undo
1916 1916
  */
1917 1917
 function geodir_action_main_content_close()
1918 1918
 {
1919
-    $tc = get_option('theme_compatibility_setting');
1920
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1921
-        $text = $tc['geodir_main_content_close_replace'];
1922
-    } else {
1923
-        $text = '</main><!-- main ends here-->';
1924
-    }
1925
-    echo $text;
1919
+	$tc = get_option('theme_compatibility_setting');
1920
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1921
+		$text = $tc['geodir_main_content_close_replace'];
1922
+	} else {
1923
+		$text = '</main><!-- main ends here-->';
1924
+	}
1925
+	echo $text;
1926 1926
 }
1927 1927
 
1928 1928
 /**
@@ -1934,14 +1934,14 @@  discard block
 block discarded – undo
1934 1934
  */
1935 1935
 function geodir_action_listings_content_inside()
1936 1936
 {
1937
-    global $gridview_columns;
1938
-    $listing_view = get_option('geodir_listing_view');
1939
-    if (strstr($listing_view, 'gridview')) {
1940
-        $gridview_columns = $listing_view;
1941
-        $listing_view_exp = explode('_', $listing_view);
1942
-        $listing_view = $listing_view_exp[0];
1943
-    }
1944
-    geodir_get_template_part('listing', 'listview');
1937
+	global $gridview_columns;
1938
+	$listing_view = get_option('geodir_listing_view');
1939
+	if (strstr($listing_view, 'gridview')) {
1940
+		$gridview_columns = $listing_view;
1941
+		$listing_view_exp = explode('_', $listing_view);
1942
+		$listing_view = $listing_view_exp[0];
1943
+	}
1944
+	geodir_get_template_part('listing', 'listview');
1945 1945
 }
1946 1946
 
1947 1947
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1957,47 +1957,47 @@  discard block
 block discarded – undo
1957 1957
  */
1958 1958
 function geodir_action_listings_content()
1959 1959
 {
1960
-    /**
1961
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1962
-     *
1963
-     * @since 1.0.0
1964
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1965
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1966
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1967
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1968
-     */
1969
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1970
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1971
-    echo '<div class="clearfix '.$extra_class.'">';
1972
-    /**
1973
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1974
-     *
1975
-     * @since 1.0.0
1976
-     */
1977
-    do_action('geodir_before_listing');
1978
-    echo '</div>';
1979
-
1980
-    /**
1981
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
1982
-     *
1983
-     * @since 1.0.0
1984
-     */
1985
-    do_action('geodir_listings_content_inside');
1986
-
1987
-    /**
1988
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1989
-     *
1990
-     * @since 1.0.0
1991
-     */
1992
-    do_action('geodir_after_listing');
1993
-
1994
-    /**
1995
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1996
-     *
1997
-     * @since 1.0.0
1998
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
1999
-     */
2000
-    do_action('geodir_main_content_close', 'listings-page');
1960
+	/**
1961
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1962
+	 *
1963
+	 * @since 1.0.0
1964
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1965
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1966
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1967
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1968
+	 */
1969
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1970
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1971
+	echo '<div class="clearfix '.$extra_class.'">';
1972
+	/**
1973
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1974
+	 *
1975
+	 * @since 1.0.0
1976
+	 */
1977
+	do_action('geodir_before_listing');
1978
+	echo '</div>';
1979
+
1980
+	/**
1981
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
1982
+	 *
1983
+	 * @since 1.0.0
1984
+	 */
1985
+	do_action('geodir_listings_content_inside');
1986
+
1987
+	/**
1988
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1989
+	 *
1990
+	 * @since 1.0.0
1991
+	 */
1992
+	do_action('geodir_after_listing');
1993
+
1994
+	/**
1995
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1996
+	 *
1997
+	 * @since 1.0.0
1998
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
1999
+	 */
2000
+	do_action('geodir_main_content_close', 'listings-page');
2001 2001
 }
2002 2002
 
2003 2003
 
@@ -2012,10 +2012,10 @@  discard block
 block discarded – undo
2012 2012
  */
2013 2013
 function geodir_action_sidebar_listings_bottom_section()
2014 2014
 {
2015
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2015
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2016 2016
         <div class="<?php
2017
-            /** This action is documented in geodirectory_template_actions.php */
2018
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2017
+			/** This action is documented in geodirectory_template_actions.php */
2018
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2019 2019
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2020 2020
         </div><!-- clearfix ends here-->
2021 2021
     <?php }
@@ -2035,38 +2035,38 @@  discard block
 block discarded – undo
2035 2035
  */
2036 2036
 function geodir_action_add_listing_page_title()
2037 2037
 {
2038
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2039
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2040
-    /** This action is documented in geodirectory_template_actions.php */
2041
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2042
-    /** This action is documented in geodirectory_template_actions.php */
2043
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2044
-
2045
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2046
-
2047
-    if(geodir_is_page('add-listing')){
2048
-        $gd_page = 'add-listing';
2049
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2050
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2051
-        }elseif(isset($listing_type)){
2052
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2053
-        }
2038
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2039
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2040
+	/** This action is documented in geodirectory_template_actions.php */
2041
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2042
+	/** This action is documented in geodirectory_template_actions.php */
2043
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2044
+
2045
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2046
+
2047
+	if(geodir_is_page('add-listing')){
2048
+		$gd_page = 'add-listing';
2049
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2050
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2051
+		}elseif(isset($listing_type)){
2052
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2053
+		}
2054 2054
 
2055
-    }
2055
+	}
2056 2056
 
2057 2057
 
2058
-    /**
2059
-     * Filter page title to replace variables.
2060
-     *
2061
-     * @since 1.5.4
2062
-     * @param string $title The page title including variables.
2063
-     * @param string $gd_page The GeoDirectory page type if any.
2064
-     */
2065
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2058
+	/**
2059
+	 * Filter page title to replace variables.
2060
+	 *
2061
+	 * @since 1.5.4
2062
+	 * @param string $title The page title including variables.
2063
+	 * @param string $gd_page The GeoDirectory page type if any.
2064
+	 */
2065
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2066 2066
 
2067
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2068
-    echo $title;
2069
-    echo '</h1></header>';
2067
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2068
+	echo $title;
2069
+	echo '</h1></header>';
2070 2070
 }
2071 2071
 
2072 2072
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2097,54 +2097,54 @@  discard block
 block discarded – undo
2097 2097
  */
2098 2098
 function geodir_action_add_listing_form()
2099 2099
 {
2100
-    global $cat_display, $post_cat, $current_user, $gd_session;
2101
-    $page_id = get_the_ID();
2102
-    $post = '';
2103
-    $title = '';
2104
-    $desc = '';
2105
-    $kw_tags = '';
2106
-    $required_msg = '';
2107
-    $submit_button = '';
2108
-
2109
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2110
-
2111
-    $thumb_img_arr = array();
2112
-    $curImages = '';
2113
-
2114
-    if (isset($_REQUEST['backandedit'])) {
2115
-        global $post;
2116
-        $post = (object)$gd_session->get('listing');
2117
-        $listing_type = $post->listing_type;
2118
-        $title = $post->post_title;
2119
-        $desc = $post->post_desc;
2120
-        $post_cat = $post->post_category;
2121
-
2122
-        $kw_tags = $post->post_tags;
2123
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2124
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2125
-        global $post, $post_images;
2126
-
2127
-        $post = geodir_get_post_info($_REQUEST['pid']);
2128
-        $thumb_img_arr = geodir_get_images($post->ID);
2129
-        if ($thumb_img_arr) {
2130
-            foreach ($thumb_img_arr as $post_img) {
2131
-                $curImages .= $post_img->src . ',';
2132
-            }
2133
-        }
2134
-
2135
-        $listing_type = $post->post_type;
2136
-        $title = $post->post_title;
2137
-        $desc = $post->post_content;
2138
-        $kw_tags = $post->post_tags;
2139
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2140
-    } else {
2141
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2142
-    }
2143
-
2144
-    if ($current_user->ID != '0') {
2145
-        $user_login = true;
2146
-    }
2147
-    ?>
2100
+	global $cat_display, $post_cat, $current_user, $gd_session;
2101
+	$page_id = get_the_ID();
2102
+	$post = '';
2103
+	$title = '';
2104
+	$desc = '';
2105
+	$kw_tags = '';
2106
+	$required_msg = '';
2107
+	$submit_button = '';
2108
+
2109
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2110
+
2111
+	$thumb_img_arr = array();
2112
+	$curImages = '';
2113
+
2114
+	if (isset($_REQUEST['backandedit'])) {
2115
+		global $post;
2116
+		$post = (object)$gd_session->get('listing');
2117
+		$listing_type = $post->listing_type;
2118
+		$title = $post->post_title;
2119
+		$desc = $post->post_desc;
2120
+		$post_cat = $post->post_category;
2121
+
2122
+		$kw_tags = $post->post_tags;
2123
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2124
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2125
+		global $post, $post_images;
2126
+
2127
+		$post = geodir_get_post_info($_REQUEST['pid']);
2128
+		$thumb_img_arr = geodir_get_images($post->ID);
2129
+		if ($thumb_img_arr) {
2130
+			foreach ($thumb_img_arr as $post_img) {
2131
+				$curImages .= $post_img->src . ',';
2132
+			}
2133
+		}
2134
+
2135
+		$listing_type = $post->post_type;
2136
+		$title = $post->post_title;
2137
+		$desc = $post->post_content;
2138
+		$kw_tags = $post->post_tags;
2139
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2140
+	} else {
2141
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2142
+	}
2143
+
2144
+	if ($current_user->ID != '0') {
2145
+		$user_login = true;
2146
+	}
2147
+	?>
2148 2148
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2149 2149
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2150 2150
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2155,27 +2155,27 @@  discard block
 block discarded – undo
2155 2155
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2156 2156
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2157 2157
         <?php
2158
-        } 
2159
-        /**
2160
-         * Called at the very top of the add listing page form for frontend.
2161
-         *
2162
-         * This is called just before the "Enter Listing Details" text.
2163
-         *
2164
-         * @since 1.0.0
2165
-         */
2166
-        do_action('geodir_before_detail_fields');
2167
-        ?>
2158
+		} 
2159
+		/**
2160
+		 * Called at the very top of the add listing page form for frontend.
2161
+		 *
2162
+		 * This is called just before the "Enter Listing Details" text.
2163
+		 *
2164
+		 * @since 1.0.0
2165
+		 */
2166
+		do_action('geodir_before_detail_fields');
2167
+		?>
2168 2168
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2169 2169
         <?php
2170
-        /**
2171
-         * Called at the top of the add listing page form for frontend.
2172
-         *
2173
-         * This is called after the "Enter Listing Details" text.
2174
-         *
2175
-         * @since 1.0.0
2176
-         */
2177
-        do_action('geodir_before_main_form_fields');
2178
-        ?>
2170
+		/**
2171
+		 * Called at the top of the add listing page form for frontend.
2172
+		 *
2173
+		 * This is called after the "Enter Listing Details" text.
2174
+		 *
2175
+		 * @since 1.0.0
2176
+		 */
2177
+		do_action('geodir_before_main_form_fields');
2178
+		?>
2179 2179
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2180 2180
             <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label>
2181 2181
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
@@ -2183,57 +2183,57 @@  discard block
 block discarded – undo
2183 2183
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2184 2184
         </div>
2185 2185
         <?php
2186
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2187
-
2188
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2189
-        $desc_limit = '';
2190
-        /**
2191
-         * Filter the add listing description field character limit number.
2192
-         *
2193
-         * @since 1.0.0
2194
-         * @param int $desc_limit The amount of characters to limit the description to.
2195
-         */
2196
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2197
-        /**
2198
-         * Filter the add listing description field text.
2199
-         *
2200
-         * @since 1.0.0
2201
-         * @param string $desc The text for the description field.
2202
-         * @param int $desc_limit The character limit number if any.
2203
-         */
2204
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2205
-        $desc_limit_msg = '';
2206
-        /**
2207
-         * Filter the add listing description limit message.
2208
-         *
2209
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2210
-         *
2211
-         * @since 1.0.0
2212
-         * @param string $desc_limit_msg The limit message string if any.
2213
-         * @param int $desc_limit The character limit numer if any.
2214
-         */
2215
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2186
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2187
+
2188
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2189
+		$desc_limit = '';
2190
+		/**
2191
+		 * Filter the add listing description field character limit number.
2192
+		 *
2193
+		 * @since 1.0.0
2194
+		 * @param int $desc_limit The amount of characters to limit the description to.
2195
+		 */
2196
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2197
+		/**
2198
+		 * Filter the add listing description field text.
2199
+		 *
2200
+		 * @since 1.0.0
2201
+		 * @param string $desc The text for the description field.
2202
+		 * @param int $desc_limit The character limit number if any.
2203
+		 */
2204
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2205
+		$desc_limit_msg = '';
2206
+		/**
2207
+		 * Filter the add listing description limit message.
2208
+		 *
2209
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2210
+		 *
2211
+		 * @since 1.0.0
2212
+		 * @param string $desc_limit_msg The limit message string if any.
2213
+		 * @param int $desc_limit The character limit numer if any.
2214
+		 */
2215
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2216 2216
         
2217
-        $desc_class = '';
2218
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2219
-            /**
2220
-             * Called on the add listing page form for frontend just before the description field.
2221
-             *
2222
-             * @since 1.0.0
2223
-             */
2224
-            do_action('geodir_before_description_field');
2217
+		$desc_class = '';
2218
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2219
+			/**
2220
+			 * Called on the add listing page form for frontend just before the description field.
2221
+			 *
2222
+			 * @since 1.0.0
2223
+			 */
2224
+			do_action('geodir_before_description_field');
2225 2225
             
2226
-            $desc_class = ' required_field';
2227
-        } else {
2228
-            $desc_class = ' hidden';
2229
-        }
2230
-        ?>
2226
+			$desc_class = ' required_field';
2227
+		} else {
2228
+			$desc_class = ' hidden';
2229
+		}
2230
+		?>
2231 2231
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2232 2232
             <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2233 2233
             <?php
2234
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2235
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2236
-            ?>
2234
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2235
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2236
+			?>
2237 2237
                 <div class="editor" field_id="post_desc" field_type="editor">
2238 2238
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2239 2239
                 </div>
@@ -2247,56 +2247,56 @@  discard block
 block discarded – undo
2247 2247
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2248 2248
         </div>
2249 2249
         <?php
2250
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2251
-            /**
2252
-             * Called on the add listing page form for frontend just after the description field.
2253
-             *
2254
-             * @since 1.0.0
2255
-             */
2256
-            do_action('geodir_after_description_field');
2257
-        }
2250
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2251
+			/**
2252
+			 * Called on the add listing page form for frontend just after the description field.
2253
+			 *
2254
+			 * @since 1.0.0
2255
+			 */
2256
+			do_action('geodir_after_description_field');
2257
+		}
2258 2258
         
2259
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2260
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2261
-        $kw_tags_msg = TAGKW_MSG;
2262
-        /**
2263
-         * Filter the add listing tags character limit.
2264
-         *
2265
-         * @since 1.0.0
2266
-         * @param int $kw_tags_count The character count limit if any.
2267
-         */
2268
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2269
-        /**
2270
-         * Filter the add listing tags field value.
2271
-         *
2272
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2273
-         *
2274
-         * @since 1.0.0
2275
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2276
-         * @param int $kw_tags_count The character count limit if any.
2277
-         */
2278
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2279
-        /**
2280
-         * Filter the add listing tags field message text.
2281
-         *
2282
-         * @since 1.0.0
2283
-         * @param string $kw_tags_msg The message shown under the field.
2284
-         * @param int $kw_tags_count The character count limit if any.
2285
-         */
2286
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2259
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2260
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2261
+		$kw_tags_msg = TAGKW_MSG;
2262
+		/**
2263
+		 * Filter the add listing tags character limit.
2264
+		 *
2265
+		 * @since 1.0.0
2266
+		 * @param int $kw_tags_count The character count limit if any.
2267
+		 */
2268
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2269
+		/**
2270
+		 * Filter the add listing tags field value.
2271
+		 *
2272
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2273
+		 *
2274
+		 * @since 1.0.0
2275
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2276
+		 * @param int $kw_tags_count The character count limit if any.
2277
+		 */
2278
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2279
+		/**
2280
+		 * Filter the add listing tags field message text.
2281
+		 *
2282
+		 * @since 1.0.0
2283
+		 * @param string $kw_tags_msg The message shown under the field.
2284
+		 * @param int $kw_tags_count The character count limit if any.
2285
+		 */
2286
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2287 2287
         
2288
-        $tags_class = '';
2289
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2290
-            /**
2291
-             * Called on the add listing page form for frontend just before the tags field.
2292
-             *
2293
-             * @since 1.0.0
2294
-             */
2295
-            do_action('geodir_before_listing_tags_field');
2296
-        } else {
2297
-            $tags_class = ' hidden';
2298
-        }
2299
-        ?>
2288
+		$tags_class = '';
2289
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2290
+			/**
2291
+			 * Called on the add listing page form for frontend just before the tags field.
2292
+			 *
2293
+			 * @since 1.0.0
2294
+			 */
2295
+			do_action('geodir_before_listing_tags_field');
2296
+		} else {
2297
+			$tags_class = ' hidden';
2298
+		}
2299
+		?>
2300 2300
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2301 2301
             <label><?php echo TAGKW_TEXT; ?></label>
2302 2302
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2304,90 +2304,90 @@  discard block
 block discarded – undo
2304 2304
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2305 2305
         </div>
2306 2306
         <?php
2307
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2308
-            /**
2309
-             * Called on the add listing page form for frontend just after the tags field.
2310
-             *
2311
-             * @since 1.0.0
2312
-             */
2313
-            do_action('geodir_after_listing_tags_field');
2314
-        }
2307
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2308
+			/**
2309
+			 * Called on the add listing page form for frontend just after the tags field.
2310
+			 *
2311
+			 * @since 1.0.0
2312
+			 */
2313
+			do_action('geodir_after_listing_tags_field');
2314
+		}
2315 2315
         
2316
-        $package_info = array();
2317
-        $package_info = geodir_post_package_info($package_info, $post);
2316
+		$package_info = array();
2317
+		$package_info = geodir_post_package_info($package_info, $post);
2318 2318
         
2319
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2319
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2320 2320
         
2321
-        // adjust values here
2322
-        $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
2321
+		// adjust values here
2322
+		$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
2323 2323
 
2324
-        $multiple = true; // allow multiple files upload
2324
+		$multiple = true; // allow multiple files upload
2325 2325
 
2326
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2326
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2327 2327
 
2328
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2328
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2329 2329
 
2330
-        $thumb_img_arr = array();
2331
-        $totImg = 0;
2332
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2333
-            $post = (object)$gd_session->get('listing');
2334
-            if (isset($post->post_images))
2335
-                $curImages = trim($post->post_images, ",");
2330
+		$thumb_img_arr = array();
2331
+		$totImg = 0;
2332
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2333
+			$post = (object)$gd_session->get('listing');
2334
+			if (isset($post->post_images))
2335
+				$curImages = trim($post->post_images, ",");
2336 2336
 
2337 2337
 
2338
-            if ($curImages != '') {
2339
-                $curImages_array = explode(',', $curImages);
2340
-                $totImg = count($curImages_array);
2341
-            }
2342
-
2343
-            $listing_type = $post->listing_type;
2338
+			if ($curImages != '') {
2339
+				$curImages_array = explode(',', $curImages);
2340
+				$totImg = count($curImages_array);
2341
+			}
2344 2342
 
2345
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2346
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2347
-            $listing_type = $post->post_type;
2348
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2343
+			$listing_type = $post->listing_type;
2349 2344
 
2350
-        } else {
2351
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2352
-        }
2345
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2346
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2347
+			$listing_type = $post->post_type;
2348
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2353 2349
 
2350
+		} else {
2351
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2352
+		}
2354 2353
 
2355
-        if (!empty($thumb_img_arr)) {
2356
-            foreach ($thumb_img_arr as $img) {
2357
-                //$curImages = $img->src.",";
2358
-            }
2359 2354
 
2360
-            $totImg = count((array)$thumb_img_arr);
2361
-        }
2355
+		if (!empty($thumb_img_arr)) {
2356
+			foreach ($thumb_img_arr as $img) {
2357
+				//$curImages = $img->src.",";
2358
+			}
2362 2359
 
2363
-        if ($curImages != '')
2364
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2365
-        else
2366
-            $svalue = '';
2367
-
2368
-        $image_limit = $package_info->image_limit;
2369
-        $show_image_input_box = ($image_limit != '0');
2370
-        /**
2371
-         * Filter to be able to show/hide the image upload section of the add listing form.
2372
-         *
2373
-         * @since 1.0.0
2374
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2375
-         * @param string $listing_type The custom post type slug.
2376
-         */
2377
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2378
-        if ($show_image_input_box) {
2379
-            ?>
2360
+			$totImg = count((array)$thumb_img_arr);
2361
+		}
2362
+
2363
+		if ($curImages != '')
2364
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2365
+		else
2366
+			$svalue = '';
2367
+
2368
+		$image_limit = $package_info->image_limit;
2369
+		$show_image_input_box = ($image_limit != '0');
2370
+		/**
2371
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2372
+		 *
2373
+		 * @since 1.0.0
2374
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2375
+		 * @param string $listing_type The custom post type slug.
2376
+		 */
2377
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2378
+		if ($show_image_input_box) {
2379
+			?>
2380 2380
 
2381 2381
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2382 2382
                 <?php if ($image_limit == 1) {
2383
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2384
-                } ?>
2383
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2384
+				} ?>
2385 2385
                 <?php if ($image_limit > 1) {
2386
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2387
-                } ?>
2386
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2387
+				} ?>
2388 2388
                 <?php if ($image_limit == '') {
2389
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2390
-                } ?>
2389
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2390
+				} ?>
2391 2391
             </h5>
2392 2392
 
2393 2393
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2425,12 +2425,12 @@  discard block
 block discarded – undo
2425 2425
         <?php } ?>
2426 2426
 
2427 2427
         <?php
2428
-        /**
2429
-         * Called on the add listing page form for frontend just after the image upload field.
2430
-         *
2431
-         * @since 1.0.0
2432
-         */
2433
-        do_action('geodir_after_main_form_fields');?>
2428
+		/**
2429
+		 * Called on the add listing page form for frontend just after the image upload field.
2430
+		 *
2431
+		 * @since 1.0.0
2432
+		 */
2433
+		do_action('geodir_after_main_form_fields');?>
2434 2434
 
2435 2435
 
2436 2436
         <!-- add captcha code -->
@@ -2459,7 +2459,7 @@  discard block
 block discarded – undo
2459 2459
 
2460 2460
     </form>
2461 2461
     <?php
2462
-    wp_reset_query();
2462
+	wp_reset_query();
2463 2463
 }
2464 2464
 
2465 2465
 /**
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
  */
2471 2471
 function geodir_add_listing_sidebar_widget_area()
2472 2472
 {
2473
-    dynamic_sidebar('geodir_add_listing_sidebar');
2473
+	dynamic_sidebar('geodir_add_listing_sidebar');
2474 2474
 }
2475 2475
 
2476 2476
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2485,16 +2485,16 @@  discard block
 block discarded – undo
2485 2485
  */
2486 2486
 function geodir_action_add_listing_sidebar()
2487 2487
 {
2488
-    /** This action is documented in geodirectory_template_actions.php */
2489
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2490
-    /**
2491
-     * This is used to add the content to the add listing page sidebar.
2492
-     *
2493
-     * @since 1.0.0
2494
-     */
2495
-    do_action('geodir_add_listing_sidebar_inside');
2496
-    /** This action is documented in geodirectory_template_actions.php */
2497
-    do_action('geodir_sidebar_right_close', 'details-page');
2488
+	/** This action is documented in geodirectory_template_actions.php */
2489
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2490
+	/**
2491
+	 * This is used to add the content to the add listing page sidebar.
2492
+	 *
2493
+	 * @since 1.0.0
2494
+	 */
2495
+	do_action('geodir_add_listing_sidebar_inside');
2496
+	/** This action is documented in geodirectory_template_actions.php */
2497
+	do_action('geodir_sidebar_right_close', 'details-page');
2498 2498
 }
2499 2499
 
2500 2500
 ###############################################
@@ -2511,11 +2511,11 @@  discard block
 block discarded – undo
2511 2511
  */
2512 2512
 function geodir_action_geodir_sidebar_signup_top()
2513 2513
 {
2514
-    ?>
2514
+	?>
2515 2515
     <div
2516 2516
         class="<?php
2517
-        /** This action is documented in geodirectory_template_actions.php */
2518
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2517
+		/** This action is documented in geodirectory_template_actions.php */
2518
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2519 2519
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2520 2520
     </div><!-- clearfix ends here-->
2521 2521
 <?php
@@ -2534,9 +2534,9 @@  discard block
 block discarded – undo
2534 2534
 function geodir_action_signup_forms()
2535 2535
 {
2536 2536
 
2537
-    global $user_login;
2537
+	global $user_login;
2538 2538
 
2539
-    ?>
2539
+	?>
2540 2540
     <script type="text/javascript">
2541 2541
         <?php if ( $user_login ) { ?>
2542 2542
         setTimeout(function () {
@@ -2572,65 +2572,65 @@  discard block
 block discarded – undo
2572 2572
         <?php } ?>
2573 2573
     </script><?php
2574 2574
 
2575
-    global $errors;
2576
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2577
-        $errors->add('claim_login', LOGIN_CLAIM);
2578
-
2579
-    if (!empty($errors)) {
2580
-        foreach ($errors as $errorsObj) {
2581
-            foreach ($errorsObj as $key => $val) {
2582
-                for ($i = 0; $i < count($val); $i++) {
2583
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2584
-                    $registration_error_msg = 1;
2585
-                }
2586
-            }
2587
-        }
2588
-    }
2575
+	global $errors;
2576
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2577
+		$errors->add('claim_login', LOGIN_CLAIM);
2578
+
2579
+	if (!empty($errors)) {
2580
+		foreach ($errors as $errorsObj) {
2581
+			foreach ($errorsObj as $key => $val) {
2582
+				for ($i = 0; $i < count($val); $i++) {
2583
+					echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2584
+					$registration_error_msg = 1;
2585
+				}
2586
+			}
2587
+		}
2588
+	}
2589 2589
 
2590
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2591
-        ?>
2590
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2591
+		?>
2592 2592
 
2593 2593
         <div class="login_form">
2594 2594
             <?php
2595
-            /**
2596
-             * Contains login form template.
2597
-             *
2598
-             * @since 1.0.0
2599
-             */
2600
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2595
+			/**
2596
+			 * Contains login form template.
2597
+			 *
2598
+			 * @since 1.0.0
2599
+			 */
2600
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2601 2601
         </div>
2602 2602
 
2603 2603
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2604 2604
 
2605 2605
         <div class="registration_form">
2606 2606
             <?php
2607
-            /**
2608
-             * Contains registration form template.
2609
-             *
2610
-             * @since 1.0.0
2611
-             */
2612
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2607
+			/**
2608
+			 * Contains registration form template.
2609
+			 *
2610
+			 * @since 1.0.0
2611
+			 */
2612
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2613 2613
         </div>
2614 2614
 
2615 2615
     <?php } else { ?>
2616 2616
 
2617 2617
         <div class="login_form_l">
2618 2618
             <?php
2619
-            /**
2620
-             * Contains login form template.
2621
-             *
2622
-             * @since 1.0.0
2623
-             */
2624
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2619
+			/**
2620
+			 * Contains login form template.
2621
+			 *
2622
+			 * @since 1.0.0
2623
+			 */
2624
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2625 2625
         </div>
2626 2626
         <div class="registration_form_r">
2627 2627
             <?php
2628
-            /**
2629
-             * Contains registration form template.
2630
-             *
2631
-             * @since 1.0.0
2632
-             */
2633
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2628
+			/**
2629
+			 * Contains registration form template.
2630
+			 *
2631
+			 * @since 1.0.0
2632
+			 */
2633
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2634 2634
         </div>
2635 2635
 
2636 2636
     <?php }?>
@@ -2661,66 +2661,66 @@  discard block
 block discarded – undo
2661 2661
  */
2662 2662
 function geodir_action_author_page_title()
2663 2663
 {
2664
-    global $term;
2664
+	global $term;
2665 2665
 
2666
-    $gd_post_type = geodir_get_current_posttype();
2667
-    $post_type_info = get_post_type_object($gd_post_type);
2666
+	$gd_post_type = geodir_get_current_posttype();
2667
+	$post_type_info = get_post_type_object($gd_post_type);
2668 2668
 
2669
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2670
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2671
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2672
-    }
2669
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2670
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2671
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2672
+	}
2673 2673
 
2674
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2675
-    $single_name = $post_type_info->labels->singular_name;
2674
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2675
+	$single_name = $post_type_info->labels->singular_name;
2676 2676
 
2677
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2677
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2678 2678
 
2679
-    if (!empty($term)) {
2680
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2681
-        if (!empty($current_term))
2682
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2683
-    }
2679
+	if (!empty($term)) {
2680
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2681
+		if (!empty($current_term))
2682
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2683
+	}
2684 2684
 
2685 2685
 
2686
-    if (is_search()) {
2687
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2686
+	if (is_search()) {
2687
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2688 2688
 
2689
-    }
2690
-    /** This action is documented in geodirectory_template_actions.php */
2691
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2692
-    /** This action is documented in geodirectory_template_actions.php */
2693
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2689
+	}
2690
+	/** This action is documented in geodirectory_template_actions.php */
2691
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2692
+	/** This action is documented in geodirectory_template_actions.php */
2693
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2694 2694
 
2695
-    $title = $list_title;
2696
-    if(geodir_is_page('author')){
2697
-        $gd_page = 'author';
2698
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2699
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2700
-        }else{
2701
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2702
-        }
2695
+	$title = $list_title;
2696
+	if(geodir_is_page('author')){
2697
+		$gd_page = 'author';
2698
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2699
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2700
+		}else{
2701
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2702
+		}
2703 2703
 
2704
-    }
2704
+	}
2705 2705
 
2706 2706
 
2707
-    /**
2708
-     * Filter page title to replace variables.
2709
-     *
2710
-     * @since 1.5.4
2711
-     * @param string $title The page title including variables.
2712
-     * @param string $gd_page The GeoDirectory page type if any.
2713
-     */
2714
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2707
+	/**
2708
+	 * Filter page title to replace variables.
2709
+	 *
2710
+	 * @since 1.5.4
2711
+	 * @param string $title The page title including variables.
2712
+	 * @param string $gd_page The GeoDirectory page type if any.
2713
+	 */
2714
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2715 2715
 
2716
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2717
-        /**
2718
-         * Filter the author page title text.
2719
-         *
2720
-         * @since 1.0.0
2721
-         * @param string $list_title The title for the page.
2722
-         */
2723
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2716
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2717
+		/**
2718
+		 * Filter the author page title text.
2719
+		 *
2720
+		 * @since 1.0.0
2721
+		 * @param string $list_title The title for the page.
2722
+		 */
2723
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2724 2724
 }
2725 2725
 
2726 2726
 
@@ -2738,11 +2738,11 @@  discard block
 block discarded – undo
2738 2738
  */
2739 2739
 function geodir_action_geodir_sidebar_author_top()
2740 2740
 {
2741
-    if (get_option('geodir_show_author_top_section')) { ?>
2741
+	if (get_option('geodir_show_author_top_section')) { ?>
2742 2742
         <div
2743 2743
             class="<?php
2744
-            /** This action is documented in geodirectory_template_actions.php */
2745
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2744
+			/** This action is documented in geodirectory_template_actions.php */
2745
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2746 2746
             <?php dynamic_sidebar('geodir_author_top'); ?>
2747 2747
         </div><!-- clearfix ends here-->
2748 2748
     <?php }
@@ -2758,7 +2758,7 @@  discard block
 block discarded – undo
2758 2758
  */
2759 2759
 function geodir_author_left_section()
2760 2760
 {
2761
-    if (get_option('geodir_show_author_left_section')) { ?>
2761
+	if (get_option('geodir_show_author_left_section')) { ?>
2762 2762
         <div class="geodir-content-left geodir-sidebar-wrap">
2763 2763
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2764 2764
         </div><!-- end geodir-content-left -->
@@ -2779,19 +2779,19 @@  discard block
 block discarded – undo
2779 2779
  */
2780 2780
 function geodir_action_author_sidebar_left()
2781 2781
 {
2782
-    if (get_option('geodir_show_author_left_section')) {
2782
+	if (get_option('geodir_show_author_left_section')) {
2783 2783
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2784
-        /** This action is documented in geodirectory_template_actions.php */
2785
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2786
-        /**
2787
-         * This is used to add the content to the author page left sidebar (if active).
2788
-         *
2789
-         * @since 1.0.0
2790
-         */
2791
-        do_action('geodir_author_sidebar_left_inside');
2792
-        /** This action is documented in geodirectory_template_actions.php */
2793
-        do_action('geodir_sidebar_left_close', 'author-page');
2794
-    }
2784
+		/** This action is documented in geodirectory_template_actions.php */
2785
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2786
+		/**
2787
+		 * This is used to add the content to the author page left sidebar (if active).
2788
+		 *
2789
+		 * @since 1.0.0
2790
+		 */
2791
+		do_action('geodir_author_sidebar_left_inside');
2792
+		/** This action is documented in geodirectory_template_actions.php */
2793
+		do_action('geodir_sidebar_left_close', 'author-page');
2794
+	}
2795 2795
 }
2796 2796
 
2797 2797
 /**
@@ -2804,7 +2804,7 @@  discard block
 block discarded – undo
2804 2804
  */
2805 2805
 function geodir_author_right_section()
2806 2806
 {
2807
-    if (get_option('geodir_show_author_right_section')) { ?>
2807
+	if (get_option('geodir_show_author_right_section')) { ?>
2808 2808
         <div class="geodir-content-right geodir-sidebar-wrap">
2809 2809
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2810 2810
         </div><!-- end geodir-content-right -->
@@ -2824,18 +2824,18 @@  discard block
 block discarded – undo
2824 2824
  */
2825 2825
 function geodir_action_author_sidebar_right()
2826 2826
 {
2827
-    if (get_option('geodir_show_author_right_section')) {
2828
-        /** This action is documented in geodirectory_template_actions.php */
2829
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2830
-        /**
2831
-         * This is used to add the content to the author page right sidebar (if active).
2832
-         *
2833
-         * @since 1.0.0
2834
-         */
2835
-        do_action('geodir_author_sidebar_right_inside');
2836
-        /** This action is documented in geodirectory_template_actions.php */
2837
-        do_action('geodir_sidebar_right_close', 'author-page');
2838
-    }
2827
+	if (get_option('geodir_show_author_right_section')) {
2828
+		/** This action is documented in geodirectory_template_actions.php */
2829
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2830
+		/**
2831
+		 * This is used to add the content to the author page right sidebar (if active).
2832
+		 *
2833
+		 * @since 1.0.0
2834
+		 */
2835
+		do_action('geodir_author_sidebar_right_inside');
2836
+		/** This action is documented in geodirectory_template_actions.php */
2837
+		do_action('geodir_sidebar_right_close', 'author-page');
2838
+	}
2839 2839
 }
2840 2840
 
2841 2841
 /**
@@ -2847,14 +2847,14 @@  discard block
 block discarded – undo
2847 2847
  */
2848 2848
 function geodir_action_author_content_inside()
2849 2849
 {
2850
-    global $gridview_columns;
2851
-    $listing_view = get_option('geodir_author_view');
2852
-    if (strstr($listing_view, 'gridview')) {
2853
-        $gridview_columns = $listing_view;
2854
-        $listing_view_exp = explode('_', $listing_view);
2855
-        $listing_view = $listing_view_exp[0];
2856
-    }
2857
-    geodir_get_template_part('listing', 'listview');
2850
+	global $gridview_columns;
2851
+	$listing_view = get_option('geodir_author_view');
2852
+	if (strstr($listing_view, 'gridview')) {
2853
+		$gridview_columns = $listing_view;
2854
+		$listing_view_exp = explode('_', $listing_view);
2855
+		$listing_view = $listing_view_exp[0];
2856
+	}
2857
+	geodir_get_template_part('listing', 'listview');
2858 2858
 }
2859 2859
 
2860 2860
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2869,22 +2869,22 @@  discard block
 block discarded – undo
2869 2869
  */
2870 2870
 function geodir_action_author_content()
2871 2871
 {
2872
-    /** This action is documented in geodirectory_template_actions.php */
2873
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2874
-    echo '<div class="clearfix">';
2875
-    /** This action is documented in geodirectory_template_actions.php */
2876
-    do_action('geodir_before_listing');
2877
-    echo '</div>';
2878
-    /**
2879
-     * This is used to add the content to the author page main content.
2880
-     *
2881
-     * @since 1.0.0
2882
-     */
2883
-    do_action('geodir_author_content_inside');
2884
-    /** This action is documented in geodirectory_template_actions.php */
2885
-    do_action('geodir_after_listing');
2886
-    /** This action is documented in geodirectory_template_actions.php */
2887
-    do_action('geodir_main_content_close', 'author-page');
2872
+	/** This action is documented in geodirectory_template_actions.php */
2873
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2874
+	echo '<div class="clearfix">';
2875
+	/** This action is documented in geodirectory_template_actions.php */
2876
+	do_action('geodir_before_listing');
2877
+	echo '</div>';
2878
+	/**
2879
+	 * This is used to add the content to the author page main content.
2880
+	 *
2881
+	 * @since 1.0.0
2882
+	 */
2883
+	do_action('geodir_author_content_inside');
2884
+	/** This action is documented in geodirectory_template_actions.php */
2885
+	do_action('geodir_after_listing');
2886
+	/** This action is documented in geodirectory_template_actions.php */
2887
+	do_action('geodir_main_content_close', 'author-page');
2888 2888
 }
2889 2889
 
2890 2890
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2898,11 +2898,11 @@  discard block
 block discarded – undo
2898 2898
  */
2899 2899
 function geodir_action_sidebar_author_bottom_section()
2900 2900
 {
2901
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2901
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2902 2902
         <div
2903 2903
             class="<?php
2904
-            /** This action is documented in geodirectory_template_actions.php */
2905
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2904
+			/** This action is documented in geodirectory_template_actions.php */
2905
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2906 2906
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2907 2907
         </div><!-- clearfix ends here-->
2908 2908
     <?php }
@@ -2921,23 +2921,23 @@  discard block
 block discarded – undo
2921 2921
  */
2922 2922
 function geodir_action_search_page_title()
2923 2923
 {
2924
-    $gd_post_type = geodir_get_current_posttype();
2925
-    $post_type_info = get_post_type_object($gd_post_type);
2924
+	$gd_post_type = geodir_get_current_posttype();
2925
+	$post_type_info = get_post_type_object($gd_post_type);
2926 2926
 
2927
-    $pt_name = '';
2928
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2927
+	$pt_name = '';
2928
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2929 2929
 
2930
-    if (is_search()) {
2931
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2930
+	if (is_search()) {
2931
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2932 2932
 
2933
-    }
2934
-    /** This action is documented in geodirectory_template_actions.php */
2935
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2936
-    /** This action is documented in geodirectory_template_actions.php */
2937
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2938
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2939
-        /** This action is documented in geodirectory_template_actions.php */
2940
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2933
+	}
2934
+	/** This action is documented in geodirectory_template_actions.php */
2935
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2936
+	/** This action is documented in geodirectory_template_actions.php */
2937
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2938
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2939
+		/** This action is documented in geodirectory_template_actions.php */
2940
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2941 2941
 }
2942 2942
 
2943 2943
 // action for adding the listings page top widget area
@@ -2953,11 +2953,11 @@  discard block
 block discarded – undo
2953 2953
  */
2954 2954
 function geodir_action_geodir_sidebar_search_top()
2955 2955
 {
2956
-    if (get_option('geodir_show_search_top_section')) { ?>
2956
+	if (get_option('geodir_show_search_top_section')) { ?>
2957 2957
         <div
2958 2958
             class="<?php
2959
-            /** This action is documented in geodirectory_template_actions.php */
2960
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2959
+			/** This action is documented in geodirectory_template_actions.php */
2960
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2961 2961
             <?php dynamic_sidebar('geodir_search_top'); ?>
2962 2962
         </div><!-- clearfix ends here-->
2963 2963
     <?php }
@@ -2973,7 +2973,7 @@  discard block
 block discarded – undo
2973 2973
  */
2974 2974
 function geodir_search_left_section()
2975 2975
 {
2976
-    if (get_option('geodir_show_search_left_section')) { ?>
2976
+	if (get_option('geodir_show_search_left_section')) { ?>
2977 2977
         <div class="geodir-content-left geodir-sidebar-wrap">
2978 2978
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
2979 2979
         </div><!-- end geodir-content-left -->
@@ -2993,19 +2993,19 @@  discard block
 block discarded – undo
2993 2993
  */
2994 2994
 function geodir_action_search_sidebar_left()
2995 2995
 {
2996
-    if (get_option('geodir_show_search_left_section')) {
2996
+	if (get_option('geodir_show_search_left_section')) {
2997 2997
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2998
-        /** This action is documented in geodirectory_template_actions.php */
2999
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3000
-        /**
3001
-         * This is used to add the content to the search page left sidebar (if active).
3002
-         *
3003
-         * @since 1.0.0
3004
-         */
3005
-        do_action('geodir_search_sidebar_left_inside');
3006
-        /** This action is documented in geodirectory_template_actions.php */
3007
-        do_action('geodir_sidebar_left_close', 'search-page');
3008
-    }
2998
+		/** This action is documented in geodirectory_template_actions.php */
2999
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3000
+		/**
3001
+		 * This is used to add the content to the search page left sidebar (if active).
3002
+		 *
3003
+		 * @since 1.0.0
3004
+		 */
3005
+		do_action('geodir_search_sidebar_left_inside');
3006
+		/** This action is documented in geodirectory_template_actions.php */
3007
+		do_action('geodir_sidebar_left_close', 'search-page');
3008
+	}
3009 3009
 }
3010 3010
 
3011 3011
 /**
@@ -3018,7 +3018,7 @@  discard block
 block discarded – undo
3018 3018
  */
3019 3019
 function geodir_search_right_section()
3020 3020
 {
3021
-    if (get_option('geodir_show_search_right_section')) { ?>
3021
+	if (get_option('geodir_show_search_right_section')) { ?>
3022 3022
         <div class="geodir-content-right geodir-sidebar-wrap">
3023 3023
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3024 3024
         </div><!-- end geodir-content-right -->
@@ -3038,18 +3038,18 @@  discard block
 block discarded – undo
3038 3038
  */
3039 3039
 function geodir_action_search_sidebar_right()
3040 3040
 {
3041
-    if (get_option('geodir_show_search_right_section')) {
3042
-        /** This action is documented in geodirectory_template_actions.php */
3043
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3044
-        /**
3045
-         * This is used to add the content to the search page right sidebar (if active).
3046
-         *
3047
-         * @since 1.0.0
3048
-         */
3049
-        do_action('geodir_search_sidebar_right_inside');
3050
-        /** This action is documented in geodirectory_template_actions.php */
3051
-        do_action('geodir_sidebar_right_close', 'search-page');
3052
-    }
3041
+	if (get_option('geodir_show_search_right_section')) {
3042
+		/** This action is documented in geodirectory_template_actions.php */
3043
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3044
+		/**
3045
+		 * This is used to add the content to the search page right sidebar (if active).
3046
+		 *
3047
+		 * @since 1.0.0
3048
+		 */
3049
+		do_action('geodir_search_sidebar_right_inside');
3050
+		/** This action is documented in geodirectory_template_actions.php */
3051
+		do_action('geodir_sidebar_right_close', 'search-page');
3052
+	}
3053 3053
 }
3054 3054
 
3055 3055
 
@@ -3064,11 +3064,11 @@  discard block
 block discarded – undo
3064 3064
  */
3065 3065
 function geodir_action_sidebar_search_bottom_section()
3066 3066
 {
3067
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3067
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3068 3068
         <div
3069 3069
             class="<?php
3070
-            /** This action is documented in geodirectory_template_actions.php */
3071
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3070
+			/** This action is documented in geodirectory_template_actions.php */
3071
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3072 3072
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3073 3073
         </div><!-- clearfix ends here-->
3074 3074
     <?php }
@@ -3083,14 +3083,14 @@  discard block
 block discarded – undo
3083 3083
  */
3084 3084
 function geodir_action_search_content_inside()
3085 3085
 {
3086
-    global $gridview_columns;
3087
-    $listing_view = get_option('geodir_search_view');
3088
-    if (strstr($listing_view, 'gridview')) {
3089
-        $gridview_columns = $listing_view;
3090
-        $listing_view_exp = explode('_', $listing_view);
3091
-        $listing_view = $listing_view_exp[0];
3092
-    }
3093
-    geodir_get_template_part('listing', 'listview');
3086
+	global $gridview_columns;
3087
+	$listing_view = get_option('geodir_search_view');
3088
+	if (strstr($listing_view, 'gridview')) {
3089
+		$gridview_columns = $listing_view;
3090
+		$listing_view_exp = explode('_', $listing_view);
3091
+		$listing_view = $listing_view_exp[0];
3092
+	}
3093
+	geodir_get_template_part('listing', 'listview');
3094 3094
 }
3095 3095
 
3096 3096
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3106,22 +3106,22 @@  discard block
 block discarded – undo
3106 3106
  */
3107 3107
 function geodir_action_search_content()
3108 3108
 {
3109
-    /** This action is documented in geodirectory_template_actions.php */
3110
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3111
-    echo '<div class="clearfix">';
3112
-    /** This action is documented in geodirectory_template_actions.php */
3113
-    do_action('geodir_before_listing');
3114
-    echo '</div>';
3115
-    /**
3116
-     * This is used to add the content to the search page main content.
3117
-     *
3118
-     * @since 1.0.0
3119
-     */
3120
-    do_action('geodir_search_content_inside');
3121
-    /** This action is documented in geodirectory_template_actions.php */
3122
-    do_action('geodir_after_listing');
3123
-    /** This action is documented in geodirectory_template_actions.php */
3124
-    do_action('geodir_main_content_close', 'search-page');
3109
+	/** This action is documented in geodirectory_template_actions.php */
3110
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3111
+	echo '<div class="clearfix">';
3112
+	/** This action is documented in geodirectory_template_actions.php */
3113
+	do_action('geodir_before_listing');
3114
+	echo '</div>';
3115
+	/**
3116
+	 * This is used to add the content to the search page main content.
3117
+	 *
3118
+	 * @since 1.0.0
3119
+	 */
3120
+	do_action('geodir_search_content_inside');
3121
+	/** This action is documented in geodirectory_template_actions.php */
3122
+	do_action('geodir_after_listing');
3123
+	/** This action is documented in geodirectory_template_actions.php */
3124
+	do_action('geodir_main_content_close', 'search-page');
3125 3125
 }
3126 3126
 
3127 3127
 ###############################################
@@ -3144,11 +3144,11 @@  discard block
 block discarded – undo
3144 3144
  */
3145 3145
 function geodir_action_geodir_sidebar_home_top()
3146 3146
 {
3147
-    if (get_option('geodir_show_home_top_section')) { ?>
3147
+	if (get_option('geodir_show_home_top_section')) { ?>
3148 3148
         <div
3149 3149
             class="<?php
3150
-            /** This action is documented in geodirectory_template_actions.php */
3151
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3150
+			/** This action is documented in geodirectory_template_actions.php */
3151
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3152 3152
             <?php dynamic_sidebar('geodir_home_top'); ?>
3153 3153
         </div><!-- clearfix ends here-->
3154 3154
     <?php }
@@ -3164,7 +3164,7 @@  discard block
 block discarded – undo
3164 3164
  */
3165 3165
 function geodir_home_left_section()
3166 3166
 {
3167
-    if (get_option('geodir_show_home_left_section')) { ?>
3167
+	if (get_option('geodir_show_home_left_section')) { ?>
3168 3168
         <div class="geodir-content-left geodir-sidebar-wrap">
3169 3169
             <?php dynamic_sidebar('geodir_home_left'); ?>
3170 3170
         </div><!-- end geodir-content-left -->
@@ -3186,19 +3186,19 @@  discard block
 block discarded – undo
3186 3186
  */
3187 3187
 function geodir_action_home_sidebar_left()
3188 3188
 {
3189
-    if (get_option('geodir_show_home_left_section')) {
3189
+	if (get_option('geodir_show_home_left_section')) {
3190 3190
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3191
-        /** This action is documented in geodirectory_template_actions.php */
3192
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3193
-        /**
3194
-         * This is used to add the content to the home page left sidebar (if active).
3195
-         *
3196
-         * @since 1.0.0
3197
-         */
3198
-        do_action('geodir_home_sidebar_left_inside');
3199
-        /** This action is documented in geodirectory_template_actions.php */
3200
-        do_action('geodir_sidebar_left_close', 'home-page');
3201
-    }
3191
+		/** This action is documented in geodirectory_template_actions.php */
3192
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3193
+		/**
3194
+		 * This is used to add the content to the home page left sidebar (if active).
3195
+		 *
3196
+		 * @since 1.0.0
3197
+		 */
3198
+		do_action('geodir_home_sidebar_left_inside');
3199
+		/** This action is documented in geodirectory_template_actions.php */
3200
+		do_action('geodir_sidebar_left_close', 'home-page');
3201
+	}
3202 3202
 }
3203 3203
 
3204 3204
 /**
@@ -3211,7 +3211,7 @@  discard block
 block discarded – undo
3211 3211
  */
3212 3212
 function geodir_home_right_section()
3213 3213
 {
3214
-    if (get_option('geodir_show_home_right_section')) { ?>
3214
+	if (get_option('geodir_show_home_right_section')) { ?>
3215 3215
         <div class="geodir-content-right geodir-sidebar-wrap">
3216 3216
             <?php dynamic_sidebar('geodir_home_right'); ?>
3217 3217
         </div><!-- end geodir-content-right -->
@@ -3232,18 +3232,18 @@  discard block
 block discarded – undo
3232 3232
  */
3233 3233
 function geodir_action_home_sidebar_right()
3234 3234
 {
3235
-    if (get_option('geodir_show_home_right_section')) {
3236
-        /** This action is documented in geodirectory_template_actions.php */
3237
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3238
-        /**
3239
-         * This is used to add the content to the home page right sidebar (if active).
3240
-         *
3241
-         * @since 1.0.0
3242
-         */
3243
-        do_action('geodir_home_sidebar_right_inside');
3244
-        /** This action is documented in geodirectory_template_actions.php */
3245
-        do_action('geodir_sidebar_right_close', 'home-page');
3246
-    }
3235
+	if (get_option('geodir_show_home_right_section')) {
3236
+		/** This action is documented in geodirectory_template_actions.php */
3237
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3238
+		/**
3239
+		 * This is used to add the content to the home page right sidebar (if active).
3240
+		 *
3241
+		 * @since 1.0.0
3242
+		 */
3243
+		do_action('geodir_home_sidebar_right_inside');
3244
+		/** This action is documented in geodirectory_template_actions.php */
3245
+		do_action('geodir_sidebar_right_close', 'home-page');
3246
+	}
3247 3247
 }
3248 3248
 
3249 3249
 /**
@@ -3254,7 +3254,7 @@  discard block
 block discarded – undo
3254 3254
  */
3255 3255
 function geodir_action_home_content_inside()
3256 3256
 {
3257
-    dynamic_sidebar('geodir_home_content');
3257
+	dynamic_sidebar('geodir_home_content');
3258 3258
 }
3259 3259
 
3260 3260
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3269,28 +3269,28 @@  discard block
 block discarded – undo
3269 3269
  */
3270 3270
 function geodir_action_home_content()
3271 3271
 {
3272
-    /** This action is documented in geodirectory_template_actions.php */
3273
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3274
-    /**
3275
-     * This called before the home page main content.
3276
-     *
3277
-     * @since 1.0.0
3278
-     */
3279
-    do_action('geodir_before_home_content');
3280
-    /**
3281
-     * This is used to add the content to the home page main content.
3282
-     *
3283
-     * @since 1.0.0
3284
-     */
3285
-    do_action('geodir_home_content_inside');
3286
-    /**
3287
-     * This is called after the homepage main content.
3288
-     *
3289
-     * @since 1.0.0
3290
-     */
3291
-    do_action('geodir_after_home_content');
3292
-    /** This action is documented in geodirectory_template_actions.php */
3293
-    do_action('geodir_main_content_close', 'home-page');
3272
+	/** This action is documented in geodirectory_template_actions.php */
3273
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3274
+	/**
3275
+	 * This called before the home page main content.
3276
+	 *
3277
+	 * @since 1.0.0
3278
+	 */
3279
+	do_action('geodir_before_home_content');
3280
+	/**
3281
+	 * This is used to add the content to the home page main content.
3282
+	 *
3283
+	 * @since 1.0.0
3284
+	 */
3285
+	do_action('geodir_home_content_inside');
3286
+	/**
3287
+	 * This is called after the homepage main content.
3288
+	 *
3289
+	 * @since 1.0.0
3290
+	 */
3291
+	do_action('geodir_after_home_content');
3292
+	/** This action is documented in geodirectory_template_actions.php */
3293
+	do_action('geodir_main_content_close', 'home-page');
3294 3294
 }
3295 3295
 
3296 3296
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3305,11 +3305,11 @@  discard block
 block discarded – undo
3305 3305
  */
3306 3306
 function geodir_action_sidebar_home_bottom_section()
3307 3307
 {
3308
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3308
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3309 3309
         <div
3310 3310
             class="<?php
3311
-            /** This action is documented in geodirectory_template_actions.php */
3312
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3311
+			/** This action is documented in geodirectory_template_actions.php */
3312
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3313 3313
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3314 3314
         </div><!-- clearfix ends here-->
3315 3315
     <?php }
@@ -3337,13 +3337,13 @@  discard block
 block discarded – undo
3337 3337
  */
3338 3338
 function geodir_filter_listing_page_title($list_title)
3339 3339
 {
3340
-    if (is_search() && trim(get_search_query()) == '') {
3341
-        $gd_post_type = geodir_get_current_posttype();
3342
-        $post_type_info = get_post_type_object($gd_post_type);
3340
+	if (is_search() && trim(get_search_query()) == '') {
3341
+		$gd_post_type = geodir_get_current_posttype();
3342
+		$post_type_info = get_post_type_object($gd_post_type);
3343 3343
 
3344
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3345
-    }
3346
-    return $list_title;
3344
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3345
+	}
3346
+	return $list_title;
3347 3347
 }
3348 3348
 
3349 3349
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3358,61 +3358,61 @@  discard block
 block discarded – undo
3358 3358
  * @param string $gd_page The geodirectory page type. Default null.
3359 3359
  */
3360 3360
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3361
-    global $post;
3361
+	global $post;
3362 3362
         
3363
-    $gd_page_id = NULL;
3364
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3365
-        $gd_page_id = geodir_home_page_id();
3366
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3367
-        $gd_page_id = geodir_preview_page_id();
3368
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3369
-        $gd_page_id = geodir_add_listing_page_id();
3370
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3371
-        $gd_page_id = geodir_success_page_id();
3372
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3373
-        $gd_page_id = geodir_location_page_id();
3374
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3375
-        $gd_page_id = geodir_info_page_id();
3376
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3377
-        $gd_page_id = geodir_login_page_id();
3378
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3379
-        $gd_page_id = geodir_payment_checkout_page_id();
3380
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3381
-        $gd_page_id = geodir_payment_invoices_page_id();
3382
-    }
3363
+	$gd_page_id = NULL;
3364
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3365
+		$gd_page_id = geodir_home_page_id();
3366
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3367
+		$gd_page_id = geodir_preview_page_id();
3368
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3369
+		$gd_page_id = geodir_add_listing_page_id();
3370
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3371
+		$gd_page_id = geodir_success_page_id();
3372
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3373
+		$gd_page_id = geodir_location_page_id();
3374
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3375
+		$gd_page_id = geodir_info_page_id();
3376
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3377
+		$gd_page_id = geodir_login_page_id();
3378
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3379
+		$gd_page_id = geodir_payment_checkout_page_id();
3380
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3381
+		$gd_page_id = geodir_payment_invoices_page_id();
3382
+	}
3383 3383
     
3384
-    if (!$gd_page_id > 0) {
3385
-        return;
3386
-    }
3384
+	if (!$gd_page_id > 0) {
3385
+		return;
3386
+	}
3387 3387
     
3388
-    $display = 'before';
3389
-    /**
3390
-     * Filter the position to display the page content.
3391
-     *
3392
-     * @since 1.6.3
3393
-     *
3394
-     * @param string $display Position to add the post content.
3395
-     * @param string $gd_page The geodirectory page type.
3396
-     */
3397
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3388
+	$display = 'before';
3389
+	/**
3390
+	 * Filter the position to display the page content.
3391
+	 *
3392
+	 * @since 1.6.3
3393
+	 *
3394
+	 * @param string $display Position to add the post content.
3395
+	 * @param string $gd_page The geodirectory page type.
3396
+	 */
3397
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3398 3398
     
3399
-    if ($position !== $display) {
3400
-        return;
3401
-    }
3399
+	if ($position !== $display) {
3400
+		return;
3401
+	}
3402 3402
         
3403
-    $gd_post = $post;
3403
+	$gd_post = $post;
3404 3404
     
3405
-    setup_postdata(get_post($gd_page_id));
3405
+	setup_postdata(get_post($gd_page_id));
3406 3406
     
3407
-    if (get_the_content()) {
3408
-        ?>
3407
+	if (get_the_content()) {
3408
+		?>
3409 3409
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3410 3410
         <?php
3411
-    }
3411
+	}
3412 3412
     
3413
-    $post = $gd_post;
3414
-    if (!empty($gd_post) && is_object($gd_post)) {
3415
-        setup_postdata($gd_post);
3416
-    }
3413
+	$post = $gd_post;
3414
+	if (!empty($gd_post) && is_object($gd_post)) {
3415
+		setup_postdata($gd_post);
3416
+	}
3417 3417
 }
3418 3418
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3419 3419
\ No newline at end of file
Please login to merge, or discard this patch.