Test Setup Failed
Push — master ( 2261e5...599f56 )
by Stiofan
02:03
created
geodirectory_template_actions.php 3 patches
Braces   +31 added lines, -24 removed lines patch added patch discarded remove patch
@@ -715,8 +715,9 @@  discard block
 block discarded – undo
715 715
 
716 716
                         if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717 717
                             if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
718
+                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') {
719
+                                                                    $term_icon = $term_icon_url['src'];
720
+                                }
720 721
                                 break;
721 722
                             }
722 723
                         }
@@ -1265,8 +1266,9 @@  discard block
 block discarded – undo
1265 1266
         echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1266 1267
     }
1267 1268
 
1268
-    if (isset($taxonomies[$post_type . '_tags']))
1269
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1269
+    if (isset($taxonomies[$post_type . '_tags'])) {
1270
+            echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1271
+    }
1270 1272
 
1271 1273
     ?>
1272 1274
     </p><?php
@@ -1634,23 +1636,21 @@  discard block
 block discarded – undo
1634 1636
     if(geodir_is_page('pt')){
1635 1637
         $gd_page = 'pt';
1636 1638
         $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1637
-    }
1638
-    elseif(geodir_is_page('listing')){
1639
+    } elseif(geodir_is_page('listing')){
1639 1640
         $gd_page = 'listing';
1640 1641
         global $wp_query;
1641 1642
         $current_term = $wp_query->get_queried_object();
1642 1643
         if (strpos($current_term->taxonomy,'_tags') !== false) {
1643 1644
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1644
-        }else{
1645
+        } else{
1645 1646
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1646 1647
         }
1647 1648
 
1648
-    }
1649
-    elseif(geodir_is_page('author')){
1649
+    } elseif(geodir_is_page('author')){
1650 1650
         $gd_page = 'author';
1651 1651
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1652 1652
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1653
-        }else{
1653
+        } else{
1654 1654
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1655 1655
         }
1656 1656
 
@@ -2074,8 +2074,9 @@  discard block
 block discarded – undo
2074 2074
  */
2075 2075
 function geodir_action_add_listing_page_title()
2076 2076
 {
2077
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2078
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2077
+    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') {
2078
+            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2079
+    }
2079 2080
     /** This action is documented in geodirectory_template_actions.php */
2080 2081
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2081 2082
     /** This action is documented in geodirectory_template_actions.php */
@@ -2087,7 +2088,7 @@  discard block
 block discarded – undo
2087 2088
         $gd_page = 'add-listing';
2088 2089
         if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2089 2090
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2090
-        }elseif(isset($listing_type)){
2091
+        } elseif(isset($listing_type)){
2091 2092
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2092 2093
         }
2093 2094
 
@@ -2406,8 +2407,9 @@  discard block
 block discarded – undo
2406 2407
         $totImg = 0;
2407 2408
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2408 2409
             $post = (object)$gd_session->get('listing');
2409
-            if (isset($post->post_images))
2410
-                $curImages = trim($post->post_images, ",");
2410
+            if (isset($post->post_images)) {
2411
+                            $curImages = trim($post->post_images, ",");
2412
+            }
2411 2413
 
2412 2414
 
2413 2415
             if ($curImages != '') {
@@ -2435,10 +2437,13 @@  discard block
 block discarded – undo
2435 2437
             $totImg = count((array)$thumb_img_arr);
2436 2438
         }
2437 2439
 
2438
-        if ($curImages != '')
2439
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2440
-        else
2441
-            $svalue = '';
2440
+        if ($curImages != '') {
2441
+                    $svalue = $curImages;
2442
+        }
2443
+        // this will be initial value of the above form field. Image urls.
2444
+        else {
2445
+                    $svalue = '';
2446
+        }
2442 2447
 
2443 2448
         $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2444 2449
         $show_image_input_box = ($image_limit != '0');
@@ -2650,8 +2655,9 @@  discard block
 block discarded – undo
2650 2655
     </script><?php
2651 2656
 
2652 2657
     global $errors;
2653
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2654
-        $errors->add('claim_login', LOGIN_CLAIM);
2658
+    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') {
2659
+            $errors->add('claim_login', LOGIN_CLAIM);
2660
+    }
2655 2661
 
2656 2662
     if (!empty($errors)) {
2657 2663
         foreach ($errors as $errorsObj) {
@@ -2758,8 +2764,9 @@  discard block
 block discarded – undo
2758 2764
 
2759 2765
     if (!empty($term)) {
2760 2766
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2761
-        if (!empty($current_term))
2762
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2767
+        if (!empty($current_term)) {
2768
+                    $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2769
+        }
2763 2770
     }
2764 2771
 
2765 2772
 
@@ -2777,7 +2784,7 @@  discard block
 block discarded – undo
2777 2784
         $gd_page = 'author';
2778 2785
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2779 2786
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2780
-        }else{
2787
+        } else{
2781 2788
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2782 2789
         }
2783 2790
 
Please login to merge, or discard this patch.
Indentation   +1829 added lines, -1829 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,107 +275,107 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
278
+	$tc = get_option('theme_compatibility_setting');
279 279
 //print_r($tc);
280
-    if (empty($tc)) {
281
-        return;
282
-    }
283
-
284
-    //php
285
-    if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
-    }
288
-
289
-    //geodir_full_page_class
290
-    if (!empty($tc['geodir_full_page_class_filter'])) {
291
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
-    }
293
-
294
-    //widget before filter
295
-    if (!empty($tc['geodir_before_widget_filter'])) {
296
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
-    }
298
-
299
-    //widget after filter
300
-    if (!empty($tc['geodir_after_widget_filter'])) {
301
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
-    }
303
-
304
-    //widget before title filter
305
-    if (!empty($tc['geodir_before_title_filter'])) {
306
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
-    }
308
-
309
-    //widget before title filter
310
-    if (!empty($tc['geodir_after_title_filter'])) {
311
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
-    }
313
-
314
-    //menu li class
315
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
316
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
-    }
318
-
319
-    //menu ul class
320
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
-    }
323
-
324
-    //menu sub li class
325
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
-    }
328
-
329
-    //menu a class
330
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
331
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
-    }
333
-
334
-    //menu sub a class
335
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
-    }
338
-
339
-    //location menu li class
340
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
-    }
343
-
344
-    //location menu sub ul class
345
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
-    }
348
-
349
-    //location menu sub li class
350
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
-    }
353
-
354
-    //location menu a class
355
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
-    }
358
-
359
-    // compat styles
360
-    if (!empty($tc['geodir_theme_compat_css'])) {
361
-        add_action('wp_head', 'gd_compat_styles');
362
-    }
363
-
364
-    // compat js
365
-    if (!empty($tc['geodir_theme_compat_js'])) {
366
-        add_action('wp_footer', 'gd_compat_script');
367
-    }
368
-
369
-
370
-    // geodir_top_content_add
371
-    if (!empty($tc['geodir_top_content_add'])) {
372
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
-    }
374
-
375
-    // geodir_before_main_content_add
376
-    if (!empty($tc['geodir_before_main_content_add'])) {
377
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
-    }
280
+	if (empty($tc)) {
281
+		return;
282
+	}
283
+
284
+	//php
285
+	if (!empty($tc['geodir_theme_compat_code'])) {
286
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
+	}
288
+
289
+	//geodir_full_page_class
290
+	if (!empty($tc['geodir_full_page_class_filter'])) {
291
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
+	}
293
+
294
+	//widget before filter
295
+	if (!empty($tc['geodir_before_widget_filter'])) {
296
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
+	}
298
+
299
+	//widget after filter
300
+	if (!empty($tc['geodir_after_widget_filter'])) {
301
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
+	}
303
+
304
+	//widget before title filter
305
+	if (!empty($tc['geodir_before_title_filter'])) {
306
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
+	}
308
+
309
+	//widget before title filter
310
+	if (!empty($tc['geodir_after_title_filter'])) {
311
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
+	}
313
+
314
+	//menu li class
315
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
316
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
+	}
318
+
319
+	//menu ul class
320
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
+	}
323
+
324
+	//menu sub li class
325
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
+	}
328
+
329
+	//menu a class
330
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
331
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
+	}
333
+
334
+	//menu sub a class
335
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
+	}
338
+
339
+	//location menu li class
340
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
+	}
343
+
344
+	//location menu sub ul class
345
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
+	}
348
+
349
+	//location menu sub li class
350
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
+	}
353
+
354
+	//location menu a class
355
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
+	}
358
+
359
+	// compat styles
360
+	if (!empty($tc['geodir_theme_compat_css'])) {
361
+		add_action('wp_head', 'gd_compat_styles');
362
+	}
363
+
364
+	// compat js
365
+	if (!empty($tc['geodir_theme_compat_js'])) {
366
+		add_action('wp_footer', 'gd_compat_script');
367
+	}
368
+
369
+
370
+	// geodir_top_content_add
371
+	if (!empty($tc['geodir_top_content_add'])) {
372
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
+	}
374
+
375
+	// geodir_before_main_content_add
376
+	if (!empty($tc['geodir_before_main_content_add'])) {
377
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
+	}
379 379
 
380 380
 
381 381
 }
@@ -398,23 +398,23 @@  discard block
 block discarded – undo
398 398
  */
399 399
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
400 400
 {
401
-    $tc = get_option('theme_compatibility_setting');
402
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
403
-        $text = $tc['geodir_wrapper_open_replace'];
404
-    } else {
405
-        $text = '<div id="[id]" class="[class]">';
406
-    }
401
+	$tc = get_option('theme_compatibility_setting');
402
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
403
+		$text = $tc['geodir_wrapper_open_replace'];
404
+	} else {
405
+		$text = '<div id="[id]" class="[class]">';
406
+	}
407 407
 
408
-    if (!empty($tc['geodir_wrapper_open_id'])) {
409
-        $id = $tc['geodir_wrapper_open_id'];
410
-    }
411
-    if (!empty($tc['geodir_wrapper_open_class'])) {
412
-        $class = $tc['geodir_wrapper_open_class'];
413
-    }
408
+	if (!empty($tc['geodir_wrapper_open_id'])) {
409
+		$id = $tc['geodir_wrapper_open_id'];
410
+	}
411
+	if (!empty($tc['geodir_wrapper_open_class'])) {
412
+		$class = $tc['geodir_wrapper_open_class'];
413
+	}
414 414
 
415
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
416 416
 
417
-    echo $text;
417
+	echo $text;
418 418
 }
419 419
 
420 420
 // action for adding the wrapperdiv closing tag
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
  */
430 430
 function geodir_action_wrapper_close($type = '')
431 431
 {
432
-    $tc = get_option('theme_compatibility_setting');
433
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
434
-        $text = $tc['geodir_wrapper_close_replace'];
435
-    } else {
436
-        $text = '</div><!-- wrapper ends here-->';
437
-    }
432
+	$tc = get_option('theme_compatibility_setting');
433
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
434
+		$text = $tc['geodir_wrapper_close_replace'];
435
+	} else {
436
+		$text = '</div><!-- wrapper ends here-->';
437
+	}
438 438
 
439
-    echo $text;
439
+	echo $text;
440 440
 }
441 441
 
442 442
 // action for adding the content div opening tag
@@ -452,35 +452,35 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
457
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
459
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
461
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
463
-    } else {
464
-        $width_css = '';
465
-    }
466
-
467
-    $tc = get_option('theme_compatibility_setting');
468
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
-        $text = $tc['geodir_wrapper_content_open_replace'];
470
-    } else {
471
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
-    }
473
-
474
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
-        $id = $tc['geodir_wrapper_content_open_id'];
476
-    }
477
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
-        $class = $tc['geodir_wrapper_content_open_class'];
479
-    }
480
-
481
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
-
483
-    echo $text;
455
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
+		$width_css = 'style="width:' . $width . '%;"';
457
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
+		$width_css = 'style="width:' . $width . '%;"';
459
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
+		$width_css = 'style="width:' . $width . '%;"';
461
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
+		$width_css = 'style="width:' . $width . '%;"';
463
+	} else {
464
+		$width_css = '';
465
+	}
466
+
467
+	$tc = get_option('theme_compatibility_setting');
468
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
+		$text = $tc['geodir_wrapper_content_open_replace'];
470
+	} else {
471
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
+	}
473
+
474
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
+		$id = $tc['geodir_wrapper_content_open_id'];
476
+	}
477
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
+		$class = $tc['geodir_wrapper_content_open_class'];
479
+	}
480
+
481
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
+
483
+	echo $text;
484 484
 }
485 485
 
486 486
 // action for adding the primary div closing tag
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_action_wrapper_content_close($type = '')
496 496
 {
497
-    $tc = get_option('theme_compatibility_setting');
498
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
-        $text = $tc['geodir_wrapper_content_close_replace'];
500
-    } else {
501
-        $text = '</div><!-- content ends here-->';
502
-    }
503
-    echo $text;
497
+	$tc = get_option('theme_compatibility_setting');
498
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
+		$text = $tc['geodir_wrapper_content_close_replace'];
500
+	} else {
501
+		$text = '</div><!-- content ends here-->';
502
+	}
503
+	echo $text;
504 504
 }
505 505
 
506 506
 // action for adding the <article> opening tag
@@ -518,24 +518,24 @@  discard block
 block discarded – undo
518 518
  */
519 519
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
520 520
 {
521
-    $class = implode(" ", $class);
522
-    $tc = get_option('theme_compatibility_setting');
523
-    if (!empty($tc['geodir_article_open_replace'])) {
524
-        $text = $tc['geodir_article_open_replace'];
525
-    } else {
526
-        $text = '<article  id="[id]" class="[class]" >';
527
-    }
521
+	$class = implode(" ", $class);
522
+	$tc = get_option('theme_compatibility_setting');
523
+	if (!empty($tc['geodir_article_open_replace'])) {
524
+		$text = $tc['geodir_article_open_replace'];
525
+	} else {
526
+		$text = '<article  id="[id]" class="[class]" >';
527
+	}
528 528
 
529
-    if (!empty($tc['geodir_article_open_id'])) {
530
-        $id = $tc['geodir_article_open_id'];
531
-    }
532
-    if (!empty($tc['geodir_article_open_class'])) {
533
-        $class = $tc['geodir_article_open_class'];
534
-    }
529
+	if (!empty($tc['geodir_article_open_id'])) {
530
+		$id = $tc['geodir_article_open_id'];
531
+	}
532
+	if (!empty($tc['geodir_article_open_class'])) {
533
+		$class = $tc['geodir_article_open_class'];
534
+	}
535 535
 
536
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
537 537
 
538
-    echo $text;
538
+	echo $text;
539 539
 }
540 540
 
541 541
 // action for adding the primary div closing tag
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_action_article_close($type = '')
551 551
 {
552
-    $tc = get_option('theme_compatibility_setting');
553
-    if (!empty($tc['geodir_article_close_replace'])) {
554
-        $text = $tc['geodir_article_close_replace'];
555
-    } else {
556
-        $text = '</article><!-- article ends here-->';
557
-    }
558
-    echo $text;
552
+	$tc = get_option('theme_compatibility_setting');
553
+	if (!empty($tc['geodir_article_close_replace'])) {
554
+		$text = $tc['geodir_article_close_replace'];
555
+	} else {
556
+		$text = '</article><!-- article ends here-->';
557
+	}
558
+	echo $text;
559 559
 }
560 560
 
561 561
 // action for adding the sidebar opening tag
@@ -572,35 +572,35 @@  discard block
 block discarded – undo
572 572
  */
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
577
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
579
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
581
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
583
-    } else {
584
-        $width_css = '';
585
-    }
586
-
587
-    $tc = get_option('theme_compatibility_setting');
588
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
-        $text = $tc['geodir_sidebar_right_open_replace'];
590
-    } else {
591
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
-    }
593
-
594
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
-        $id = $tc['geodir_sidebar_right_open_id'];
596
-    }
597
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
-        $class = $tc['geodir_sidebar_right_open_class'];
599
-    }
600
-
601
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
-
603
-    echo $text;
575
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
+		$width_css = 'style="width:' . $width . '%;"';
577
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
+		$width_css = 'style="width:' . $width . '%;"';
579
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
+		$width_css = 'style="width:' . $width . '%;"';
581
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
+		$width_css = 'style="width:' . $width . '%;"';
583
+	} else {
584
+		$width_css = '';
585
+	}
586
+
587
+	$tc = get_option('theme_compatibility_setting');
588
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
+		$text = $tc['geodir_sidebar_right_open_replace'];
590
+	} else {
591
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
+	}
593
+
594
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
+		$id = $tc['geodir_sidebar_right_open_id'];
596
+	}
597
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
+		$class = $tc['geodir_sidebar_right_open_class'];
599
+	}
600
+
601
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
+
603
+	echo $text;
604 604
 }
605 605
 
606 606
 // action for adding the primary div closing tag
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_action_sidebar_right_close($type = '')
616 616
 {
617
-    $tc = get_option('theme_compatibility_setting');
618
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
-        $text = $tc['geodir_sidebar_right_close_replace'];
620
-    } else {
621
-        $text = '</aside><!-- sidebar ends here-->';
622
-    }
623
-    echo $text;
617
+	$tc = get_option('theme_compatibility_setting');
618
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
+		$text = $tc['geodir_sidebar_right_close_replace'];
620
+	} else {
621
+		$text = '</aside><!-- sidebar ends here-->';
622
+	}
623
+	echo $text;
624 624
 }
625 625
 
626 626
 
@@ -641,120 +641,120 @@  discard block
 block discarded – undo
641 641
  */
642 642
 function geodir_action_geodir_set_preview_post()
643 643
 {
644
-    global $post, $preview, $gd_session;
645
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
-    if (!$preview || $is_backend_preview) {
647
-        return;
648
-    }// bail if not previewing
649
-
650
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
-
652
-    $fields_info = geodir_get_custom_fields_type($listing_type);
653
-
654
-    foreach ($_REQUEST as $pkey => $pval) {
655
-        if ($pkey == 'geodir_video') {
656
-            $tags = '<iframe>';
657
-        } else if ($pkey == 'post_desc') {
658
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
-        } else if (is_array($_REQUEST[$pkey])) {
662
-            $tags = 'skip_field';
663
-        } else {
664
-            $tags = '';
665
-        }
666
-        /**
667
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
-         *
669
-         * @since 1.0.0
670
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
-         */
673
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
-
675
-        if ($tags != 'skip_field') {
676
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
-        }
678
-    }
644
+	global $post, $preview, $gd_session;
645
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
646
+	if (!$preview || $is_backend_preview) {
647
+		return;
648
+	}// bail if not previewing
649
+
650
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
+
652
+	$fields_info = geodir_get_custom_fields_type($listing_type);
653
+
654
+	foreach ($_REQUEST as $pkey => $pval) {
655
+		if ($pkey == 'geodir_video') {
656
+			$tags = '<iframe>';
657
+		} else if ($pkey == 'post_desc') {
658
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
+		} else if (is_array($_REQUEST[$pkey])) {
662
+			$tags = 'skip_field';
663
+		} else {
664
+			$tags = '';
665
+		}
666
+		/**
667
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
+		 *
669
+		 * @since 1.0.0
670
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
671
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
+		 */
673
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
+
675
+		if ($tags != 'skip_field') {
676
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
+		}
678
+	}
679 679
 
680
-    $post = (object)$_REQUEST;
680
+	$post = (object)$_REQUEST;
681 681
 
682 682
 
683
-    if (isset($post->video)) {
684
-        $post->video = stripslashes($post->video);
685
-    }
683
+	if (isset($post->video)) {
684
+		$post->video = stripslashes($post->video);
685
+	}
686 686
 
687
-    if (isset($post->Video2)) {
688
-        $post->Video2 = stripslashes($post->Video2);
689
-    }
687
+	if (isset($post->Video2)) {
688
+		$post->Video2 = stripslashes($post->Video2);
689
+	}
690 690
 
691
-    $post_type = $post->listing_type;
692
-    $post_type_info = get_post_type_object($post_type);
691
+	$post_type = $post->listing_type;
692
+	$post_type_info = get_post_type_object($post_type);
693 693
 
694
-    $listing_label = $post_type_info->labels->singular_name;
694
+	$listing_label = $post_type_info->labels->singular_name;
695 695
 
696
-    $term_icon = '';
696
+	$term_icon = '';
697 697
 
698
-    if (!empty($post->post_category)) {
699
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
698
+	if (!empty($post->post_category)) {
699
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
700 700
 
701
-            if ($post_term != '' && !is_array($post_term)) {
702
-                $post_term = explode(',', trim($post_term, ','));
703
-            }
701
+			if ($post_term != '' && !is_array($post_term)) {
702
+				$post_term = explode(',', trim($post_term, ','));
703
+			}
704 704
 
705
-            if (is_array($post_term)) {
706
-                $post_term = array_unique($post_term);
707
-            }
705
+			if (is_array($post_term)) {
706
+				$post_term = array_unique($post_term);
707
+			}
708 708
 
709
-            if (!empty($post_term)) {
710
-                foreach ($post_term as $cat_id) {
711
-                    $cat_id = trim($cat_id);
712
-
713
-                    if ($cat_id != '') {
714
-                        $term_icon = get_option('geodir_default_marker_icon');
715
-
716
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
-                            if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
720
-                                break;
721
-                            }
722
-                        }
723
-                    }
724
-                }
725
-            }
726
-        }
727
-    }
709
+			if (!empty($post_term)) {
710
+				foreach ($post_term as $cat_id) {
711
+					$cat_id = trim($cat_id);
712
+
713
+					if ($cat_id != '') {
714
+						$term_icon = get_option('geodir_default_marker_icon');
715
+
716
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
+							if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
+									$term_icon = $term_icon_url['src'];
720
+								break;
721
+							}
722
+						}
723
+					}
724
+				}
725
+			}
726
+		}
727
+	}
728 728
 
729
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
729
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
731 731
 
732
-    $srcharr = array("'", "/", "-", '"', '\\');
733
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
732
+	$srcharr = array("'", "/", "-", '"', '\\');
733
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
734 734
 
735
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
735
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
736 736
 
737
-    $json = '{';
738
-    $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
743
-    $json .= '}';
737
+	$json = '{';
738
+	$json .= '"post_preview": "1",';
739
+	$json .= '"t": "' . $json_title . '",';
740
+	$json .= '"lt": "' . $post_latitude . '",';
741
+	$json .= '"ln": "' . $post_longitude . '",';
742
+	$json .= '"i":"' . $term_icon . '"';
743
+	$json .= '}';
744 744
 
745
-    $post->marker_json = $json;
745
+	$post->marker_json = $json;
746 746
 
747
-    $gd_session->set('listing', $_REQUEST);
747
+	$gd_session->set('listing', $_REQUEST);
748 748
 
749
-    // we need to define a few things to trick the setup_postdata
750
-    if (!isset($post->ID)) {
751
-        $post->ID = '';
752
-        $post->post_author = '';
753
-        $post->post_date = '';
754
-        $post->post_content = '';
755
-        $post->default_category = '';
756
-        $post->post_type = '';
757
-    }
749
+	// we need to define a few things to trick the setup_postdata
750
+	if (!isset($post->ID)) {
751
+		$post->ID = '';
752
+		$post->post_author = '';
753
+		$post->post_date = '';
754
+		$post->post_content = '';
755
+		$post->default_category = '';
756
+		$post->post_type = '';
757
+	}
758 758
 	if (empty($post->default_category) && ! empty($post->post_default_category)) {
759 759
 		$post->default_category = $post->post_default_category;
760 760
 	}
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 	if (!empty($post_type) && empty($post->{$cat_taxonomy}) && !empty($post->post_category) && !empty($post->post_category[$cat_taxonomy])) {
767 767
 		$post->{$cat_taxonomy} = $post->post_category[$cat_taxonomy];
768 768
 	}
769
-    setup_postdata($post);
769
+	setup_postdata($post);
770 770
 }
771 771
 
772 772
 /**
@@ -778,15 +778,15 @@  discard block
 block discarded – undo
778 778
  */
779 779
 function geodir_action_geodir_preview_code()
780 780
 {
781
-    global $preview;
781
+	global $preview;
782 782
 
783
-    $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
783
+	$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
784 784
 
785
-    if (!$preview || $is_backend_preview) {
786
-        return;
787
-    }// bail if not previewing
785
+	if (!$preview || $is_backend_preview) {
786
+		return;
787
+	}// bail if not previewing
788 788
 
789
-    geodir_get_template_part('preview', 'buttons');
789
+	geodir_get_template_part('preview', 'buttons');
790 790
 }
791 791
 
792 792
 // action for adding the details page top widget area
@@ -802,20 +802,20 @@  discard block
 block discarded – undo
802 802
  */
803 803
 function geodir_action_geodir_sidebar_detail_top($class = '')
804 804
 {
805
-    if (get_option('geodir_show_detail_top_section')) { ?>
805
+	if (get_option('geodir_show_detail_top_section')) { ?>
806 806
         <div
807 807
             class="<?php
808
-            /**
809
-             * Filter the div class for the wrapper of the full width widget areas.
810
-             *
811
-             * 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.
812
-             *
813
-             * @since 1.0.0
814
-             * @param string $class The class of the div.
815
-             * @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',
816
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
817
-             */
818
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
808
+			/**
809
+			 * Filter the div class for the wrapper of the full width widget areas.
810
+			 *
811
+			 * 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.
812
+			 *
813
+			 * @since 1.0.0
814
+			 * @param string $class The class of the div.
815
+			 * @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',
816
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
817
+			 */
818
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
819 819
             <?php dynamic_sidebar('geodir_detail_top'); ?>
820 820
         </div>
821 821
     <?php }
@@ -839,11 +839,11 @@  discard block
 block discarded – undo
839 839
  */
840 840
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
841 841
 {
842
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
842
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
843 843
         <div
844 844
             class="<?php
845
-            /** This action is documented in geodirectory_template_actions.php */
846
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
845
+			/** This action is documented in geodirectory_template_actions.php */
846
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
847 847
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
848 848
         </div><!-- clearfix ends here-->
849 849
     <?php }
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
  */
858 858
 function geodir_details_sidebar_widget_area()
859 859
 {
860
-    dynamic_sidebar('geodir_detail_sidebar');
860
+	dynamic_sidebar('geodir_detail_sidebar');
861 861
 }
862 862
 
863 863
 /**
@@ -868,12 +868,12 @@  discard block
 block discarded – undo
868 868
  */
869 869
 function geodir_details_sidebar_place_details()
870 870
 {
871
-    /**
872
-     * Used to add items to the details page sidebar.
873
-     *
874
-     * @since 1.0.0
875
-     */
876
-    do_action('geodir_detail_page_sidebar');
871
+	/**
872
+	 * Used to add items to the details page sidebar.
873
+	 *
874
+	 * @since 1.0.0
875
+	 */
876
+	do_action('geodir_detail_page_sidebar');
877 877
 }
878 878
 
879 879
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -888,68 +888,68 @@  discard block
 block discarded – undo
888 888
  */
889 889
 function geodir_action_details_sidebar()
890 890
 {
891
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
892
-    if (get_option('geodir_detail_sidebar_left_section')) {
893
-        /**
894
-         * Called before the details page left sidebar is opened.
895
-         *
896
-         * This is used to add opening wrapper HTML to the details page left sidebar.
897
-         *
898
-         * @since 1.0.0
899
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
900
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
901
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
902
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
903
-         */
904
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
905
-        ?>
891
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
892
+	if (get_option('geodir_detail_sidebar_left_section')) {
893
+		/**
894
+		 * Called before the details page left sidebar is opened.
895
+		 *
896
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
897
+		 *
898
+		 * @since 1.0.0
899
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
900
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
901
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
902
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
903
+		 */
904
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
905
+		?>
906 906
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
907
-        /**
908
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
909
-         *
910
-         * This is used to add all info to the details page sidebars.
911
-         *
912
-         * @since 1.0.0
913
-         */
914
-        do_action('geodir_detail_sidebar_inside');
915
-        ?></div><!-- end geodir-content-left --><?php
916
-        /**
917
-         * Called after the details page left sidebar.
918
-         *
919
-         * This is used to add closing wrapper HTML to the details page left sidebar.
920
-         *
921
-         * @since 1.0.0
922
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
923
-         */
924
-        do_action('geodir_sidebar_left_close', 'details-page');
925
-    } else {
926
-        /**
927
-         * Called before the details page right sidebar is opened.
928
-         *
929
-         * This is used to add opening wrapper HTML to the details page right sidebar.
930
-         *
931
-         * @since 1.0.0
932
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
933
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
934
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
935
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
936
-         */
937
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
938
-        ?>
907
+		/**
908
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
909
+		 *
910
+		 * This is used to add all info to the details page sidebars.
911
+		 *
912
+		 * @since 1.0.0
913
+		 */
914
+		do_action('geodir_detail_sidebar_inside');
915
+		?></div><!-- end geodir-content-left --><?php
916
+		/**
917
+		 * Called after the details page left sidebar.
918
+		 *
919
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
920
+		 *
921
+		 * @since 1.0.0
922
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
923
+		 */
924
+		do_action('geodir_sidebar_left_close', 'details-page');
925
+	} else {
926
+		/**
927
+		 * Called before the details page right sidebar is opened.
928
+		 *
929
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
930
+		 *
931
+		 * @since 1.0.0
932
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
933
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
934
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
935
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
936
+		 */
937
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
938
+		?>
939 939
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
940
-        /** This action is documented in geodirectory_template_actions.php */
941
-        do_action('geodir_detail_sidebar_inside');
942
-        ?></div><!-- end geodir-content-right --><?php
943
-        /**
944
-         * Called after the details page right sidebar.
945
-         *
946
-         * This is used to add closing wrapper HTML to the details page right sidebar.
947
-         *
948
-         * @since 1.0.0
949
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
950
-         */
951
-        do_action('geodir_sidebar_right_close', 'details-page');
952
-    }
940
+		/** This action is documented in geodirectory_template_actions.php */
941
+		do_action('geodir_detail_sidebar_inside');
942
+		?></div><!-- end geodir-content-right --><?php
943
+		/**
944
+		 * Called after the details page right sidebar.
945
+		 *
946
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
947
+		 *
948
+		 * @since 1.0.0
949
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
950
+		 */
951
+		do_action('geodir_sidebar_right_close', 'details-page');
952
+	}
953 953
 }
954 954
 
955 955
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -963,21 +963,21 @@  discard block
 block discarded – undo
963 963
  */
964 964
 function geodir_action_page_title()
965 965
 {
966
-    /**
967
-     * Filter the page title HTML h1 class.
968
-     *
969
-     * @since 1.0.0
970
-     * @param string $class The class to use. Default is 'entry-title fn'.
971
-     */
972
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
973
-    /**
974
-     * Filter the page title HTML header wrapper class.
975
-     *
976
-     * @since 1.0.0
977
-     * @param string $class The class to use. Default is 'entry-header'.
978
-     */
979
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
980
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
966
+	/**
967
+	 * Filter the page title HTML h1 class.
968
+	 *
969
+	 * @since 1.0.0
970
+	 * @param string $class The class to use. Default is 'entry-title fn'.
971
+	 */
972
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
973
+	/**
974
+	 * Filter the page title HTML header wrapper class.
975
+	 *
976
+	 * @since 1.0.0
977
+	 * @param string $class The class to use. Default is 'entry-header'.
978
+	 */
979
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
980
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
981 981
 }
982 982
 
983 983
 
@@ -994,106 +994,106 @@  discard block
 block discarded – undo
994 994
  */
995 995
 function geodir_action_details_slider()
996 996
 {
997
-    global $preview, $post;
997
+	global $preview, $post;
998 998
 
999
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
999
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
1000 1000
 
1001
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
1002
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1001
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
1002
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1003 1003
 
1004
-        $preview_post_images = array();
1005
-        if ($preview_get_images) {
1006
-            foreach ($preview_get_images as $row) {
1007
-                $preview_post_images[] = $row->src;
1008
-            }
1009
-        }
1010
-        if (!empty($preview_post_images)) {
1011
-            $post->post_images = implode(',', $preview_post_images);
1012
-        }
1013
-    }
1004
+		$preview_post_images = array();
1005
+		if ($preview_get_images) {
1006
+			foreach ($preview_get_images as $row) {
1007
+				$preview_post_images[] = $row->src;
1008
+			}
1009
+		}
1010
+		if (!empty($preview_post_images)) {
1011
+			$post->post_images = implode(',', $preview_post_images);
1012
+		}
1013
+	}
1014 1014
     
1015
-    $package_info = geodir_post_package_info(array(), $post, (!empty($post->post_type) ? $post->post_type : ''));
1016
-    $image_limit = '';
1017
-    if (defined('GEODIRPAYMENT_VERSION') && !empty($package_info) && isset($package_info->image_limit) && $package_info->image_limit !== '') {
1018
-        $image_limit = (int)$package_info->image_limit;
1019
-    }
1020
-
1021
-    if ($preview) {
1022
-        $post_images = array();
1023
-        if (isset($post->post_images) && !empty($post->post_images)) {
1024
-            $post->post_images = trim($post->post_images, ",");
1025
-            $post_images = explode(",", $post->post_images);
1026
-        }
1015
+	$package_info = geodir_post_package_info(array(), $post, (!empty($post->post_type) ? $post->post_type : ''));
1016
+	$image_limit = '';
1017
+	if (defined('GEODIRPAYMENT_VERSION') && !empty($package_info) && isset($package_info->image_limit) && $package_info->image_limit !== '') {
1018
+		$image_limit = (int)$package_info->image_limit;
1019
+	}
1027 1020
 
1028
-        $main_slides = '';
1029
-        $nav_slides = '';
1030
-        $slides = 0;
1031
-
1032
-        if (!empty($post_images)) {
1033
-            foreach ($post_images as $image) {
1034
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1035
-                     break;
1036
-                }
1037
-                if (!empty($image)) {
1038
-                    $sizes = getimagesize(trim($image));
1039
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1040
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1041
-
1042
-                    if ($image && $width && $height) {
1043
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1044
-                    }
1045
-
1046
-                    if (isset($image->src)) {
1047
-                        if ($image->height >= 400) {
1048
-                            $spacer_height = 0;
1049
-                        } else {
1050
-                            $spacer_height = ((400 - $image->height) / 2);
1051
-                        }
1052
-
1053
-                        $image_title = isset($image->title) ? $image->title : '';
1054
-
1055
-                        $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;" />';
1056
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1057
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1058
-                        $slides++;
1059
-                    }
1060
-                }
1061
-            }// endfore
1062
-        } //end if
1063
-    } else {
1064
-        $main_slides = '';
1065
-        $nav_slides = '';
1066
-        /**
1067
-         * Filter if default images should show on the details page.
1068
-         *
1069
-         * @param bool $use_default_image Default false.
1070
-         * @since 1.6.16
1071
-         */
1072
-        $use_default_image = apply_filters('geodir_details_default_image_show', false);
1073
-        $post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1074
-        $slides = 0;
1075
-
1076
-        if (!empty($post_images)) {
1077
-            foreach ($post_images as $image) {
1078
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1079
-                     break;
1080
-                }
1081
-                if ($image->height >= 400) {
1082
-                    $spacer_height = 0;
1083
-                } else {
1084
-                    $spacer_height = ((400 - $image->height) / 2);
1085
-                }
1086
-
1087
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1088
-                $main_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1089
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1090
-                $slides++;
1091
-            }
1092
-        }// endfore
1093
-    }
1021
+	if ($preview) {
1022
+		$post_images = array();
1023
+		if (isset($post->post_images) && !empty($post->post_images)) {
1024
+			$post->post_images = trim($post->post_images, ",");
1025
+			$post_images = explode(",", $post->post_images);
1026
+		}
1094 1027
 
1095
-    if (!empty($post_images)) {
1096
-        ?>
1028
+		$main_slides = '';
1029
+		$nav_slides = '';
1030
+		$slides = 0;
1031
+
1032
+		if (!empty($post_images)) {
1033
+			foreach ($post_images as $image) {
1034
+				if ($image_limit !== '' && ($slides+1) > $image_limit) {
1035
+					 break;
1036
+				}
1037
+				if (!empty($image)) {
1038
+					$sizes = getimagesize(trim($image));
1039
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1040
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1041
+
1042
+					if ($image && $width && $height) {
1043
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1044
+					}
1045
+
1046
+					if (isset($image->src)) {
1047
+						if ($image->height >= 400) {
1048
+							$spacer_height = 0;
1049
+						} else {
1050
+							$spacer_height = ((400 - $image->height) / 2);
1051
+						}
1052
+
1053
+						$image_title = isset($image->title) ? $image->title : '';
1054
+
1055
+						$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;" />';
1056
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1057
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1058
+						$slides++;
1059
+					}
1060
+				}
1061
+			}// endfore
1062
+		} //end if
1063
+	} else {
1064
+		$main_slides = '';
1065
+		$nav_slides = '';
1066
+		/**
1067
+		 * Filter if default images should show on the details page.
1068
+		 *
1069
+		 * @param bool $use_default_image Default false.
1070
+		 * @since 1.6.16
1071
+		 */
1072
+		$use_default_image = apply_filters('geodir_details_default_image_show', false);
1073
+		$post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page.
1074
+		$slides = 0;
1075
+
1076
+		if (!empty($post_images)) {
1077
+			foreach ($post_images as $image) {
1078
+				if ($image_limit !== '' && ($slides+1) > $image_limit) {
1079
+					 break;
1080
+				}
1081
+				if ($image->height >= 400) {
1082
+					$spacer_height = 0;
1083
+				} else {
1084
+					$spacer_height = ((400 - $image->height) / 2);
1085
+				}
1086
+
1087
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1088
+				$main_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1089
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1090
+				$slides++;
1091
+			}
1092
+		}// endfore
1093
+	}
1094
+
1095
+	if (!empty($post_images)) {
1096
+		?>
1097 1097
         <div class="geodir_flex-container">
1098 1098
             <div class="geodir_flex-loader"><i class="fas fa-sync fa-spin"></i></div>
1099 1099
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
             <?php } ?>
1107 1107
         </div>
1108 1108
     <?php
1109
-    }
1109
+	}
1110 1110
 }
1111 1111
 
1112 1112
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1121,177 +1121,177 @@  discard block
 block discarded – undo
1121 1121
  */
1122 1122
 function geodir_action_details_taxonomies()
1123 1123
 {
1124
-    global $preview, $post;?>
1124
+	global $preview, $post;?>
1125 1125
     <p class="geodir_post_taxomomies clearfix">
1126 1126
     <?php
1127
-    $taxonomies = array();
1128
-
1129
-    $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
1130
-
1131
-    if ($preview && !$is_backend_preview) {
1132
-        $post_type = $post->listing_type;
1133
-        $post_taxonomy = $post_type . 'category';
1134
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1135
-    } else {
1136
-        $post_type = $post->post_type;
1137
-        $post_taxonomy = $post_type . 'category';
1138
-    }
1127
+	$taxonomies = array();
1128
+
1129
+	$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
1130
+
1131
+	if ($preview && !$is_backend_preview) {
1132
+		$post_type = $post->listing_type;
1133
+		$post_taxonomy = $post_type . 'category';
1134
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1135
+	} else {
1136
+		$post_type = $post->post_type;
1137
+		$post_taxonomy = $post_type . 'category';
1138
+	}
1139 1139
 //{	
1140
-    $post_type_info = get_post_type_object($post_type);
1141
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1142
-
1143
-    if (!empty($post->post_tags)) {
1144
-
1145
-        if (taxonomy_exists($post_type . '_tags')):
1146
-            $links = array();
1147
-            $terms = array();
1148
-            // to limit post tags
1149
-            $post_tags = trim($post->post_tags, ",");
1150
-            $post_id = isset($post->ID) ? $post->ID : '';
1151
-            /**
1152
-             * Filter the post tags.
1153
-             *
1154
-             * Allows you to filter the post tags output on the details page of a post.
1155
-             *
1156
-             * @since 1.0.0
1157
-             * @param string $post_tags A comma seperated list of tags.
1158
-             * @param int $post_id The current post id.
1159
-             */
1160
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1161
-
1162
-            $post->post_tags = $post_tags;
1163
-            $post_tags = explode(",", trim($post->post_tags, ","));
1164
-
1165
-
1166
-            foreach ($post_tags as $post_term) {
1167
-
1168
-                // fix slug creation order for tags & location
1169
-                $post_term = trim($post_term);
1170
-
1171
-                $priority_location = false;
1172
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1173
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1174
-                } else {
1175
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1176
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1177
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1178
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1179
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1180
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1181
-                    if ($match_country || $match_region || $match_city) {
1182
-                        $priority_location = true;
1183
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1184
-                    } else {
1185
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1186
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1187
-                    }
1188
-                }
1189
-
1190
-                if (!is_wp_error($term) && is_object($term)) {
1191
-
1192
-                    // fix tag link on detail page
1193
-                    if ($priority_location) {
1194
-
1195
-                        $tag_link = "<a href=''>$post_term</a>";
1196
-                        /**
1197
-                         * Filter the tag name on the details page.
1198
-                         *
1199
-                         * @since 1.5.6
1200
-                         * @param string $tag_link The tag link html.
1201
-                         * @param object $term The tag term object.
1202
-                         */
1203
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1204
-                        $links[] = $tag_link;
1205
-                    } else {
1206
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1207
-                        /** This action is documented in geodirectory-template_actions.php */
1208
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1209
-                        $links[] = $tag_link;
1210
-                    }
1211
-                    $terms[] = $term;
1212
-                }
1213
-                //
1214
-            }
1215
-            if (!isset($listing_label)) {
1216
-                $listing_label = '';
1217
-            }
1218
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1219
-        endif;
1220
-
1221
-    }
1222
-
1223
-    if (!empty($post->{$post_taxonomy})) {
1224
-        $links = array();
1225
-        $terms = array();
1226
-        $termsOrdered = array();
1227
-        if (!is_array($post->{$post_taxonomy})) {
1228
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1229
-        } else {
1230
-            $post_term = $post->{$post_taxonomy};
1140
+	$post_type_info = get_post_type_object($post_type);
1141
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1142
+
1143
+	if (!empty($post->post_tags)) {
1144
+
1145
+		if (taxonomy_exists($post_type . '_tags')):
1146
+			$links = array();
1147
+			$terms = array();
1148
+			// to limit post tags
1149
+			$post_tags = trim($post->post_tags, ",");
1150
+			$post_id = isset($post->ID) ? $post->ID : '';
1151
+			/**
1152
+			 * Filter the post tags.
1153
+			 *
1154
+			 * Allows you to filter the post tags output on the details page of a post.
1155
+			 *
1156
+			 * @since 1.0.0
1157
+			 * @param string $post_tags A comma seperated list of tags.
1158
+			 * @param int $post_id The current post id.
1159
+			 */
1160
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1161
+
1162
+			$post->post_tags = $post_tags;
1163
+			$post_tags = explode(",", trim($post->post_tags, ","));
1164
+
1165
+
1166
+			foreach ($post_tags as $post_term) {
1167
+
1168
+				// fix slug creation order for tags & location
1169
+				$post_term = trim($post_term);
1170
+
1171
+				$priority_location = false;
1172
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1173
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1174
+				} else {
1175
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1176
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1177
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1178
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1179
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1180
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1181
+					if ($match_country || $match_region || $match_city) {
1182
+						$priority_location = true;
1183
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1184
+					} else {
1185
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1186
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1187
+					}
1188
+				}
1189
+
1190
+				if (!is_wp_error($term) && is_object($term)) {
1191
+
1192
+					// fix tag link on detail page
1193
+					if ($priority_location) {
1194
+
1195
+						$tag_link = "<a href=''>$post_term</a>";
1196
+						/**
1197
+						 * Filter the tag name on the details page.
1198
+						 *
1199
+						 * @since 1.5.6
1200
+						 * @param string $tag_link The tag link html.
1201
+						 * @param object $term The tag term object.
1202
+						 */
1203
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1204
+						$links[] = $tag_link;
1205
+					} else {
1206
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1207
+						/** This action is documented in geodirectory-template_actions.php */
1208
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1209
+						$links[] = $tag_link;
1210
+					}
1211
+					$terms[] = $term;
1212
+				}
1213
+				//
1214
+			}
1215
+			if (!isset($listing_label)) {
1216
+				$listing_label = '';
1217
+			}
1218
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1219
+		endif;
1220
+
1221
+	}
1222
+
1223
+	if (!empty($post->{$post_taxonomy})) {
1224
+		$links = array();
1225
+		$terms = array();
1226
+		$termsOrdered = array();
1227
+		if (!is_array($post->{$post_taxonomy})) {
1228
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1229
+		} else {
1230
+			$post_term = $post->{$post_taxonomy};
1231 1231
 			
1232 1232
 			if ($preview && !$is_backend_preview) {
1233 1233
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1234 1234
 			}
1235
-        }
1236
-
1237
-        $post_term = array_unique($post_term);
1238
-        if (!empty($post_term)) {
1239
-            foreach ($post_term as $post_term) {
1240
-                $post_term = trim($post_term);
1241
-
1242
-                if ($post_term != ''):
1243
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1244
-
1245
-                    if (is_object($term)) {
1246
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1247
-                        /**
1248
-                         * Filter the category name on the details page.
1249
-                         *
1250
-                         * @since 1.5.6
1251
-                         * @param string $term_link The link html to the category.
1252
-                         * @param object $term The category term object.
1253
-                         */
1254
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1255
-                        $links[] = $term_link;
1256
-                        $terms[] = $term;
1257
-                    }
1258
-                endif;
1259
-            }
1260
-            // order alphabetically
1261
-            asort($links);
1262
-            foreach (array_keys($links) as $key) {
1263
-                $termsOrdered[$key] = $terms[$key];
1264
-            }
1265
-            $terms = $termsOrdered;
1235
+		}
1266 1236
 
1267
-        }
1237
+		$post_term = array_unique($post_term);
1238
+		if (!empty($post_term)) {
1239
+			foreach ($post_term as $post_term) {
1240
+				$post_term = trim($post_term);
1241
+
1242
+				if ($post_term != ''):
1243
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1244
+
1245
+					if (is_object($term)) {
1246
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1247
+						/**
1248
+						 * Filter the category name on the details page.
1249
+						 *
1250
+						 * @since 1.5.6
1251
+						 * @param string $term_link The link html to the category.
1252
+						 * @param object $term The category term object.
1253
+						 */
1254
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1255
+						$links[] = $term_link;
1256
+						$terms[] = $term;
1257
+					}
1258
+				endif;
1259
+			}
1260
+			// order alphabetically
1261
+			asort($links);
1262
+			foreach (array_keys($links) as $key) {
1263
+				$termsOrdered[$key] = $terms[$key];
1264
+			}
1265
+			$terms = $termsOrdered;
1268 1266
 
1269
-        if (!isset($listing_label)) {
1270
-            $listing_label = '';
1271
-        }
1272
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1267
+		}
1273 1268
 
1274
-    }
1269
+		if (!isset($listing_label)) {
1270
+			$listing_label = '';
1271
+		}
1272
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1275 1273
 
1276
-    /**
1277
-     * Filter the taxonomies array before output.
1278
-     *
1279
-     * @since 1.5.9
1280
-     * @param array $taxonomies The array of cats and tags.
1281
-     * @param string $post_type The post type being output.
1282
-     * @param string $listing_label The post type label.
1283
-     * @param string $listing_label The post type label with ucwords function.
1284
-     */
1285
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1274
+	}
1286 1275
 
1287
-    if (isset($taxonomies[$post_taxonomy])) {
1288
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1289
-    }
1276
+	/**
1277
+	 * Filter the taxonomies array before output.
1278
+	 *
1279
+	 * @since 1.5.9
1280
+	 * @param array $taxonomies The array of cats and tags.
1281
+	 * @param string $post_type The post type being output.
1282
+	 * @param string $listing_label The post type label.
1283
+	 * @param string $listing_label The post type label with ucwords function.
1284
+	 */
1285
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1286
+
1287
+	if (isset($taxonomies[$post_taxonomy])) {
1288
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1289
+	}
1290 1290
 
1291
-    if (isset($taxonomies[$post_type . '_tags']))
1292
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1291
+	if (isset($taxonomies[$post_type . '_tags']))
1292
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1293 1293
 
1294
-    ?>
1294
+	?>
1295 1295
     </p><?php
1296 1296
 }
1297 1297
 
@@ -1313,144 +1313,144 @@  discard block
 block discarded – undo
1313 1313
 function geodir_action_details_micordata($post='')
1314 1314
 {
1315 1315
 
1316
-    global $preview;
1317
-    if(empty($post)){global $post;}
1318
-    if ($preview || !geodir_is_page('detail')) {
1319
-        return;
1320
-    }
1321
-
1322
-    // url
1323
-    $c_url = geodir_curPageURL();
1324
-
1325
-    // post reviews
1326
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1327
-    if (empty($post_reviews)) {
1328
-        $reviews = '';
1329
-    } else {
1330
-        foreach ($post_reviews as $review) {
1331
-
1332
-            if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1333
-                $reviews[] = array(
1334
-                    "@type" => "Review",
1335
-                    "author" => $review->comment_author,
1336
-                    "datePublished" => $review->comment_date,
1337
-                    "description" => $review->comment_content,
1338
-                    "reviewRating" => array(
1339
-                        "@type" => "Rating",
1340
-                        "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1341
-                        "ratingValue" => $rating_value,
1342
-                        "worstRating" => "1"
1343
-                    )
1344
-                );
1345
-            }
1316
+	global $preview;
1317
+	if(empty($post)){global $post;}
1318
+	if ($preview || !geodir_is_page('detail')) {
1319
+		return;
1320
+	}
1346 1321
 
1347
-        }
1322
+	// url
1323
+	$c_url = geodir_curPageURL();
1324
+
1325
+	// post reviews
1326
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1327
+	if (empty($post_reviews)) {
1328
+		$reviews = '';
1329
+	} else {
1330
+		foreach ($post_reviews as $review) {
1331
+
1332
+			if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1333
+				$reviews[] = array(
1334
+					"@type" => "Review",
1335
+					"author" => $review->comment_author,
1336
+					"datePublished" => $review->comment_date,
1337
+					"description" => $review->comment_content,
1338
+					"reviewRating" => array(
1339
+						"@type" => "Rating",
1340
+						"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1341
+						"ratingValue" => $rating_value,
1342
+						"worstRating" => "1"
1343
+					)
1344
+				);
1345
+			}
1348 1346
 
1349
-    }
1347
+		}
1350 1348
 
1351
-    // post images
1352
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1353
-    if (empty($post_images)) {
1354
-        $images = '';
1355
-    } else {
1356
-        $i_arr = array();
1357
-        foreach ($post_images as $img) {
1358
-            $i_arr[] = $img->src;
1359
-        }
1349
+	}
1360 1350
 
1361
-        if (count($i_arr) == 1) {
1362
-            $images = $i_arr[0];
1363
-        } else {
1364
-            $images = $i_arr;
1365
-        }
1351
+	// post images
1352
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1353
+	if (empty($post_images)) {
1354
+		$images = '';
1355
+	} else {
1356
+		$i_arr = array();
1357
+		foreach ($post_images as $img) {
1358
+			$i_arr[] = $img->src;
1359
+		}
1360
+
1361
+		if (count($i_arr) == 1) {
1362
+			$images = $i_arr[0];
1363
+		} else {
1364
+			$images = $i_arr;
1365
+		}
1366
+
1367
+	}
1368
+	//print_r($post);
1369
+	// external links
1370
+	$external_links =  array();
1371
+	$external_links[] = $post->geodir_website;
1372
+	$external_links[] = $post->geodir_twitter;
1373
+	$external_links[] = $post->geodir_facebook;
1374
+	$external_links = array_filter($external_links);
1375
+
1376
+	if(!empty($external_links)){
1377
+		$external_links = array_values($external_links);
1378
+	}
1379
+
1380
+	// reviews
1381
+	$comment_count = geodir_get_review_count_total($post->ID);
1382
+	$post_avgratings = geodir_get_post_rating($post->ID);
1383
+
1384
+	// schema type
1385
+	$schema_type = 'LocalBusiness';
1386
+	if(isset($post->default_category) && $post->default_category){
1387
+		$cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1388
+		if($cat_schema){$schema_type = $cat_schema;}
1389
+		if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1390
+	}
1391
+
1392
+	$schema = array();
1393
+	$schema['@context'] = "https://schema.org";
1394
+	$schema['@type'] = $schema_type;
1395
+	$schema['name'] = $post->post_title;
1396
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1397
+	$schema['telephone'] = $post->geodir_contact;
1398
+	$schema['url'] = $c_url;
1399
+	$schema['sameAs'] = $external_links;
1400
+	$schema['image'] = $images;
1401
+	$schema['address'] = array(
1402
+		"@type" => "PostalAddress",
1403
+		"streetAddress" => $post->post_address,
1404
+		"addressLocality" => $post->post_city,
1405
+		"addressRegion" => $post->post_region,
1406
+		"addressCountry" => $post->post_country,
1407
+		"postalCode" => $post->post_zip
1408
+	);
1409
+
1410
+	if($post->post_latitude && $post->post_longitude) {
1411
+		$schema['geo'] = array(
1412
+			"@type" => "GeoCoordinates",
1413
+			"latitude" => $post->post_latitude,
1414
+			"longitude" => $post->post_longitude
1415
+		);
1416
+	}
1417
+
1418
+	if($post_avgratings) {
1419
+		$schema['aggregateRating'] = array(
1420
+			"@type" => "AggregateRating",
1421
+			"ratingValue" => $post_avgratings,
1422
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1423
+			"worstRating" => "1",
1424
+			"ratingCount" => $comment_count
1425
+		);
1426
+	}
1427
+	$schema['review'] = $reviews;
1428
+
1429
+	/**
1430
+	 * Allow the schema JSON-LD info to be filtered.
1431
+	 *
1432
+	 * @since 1.5.4
1433
+	 * @since 1.5.7 Added $post variable.
1434
+	 * @param array $schema The array of schema data to be filtered.
1435
+	 * @param object $post The post object.
1436
+	 */
1437
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1438
+
1439
+
1440
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1366 1441
 
1367
-    }
1368
-    //print_r($post);
1369
-    // external links
1370
-    $external_links =  array();
1371
-    $external_links[] = $post->geodir_website;
1372
-    $external_links[] = $post->geodir_twitter;
1373
-    $external_links[] = $post->geodir_facebook;
1374
-    $external_links = array_filter($external_links);
1375
-
1376
-    if(!empty($external_links)){
1377
-        $external_links = array_values($external_links);
1378
-    }
1379
-
1380
-    // reviews
1381
-    $comment_count = geodir_get_review_count_total($post->ID);
1382
-    $post_avgratings = geodir_get_post_rating($post->ID);
1383
-
1384
-    // schema type
1385
-    $schema_type = 'LocalBusiness';
1386
-    if(isset($post->default_category) && $post->default_category){
1387
-        $cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1388
-        if($cat_schema){$schema_type = $cat_schema;}
1389
-        if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1390
-    }
1391
-
1392
-    $schema = array();
1393
-    $schema['@context'] = "https://schema.org";
1394
-    $schema['@type'] = $schema_type;
1395
-    $schema['name'] = $post->post_title;
1396
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1397
-    $schema['telephone'] = $post->geodir_contact;
1398
-    $schema['url'] = $c_url;
1399
-    $schema['sameAs'] = $external_links;
1400
-    $schema['image'] = $images;
1401
-    $schema['address'] = array(
1402
-        "@type" => "PostalAddress",
1403
-        "streetAddress" => $post->post_address,
1404
-        "addressLocality" => $post->post_city,
1405
-        "addressRegion" => $post->post_region,
1406
-        "addressCountry" => $post->post_country,
1407
-        "postalCode" => $post->post_zip
1408
-    );
1409
-
1410
-    if($post->post_latitude && $post->post_longitude) {
1411
-        $schema['geo'] = array(
1412
-            "@type" => "GeoCoordinates",
1413
-            "latitude" => $post->post_latitude,
1414
-            "longitude" => $post->post_longitude
1415
-        );
1416
-    }
1417
-
1418
-    if($post_avgratings) {
1419
-        $schema['aggregateRating'] = array(
1420
-            "@type" => "AggregateRating",
1421
-            "ratingValue" => $post_avgratings,
1422
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1423
-            "worstRating" => "1",
1424
-            "ratingCount" => $comment_count
1425
-        );
1426
-    }
1427
-    $schema['review'] = $reviews;
1428
-
1429
-    /**
1430
-     * Allow the schema JSON-LD info to be filtered.
1431
-     *
1432
-     * @since 1.5.4
1433
-     * @since 1.5.7 Added $post variable.
1434
-     * @param array $schema The array of schema data to be filtered.
1435
-     * @param object $post The post object.
1436
-     */
1437
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1438
-
1439
-
1440
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1441
-
1442
-
1443
-    $uploads = wp_upload_dir();
1444
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1445
-
1446
-    /**
1447
-     * Show facebook open graph meta info
1448
-     *
1449
-     * @since 1.6.6
1450
-     * @param string $facebook_og The open graph html to be filtered.
1451
-     * @param object $post The post object.
1452
-     */
1453
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1442
+
1443
+	$uploads = wp_upload_dir();
1444
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1445
+
1446
+	/**
1447
+	 * Show facebook open graph meta info
1448
+	 *
1449
+	 * @since 1.6.6
1450
+	 * @param string $facebook_og The open graph html to be filtered.
1451
+	 * @param object $post The post object.
1452
+	 */
1453
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1454 1454
 
1455 1455
 
1456 1456
 
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
  */
1471 1471
 function geodir_action_details_next_prev()
1472 1472
 {
1473
-    ?>
1473
+	?>
1474 1474
     <div class="geodir-pos_navigation clearfix">
1475 1475
     <div
1476 1476
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1488,15 +1488,15 @@  discard block
 block discarded – undo
1488 1488
  */
1489 1489
 function geodir_action_before_single_post()
1490 1490
 {
1491
-    global $post;
1492
-    /**
1493
-     * Called at the very start of the details page output, before the title section.
1494
-     *
1495
-     * @since 1.0.0
1496
-     * @param object $post The current post object.
1497
-     * @global WP_Post|null $post The current post, if available.
1498
-     */
1499
-    do_action('geodir_before_single_post', $post); // extra action	
1491
+	global $post;
1492
+	/**
1493
+	 * Called at the very start of the details page output, before the title section.
1494
+	 *
1495
+	 * @since 1.0.0
1496
+	 * @param object $post The current post object.
1497
+	 * @global WP_Post|null $post The current post, if available.
1498
+	 */
1499
+	do_action('geodir_before_single_post', $post); // extra action	
1500 1500
 }
1501 1501
 
1502 1502
 /**
@@ -1507,13 +1507,13 @@  discard block
 block discarded – undo
1507 1507
  */
1508 1508
 function geodir_action_after_single_post($post)
1509 1509
 {
1510
-    /**
1511
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1512
-     *
1513
-     * @since 1.0.0
1514
-     * @param object $post The current post object.
1515
-     */
1516
-    do_action('geodir_after_single_post', $post); // extra action	
1510
+	/**
1511
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1512
+	 *
1513
+	 * @since 1.0.0
1514
+	 * @param object $post The current post object.
1515
+	 */
1516
+	do_action('geodir_after_single_post', $post); // extra action	
1517 1517
 }
1518 1518
 
1519 1519
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1539,168 +1539,168 @@  discard block
 block discarded – undo
1539 1539
  */
1540 1540
 function geodir_action_listings_title()
1541 1541
 {
1542
-    global $wp, $term;
1542
+	global $wp, $term;
1543 1543
 
1544
-    $gd_post_type = geodir_get_current_posttype();
1545
-    $post_type_info = get_post_type_object($gd_post_type);
1544
+	$gd_post_type = geodir_get_current_posttype();
1545
+	$post_type_info = get_post_type_object($gd_post_type);
1546 1546
 
1547
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1548
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1549
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1550
-    }
1547
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1548
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1549
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1550
+	}
1551 1551
 
1552
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1553
-    $single_name = $post_type_info->labels->singular_name;
1552
+	$list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1553
+	$single_name = $post_type_info->labels->singular_name;
1554 1554
 
1555
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1555
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1556 1556
 
1557
-    $gd_country = get_query_var('gd_country');
1558
-    $gd_region = get_query_var('gd_region');
1559
-    $gd_city = get_query_var('gd_city');
1557
+	$gd_country = get_query_var('gd_country');
1558
+	$gd_region = get_query_var('gd_region');
1559
+	$gd_city = get_query_var('gd_city');
1560 1560
 
1561
-    if (!empty($term)) {
1562
-        $location_name = '';
1563
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1564
-            if ($gd_country != '') {
1565
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1566
-            }
1561
+	if (!empty($term)) {
1562
+		$location_name = '';
1563
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1564
+			if ($gd_country != '') {
1565
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1566
+			}
1567 1567
 
1568
-            if ($gd_region != '') {
1569
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1570
-            }
1568
+			if ($gd_region != '') {
1569
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1570
+			}
1571 1571
 
1572
-            if ($gd_city != '') {
1573
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1574
-            }
1575
-        }
1572
+			if ($gd_city != '') {
1573
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1574
+			}
1575
+		}
1576 1576
 
1577
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1578
-        if (!empty($current_term)) {
1579
-            $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1580
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1581
-                $location_last_char = substr($location_name, -1);
1582
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1583
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1584
-            } else {
1585
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1586
-            }
1587
-        } else {
1588
-            if (count($taxonomy) > 1) {
1589
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1590
-
1591
-                if (!empty($current_term)) {
1592
-                    $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1593
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1594
-                        $location_last_char = substr($location_name, -1);
1595
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1596
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1597
-                    } else {
1598
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1599
-                    }
1600
-                }
1601
-            }
1602
-        }
1577
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1578
+		if (!empty($current_term)) {
1579
+			$current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1580
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1581
+				$location_last_char = substr($location_name, -1);
1582
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1583
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1584
+			} else {
1585
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1586
+			}
1587
+		} else {
1588
+			if (count($taxonomy) > 1) {
1589
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1590
+
1591
+				if (!empty($current_term)) {
1592
+					$current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1593
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1594
+						$location_last_char = substr($location_name, -1);
1595
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1596
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1597
+					} else {
1598
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1599
+					}
1600
+				}
1601
+			}
1602
+		}
1603 1603
 
1604
-    } else {
1605
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1606
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1607
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1604
+	} else {
1605
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1606
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1607
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1608 1608
 
1609
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1609
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1610 1610
 
1611
-        if (function_exists('get_actual_location_name')) {
1612
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1613
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1614
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1615
-        }
1611
+		if (function_exists('get_actual_location_name')) {
1612
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1613
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1614
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1615
+		}
1616 1616
 
1617
-        if ($gd_city != '') {
1618
-            if ($gd_city_actual != '') {
1619
-                $gd_city = $gd_city_actual;
1620
-            } else {
1621
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1622
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1623
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1624
-            }
1617
+		if ($gd_city != '') {
1618
+			if ($gd_city_actual != '') {
1619
+				$gd_city = $gd_city_actual;
1620
+			} else {
1621
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1622
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1623
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1624
+			}
1625 1625
 
1626
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1627
-        } else if ($gd_region != '') {
1628
-            if ($gd_region_actual != '') {
1629
-                $gd_region = $gd_region_actual;
1630
-            } else {
1631
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1632
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1633
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1634
-            }
1626
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1627
+		} else if ($gd_region != '') {
1628
+			if ($gd_region_actual != '') {
1629
+				$gd_region = $gd_region_actual;
1630
+			} else {
1631
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1632
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1633
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1634
+			}
1635 1635
 
1636
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1637
-        } else if ($gd_country != '') {
1638
-            if ($gd_country_actual != '') {
1639
-                $gd_country = $gd_country_actual;
1640
-            } else {
1641
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1642
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1643
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1644
-            }
1636
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1637
+		} else if ($gd_country != '') {
1638
+			if ($gd_country_actual != '') {
1639
+				$gd_country = $gd_country_actual;
1640
+			} else {
1641
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1642
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1643
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1644
+			}
1645 1645
 
1646
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1647
-        }
1648
-    }
1649
-
1650
-    if (is_search()) {
1651
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1652
-    }
1653
-    /** This action is documented in geodirectory_template_actions.php */
1654
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1655
-    /** This action is documented in geodirectory_template_actions.php */
1656
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1657
-
1658
-
1659
-    $title = $list_title;
1660
-    $gd_page = '';
1661
-    if(geodir_is_page('pt')){
1662
-        $gd_page = 'pt';
1663
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1664
-    }
1665
-    elseif(geodir_is_page('listing')){
1666
-        $gd_page = 'listing';
1667
-        global $wp_query;
1668
-        $current_term = $wp_query->get_queried_object();
1669
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1670
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1671
-        }else{
1672
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1673
-        }
1646
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1647
+		}
1648
+	}
1674 1649
 
1675
-    }
1676
-    elseif(geodir_is_page('author')){
1677
-        $gd_page = 'author';
1678
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1679
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1680
-        }else{
1681
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1682
-        }
1650
+	if (is_search()) {
1651
+		$list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1652
+	}
1653
+	/** This action is documented in geodirectory_template_actions.php */
1654
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1655
+	/** This action is documented in geodirectory_template_actions.php */
1656
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1683 1657
 
1684
-    }
1685 1658
 
1659
+	$title = $list_title;
1660
+	$gd_page = '';
1661
+	if(geodir_is_page('pt')){
1662
+		$gd_page = 'pt';
1663
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1664
+	}
1665
+	elseif(geodir_is_page('listing')){
1666
+		$gd_page = 'listing';
1667
+		global $wp_query;
1668
+		$current_term = $wp_query->get_queried_object();
1669
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1670
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1671
+		}else{
1672
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1673
+		}
1686 1674
 
1687
-    /**
1688
-     * Filter page title to replace variables.
1689
-     *
1690
-     * @since 1.5.4
1691
-     * @param string $title The page title including variables.
1692
-     * @param string $gd_page The GeoDirectory page type if any.
1693
-     */
1694
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1675
+	}
1676
+	elseif(geodir_is_page('author')){
1677
+		$gd_page = 'author';
1678
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1679
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1680
+		}else{
1681
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1682
+		}
1695 1683
 
1696
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1697
-        /**
1698
-         * Filter the listing page title.
1699
-         *
1700
-         * @since 1.0.0
1701
-         * @param string $list_title The title for the category page.
1702
-         */
1703
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1684
+	}
1685
+
1686
+
1687
+	/**
1688
+	 * Filter page title to replace variables.
1689
+	 *
1690
+	 * @since 1.5.4
1691
+	 * @param string $title The page title including variables.
1692
+	 * @param string $gd_page The GeoDirectory page type if any.
1693
+	 */
1694
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1695
+
1696
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1697
+		/**
1698
+		 * Filter the listing page title.
1699
+		 *
1700
+		 * @since 1.0.0
1701
+		 * @param string $list_title The title for the category page.
1702
+		 */
1703
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1704 1704
 }
1705 1705
 
1706 1706
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1713,46 +1713,46 @@  discard block
 block discarded – undo
1713 1713
  */
1714 1714
 function geodir_action_listings_description()
1715 1715
 {
1716
-    global $wp_query;
1717
-    $current_term = $wp_query->get_queried_object();
1716
+	global $wp_query;
1717
+	$current_term = $wp_query->get_queried_object();
1718 1718
 
1719
-    $gd_post_type = geodir_get_current_posttype();
1720
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1719
+	$gd_post_type = geodir_get_current_posttype();
1720
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1721 1721
 
1722
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1723
-        $saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1724
-        if ($term_desc && !$saved_data) {
1725
-            $saved_data = $term_desc;
1726
-        }
1722
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1723
+		$saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1724
+		if ($term_desc && !$saved_data) {
1725
+			$saved_data = $term_desc;
1726
+		}
1727 1727
 
1728
-        // stop payment manager filtering content length
1729
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1730
-        if ( false !== $filter_priority ) {
1731
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1732
-        }
1728
+		// stop payment manager filtering content length
1729
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1730
+		if ( false !== $filter_priority ) {
1731
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1732
+		}
1733 1733
 
1734
-        /**
1735
-         * Apply the core filter `the_content` filter to the variable string.
1736
-         *
1737
-         * This is a WordPress core filter that does many things.
1738
-         *
1739
-         * @since 1.0.0
1740
-         * @param string $var The string to apply the filter to.
1741
-         */
1742
-        $cat_description = apply_filters('the_content', $saved_data);
1734
+		/**
1735
+		 * Apply the core filter `the_content` filter to the variable string.
1736
+		 *
1737
+		 * This is a WordPress core filter that does many things.
1738
+		 *
1739
+		 * @since 1.0.0
1740
+		 * @param string $var The string to apply the filter to.
1741
+		 */
1742
+		$cat_description = apply_filters('the_content', $saved_data);
1743 1743
 
1744 1744
 
1745
-        if ( false !== $filter_priority ) {
1746
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1747
-        }
1745
+		if ( false !== $filter_priority ) {
1746
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1747
+		}
1748 1748
 
1749
-        if ($cat_description) {
1750
-            ?>
1749
+		if ($cat_description) {
1750
+			?>
1751 1751
 
1752 1752
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1753
-        }
1753
+		}
1754 1754
 
1755
-    }
1755
+	}
1756 1756
 }
1757 1757
 
1758 1758
 // action for adding the listings page top widget area
@@ -1771,11 +1771,11 @@  discard block
 block discarded – undo
1771 1771
  */
1772 1772
 function geodir_action_geodir_sidebar_listings_top()
1773 1773
 {
1774
-    if (get_option('geodir_show_listing_top_section')) { ?>
1774
+	if (get_option('geodir_show_listing_top_section')) { ?>
1775 1775
         <div
1776 1776
             class="<?php
1777
-            /** This action is documented in geodirectory_template_actions.php */
1778
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1777
+			/** This action is documented in geodirectory_template_actions.php */
1778
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1779 1779
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1780 1780
         </div><!-- clearfix ends here-->
1781 1781
     <?php }
@@ -1798,35 +1798,35 @@  discard block
 block discarded – undo
1798 1798
  */
1799 1799
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1800 1800
 {
1801
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1802
-        $width_css = 'style="width:' . $width . '%;"';
1803
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1804
-        $width_css = 'style="width:' . $width . '%;"';
1805
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1806
-        $width_css = 'style="width:' . $width . '%;"';
1807
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1808
-        $width_css = 'style="width:' . $width . '%;"';
1809
-    } else {
1810
-        $width_css = '';
1811
-    }
1812
-
1813
-    $tc = get_option('theme_compatibility_setting');
1814
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1815
-        $text = $tc['geodir_sidebar_left_open_replace'];
1816
-    } else {
1817
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1818
-    }
1819
-
1820
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1821
-        $id = $tc['geodir_sidebar_left_open_id'];
1822
-    }
1823
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1824
-        $class = $tc['geodir_sidebar_left_open_class'];
1825
-    }
1826
-
1827
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1828
-
1829
-    echo $text;
1801
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1802
+		$width_css = 'style="width:' . $width . '%;"';
1803
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1804
+		$width_css = 'style="width:' . $width . '%;"';
1805
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1806
+		$width_css = 'style="width:' . $width . '%;"';
1807
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1808
+		$width_css = 'style="width:' . $width . '%;"';
1809
+	} else {
1810
+		$width_css = '';
1811
+	}
1812
+
1813
+	$tc = get_option('theme_compatibility_setting');
1814
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1815
+		$text = $tc['geodir_sidebar_left_open_replace'];
1816
+	} else {
1817
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1818
+	}
1819
+
1820
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1821
+		$id = $tc['geodir_sidebar_left_open_id'];
1822
+	}
1823
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1824
+		$class = $tc['geodir_sidebar_left_open_class'];
1825
+	}
1826
+
1827
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1828
+
1829
+	echo $text;
1830 1830
 }
1831 1831
 
1832 1832
 // action for adding the primary div closing tag
@@ -1842,13 +1842,13 @@  discard block
 block discarded – undo
1842 1842
  */
1843 1843
 function geodir_action_sidebar_left_close($type = '')
1844 1844
 {
1845
-    $tc = get_option('theme_compatibility_setting');
1846
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1847
-        $text = $tc['geodir_sidebar_left_close_replace'];
1848
-    } else {
1849
-        $text = '</aside><!-- sidebar ends here-->';
1850
-    }
1851
-    echo $text;
1845
+	$tc = get_option('theme_compatibility_setting');
1846
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1847
+		$text = $tc['geodir_sidebar_left_close_replace'];
1848
+	} else {
1849
+		$text = '</aside><!-- sidebar ends here-->';
1850
+	}
1851
+	echo $text;
1852 1852
 }
1853 1853
 
1854 1854
 /**
@@ -1861,7 +1861,7 @@  discard block
 block discarded – undo
1861 1861
  */
1862 1862
 function geodir_listing_left_section()
1863 1863
 {
1864
-    if (get_option('geodir_show_listing_left_section')) { ?>
1864
+	if (get_option('geodir_show_listing_left_section')) { ?>
1865 1865
         <div class="geodir-content-left geodir-sidebar-wrap">
1866 1866
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1867 1867
         </div><!-- end geodir-content-left -->
@@ -1879,20 +1879,20 @@  discard block
 block discarded – undo
1879 1879
  */
1880 1880
 function geodir_action_listings_sidebar_left()
1881 1881
 {
1882
-    if (get_option('geodir_show_listing_left_section')) {
1883
-        /** This action is documented in geodirectory_template_actions.php */
1884
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1885
-        /**
1886
-         * Calls the listings page (category) left sidebar content.
1887
-         *
1888
-         * All the content for the listings page left sidebar is added via this hook.
1889
-         *
1890
-         * @since 1.0.0
1891
-         */
1892
-        do_action('geodir_listings_sidebar_left_inside');
1893
-        /** This action is documented in geodirectory_template_actions.php */
1894
-        do_action('geodir_sidebar_left_close', 'listings-page');
1895
-    }
1882
+	if (get_option('geodir_show_listing_left_section')) {
1883
+		/** This action is documented in geodirectory_template_actions.php */
1884
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1885
+		/**
1886
+		 * Calls the listings page (category) left sidebar content.
1887
+		 *
1888
+		 * All the content for the listings page left sidebar is added via this hook.
1889
+		 *
1890
+		 * @since 1.0.0
1891
+		 */
1892
+		do_action('geodir_listings_sidebar_left_inside');
1893
+		/** This action is documented in geodirectory_template_actions.php */
1894
+		do_action('geodir_sidebar_left_close', 'listings-page');
1895
+	}
1896 1896
 }
1897 1897
 
1898 1898
 /**
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
  */
1906 1906
 function geodir_listing_right_section()
1907 1907
 {
1908
-    if (get_option('geodir_show_listing_right_section')) { ?>
1908
+	if (get_option('geodir_show_listing_right_section')) { ?>
1909 1909
         <div class="geodir-content-right geodir-sidebar-wrap">
1910 1910
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1911 1911
         </div><!-- end geodir-content-right -->
@@ -1923,20 +1923,20 @@  discard block
 block discarded – undo
1923 1923
  */
1924 1924
 function geodir_action_listings_sidebar_right()
1925 1925
 {
1926
-    if (get_option('geodir_show_listing_right_section')) {
1927
-        /** This action is documented in geodirectory_template_actions.php */
1928
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1929
-        /**
1930
-         * Calls the listings page (category) right sidebar content.
1931
-         *
1932
-         * All the content for the listings page right sidebar is added via this hook.
1933
-         *
1934
-         * @since 1.0.0
1935
-         */
1936
-        do_action('geodir_listings_sidebar_right_inside');
1937
-        /** This action is documented in geodirectory_template_actions.php */
1938
-        do_action('geodir_sidebar_right_close', 'listings-page');
1939
-    }
1926
+	if (get_option('geodir_show_listing_right_section')) {
1927
+		/** This action is documented in geodirectory_template_actions.php */
1928
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1929
+		/**
1930
+		 * Calls the listings page (category) right sidebar content.
1931
+		 *
1932
+		 * All the content for the listings page right sidebar is added via this hook.
1933
+		 *
1934
+		 * @since 1.0.0
1935
+		 */
1936
+		do_action('geodir_listings_sidebar_right_inside');
1937
+		/** This action is documented in geodirectory_template_actions.php */
1938
+		do_action('geodir_sidebar_right_close', 'listings-page');
1939
+	}
1940 1940
 }
1941 1941
 
1942 1942
 
@@ -1953,23 +1953,23 @@  discard block
 block discarded – undo
1953 1953
  */
1954 1954
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1955 1955
 {
1956
-    $tc = get_option('theme_compatibility_setting');
1957
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1958
-        $text = $tc['geodir_main_content_open_replace'];
1959
-    } else {
1960
-        $text = '<main id="[id]" class="[class]" role="main">';
1961
-    }
1956
+	$tc = get_option('theme_compatibility_setting');
1957
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1958
+		$text = $tc['geodir_main_content_open_replace'];
1959
+	} else {
1960
+		$text = '<main id="[id]" class="[class]" role="main">';
1961
+	}
1962 1962
 
1963
-    if (!empty($tc['geodir_main_content_open_id'])) {
1964
-        $id = $tc['geodir_main_content_open_id'];
1965
-    }
1966
-    if (!empty($tc['geodir_main_content_open_class'])) {
1967
-        $class = $tc['geodir_main_content_open_class'];
1968
-    }
1963
+	if (!empty($tc['geodir_main_content_open_id'])) {
1964
+		$id = $tc['geodir_main_content_open_id'];
1965
+	}
1966
+	if (!empty($tc['geodir_main_content_open_class'])) {
1967
+		$class = $tc['geodir_main_content_open_class'];
1968
+	}
1969 1969
 
1970
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1970
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1971 1971
 
1972
-    echo $text;
1972
+	echo $text;
1973 1973
 }
1974 1974
 
1975 1975
 // action for adding the primary div closing tag
@@ -1982,13 +1982,13 @@  discard block
 block discarded – undo
1982 1982
  */
1983 1983
 function geodir_action_main_content_close()
1984 1984
 {
1985
-    $tc = get_option('theme_compatibility_setting');
1986
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1987
-        $text = $tc['geodir_main_content_close_replace'];
1988
-    } else {
1989
-        $text = '</main><!-- main ends here-->';
1990
-    }
1991
-    echo $text;
1985
+	$tc = get_option('theme_compatibility_setting');
1986
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1987
+		$text = $tc['geodir_main_content_close_replace'];
1988
+	} else {
1989
+		$text = '</main><!-- main ends here-->';
1990
+	}
1991
+	echo $text;
1992 1992
 }
1993 1993
 
1994 1994
 /**
@@ -2000,14 +2000,14 @@  discard block
 block discarded – undo
2000 2000
  */
2001 2001
 function geodir_action_listings_content_inside()
2002 2002
 {
2003
-    global $gridview_columns;
2004
-    $listing_view = get_option('geodir_listing_view');
2005
-    if (strstr($listing_view, 'gridview')) {
2006
-        $gridview_columns = $listing_view;
2007
-        $listing_view_exp = explode('_', $listing_view);
2008
-        $listing_view = $listing_view_exp[0];
2009
-    }
2010
-    geodir_get_template_part('listing', 'listview');
2003
+	global $gridview_columns;
2004
+	$listing_view = get_option('geodir_listing_view');
2005
+	if (strstr($listing_view, 'gridview')) {
2006
+		$gridview_columns = $listing_view;
2007
+		$listing_view_exp = explode('_', $listing_view);
2008
+		$listing_view = $listing_view_exp[0];
2009
+	}
2010
+	geodir_get_template_part('listing', 'listview');
2011 2011
 }
2012 2012
 
2013 2013
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -2023,47 +2023,47 @@  discard block
 block discarded – undo
2023 2023
  */
2024 2024
 function geodir_action_listings_content()
2025 2025
 {
2026
-    /**
2027
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2028
-     *
2029
-     * @since 1.0.0
2030
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2031
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
2032
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2033
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2034
-     */
2035
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2036
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2037
-    echo '<div class="clearfix '.$extra_class.'">';
2038
-    /**
2039
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2040
-     *
2041
-     * @since 1.0.0
2042
-     */
2043
-    do_action('geodir_before_listing');
2044
-    echo '</div>';
2045
-
2046
-    /**
2047
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2048
-     *
2049
-     * @since 1.0.0
2050
-     */
2051
-    do_action('geodir_listings_content_inside');
2052
-
2053
-    /**
2054
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2055
-     *
2056
-     * @since 1.0.0
2057
-     */
2058
-    do_action('geodir_after_listing');
2059
-
2060
-    /**
2061
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2062
-     *
2063
-     * @since 1.0.0
2064
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2065
-     */
2066
-    do_action('geodir_main_content_close', 'listings-page');
2026
+	/**
2027
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
2028
+	 *
2029
+	 * @since 1.0.0
2030
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2031
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
2032
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
2033
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2034
+	 */
2035
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2036
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2037
+	echo '<div class="clearfix '.$extra_class.'">';
2038
+	/**
2039
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2040
+	 *
2041
+	 * @since 1.0.0
2042
+	 */
2043
+	do_action('geodir_before_listing');
2044
+	echo '</div>';
2045
+
2046
+	/**
2047
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2048
+	 *
2049
+	 * @since 1.0.0
2050
+	 */
2051
+	do_action('geodir_listings_content_inside');
2052
+
2053
+	/**
2054
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2055
+	 *
2056
+	 * @since 1.0.0
2057
+	 */
2058
+	do_action('geodir_after_listing');
2059
+
2060
+	/**
2061
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2062
+	 *
2063
+	 * @since 1.0.0
2064
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2065
+	 */
2066
+	do_action('geodir_main_content_close', 'listings-page');
2067 2067
 }
2068 2068
 
2069 2069
 
@@ -2078,10 +2078,10 @@  discard block
 block discarded – undo
2078 2078
  */
2079 2079
 function geodir_action_sidebar_listings_bottom_section()
2080 2080
 {
2081
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2081
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2082 2082
         <div class="<?php
2083
-            /** This action is documented in geodirectory_template_actions.php */
2084
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2083
+			/** This action is documented in geodirectory_template_actions.php */
2084
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2085 2085
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2086 2086
         </div><!-- clearfix ends here-->
2087 2087
     <?php }
@@ -2101,38 +2101,38 @@  discard block
 block discarded – undo
2101 2101
  */
2102 2102
 function geodir_action_add_listing_page_title()
2103 2103
 {
2104
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2105
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2106
-    /** This action is documented in geodirectory_template_actions.php */
2107
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2108
-    /** This action is documented in geodirectory_template_actions.php */
2109
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2110
-
2111
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2112
-
2113
-    if(geodir_is_page('add-listing')){
2114
-        $gd_page = 'add-listing';
2115
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2116
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2117
-        }elseif(isset($listing_type)){
2118
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2119
-        }
2104
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2105
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2106
+	/** This action is documented in geodirectory_template_actions.php */
2107
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2108
+	/** This action is documented in geodirectory_template_actions.php */
2109
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2110
+
2111
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2112
+
2113
+	if(geodir_is_page('add-listing')){
2114
+		$gd_page = 'add-listing';
2115
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2116
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2117
+		}elseif(isset($listing_type)){
2118
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2119
+		}
2120 2120
 
2121
-    }
2121
+	}
2122 2122
 
2123 2123
 
2124
-    /**
2125
-     * Filter page title to replace variables.
2126
-     *
2127
-     * @since 1.5.4
2128
-     * @param string $title The page title including variables.
2129
-     * @param string $gd_page The GeoDirectory page type if any.
2130
-     */
2131
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2124
+	/**
2125
+	 * Filter page title to replace variables.
2126
+	 *
2127
+	 * @since 1.5.4
2128
+	 * @param string $title The page title including variables.
2129
+	 * @param string $gd_page The GeoDirectory page type if any.
2130
+	 */
2131
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2132 2132
 
2133
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2134
-    echo $title;
2135
-    echo '</h1></header>';
2133
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2134
+	echo $title;
2135
+	echo '</h1></header>';
2136 2136
 }
2137 2137
 
2138 2138
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2163,61 +2163,61 @@  discard block
 block discarded – undo
2163 2163
  */
2164 2164
 function geodir_action_add_listing_form()
2165 2165
 {
2166
-    global $cat_display, $post_cat, $current_user, $gd_session;
2167
-    $page_id = get_the_ID();
2168
-    $post = '';
2169
-    $title = '';
2170
-    $desc = '';
2171
-    $kw_tags = '';
2172
-    $required_msg = '';
2173
-    $submit_button = '';
2174
-
2175
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2176
-
2177
-    $thumb_img_arr = array();
2178
-    $curImages = '';
2179
-
2180
-    if (isset($_REQUEST['backandedit'])) {
2181
-        global $post;
2182
-        $post = (object)$gd_session->get('listing');
2183
-        $listing_type = $post->listing_type;
2184
-        $title = $post->post_title;
2185
-        $desc = $post->post_desc;
2186
-        $post_cat = isset($post->post_category) ? $post->post_category : '';
2187
-
2188
-        $kw_tags = $post->post_tags;
2189
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2190
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2191
-        global $post, $post_images;
2192
-
2193
-        $post = geodir_get_post_info($_REQUEST['pid']);
2194
-        $thumb_img_arr = geodir_get_images($post->ID);
2195
-        if ($thumb_img_arr) {
2196
-            foreach ($thumb_img_arr as $post_img) {
2197
-                $curImages .= $post_img->src . ',';
2198
-            }
2199
-        }
2166
+	global $cat_display, $post_cat, $current_user, $gd_session;
2167
+	$page_id = get_the_ID();
2168
+	$post = '';
2169
+	$title = '';
2170
+	$desc = '';
2171
+	$kw_tags = '';
2172
+	$required_msg = '';
2173
+	$submit_button = '';
2174
+
2175
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2176
+
2177
+	$thumb_img_arr = array();
2178
+	$curImages = '';
2179
+
2180
+	if (isset($_REQUEST['backandedit'])) {
2181
+		global $post;
2182
+		$post = (object)$gd_session->get('listing');
2183
+		$listing_type = $post->listing_type;
2184
+		$title = $post->post_title;
2185
+		$desc = $post->post_desc;
2186
+		$post_cat = isset($post->post_category) ? $post->post_category : '';
2187
+
2188
+		$kw_tags = $post->post_tags;
2189
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2190
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2191
+		global $post, $post_images;
2192
+
2193
+		$post = geodir_get_post_info($_REQUEST['pid']);
2194
+		$thumb_img_arr = geodir_get_images($post->ID);
2195
+		if ($thumb_img_arr) {
2196
+			foreach ($thumb_img_arr as $post_img) {
2197
+				$curImages .= $post_img->src . ',';
2198
+			}
2199
+		}
2200 2200
 
2201
-        $listing_type = $post->post_type;
2202
-        $title = $post->post_title;
2203
-        $desc = $post->post_content;
2204
-        $kw_tags = $post->post_tags;
2205
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2206
-    } else {
2207
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2208
-    }
2201
+		$listing_type = $post->post_type;
2202
+		$title = $post->post_title;
2203
+		$desc = $post->post_content;
2204
+		$kw_tags = $post->post_tags;
2205
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2206
+	} else {
2207
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2208
+	}
2209 2209
 
2210
-    if ($current_user->ID != '0') {
2211
-        $user_login = true;
2212
-    }
2210
+	if ($current_user->ID != '0') {
2211
+		$user_login = true;
2212
+	}
2213 2213
 
2214
-    $post_type_info = geodir_get_posttype_info($listing_type);
2214
+	$post_type_info = geodir_get_posttype_info($listing_type);
2215 2215
 
2216
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2216
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2217 2217
     
2218
-    $package_info = array();
2219
-    $package_info = geodir_post_package_info($package_info, $post);
2220
-    ?>
2218
+	$package_info = array();
2219
+	$package_info = geodir_post_package_info($package_info, $post);
2220
+	?>
2221 2221
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2222 2222
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2223 2223
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2228,114 +2228,114 @@  discard block
 block discarded – undo
2228 2228
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2229 2229
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2230 2230
         <?php
2231
-        } 
2232
-        /**
2233
-         * Called at the very top of the add listing page form for frontend.
2234
-         *
2235
-         * This is called just before the "Enter Listing Details" text.
2236
-         *
2237
-         * @since 1.0.0
2238
-         */
2239
-        do_action('geodir_before_detail_fields');
2240
-        ?>
2231
+		} 
2232
+		/**
2233
+		 * Called at the very top of the add listing page form for frontend.
2234
+		 *
2235
+		 * This is called just before the "Enter Listing Details" text.
2236
+		 *
2237
+		 * @since 1.0.0
2238
+		 */
2239
+		do_action('geodir_before_detail_fields');
2240
+		?>
2241 2241
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2242 2242
         <?php
2243
-        /**
2244
-         * Called at the top of the add listing page form for frontend.
2245
-         *
2246
-         * This is called after the "Enter Listing Details" text.
2247
-         *
2248
-         * @since 1.0.0
2249
-         */
2250
-        do_action('geodir_before_main_form_fields');
2251
-        ?>
2243
+		/**
2244
+		 * Called at the top of the add listing page form for frontend.
2245
+		 *
2246
+		 * This is called after the "Enter Listing Details" text.
2247
+		 *
2248
+		 * @since 1.0.0
2249
+		 */
2250
+		do_action('geodir_before_main_form_fields');
2251
+		?>
2252 2252
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2253 2253
             <label><?php
2254
-                /**
2255
-                 * Filter the add listing page title input label.
2256
-                 *
2257
-                 * @since 1.6.11
2258
-                 * @param string $title The title to be output.
2259
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2260
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2261
-                 */
2262
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2254
+				/**
2255
+				 * Filter the add listing page title input label.
2256
+				 *
2257
+				 * @since 1.6.11
2258
+				 * @param string $title The title to be output.
2259
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2260
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2261
+				 */
2262
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2263 2263
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2264 2264
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2265 2265
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2266 2266
         </div>
2267 2267
         <?php
2268
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2269
-        $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2270
-        /**
2271
-         * Filter whether to show or don't show the editor.
2272
-         *
2273
-         * @since 1.6.16
2274
-         * @param bool $show_editor If true the editor will be available for description field.
2275
-         * @param object $package_info The listing package.
2276
-         * @param string $listing_type The current post type.
2277
-         * @param object $post The current post object.
2278
-         */
2279
-        $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2280
-
2281
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2282
-        $desc_limit = '';
2283
-        /**
2284
-         * Filter the add listing description field character limit number.
2285
-         *
2286
-         * @since 1.0.0
2287
-         * @param int $desc_limit The amount of characters to limit the description to.
2288
-         */
2289
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2290
-        /**
2291
-         * Filter the add listing description field text.
2292
-         *
2293
-         * @since 1.0.0
2294
-         * @param string $desc The text for the description field.
2295
-         * @param int $desc_limit The character limit number if any.
2296
-         */
2297
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2298
-        $desc_limit_msg = '';
2299
-        /**
2300
-         * Filter the add listing description limit message.
2301
-         *
2302
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2303
-         *
2304
-         * @since 1.0.0
2305
-         * @param string $desc_limit_msg The limit message string if any.
2306
-         * @param int $desc_limit The character limit numer if any.
2307
-         */
2308
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2268
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2269
+		$show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false;
2270
+		/**
2271
+		 * Filter whether to show or don't show the editor.
2272
+		 *
2273
+		 * @since 1.6.16
2274
+		 * @param bool $show_editor If true the editor will be available for description field.
2275
+		 * @param object $package_info The listing package.
2276
+		 * @param string $listing_type The current post type.
2277
+		 * @param object $post The current post object.
2278
+		 */
2279
+		$show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post);
2280
+
2281
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2282
+		$desc_limit = '';
2283
+		/**
2284
+		 * Filter the add listing description field character limit number.
2285
+		 *
2286
+		 * @since 1.0.0
2287
+		 * @param int $desc_limit The amount of characters to limit the description to.
2288
+		 */
2289
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2290
+		/**
2291
+		 * Filter the add listing description field text.
2292
+		 *
2293
+		 * @since 1.0.0
2294
+		 * @param string $desc The text for the description field.
2295
+		 * @param int $desc_limit The character limit number if any.
2296
+		 */
2297
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2298
+		$desc_limit_msg = '';
2299
+		/**
2300
+		 * Filter the add listing description limit message.
2301
+		 *
2302
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2303
+		 *
2304
+		 * @since 1.0.0
2305
+		 * @param string $desc_limit_msg The limit message string if any.
2306
+		 * @param int $desc_limit The character limit numer if any.
2307
+		 */
2308
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2309 2309
         
2310
-        $desc_class = '';
2311
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2312
-            /**
2313
-             * Called on the add listing page form for frontend just before the description field.
2314
-             *
2315
-             * @since 1.0.0
2316
-             */
2317
-            do_action('geodir_before_description_field');
2310
+		$desc_class = '';
2311
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2312
+			/**
2313
+			 * Called on the add listing page form for frontend just before the description field.
2314
+			 *
2315
+			 * @since 1.0.0
2316
+			 */
2317
+			do_action('geodir_before_description_field');
2318 2318
             
2319
-            $desc_class = ' required_field';
2320
-        } else {
2321
-            $desc_class = ' hidden';
2322
-        }
2323
-        ?>
2319
+			$desc_class = ' required_field';
2320
+		} else {
2321
+			$desc_class = ' hidden';
2322
+		}
2323
+		?>
2324 2324
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2325 2325
             <label><?php
2326
-                /**
2327
-                 * Filter the add listing page description input label.
2328
-                 *
2329
-                 * @since 1.6.11
2330
-                 * @param string $title The title to be output.
2331
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2332
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2333
-                 */
2334
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2326
+				/**
2327
+				 * Filter the add listing page description input label.
2328
+				 *
2329
+				 * @since 1.6.11
2330
+				 * @param string $title The title to be output.
2331
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2332
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2333
+				 */
2334
+				echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2335 2335
             <?php
2336
-            if ($show_editor) {
2337
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2338
-            ?>
2336
+			if ($show_editor) {
2337
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2338
+			?>
2339 2339
                 <div class="editor" field_id="post_desc" field_type="editor">
2340 2340
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2341 2341
                 </div>
@@ -2349,56 +2349,56 @@  discard block
 block discarded – undo
2349 2349
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2350 2350
         </div>
2351 2351
         <?php
2352
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2353
-            /**
2354
-             * Called on the add listing page form for frontend just after the description field.
2355
-             *
2356
-             * @since 1.0.0
2357
-             */
2358
-            do_action('geodir_after_description_field');
2359
-        }
2352
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2353
+			/**
2354
+			 * Called on the add listing page form for frontend just after the description field.
2355
+			 *
2356
+			 * @since 1.0.0
2357
+			 */
2358
+			do_action('geodir_after_description_field');
2359
+		}
2360 2360
         
2361
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2362
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2363
-        $kw_tags_msg = TAGKW_MSG;
2364
-        /**
2365
-         * Filter the add listing tags character limit.
2366
-         *
2367
-         * @since 1.0.0
2368
-         * @param int $kw_tags_count The character count limit if any.
2369
-         */
2370
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2371
-        /**
2372
-         * Filter the add listing tags field value.
2373
-         *
2374
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2375
-         *
2376
-         * @since 1.0.0
2377
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2378
-         * @param int $kw_tags_count The character count limit if any.
2379
-         */
2380
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2381
-        /**
2382
-         * Filter the add listing tags field message text.
2383
-         *
2384
-         * @since 1.0.0
2385
-         * @param string $kw_tags_msg The message shown under the field.
2386
-         * @param int $kw_tags_count The character count limit if any.
2387
-         */
2388
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2361
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2362
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2363
+		$kw_tags_msg = TAGKW_MSG;
2364
+		/**
2365
+		 * Filter the add listing tags character limit.
2366
+		 *
2367
+		 * @since 1.0.0
2368
+		 * @param int $kw_tags_count The character count limit if any.
2369
+		 */
2370
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2371
+		/**
2372
+		 * Filter the add listing tags field value.
2373
+		 *
2374
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2375
+		 *
2376
+		 * @since 1.0.0
2377
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2378
+		 * @param int $kw_tags_count The character count limit if any.
2379
+		 */
2380
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2381
+		/**
2382
+		 * Filter the add listing tags field message text.
2383
+		 *
2384
+		 * @since 1.0.0
2385
+		 * @param string $kw_tags_msg The message shown under the field.
2386
+		 * @param int $kw_tags_count The character count limit if any.
2387
+		 */
2388
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2389 2389
         
2390
-        $tags_class = '';
2391
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2392
-            /**
2393
-             * Called on the add listing page form for frontend just before the tags field.
2394
-             *
2395
-             * @since 1.0.0
2396
-             */
2397
-            do_action('geodir_before_listing_tags_field');
2398
-        } else {
2399
-            $tags_class = ' hidden';
2400
-        }
2401
-        ?>
2390
+		$tags_class = '';
2391
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2392
+			/**
2393
+			 * Called on the add listing page form for frontend just before the tags field.
2394
+			 *
2395
+			 * @since 1.0.0
2396
+			 */
2397
+			do_action('geodir_before_listing_tags_field');
2398
+		} else {
2399
+			$tags_class = ' hidden';
2400
+		}
2401
+		?>
2402 2402
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2403 2403
             <label><?php echo TAGKW_TEXT; ?></label>
2404 2404
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2406,90 +2406,90 @@  discard block
 block discarded – undo
2406 2406
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2407 2407
         </div>
2408 2408
         <?php
2409
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2410
-            /**
2411
-             * Called on the add listing page form for frontend just after the tags field.
2412
-             *
2413
-             * @since 1.0.0
2414
-             */
2415
-            do_action('geodir_after_listing_tags_field');
2416
-        }
2409
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2410
+			/**
2411
+			 * Called on the add listing page form for frontend just after the tags field.
2412
+			 *
2413
+			 * @since 1.0.0
2414
+			 */
2415
+			do_action('geodir_after_listing_tags_field');
2416
+		}
2417 2417
         
2418
-        $package_info = array();
2419
-        $package_info = geodir_post_package_info($package_info, $post);
2418
+		$package_info = array();
2419
+		$package_info = geodir_post_package_info($package_info, $post);
2420 2420
         
2421
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2421
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2422 2422
         
2423
-        // adjust values here
2424
-        $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
2423
+		// adjust values here
2424
+		$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
2425 2425
 
2426
-        $multiple = true; // allow multiple files upload
2426
+		$multiple = true; // allow multiple files upload
2427 2427
 
2428
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2428
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2429 2429
 
2430
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2430
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2431 2431
 
2432
-        $thumb_img_arr = array();
2433
-        $totImg = 0;
2434
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2435
-            $post = (object)$gd_session->get('listing');
2436
-            if (isset($post->post_images))
2437
-                $curImages = trim($post->post_images, ",");
2432
+		$thumb_img_arr = array();
2433
+		$totImg = 0;
2434
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2435
+			$post = (object)$gd_session->get('listing');
2436
+			if (isset($post->post_images))
2437
+				$curImages = trim($post->post_images, ",");
2438 2438
 
2439 2439
 
2440
-            if ($curImages != '') {
2441
-                $curImages_array = explode(',', $curImages);
2442
-                $totImg = count($curImages_array);
2443
-            }
2440
+			if ($curImages != '') {
2441
+				$curImages_array = explode(',', $curImages);
2442
+				$totImg = count($curImages_array);
2443
+			}
2444 2444
 
2445
-            $listing_type = $post->listing_type;
2445
+			$listing_type = $post->listing_type;
2446 2446
 
2447
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2448
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2449
-            $listing_type = $post->post_type;
2450
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2447
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2448
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2449
+			$listing_type = $post->post_type;
2450
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2451 2451
 
2452
-        } else {
2453
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2454
-        }
2452
+		} else {
2453
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2454
+		}
2455 2455
 
2456 2456
 
2457
-        if (!empty($thumb_img_arr)) {
2458
-            foreach ($thumb_img_arr as $img) {
2459
-                //$curImages = $img->src.",";
2460
-            }
2457
+		if (!empty($thumb_img_arr)) {
2458
+			foreach ($thumb_img_arr as $img) {
2459
+				//$curImages = $img->src.",";
2460
+			}
2461 2461
 
2462
-            $totImg = count((array)$thumb_img_arr);
2463
-        }
2462
+			$totImg = count((array)$thumb_img_arr);
2463
+		}
2464 2464
 
2465
-        if ($curImages != '')
2466
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2467
-        else
2468
-            $svalue = '';
2469
-
2470
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2471
-        $show_image_input_box = ($image_limit != '0');
2472
-        /**
2473
-         * Filter to be able to show/hide the image upload section of the add listing form.
2474
-         *
2475
-         * @since 1.0.0
2476
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2477
-         * @param string $listing_type The custom post type slug.
2478
-         */
2479
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2480
-        if ($show_image_input_box) {
2481
-            ?>
2465
+		if ($curImages != '')
2466
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2467
+		else
2468
+			$svalue = '';
2469
+
2470
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2471
+		$show_image_input_box = ($image_limit != '0');
2472
+		/**
2473
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2474
+		 *
2475
+		 * @since 1.0.0
2476
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2477
+		 * @param string $listing_type The custom post type slug.
2478
+		 */
2479
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2480
+		if ($show_image_input_box) {
2481
+			?>
2482 2482
 
2483 2483
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2484 2484
                 <?php if ($image_limit == 1) {
2485
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2486
-                } ?>
2485
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2486
+				} ?>
2487 2487
                 <?php if ($image_limit > 1) {
2488
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2489
-                } ?>
2488
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2489
+				} ?>
2490 2490
                 <?php if ($image_limit == '') {
2491
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2492
-                } ?>
2491
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2492
+				} ?>
2493 2493
             </h5>
2494 2494
 
2495 2495
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2527,12 +2527,12 @@  discard block
 block discarded – undo
2527 2527
         <?php } ?>
2528 2528
 
2529 2529
         <?php
2530
-        /**
2531
-         * Called on the add listing page form for frontend just after the image upload field.
2532
-         *
2533
-         * @since 1.0.0
2534
-         */
2535
-        do_action('geodir_after_main_form_fields');?>
2530
+		/**
2531
+		 * Called on the add listing page form for frontend just after the image upload field.
2532
+		 *
2533
+		 * @since 1.0.0
2534
+		 */
2535
+		do_action('geodir_after_main_form_fields');?>
2536 2536
 
2537 2537
 
2538 2538
         <!-- add captcha code -->
@@ -2561,7 +2561,7 @@  discard block
 block discarded – undo
2561 2561
 
2562 2562
     </form>
2563 2563
     <?php
2564
-    wp_reset_query();
2564
+	wp_reset_query();
2565 2565
 }
2566 2566
 
2567 2567
 /**
@@ -2572,7 +2572,7 @@  discard block
 block discarded – undo
2572 2572
  */
2573 2573
 function geodir_add_listing_sidebar_widget_area()
2574 2574
 {
2575
-    dynamic_sidebar('geodir_add_listing_sidebar');
2575
+	dynamic_sidebar('geodir_add_listing_sidebar');
2576 2576
 }
2577 2577
 
2578 2578
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2587,16 +2587,16 @@  discard block
 block discarded – undo
2587 2587
  */
2588 2588
 function geodir_action_add_listing_sidebar()
2589 2589
 {
2590
-    /** This action is documented in geodirectory_template_actions.php */
2591
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2592
-    /**
2593
-     * This is used to add the content to the add listing page sidebar.
2594
-     *
2595
-     * @since 1.0.0
2596
-     */
2597
-    do_action('geodir_add_listing_sidebar_inside');
2598
-    /** This action is documented in geodirectory_template_actions.php */
2599
-    do_action('geodir_sidebar_right_close', 'details-page');
2590
+	/** This action is documented in geodirectory_template_actions.php */
2591
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2592
+	/**
2593
+	 * This is used to add the content to the add listing page sidebar.
2594
+	 *
2595
+	 * @since 1.0.0
2596
+	 */
2597
+	do_action('geodir_add_listing_sidebar_inside');
2598
+	/** This action is documented in geodirectory_template_actions.php */
2599
+	do_action('geodir_sidebar_right_close', 'details-page');
2600 2600
 }
2601 2601
 
2602 2602
 ###############################################
@@ -2613,11 +2613,11 @@  discard block
 block discarded – undo
2613 2613
  */
2614 2614
 function geodir_action_geodir_sidebar_signup_top()
2615 2615
 {
2616
-    ?>
2616
+	?>
2617 2617
     <div
2618 2618
         class="<?php
2619
-        /** This action is documented in geodirectory_template_actions.php */
2620
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2619
+		/** This action is documented in geodirectory_template_actions.php */
2620
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2621 2621
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2622 2622
     </div><!-- clearfix ends here-->
2623 2623
 <?php
@@ -2636,11 +2636,11 @@  discard block
 block discarded – undo
2636 2636
 function geodir_action_signup_forms()
2637 2637
 {
2638 2638
 
2639
-    global $user_login;
2639
+	global $user_login;
2640 2640
     
2641
-    $is_enable_signup = get_option( 'users_can_register' );
2641
+	$is_enable_signup = get_option( 'users_can_register' );
2642 2642
     
2643
-    ?>
2643
+	?>
2644 2644
     <script type="text/javascript">
2645 2645
         <?php if ( $user_login ) { ?>
2646 2646
         setTimeout(function () {
@@ -2676,67 +2676,67 @@  discard block
 block discarded – undo
2676 2676
         <?php } ?>
2677 2677
     </script><?php
2678 2678
 
2679
-    global $errors;
2680
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2681
-        $errors->add('claim_login', LOGIN_CLAIM);
2682
-
2683
-    if (!empty($errors)) {
2684
-        foreach ($errors as $errorsObj) {
2685
-            foreach ($errorsObj as $key => $val) {
2686
-                for ($i = 0; $i < count($val); $i++) {
2687
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2688
-                    $registration_error_msg = 1;
2689
-                }
2690
-            }
2691
-        }
2692
-    }
2679
+	global $errors;
2680
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2681
+		$errors->add('claim_login', LOGIN_CLAIM);
2682
+
2683
+	if (!empty($errors)) {
2684
+		foreach ($errors as $errorsObj) {
2685
+			foreach ($errorsObj as $key => $val) {
2686
+				for ($i = 0; $i < count($val); $i++) {
2687
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2688
+					$registration_error_msg = 1;
2689
+				}
2690
+			}
2691
+		}
2692
+	}
2693 2693
 
2694
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2695
-        ?>
2694
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2695
+		?>
2696 2696
 
2697 2697
         <div class="login_form">
2698 2698
             <?php
2699
-            /**
2700
-             * Contains login form template.
2701
-             *
2702
-             * @since 1.0.0
2703
-             */
2704
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2699
+			/**
2700
+			 * Contains login form template.
2701
+			 *
2702
+			 * @since 1.0.0
2703
+			 */
2704
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2705 2705
         </div>
2706 2706
 
2707 2707
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup ) { ?>
2708 2708
 
2709 2709
         <div class="registration_form">
2710 2710
             <?php
2711
-            /**
2712
-             * Contains registration form template.
2713
-             *
2714
-             * @since 1.0.0
2715
-             */
2716
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2711
+			/**
2712
+			 * Contains registration form template.
2713
+			 *
2714
+			 * @since 1.0.0
2715
+			 */
2716
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2717 2717
         </div>
2718 2718
 
2719 2719
     <?php } else { ?>
2720 2720
 
2721 2721
         <div class="login_form_l">
2722 2722
             <?php
2723
-            /**
2724
-             * Contains login form template.
2725
-             *
2726
-             * @since 1.0.0
2727
-             */
2728
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2723
+			/**
2724
+			 * Contains login form template.
2725
+			 *
2726
+			 * @since 1.0.0
2727
+			 */
2728
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2729 2729
         </div>
2730 2730
         
2731 2731
         <?php if ( $is_enable_signup ) { ?>
2732 2732
             <div class="registration_form_r">
2733 2733
                 <?php
2734
-                /**
2735
-                 * Contains registration form template.
2736
-                 *
2737
-                 * @since 1.0.0
2738
-                 */
2739
-                include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2734
+				/**
2735
+				 * Contains registration form template.
2736
+				 *
2737
+				 * @since 1.0.0
2738
+				 */
2739
+				include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2740 2740
             </div>
2741 2741
         <?php } ?>
2742 2742
 
@@ -2768,66 +2768,66 @@  discard block
 block discarded – undo
2768 2768
  */
2769 2769
 function geodir_action_author_page_title()
2770 2770
 {
2771
-    global $term;
2771
+	global $term;
2772 2772
 
2773
-    $gd_post_type = geodir_get_current_posttype();
2774
-    $post_type_info = get_post_type_object($gd_post_type);
2773
+	$gd_post_type = geodir_get_current_posttype();
2774
+	$post_type_info = get_post_type_object($gd_post_type);
2775 2775
 
2776
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2777
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2778
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2779
-    }
2780
-
2781
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2782
-    $single_name = $post_type_info->labels->singular_name;
2776
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2777
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2778
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2779
+	}
2783 2780
 
2784
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2781
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2782
+	$single_name = $post_type_info->labels->singular_name;
2785 2783
 
2786
-    if (!empty($term)) {
2787
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2788
-        if (!empty($current_term))
2789
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2790
-    }
2784
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2791 2785
 
2786
+	if (!empty($term)) {
2787
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2788
+		if (!empty($current_term))
2789
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2790
+	}
2792 2791
 
2793
-    if (is_search()) {
2794
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2795 2792
 
2796
-    }
2797
-    /** This action is documented in geodirectory_template_actions.php */
2798
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2799
-    /** This action is documented in geodirectory_template_actions.php */
2800
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2793
+	if (is_search()) {
2794
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2801 2795
 
2802
-    $title = $list_title;
2803
-    if(geodir_is_page('author')){
2804
-        $gd_page = 'author';
2805
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2806
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2807
-        }else{
2808
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2809
-        }
2796
+	}
2797
+	/** This action is documented in geodirectory_template_actions.php */
2798
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2799
+	/** This action is documented in geodirectory_template_actions.php */
2800
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2801
+
2802
+	$title = $list_title;
2803
+	if(geodir_is_page('author')){
2804
+		$gd_page = 'author';
2805
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2806
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2807
+		}else{
2808
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2809
+		}
2810 2810
 
2811
-    }
2811
+	}
2812 2812
 
2813 2813
 
2814
-    /**
2815
-     * Filter page title to replace variables.
2816
-     *
2817
-     * @since 1.5.4
2818
-     * @param string $title The page title including variables.
2819
-     * @param string $gd_page The GeoDirectory page type if any.
2820
-     */
2821
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2814
+	/**
2815
+	 * Filter page title to replace variables.
2816
+	 *
2817
+	 * @since 1.5.4
2818
+	 * @param string $title The page title including variables.
2819
+	 * @param string $gd_page The GeoDirectory page type if any.
2820
+	 */
2821
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2822 2822
 
2823
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2824
-        /**
2825
-         * Filter the author page title text.
2826
-         *
2827
-         * @since 1.0.0
2828
-         * @param string $list_title The title for the page.
2829
-         */
2830
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2823
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2824
+		/**
2825
+		 * Filter the author page title text.
2826
+		 *
2827
+		 * @since 1.0.0
2828
+		 * @param string $list_title The title for the page.
2829
+		 */
2830
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2831 2831
 }
2832 2832
 
2833 2833
 
@@ -2845,11 +2845,11 @@  discard block
 block discarded – undo
2845 2845
  */
2846 2846
 function geodir_action_geodir_sidebar_author_top()
2847 2847
 {
2848
-    if (get_option('geodir_show_author_top_section')) { ?>
2848
+	if (get_option('geodir_show_author_top_section')) { ?>
2849 2849
         <div
2850 2850
             class="<?php
2851
-            /** This action is documented in geodirectory_template_actions.php */
2852
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2851
+			/** This action is documented in geodirectory_template_actions.php */
2852
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2853 2853
             <?php dynamic_sidebar('geodir_author_top'); ?>
2854 2854
         </div><!-- clearfix ends here-->
2855 2855
     <?php }
@@ -2865,7 +2865,7 @@  discard block
 block discarded – undo
2865 2865
  */
2866 2866
 function geodir_author_left_section()
2867 2867
 {
2868
-    if (get_option('geodir_show_author_left_section')) { ?>
2868
+	if (get_option('geodir_show_author_left_section')) { ?>
2869 2869
         <div class="geodir-content-left geodir-sidebar-wrap">
2870 2870
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2871 2871
         </div><!-- end geodir-content-left -->
@@ -2886,19 +2886,19 @@  discard block
 block discarded – undo
2886 2886
  */
2887 2887
 function geodir_action_author_sidebar_left()
2888 2888
 {
2889
-    if (get_option('geodir_show_author_left_section')) {
2889
+	if (get_option('geodir_show_author_left_section')) {
2890 2890
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2891
-        /** This action is documented in geodirectory_template_actions.php */
2892
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2893
-        /**
2894
-         * This is used to add the content to the author page left sidebar (if active).
2895
-         *
2896
-         * @since 1.0.0
2897
-         */
2898
-        do_action('geodir_author_sidebar_left_inside');
2899
-        /** This action is documented in geodirectory_template_actions.php */
2900
-        do_action('geodir_sidebar_left_close', 'author-page');
2901
-    }
2891
+		/** This action is documented in geodirectory_template_actions.php */
2892
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2893
+		/**
2894
+		 * This is used to add the content to the author page left sidebar (if active).
2895
+		 *
2896
+		 * @since 1.0.0
2897
+		 */
2898
+		do_action('geodir_author_sidebar_left_inside');
2899
+		/** This action is documented in geodirectory_template_actions.php */
2900
+		do_action('geodir_sidebar_left_close', 'author-page');
2901
+	}
2902 2902
 }
2903 2903
 
2904 2904
 /**
@@ -2911,7 +2911,7 @@  discard block
 block discarded – undo
2911 2911
  */
2912 2912
 function geodir_author_right_section()
2913 2913
 {
2914
-    if (get_option('geodir_show_author_right_section')) { ?>
2914
+	if (get_option('geodir_show_author_right_section')) { ?>
2915 2915
         <div class="geodir-content-right geodir-sidebar-wrap">
2916 2916
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2917 2917
         </div><!-- end geodir-content-right -->
@@ -2931,18 +2931,18 @@  discard block
 block discarded – undo
2931 2931
  */
2932 2932
 function geodir_action_author_sidebar_right()
2933 2933
 {
2934
-    if (get_option('geodir_show_author_right_section')) {
2935
-        /** This action is documented in geodirectory_template_actions.php */
2936
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2937
-        /**
2938
-         * This is used to add the content to the author page right sidebar (if active).
2939
-         *
2940
-         * @since 1.0.0
2941
-         */
2942
-        do_action('geodir_author_sidebar_right_inside');
2943
-        /** This action is documented in geodirectory_template_actions.php */
2944
-        do_action('geodir_sidebar_right_close', 'author-page');
2945
-    }
2934
+	if (get_option('geodir_show_author_right_section')) {
2935
+		/** This action is documented in geodirectory_template_actions.php */
2936
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2937
+		/**
2938
+		 * This is used to add the content to the author page right sidebar (if active).
2939
+		 *
2940
+		 * @since 1.0.0
2941
+		 */
2942
+		do_action('geodir_author_sidebar_right_inside');
2943
+		/** This action is documented in geodirectory_template_actions.php */
2944
+		do_action('geodir_sidebar_right_close', 'author-page');
2945
+	}
2946 2946
 }
2947 2947
 
2948 2948
 /**
@@ -2954,14 +2954,14 @@  discard block
 block discarded – undo
2954 2954
  */
2955 2955
 function geodir_action_author_content_inside()
2956 2956
 {
2957
-    global $gridview_columns;
2958
-    $listing_view = get_option('geodir_author_view');
2959
-    if (strstr($listing_view, 'gridview')) {
2960
-        $gridview_columns = $listing_view;
2961
-        $listing_view_exp = explode('_', $listing_view);
2962
-        $listing_view = $listing_view_exp[0];
2963
-    }
2964
-    geodir_get_template_part('listing', 'listview');
2957
+	global $gridview_columns;
2958
+	$listing_view = get_option('geodir_author_view');
2959
+	if (strstr($listing_view, 'gridview')) {
2960
+		$gridview_columns = $listing_view;
2961
+		$listing_view_exp = explode('_', $listing_view);
2962
+		$listing_view = $listing_view_exp[0];
2963
+	}
2964
+	geodir_get_template_part('listing', 'listview');
2965 2965
 }
2966 2966
 
2967 2967
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2976,22 +2976,22 @@  discard block
 block discarded – undo
2976 2976
  */
2977 2977
 function geodir_action_author_content()
2978 2978
 {
2979
-    /** This action is documented in geodirectory_template_actions.php */
2980
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2981
-    echo '<div class="clearfix">';
2982
-    /** This action is documented in geodirectory_template_actions.php */
2983
-    do_action('geodir_before_listing');
2984
-    echo '</div>';
2985
-    /**
2986
-     * This is used to add the content to the author page main content.
2987
-     *
2988
-     * @since 1.0.0
2989
-     */
2990
-    do_action('geodir_author_content_inside');
2991
-    /** This action is documented in geodirectory_template_actions.php */
2992
-    do_action('geodir_after_listing');
2993
-    /** This action is documented in geodirectory_template_actions.php */
2994
-    do_action('geodir_main_content_close', 'author-page');
2979
+	/** This action is documented in geodirectory_template_actions.php */
2980
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2981
+	echo '<div class="clearfix">';
2982
+	/** This action is documented in geodirectory_template_actions.php */
2983
+	do_action('geodir_before_listing');
2984
+	echo '</div>';
2985
+	/**
2986
+	 * This is used to add the content to the author page main content.
2987
+	 *
2988
+	 * @since 1.0.0
2989
+	 */
2990
+	do_action('geodir_author_content_inside');
2991
+	/** This action is documented in geodirectory_template_actions.php */
2992
+	do_action('geodir_after_listing');
2993
+	/** This action is documented in geodirectory_template_actions.php */
2994
+	do_action('geodir_main_content_close', 'author-page');
2995 2995
 }
2996 2996
 
2997 2997
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -3005,11 +3005,11 @@  discard block
 block discarded – undo
3005 3005
  */
3006 3006
 function geodir_action_sidebar_author_bottom_section()
3007 3007
 {
3008
-    if (get_option('geodir_show_author_bottom_section')) { ?>
3008
+	if (get_option('geodir_show_author_bottom_section')) { ?>
3009 3009
         <div
3010 3010
             class="<?php
3011
-            /** This action is documented in geodirectory_template_actions.php */
3012
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
3011
+			/** This action is documented in geodirectory_template_actions.php */
3012
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
3013 3013
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
3014 3014
         </div><!-- clearfix ends here-->
3015 3015
     <?php }
@@ -3028,23 +3028,23 @@  discard block
 block discarded – undo
3028 3028
  */
3029 3029
 function geodir_action_search_page_title()
3030 3030
 {
3031
-    $gd_post_type = geodir_get_current_posttype();
3032
-    $post_type_info = get_post_type_object($gd_post_type);
3031
+	$gd_post_type = geodir_get_current_posttype();
3032
+	$post_type_info = get_post_type_object($gd_post_type);
3033 3033
 
3034
-    $pt_name = '';
3035
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3034
+	$pt_name = '';
3035
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3036 3036
 
3037
-    if (is_search()) {
3038
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3037
+	if (is_search()) {
3038
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3039 3039
 
3040
-    }
3041
-    /** This action is documented in geodirectory_template_actions.php */
3042
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3043
-    /** This action is documented in geodirectory_template_actions.php */
3044
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3045
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3046
-        /** This action is documented in geodirectory_template_actions.php */
3047
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3040
+	}
3041
+	/** This action is documented in geodirectory_template_actions.php */
3042
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
3043
+	/** This action is documented in geodirectory_template_actions.php */
3044
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3045
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3046
+		/** This action is documented in geodirectory_template_actions.php */
3047
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3048 3048
 }
3049 3049
 
3050 3050
 // action for adding the listings page top widget area
@@ -3060,11 +3060,11 @@  discard block
 block discarded – undo
3060 3060
  */
3061 3061
 function geodir_action_geodir_sidebar_search_top()
3062 3062
 {
3063
-    if (get_option('geodir_show_search_top_section')) { ?>
3063
+	if (get_option('geodir_show_search_top_section')) { ?>
3064 3064
         <div
3065 3065
             class="<?php
3066
-            /** This action is documented in geodirectory_template_actions.php */
3067
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3066
+			/** This action is documented in geodirectory_template_actions.php */
3067
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3068 3068
             <?php dynamic_sidebar('geodir_search_top'); ?>
3069 3069
         </div><!-- clearfix ends here-->
3070 3070
     <?php }
@@ -3080,7 +3080,7 @@  discard block
 block discarded – undo
3080 3080
  */
3081 3081
 function geodir_search_left_section()
3082 3082
 {
3083
-    if (get_option('geodir_show_search_left_section')) { ?>
3083
+	if (get_option('geodir_show_search_left_section')) { ?>
3084 3084
         <div class="geodir-content-left geodir-sidebar-wrap">
3085 3085
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3086 3086
         </div><!-- end geodir-content-left -->
@@ -3100,19 +3100,19 @@  discard block
 block discarded – undo
3100 3100
  */
3101 3101
 function geodir_action_search_sidebar_left()
3102 3102
 {
3103
-    if (get_option('geodir_show_search_left_section')) {
3103
+	if (get_option('geodir_show_search_left_section')) {
3104 3104
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3105
-        /** This action is documented in geodirectory_template_actions.php */
3106
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3107
-        /**
3108
-         * This is used to add the content to the search page left sidebar (if active).
3109
-         *
3110
-         * @since 1.0.0
3111
-         */
3112
-        do_action('geodir_search_sidebar_left_inside');
3113
-        /** This action is documented in geodirectory_template_actions.php */
3114
-        do_action('geodir_sidebar_left_close', 'search-page');
3115
-    }
3105
+		/** This action is documented in geodirectory_template_actions.php */
3106
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3107
+		/**
3108
+		 * This is used to add the content to the search page left sidebar (if active).
3109
+		 *
3110
+		 * @since 1.0.0
3111
+		 */
3112
+		do_action('geodir_search_sidebar_left_inside');
3113
+		/** This action is documented in geodirectory_template_actions.php */
3114
+		do_action('geodir_sidebar_left_close', 'search-page');
3115
+	}
3116 3116
 }
3117 3117
 
3118 3118
 /**
@@ -3125,7 +3125,7 @@  discard block
 block discarded – undo
3125 3125
  */
3126 3126
 function geodir_search_right_section()
3127 3127
 {
3128
-    if (get_option('geodir_show_search_right_section')) { ?>
3128
+	if (get_option('geodir_show_search_right_section')) { ?>
3129 3129
         <div class="geodir-content-right geodir-sidebar-wrap">
3130 3130
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3131 3131
         </div><!-- end geodir-content-right -->
@@ -3145,18 +3145,18 @@  discard block
 block discarded – undo
3145 3145
  */
3146 3146
 function geodir_action_search_sidebar_right()
3147 3147
 {
3148
-    if (get_option('geodir_show_search_right_section')) {
3149
-        /** This action is documented in geodirectory_template_actions.php */
3150
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3151
-        /**
3152
-         * This is used to add the content to the search page right sidebar (if active).
3153
-         *
3154
-         * @since 1.0.0
3155
-         */
3156
-        do_action('geodir_search_sidebar_right_inside');
3157
-        /** This action is documented in geodirectory_template_actions.php */
3158
-        do_action('geodir_sidebar_right_close', 'search-page');
3159
-    }
3148
+	if (get_option('geodir_show_search_right_section')) {
3149
+		/** This action is documented in geodirectory_template_actions.php */
3150
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3151
+		/**
3152
+		 * This is used to add the content to the search page right sidebar (if active).
3153
+		 *
3154
+		 * @since 1.0.0
3155
+		 */
3156
+		do_action('geodir_search_sidebar_right_inside');
3157
+		/** This action is documented in geodirectory_template_actions.php */
3158
+		do_action('geodir_sidebar_right_close', 'search-page');
3159
+	}
3160 3160
 }
3161 3161
 
3162 3162
 
@@ -3171,11 +3171,11 @@  discard block
 block discarded – undo
3171 3171
  */
3172 3172
 function geodir_action_sidebar_search_bottom_section()
3173 3173
 {
3174
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3174
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3175 3175
         <div
3176 3176
             class="<?php
3177
-            /** This action is documented in geodirectory_template_actions.php */
3178
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3177
+			/** This action is documented in geodirectory_template_actions.php */
3178
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3179 3179
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3180 3180
         </div><!-- clearfix ends here-->
3181 3181
     <?php }
@@ -3190,14 +3190,14 @@  discard block
 block discarded – undo
3190 3190
  */
3191 3191
 function geodir_action_search_content_inside()
3192 3192
 {
3193
-    global $gridview_columns;
3194
-    $listing_view = get_option('geodir_search_view');
3195
-    if (strstr($listing_view, 'gridview')) {
3196
-        $gridview_columns = $listing_view;
3197
-        $listing_view_exp = explode('_', $listing_view);
3198
-        $listing_view = $listing_view_exp[0];
3199
-    }
3200
-    geodir_get_template_part('listing', 'listview');
3193
+	global $gridview_columns;
3194
+	$listing_view = get_option('geodir_search_view');
3195
+	if (strstr($listing_view, 'gridview')) {
3196
+		$gridview_columns = $listing_view;
3197
+		$listing_view_exp = explode('_', $listing_view);
3198
+		$listing_view = $listing_view_exp[0];
3199
+	}
3200
+	geodir_get_template_part('listing', 'listview');
3201 3201
 }
3202 3202
 
3203 3203
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3213,22 +3213,22 @@  discard block
 block discarded – undo
3213 3213
  */
3214 3214
 function geodir_action_search_content()
3215 3215
 {
3216
-    /** This action is documented in geodirectory_template_actions.php */
3217
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3218
-    echo '<div class="clearfix">';
3219
-    /** This action is documented in geodirectory_template_actions.php */
3220
-    do_action('geodir_before_listing');
3221
-    echo '</div>';
3222
-    /**
3223
-     * This is used to add the content to the search page main content.
3224
-     *
3225
-     * @since 1.0.0
3226
-     */
3227
-    do_action('geodir_search_content_inside');
3228
-    /** This action is documented in geodirectory_template_actions.php */
3229
-    do_action('geodir_after_listing');
3230
-    /** This action is documented in geodirectory_template_actions.php */
3231
-    do_action('geodir_main_content_close', 'search-page');
3216
+	/** This action is documented in geodirectory_template_actions.php */
3217
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3218
+	echo '<div class="clearfix">';
3219
+	/** This action is documented in geodirectory_template_actions.php */
3220
+	do_action('geodir_before_listing');
3221
+	echo '</div>';
3222
+	/**
3223
+	 * This is used to add the content to the search page main content.
3224
+	 *
3225
+	 * @since 1.0.0
3226
+	 */
3227
+	do_action('geodir_search_content_inside');
3228
+	/** This action is documented in geodirectory_template_actions.php */
3229
+	do_action('geodir_after_listing');
3230
+	/** This action is documented in geodirectory_template_actions.php */
3231
+	do_action('geodir_main_content_close', 'search-page');
3232 3232
 }
3233 3233
 
3234 3234
 ###############################################
@@ -3251,11 +3251,11 @@  discard block
 block discarded – undo
3251 3251
  */
3252 3252
 function geodir_action_geodir_sidebar_home_top()
3253 3253
 {
3254
-    if (get_option('geodir_show_home_top_section')) { ?>
3254
+	if (get_option('geodir_show_home_top_section')) { ?>
3255 3255
         <div
3256 3256
             class="<?php
3257
-            /** This action is documented in geodirectory_template_actions.php */
3258
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3257
+			/** This action is documented in geodirectory_template_actions.php */
3258
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3259 3259
             <?php dynamic_sidebar('geodir_home_top'); ?>
3260 3260
         </div><!-- clearfix ends here-->
3261 3261
     <?php }
@@ -3271,7 +3271,7 @@  discard block
 block discarded – undo
3271 3271
  */
3272 3272
 function geodir_home_left_section()
3273 3273
 {
3274
-    if (get_option('geodir_show_home_left_section')) { ?>
3274
+	if (get_option('geodir_show_home_left_section')) { ?>
3275 3275
         <div class="geodir-content-left geodir-sidebar-wrap">
3276 3276
             <?php dynamic_sidebar('geodir_home_left'); ?>
3277 3277
         </div><!-- end geodir-content-left -->
@@ -3293,19 +3293,19 @@  discard block
 block discarded – undo
3293 3293
  */
3294 3294
 function geodir_action_home_sidebar_left()
3295 3295
 {
3296
-    if (get_option('geodir_show_home_left_section')) {
3296
+	if (get_option('geodir_show_home_left_section')) {
3297 3297
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3298
-        /** This action is documented in geodirectory_template_actions.php */
3299
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3300
-        /**
3301
-         * This is used to add the content to the home page left sidebar (if active).
3302
-         *
3303
-         * @since 1.0.0
3304
-         */
3305
-        do_action('geodir_home_sidebar_left_inside');
3306
-        /** This action is documented in geodirectory_template_actions.php */
3307
-        do_action('geodir_sidebar_left_close', 'home-page');
3308
-    }
3298
+		/** This action is documented in geodirectory_template_actions.php */
3299
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3300
+		/**
3301
+		 * This is used to add the content to the home page left sidebar (if active).
3302
+		 *
3303
+		 * @since 1.0.0
3304
+		 */
3305
+		do_action('geodir_home_sidebar_left_inside');
3306
+		/** This action is documented in geodirectory_template_actions.php */
3307
+		do_action('geodir_sidebar_left_close', 'home-page');
3308
+	}
3309 3309
 }
3310 3310
 
3311 3311
 /**
@@ -3318,7 +3318,7 @@  discard block
 block discarded – undo
3318 3318
  */
3319 3319
 function geodir_home_right_section()
3320 3320
 {
3321
-    if (get_option('geodir_show_home_right_section')) { ?>
3321
+	if (get_option('geodir_show_home_right_section')) { ?>
3322 3322
         <div class="geodir-content-right geodir-sidebar-wrap">
3323 3323
             <?php dynamic_sidebar('geodir_home_right'); ?>
3324 3324
         </div><!-- end geodir-content-right -->
@@ -3339,18 +3339,18 @@  discard block
 block discarded – undo
3339 3339
  */
3340 3340
 function geodir_action_home_sidebar_right()
3341 3341
 {
3342
-    if (get_option('geodir_show_home_right_section')) {
3343
-        /** This action is documented in geodirectory_template_actions.php */
3344
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3345
-        /**
3346
-         * This is used to add the content to the home page right sidebar (if active).
3347
-         *
3348
-         * @since 1.0.0
3349
-         */
3350
-        do_action('geodir_home_sidebar_right_inside');
3351
-        /** This action is documented in geodirectory_template_actions.php */
3352
-        do_action('geodir_sidebar_right_close', 'home-page');
3353
-    }
3342
+	if (get_option('geodir_show_home_right_section')) {
3343
+		/** This action is documented in geodirectory_template_actions.php */
3344
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3345
+		/**
3346
+		 * This is used to add the content to the home page right sidebar (if active).
3347
+		 *
3348
+		 * @since 1.0.0
3349
+		 */
3350
+		do_action('geodir_home_sidebar_right_inside');
3351
+		/** This action is documented in geodirectory_template_actions.php */
3352
+		do_action('geodir_sidebar_right_close', 'home-page');
3353
+	}
3354 3354
 }
3355 3355
 
3356 3356
 /**
@@ -3361,7 +3361,7 @@  discard block
 block discarded – undo
3361 3361
  */
3362 3362
 function geodir_action_home_content_inside()
3363 3363
 {
3364
-    dynamic_sidebar('geodir_home_content');
3364
+	dynamic_sidebar('geodir_home_content');
3365 3365
 }
3366 3366
 
3367 3367
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3376,28 +3376,28 @@  discard block
 block discarded – undo
3376 3376
  */
3377 3377
 function geodir_action_home_content()
3378 3378
 {
3379
-    /** This action is documented in geodirectory_template_actions.php */
3380
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3381
-    /**
3382
-     * This called before the home page main content.
3383
-     *
3384
-     * @since 1.0.0
3385
-     */
3386
-    do_action('geodir_before_home_content');
3387
-    /**
3388
-     * This is used to add the content to the home page main content.
3389
-     *
3390
-     * @since 1.0.0
3391
-     */
3392
-    do_action('geodir_home_content_inside');
3393
-    /**
3394
-     * This is called after the homepage main content.
3395
-     *
3396
-     * @since 1.0.0
3397
-     */
3398
-    do_action('geodir_after_home_content');
3399
-    /** This action is documented in geodirectory_template_actions.php */
3400
-    do_action('geodir_main_content_close', 'home-page');
3379
+	/** This action is documented in geodirectory_template_actions.php */
3380
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3381
+	/**
3382
+	 * This called before the home page main content.
3383
+	 *
3384
+	 * @since 1.0.0
3385
+	 */
3386
+	do_action('geodir_before_home_content');
3387
+	/**
3388
+	 * This is used to add the content to the home page main content.
3389
+	 *
3390
+	 * @since 1.0.0
3391
+	 */
3392
+	do_action('geodir_home_content_inside');
3393
+	/**
3394
+	 * This is called after the homepage main content.
3395
+	 *
3396
+	 * @since 1.0.0
3397
+	 */
3398
+	do_action('geodir_after_home_content');
3399
+	/** This action is documented in geodirectory_template_actions.php */
3400
+	do_action('geodir_main_content_close', 'home-page');
3401 3401
 }
3402 3402
 
3403 3403
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3412,11 +3412,11 @@  discard block
 block discarded – undo
3412 3412
  */
3413 3413
 function geodir_action_sidebar_home_bottom_section()
3414 3414
 {
3415
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3415
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3416 3416
         <div
3417 3417
             class="<?php
3418
-            /** This action is documented in geodirectory_template_actions.php */
3419
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3418
+			/** This action is documented in geodirectory_template_actions.php */
3419
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3420 3420
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3421 3421
         </div><!-- clearfix ends here-->
3422 3422
     <?php }
@@ -3444,13 +3444,13 @@  discard block
 block discarded – undo
3444 3444
  */
3445 3445
 function geodir_filter_listing_page_title($list_title)
3446 3446
 {
3447
-    if (is_search() && trim(get_search_query()) == '') {
3448
-        $gd_post_type = geodir_get_current_posttype();
3449
-        $post_type_info = get_post_type_object($gd_post_type);
3447
+	if (is_search() && trim(get_search_query()) == '') {
3448
+		$gd_post_type = geodir_get_current_posttype();
3449
+		$post_type_info = get_post_type_object($gd_post_type);
3450 3450
 
3451
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3452
-    }
3453
-    return $list_title;
3451
+		$list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3452
+	}
3453
+	return $list_title;
3454 3454
 }
3455 3455
 
3456 3456
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3466,63 +3466,63 @@  discard block
 block discarded – undo
3466 3466
  * @param string $gd_page The geodirectory page type. Default null.
3467 3467
  */
3468 3468
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3469
-    global $post;
3470
-
3471
-    $gd_page_id = NULL;
3472
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3473
-        $gd_page_id = geodir_home_page_id();
3474
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3475
-        $gd_page_id = geodir_preview_page_id();
3476
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3477
-        $gd_page_id = geodir_add_listing_page_id();
3478
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3479
-        $gd_page_id = geodir_success_page_id();
3480
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3481
-        $gd_page_id = geodir_location_page_id();
3482
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3483
-        $gd_page_id = geodir_info_page_id();
3484
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3485
-        $gd_page_id = geodir_login_page_id();
3486
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3487
-        $gd_page_id = geodir_payment_checkout_page_id();
3488
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3489
-        $gd_page_id = geodir_payment_invoices_page_id();
3490
-    }
3491
-
3492
-    if (!$gd_page_id > 0) {
3493
-        return;
3494
-    }
3469
+	global $post;
3470
+
3471
+	$gd_page_id = NULL;
3472
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3473
+		$gd_page_id = geodir_home_page_id();
3474
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3475
+		$gd_page_id = geodir_preview_page_id();
3476
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3477
+		$gd_page_id = geodir_add_listing_page_id();
3478
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3479
+		$gd_page_id = geodir_success_page_id();
3480
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3481
+		$gd_page_id = geodir_location_page_id();
3482
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3483
+		$gd_page_id = geodir_info_page_id();
3484
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3485
+		$gd_page_id = geodir_login_page_id();
3486
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3487
+		$gd_page_id = geodir_payment_checkout_page_id();
3488
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3489
+		$gd_page_id = geodir_payment_invoices_page_id();
3490
+	}
3491
+
3492
+	if (!$gd_page_id > 0) {
3493
+		return;
3494
+	}
3495 3495
     
3496
-    $display = 'before';
3497
-    /**
3498
-     * Filter the position to display the page content.
3499
-     *
3500
-     * @since 1.6.3
3501
-     *
3502
-     * @param string $display Position to add the post content.
3503
-     * @param string $gd_page The geodirectory page type.
3504
-     */
3505
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3506
-
3507
-    if ($position !== $display) {
3508
-        return;
3509
-    }
3510
-
3511
-    $gd_post = $post;
3512
-    $post = get_post($gd_page_id);
3513
-
3514
-    setup_postdata($post);
3515
-
3516
-    if (get_the_content()) {
3517
-        ?>
3496
+	$display = 'before';
3497
+	/**
3498
+	 * Filter the position to display the page content.
3499
+	 *
3500
+	 * @since 1.6.3
3501
+	 *
3502
+	 * @param string $display Position to add the post content.
3503
+	 * @param string $gd_page The geodirectory page type.
3504
+	 */
3505
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3506
+
3507
+	if ($position !== $display) {
3508
+		return;
3509
+	}
3510
+
3511
+	$gd_post = $post;
3512
+	$post = get_post($gd_page_id);
3513
+
3514
+	setup_postdata($post);
3515
+
3516
+	if (get_the_content()) {
3517
+		?>
3518 3518
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3519 3519
         <?php
3520
-    }
3520
+	}
3521 3521
 
3522
-    $post = $gd_post;
3523
-    if (!empty($gd_post) && is_object($gd_post)) {
3524
-        setup_postdata($gd_post);
3525
-    }
3522
+	$post = $gd_post;
3523
+	if (!empty($gd_post) && is_object($gd_post)) {
3524
+		setup_postdata($gd_post);
3525
+	}
3526 3526
 
3527 3527
 }
3528 3528
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
@@ -3543,13 +3543,13 @@  discard block
 block discarded – undo
3543 3543
  * @return string Filtered SQL JOIN clause.
3544 3544
  */
3545 3545
 function geodir_previous_next_post_join( $join, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3546
-    global $plugin_prefix;
3546
+	global $plugin_prefix;
3547 3547
 
3548
-    if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3549
-        $join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3550
-    }
3548
+	if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3549
+		$join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3550
+	}
3551 3551
     
3552
-    return $join;
3552
+	return $join;
3553 3553
 }
3554 3554
 add_filter( 'get_previous_post_join', 'geodir_previous_next_post_join', 10, 5 );
3555 3555
 add_filter( 'get_next_post_join', 'geodir_previous_next_post_join', 10, 5 );
@@ -3571,31 +3571,31 @@  discard block
 block discarded – undo
3571 3571
  * @return string Filtered SQL WHERE clause.
3572 3572
  */
3573 3573
 function geodir_previous_next_post_where( $where, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3574
-    global $wpdb, $plugin_prefix;
3574
+	global $wpdb, $plugin_prefix;
3575 3575
 
3576
-    if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3577
-        $post_locations = '';
3578
-        $post_locations_var = array();
3576
+	if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3577
+		$post_locations = '';
3578
+		$post_locations_var = array();
3579 3579
         
3580
-        if ( !empty( $post->country_slug ) ) {
3581
-            $post_locations .= " AND post_locations LIKE %s";
3582
-            $post_locations_var[] = "%,[" . $post->country_slug . "]";
3583
-        }
3580
+		if ( !empty( $post->country_slug ) ) {
3581
+			$post_locations .= " AND post_locations LIKE %s";
3582
+			$post_locations_var[] = "%,[" . $post->country_slug . "]";
3583
+		}
3584 3584
 
3585
-        if ( !empty( $post->region_slug ) ) {
3586
-            $post_locations .= " AND post_locations LIKE %s";
3587
-            $post_locations_var[] = "%,[" . $post->region_slug . "],%";
3588
-        }
3585
+		if ( !empty( $post->region_slug ) ) {
3586
+			$post_locations .= " AND post_locations LIKE %s";
3587
+			$post_locations_var[] = "%,[" . $post->region_slug . "],%";
3588
+		}
3589 3589
 
3590
-        if ( !empty( $post->city_slug ) ) {
3591
-            $post_locations .= " AND post_locations LIKE %s";
3592
-            $post_locations_var[] = "[" . $post->city_slug . "],%";
3593
-        }
3590
+		if ( !empty( $post->city_slug ) ) {
3591
+			$post_locations .= " AND post_locations LIKE %s";
3592
+			$post_locations_var[] = "[" . $post->city_slug . "],%";
3593
+		}
3594 3594
         
3595
-        $where .= $wpdb->prepare( $post_locations, $post_locations_var );
3596
-    }
3595
+		$where .= $wpdb->prepare( $post_locations, $post_locations_var );
3596
+	}
3597 3597
     
3598
-    return $where;
3598
+	return $where;
3599 3599
 }
3600 3600
 add_filter( 'get_previous_post_where', 'geodir_previous_next_post_where', 10, 5 );
3601 3601
 add_filter( 'get_next_post_where', 'geodir_previous_next_post_where', 10, 5 );
Please login to merge, or discard this patch.
Spacing   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
     //php
285 285
     if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+        include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
287 287
     }
288 288
 
289 289
     //geodir_full_page_class
@@ -453,13 +453,13 @@  discard block
 block discarded – undo
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455 455
     if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
456
+        $width_css = 'style="width:'.$width.'%;"';
457 457
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
458
+        $width_css = 'style="width:'.$width.'%;"';
459 459
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
460
+        $width_css = 'style="width:'.$width.'%;"';
461 461
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
462
+        $width_css = 'style="width:'.$width.'%;"';
463 463
     } else {
464 464
         $width_css = '';
465 465
     }
@@ -573,13 +573,13 @@  discard block
 block discarded – undo
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575 575
     if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
576
+        $width_css = 'style="width:'.$width.'%;"';
577 577
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
578
+        $width_css = 'style="width:'.$width.'%;"';
579 579
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
580
+        $width_css = 'style="width:'.$width.'%;"';
581 581
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
582
+        $width_css = 'style="width:'.$width.'%;"';
583 583
     } else {
584 584
         $width_css = '';
585 585
     }
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         }
678 678
     }
679 679
 
680
-    $post = (object)$_REQUEST;
680
+    $post = (object) $_REQUEST;
681 681
 
682 682
 
683 683
     if (isset($post->video)) {
@@ -736,10 +736,10 @@  discard block
 block discarded – undo
736 736
 
737 737
     $json = '{';
738 738
     $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
739
+    $json .= '"t": "'.$json_title.'",';
740
+    $json .= '"lt": "'.$post_latitude.'",';
741
+    $json .= '"ln": "'.$post_longitude.'",';
742
+    $json .= '"i":"'.$term_icon.'"';
743 743
     $json .= '}';
744 744
 
745 745
     $post->marker_json = $json;
@@ -755,14 +755,14 @@  discard block
 block discarded – undo
755 755
         $post->default_category = '';
756 756
         $post->post_type = '';
757 757
     }
758
-	if (empty($post->default_category) && ! empty($post->post_default_category)) {
758
+	if (empty($post->default_category) && !empty($post->post_default_category)) {
759 759
 		$post->default_category = $post->post_default_category;
760 760
 	}
761 761
 	if (empty($post->post_type) && !empty($post->listing_type)) {
762 762
 		$post->post_type = $post->listing_type;
763 763
 	}
764 764
 	$post_type = $post->post_type;
765
-	$cat_taxonomy = $post_type . "category";
765
+	$cat_taxonomy = $post_type."category";
766 766
 	if (!empty($post_type) && empty($post->{$cat_taxonomy}) && !empty($post->post_category) && !empty($post->post_category[$cat_taxonomy])) {
767 767
 		$post->{$cat_taxonomy} = $post->post_category[$cat_taxonomy];
768 768
 	}
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
      * @param string $class The class to use. Default is 'entry-header'.
978 978
      */
979 979
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
980
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
980
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>';
981 981
 }
982 982
 
983 983
 
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
     $package_info = geodir_post_package_info(array(), $post, (!empty($post->post_type) ? $post->post_type : ''));
1016 1016
     $image_limit = '';
1017 1017
     if (defined('GEODIRPAYMENT_VERSION') && !empty($package_info) && isset($package_info->image_limit) && $package_info->image_limit !== '') {
1018
-        $image_limit = (int)$package_info->image_limit;
1018
+        $image_limit = (int) $package_info->image_limit;
1019 1019
     }
1020 1020
 
1021 1021
     if ($preview) {
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
         if (!empty($post_images)) {
1033 1033
             foreach ($post_images as $image) {
1034
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1034
+                if ($image_limit !== '' && ($slides + 1) > $image_limit) {
1035 1035
                      break;
1036 1036
                 }
1037 1037
                 if (!empty($image)) {
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
                     $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1041 1041
 
1042 1042
                     if ($image && $width && $height) {
1043
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1043
+                        $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
1044 1044
                     }
1045 1045
 
1046 1046
                     if (isset($image->src)) {
@@ -1052,9 +1052,9 @@  discard block
 block discarded – undo
1052 1052
 
1053 1053
                         $image_title = isset($image->title) ? $image->title : '';
1054 1054
 
1055
-                        $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;" />';
1056
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1057
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1055
+                        $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;" />';
1056
+                        $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>';
1057
+                        $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>';
1058 1058
                         $slides++;
1059 1059
                     }
1060 1060
                 }
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 
1076 1076
         if (!empty($post_images)) {
1077 1077
             foreach ($post_images as $image) {
1078
-                if ($image_limit !== '' && ($slides+1) > $image_limit) {
1078
+                if ($image_limit !== '' && ($slides + 1) > $image_limit) {
1079 1079
                      break;
1080 1080
                 }
1081 1081
                 if ($image->height >= 400) {
@@ -1084,9 +1084,9 @@  discard block
 block discarded – undo
1084 1084
                     $spacer_height = ((400 - $image->height) / 2);
1085 1085
                 }
1086 1086
 
1087
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1088
-                $main_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1089
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1087
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1088
+                $main_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1089
+                $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
1090 1090
                 $slides++;
1091 1091
             }
1092 1092
         }// endfore
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
  */
1122 1122
 function geodir_action_details_taxonomies()
1123 1123
 {
1124
-    global $preview, $post;?>
1124
+    global $preview, $post; ?>
1125 1125
     <p class="geodir_post_taxomomies clearfix">
1126 1126
     <?php
1127 1127
     $taxonomies = array();
@@ -1130,11 +1130,11 @@  discard block
 block discarded – undo
1130 1130
 
1131 1131
     if ($preview && !$is_backend_preview) {
1132 1132
         $post_type = $post->listing_type;
1133
-        $post_taxonomy = $post_type . 'category';
1133
+        $post_taxonomy = $post_type.'category';
1134 1134
         $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1135 1135
     } else {
1136 1136
         $post_type = $post->post_type;
1137
-        $post_taxonomy = $post_type . 'category';
1137
+        $post_taxonomy = $post_type.'category';
1138 1138
     }
1139 1139
 //{	
1140 1140
     $post_type_info = get_post_type_object($post_type);
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 
1143 1143
     if (!empty($post->post_tags)) {
1144 1144
 
1145
-        if (taxonomy_exists($post_type . '_tags')):
1145
+        if (taxonomy_exists($post_type.'_tags')):
1146 1146
             $links = array();
1147 1147
             $terms = array();
1148 1148
             // to limit post tags
@@ -1169,8 +1169,8 @@  discard block
 block discarded – undo
1169 1169
                 $post_term = trim($post_term);
1170 1170
 
1171 1171
                 $priority_location = false;
1172
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1173
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1172
+                if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
1173
+                    $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
1174 1174
                 } else {
1175 1175
                     $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1176 1176
                     $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
@@ -1180,10 +1180,10 @@  discard block
 block discarded – undo
1180 1180
                     $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1181 1181
                     if ($match_country || $match_region || $match_city) {
1182 1182
                         $priority_location = true;
1183
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1183
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1184 1184
                     } else {
1185
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1186
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1185
+                        $insert_term = wp_insert_term($post_term, $post_type.'_tags');
1186
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1187 1187
                     }
1188 1188
                 }
1189 1189
 
@@ -1200,12 +1200,12 @@  discard block
 block discarded – undo
1200 1200
                          * @param string $tag_link The tag link html.
1201 1201
                          * @param object $term The tag term object.
1202 1202
                          */
1203
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1203
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1204 1204
                         $links[] = $tag_link;
1205 1205
                     } else {
1206
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1206
+                        $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>";
1207 1207
                         /** This action is documented in geodirectory-template_actions.php */
1208
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1208
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1209 1209
                         $links[] = $tag_link;
1210 1210
                     }
1211 1211
                     $terms[] = $term;
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
             if (!isset($listing_label)) {
1216 1216
                 $listing_label = '';
1217 1217
             }
1218
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1218
+            $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1219 1219
         endif;
1220 1220
 
1221 1221
     }
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
                     $term = get_term_by('id', $post_term, $post_taxonomy);
1244 1244
 
1245 1245
                     if (is_object($term)) {
1246
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1246
+                        $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>";
1247 1247
                         /**
1248 1248
                          * Filter the category name on the details page.
1249 1249
                          *
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
                          * @param string $term_link The link html to the category.
1252 1252
                          * @param object $term The category term object.
1253 1253
                          */
1254
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1254
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1255 1255
                         $links[] = $term_link;
1256 1256
                         $terms[] = $term;
1257 1257
                     }
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
         if (!isset($listing_label)) {
1270 1270
             $listing_label = '';
1271 1271
         }
1272
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1272
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1273 1273
 
1274 1274
     }
1275 1275
 
@@ -1282,14 +1282,14 @@  discard block
 block discarded – undo
1282 1282
      * @param string $listing_label The post type label.
1283 1283
      * @param string $listing_label The post type label with ucwords function.
1284 1284
      */
1285
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1285
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1286 1286
 
1287 1287
     if (isset($taxonomies[$post_taxonomy])) {
1288
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1288
+        echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>';
1289 1289
     }
1290 1290
 
1291
-    if (isset($taxonomies[$post_type . '_tags']))
1292
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1291
+    if (isset($taxonomies[$post_type.'_tags']))
1292
+        echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>';
1293 1293
 
1294 1294
     ?>
1295 1295
     </p><?php
@@ -1310,11 +1310,11 @@  discard block
 block discarded – undo
1310 1310
  * @param object $post Optional. The post object or blank.
1311 1311
  * @package GeoDirectory
1312 1312
  */
1313
-function geodir_action_details_micordata($post='')
1313
+function geodir_action_details_micordata($post = '')
1314 1314
 {
1315 1315
 
1316 1316
     global $preview;
1317
-    if(empty($post)){global $post;}
1317
+    if (empty($post)) {global $post; }
1318 1318
     if ($preview || !geodir_is_page('detail')) {
1319 1319
         return;
1320 1320
     }
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
     } else {
1330 1330
         foreach ($post_reviews as $review) {
1331 1331
 
1332
-            if($rating_value = geodir_get_commentoverall($review->comment_ID)){
1332
+            if ($rating_value = geodir_get_commentoverall($review->comment_ID)) {
1333 1333
                 $reviews[] = array(
1334 1334
                     "@type" => "Review",
1335 1335
                     "author" => $review->comment_author,
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
                     "description" => $review->comment_content,
1338 1338
                     "reviewRating" => array(
1339 1339
                         "@type" => "Rating",
1340
-                        "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1340
+                        "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1341 1341
                         "ratingValue" => $rating_value,
1342 1342
                         "worstRating" => "1"
1343 1343
                     )
@@ -1367,13 +1367,13 @@  discard block
 block discarded – undo
1367 1367
     }
1368 1368
     //print_r($post);
1369 1369
     // external links
1370
-    $external_links =  array();
1370
+    $external_links = array();
1371 1371
     $external_links[] = $post->geodir_website;
1372 1372
     $external_links[] = $post->geodir_twitter;
1373 1373
     $external_links[] = $post->geodir_facebook;
1374 1374
     $external_links = array_filter($external_links);
1375 1375
 
1376
-    if(!empty($external_links)){
1376
+    if (!empty($external_links)) {
1377 1377
         $external_links = array_values($external_links);
1378 1378
     }
1379 1379
 
@@ -1383,17 +1383,17 @@  discard block
 block discarded – undo
1383 1383
 
1384 1384
     // schema type
1385 1385
     $schema_type = 'LocalBusiness';
1386
-    if(isset($post->default_category) && $post->default_category){
1386
+    if (isset($post->default_category) && $post->default_category) {
1387 1387
         $cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1388
-        if($cat_schema){$schema_type = $cat_schema;}
1389
-        if(!$cat_schema && $schema_type=='LocalBusiness' && $post->post_type=='gd_event'){$schema_type = 'Event';}
1388
+        if ($cat_schema) {$schema_type = $cat_schema; }
1389
+        if (!$cat_schema && $schema_type == 'LocalBusiness' && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1390 1390
     }
1391 1391
 
1392 1392
     $schema = array();
1393 1393
     $schema['@context'] = "https://schema.org";
1394 1394
     $schema['@type'] = $schema_type;
1395 1395
     $schema['name'] = $post->post_title;
1396
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1396
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1397 1397
     $schema['telephone'] = $post->geodir_contact;
1398 1398
     $schema['url'] = $c_url;
1399 1399
     $schema['sameAs'] = $external_links;
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
         "postalCode" => $post->post_zip
1408 1408
     );
1409 1409
 
1410
-    if($post->post_latitude && $post->post_longitude) {
1410
+    if ($post->post_latitude && $post->post_longitude) {
1411 1411
         $schema['geo'] = array(
1412 1412
             "@type" => "GeoCoordinates",
1413 1413
             "latitude" => $post->post_latitude,
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
         );
1416 1416
     }
1417 1417
 
1418
-    if($post_avgratings) {
1418
+    if ($post_avgratings) {
1419 1419
         $schema['aggregateRating'] = array(
1420 1420
             "@type" => "AggregateRating",
1421 1421
             "ratingValue" => $post_avgratings,
@@ -1434,10 +1434,10 @@  discard block
 block discarded – undo
1434 1434
      * @param array $schema The array of schema data to be filtered.
1435 1435
      * @param object $post The post object.
1436 1436
      */
1437
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1437
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1438 1438
 
1439 1439
 
1440
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1440
+    echo '<script type="application/ld+json">'.json_encode($schema).'</script>';
1441 1441
 
1442 1442
 
1443 1443
     $uploads = wp_upload_dir();
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
      * @param string $facebook_og The open graph html to be filtered.
1451 1451
      * @param object $post The post object.
1452 1452
      */
1453
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1453
+    echo apply_filters('geodir_details_facebook_og', $facebook_og, $post);
1454 1454
 
1455 1455
 
1456 1456
 
@@ -1473,9 +1473,9 @@  discard block
 block discarded – undo
1473 1473
     ?>
1474 1474
     <div class="geodir-pos_navigation clearfix">
1475 1475
     <div
1476
-        class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
1476
+        class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
1477 1477
     <div
1478
-        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
1478
+        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
1479 1479
     </div><?php
1480 1480
 }
1481 1481
 
@@ -1544,12 +1544,12 @@  discard block
 block discarded – undo
1544 1544
     $gd_post_type = geodir_get_current_posttype();
1545 1545
     $post_type_info = get_post_type_object($gd_post_type);
1546 1546
 
1547
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1547
+    $add_string_in_title = __('All', 'geodirectory').' ';
1548 1548
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1549
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1549
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
1550 1550
     }
1551 1551
 
1552
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1552
+    $list_title = $add_string_in_title.__($post_type_info->labels->name, 'geodirectory');
1553 1553
     $single_name = $post_type_info->labels->singular_name;
1554 1554
 
1555 1555
     $taxonomy = geodir_get_taxonomies($gd_post_type, true);
@@ -1577,12 +1577,12 @@  discard block
 block discarded – undo
1577 1577
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
1578 1578
         if (!empty($current_term)) {
1579 1579
             $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1580
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1580
+            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1581 1581
                 $location_last_char = substr($location_name, -1);
1582 1582
                 $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1583
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1583
+                $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1584 1584
             } else {
1585
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1585
+                $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1586 1586
             }
1587 1587
         } else {
1588 1588
             if (count($taxonomy) > 1) {
@@ -1590,12 +1590,12 @@  discard block
 block discarded – undo
1590 1590
 
1591 1591
                 if (!empty($current_term)) {
1592 1592
                     $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory');
1593
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1593
+                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1594 1594
                         $location_last_char = substr($location_name, -1);
1595 1595
                         $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1596
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1596
+                        $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1597 1597
                     } else {
1598
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1598
+                        $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1599 1599
                     }
1600 1600
                 }
1601 1601
             }
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
                 $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1624 1624
             }
1625 1625
 
1626
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1626
+            $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
1627 1627
         } else if ($gd_region != '') {
1628 1628
             if ($gd_region_actual != '') {
1629 1629
                 $gd_region = $gd_region_actual;
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
                 $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1634 1634
             }
1635 1635
 
1636
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1636
+            $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
1637 1637
         } else if ($gd_country != '') {
1638 1638
             if ($gd_country_actual != '') {
1639 1639
                 $gd_country = $gd_country_actual;
@@ -1643,12 +1643,12 @@  discard block
 block discarded – undo
1643 1643
                 $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1644 1644
             }
1645 1645
 
1646
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1646
+            $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
1647 1647
         }
1648 1648
     }
1649 1649
 
1650 1650
     if (is_search()) {
1651
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1651
+        $list_title = __('Search', 'geodirectory').' '.__(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
1652 1652
     }
1653 1653
     /** This action is documented in geodirectory_template_actions.php */
1654 1654
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
@@ -1658,26 +1658,26 @@  discard block
 block discarded – undo
1658 1658
 
1659 1659
     $title = $list_title;
1660 1660
     $gd_page = '';
1661
-    if(geodir_is_page('pt')){
1661
+    if (geodir_is_page('pt')) {
1662 1662
         $gd_page = 'pt';
1663
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1663
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1664 1664
     }
1665
-    elseif(geodir_is_page('listing')){
1665
+    elseif (geodir_is_page('listing')) {
1666 1666
         $gd_page = 'listing';
1667 1667
         global $wp_query;
1668 1668
         $current_term = $wp_query->get_queried_object();
1669
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1669
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1670 1670
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1671
-        }else{
1671
+        } else {
1672 1672
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1673 1673
         }
1674 1674
 
1675 1675
     }
1676
-    elseif(geodir_is_page('author')){
1676
+    elseif (geodir_is_page('author')) {
1677 1677
         $gd_page = 'author';
1678
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1678
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1679 1679
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1680
-        }else{
1680
+        } else {
1681 1681
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1682 1682
         }
1683 1683
 
@@ -1691,16 +1691,16 @@  discard block
 block discarded – undo
1691 1691
      * @param string $title The page title including variables.
1692 1692
      * @param string $gd_page The GeoDirectory page type if any.
1693 1693
      */
1694
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1694
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1695 1695
 
1696
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1696
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
1697 1697
         /**
1698 1698
          * Filter the listing page title.
1699 1699
          *
1700 1700
          * @since 1.0.0
1701 1701
          * @param string $list_title The title for the category page.
1702 1702
          */
1703
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1703
+        apply_filters('geodir_listing_page_title', $title).'</h1></header>';
1704 1704
 }
1705 1705
 
1706 1706
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1719,16 +1719,16 @@  discard block
 block discarded – undo
1719 1719
     $gd_post_type = geodir_get_current_posttype();
1720 1720
     if (isset($current_term->term_id) && $current_term->term_id != '') {
1721 1721
 
1722
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1722
+        $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags');
1723 1723
         $saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1724 1724
         if ($term_desc && !$saved_data) {
1725 1725
             $saved_data = $term_desc;
1726 1726
         }
1727 1727
 
1728 1728
         // stop payment manager filtering content length
1729
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1730
-        if ( false !== $filter_priority ) {
1731
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1729
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1730
+        if (false !== $filter_priority) {
1731
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1732 1732
         }
1733 1733
 
1734 1734
         /**
@@ -1742,14 +1742,14 @@  discard block
 block discarded – undo
1742 1742
         $cat_description = apply_filters('the_content', $saved_data);
1743 1743
 
1744 1744
 
1745
-        if ( false !== $filter_priority ) {
1746
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1745
+        if (false !== $filter_priority) {
1746
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1747 1747
         }
1748 1748
 
1749 1749
         if ($cat_description) {
1750 1750
             ?>
1751 1751
 
1752
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1752
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1753 1753
         }
1754 1754
 
1755 1755
     }
@@ -1799,13 +1799,13 @@  discard block
 block discarded – undo
1799 1799
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1800 1800
 {
1801 1801
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1802
-        $width_css = 'style="width:' . $width . '%;"';
1802
+        $width_css = 'style="width:'.$width.'%;"';
1803 1803
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1804
-        $width_css = 'style="width:' . $width . '%;"';
1804
+        $width_css = 'style="width:'.$width.'%;"';
1805 1805
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1806
-        $width_css = 'style="width:' . $width . '%;"';
1806
+        $width_css = 'style="width:'.$width.'%;"';
1807 1807
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1808
-        $width_css = 'style="width:' . $width . '%;"';
1808
+        $width_css = 'style="width:'.$width.'%;"';
1809 1809
     } else {
1810 1810
         $width_css = '';
1811 1811
     }
@@ -2110,11 +2110,11 @@  discard block
 block discarded – undo
2110 2110
 
2111 2111
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2112 2112
 
2113
-    if(geodir_is_page('add-listing')){
2113
+    if (geodir_is_page('add-listing')) {
2114 2114
         $gd_page = 'add-listing';
2115
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2115
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2116 2116
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2117
-        }elseif(isset($listing_type)){
2117
+        }elseif (isset($listing_type)) {
2118 2118
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2119 2119
         }
2120 2120
 
@@ -2128,9 +2128,9 @@  discard block
 block discarded – undo
2128 2128
      * @param string $title The page title including variables.
2129 2129
      * @param string $gd_page The GeoDirectory page type if any.
2130 2130
      */
2131
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2131
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2132 2132
 
2133
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2133
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2134 2134
     echo $title;
2135 2135
     echo '</h1></header>';
2136 2136
 }
@@ -2144,7 +2144,7 @@  discard block
 block discarded – undo
2144 2144
  */
2145 2145
 function geodir_action_add_listing_page_mandatory()
2146 2146
 {?>
2147
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2147
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2148 2148
 <?php
2149 2149
 }
2150 2150
 
@@ -2179,7 +2179,7 @@  discard block
 block discarded – undo
2179 2179
 
2180 2180
     if (isset($_REQUEST['backandedit'])) {
2181 2181
         global $post;
2182
-        $post = (object)$gd_session->get('listing');
2182
+        $post = (object) $gd_session->get('listing');
2183 2183
         $listing_type = $post->listing_type;
2184 2184
         $title = $post->post_title;
2185 2185
         $desc = $post->post_desc;
@@ -2194,7 +2194,7 @@  discard block
 block discarded – undo
2194 2194
         $thumb_img_arr = geodir_get_images($post->ID);
2195 2195
         if ($thumb_img_arr) {
2196 2196
             foreach ($thumb_img_arr as $post_img) {
2197
-                $curImages .= $post_img->src . ',';
2197
+                $curImages .= $post_img->src.',';
2198 2198
             }
2199 2199
         }
2200 2200
 
@@ -2202,7 +2202,7 @@  discard block
 block discarded – undo
2202 2202
         $title = $post->post_title;
2203 2203
         $desc = $post->post_content;
2204 2204
         $kw_tags = $post->post_tags;
2205
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2205
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2206 2206
     } else {
2207 2207
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2208 2208
     }
@@ -2213,20 +2213,20 @@  discard block
 block discarded – undo
2213 2213
 
2214 2214
     $post_type_info = geodir_get_posttype_info($listing_type);
2215 2215
 
2216
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory');
2216
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing', 'geodirectory');
2217 2217
     
2218 2218
     $package_info = array();
2219 2219
     $package_info = geodir_post_package_info($package_info, $post);
2220 2220
     ?>
2221
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2222
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2223
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2221
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2222
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2223
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2224 2224
         <?php if ($page_id) { ?>
2225
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2225
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2226 2226
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2227
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2227
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2228 2228
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2229
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2229
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2230 2230
         <?php
2231 2231
         } 
2232 2232
         /**
@@ -2238,7 +2238,7 @@  discard block
 block discarded – undo
2238 2238
          */
2239 2239
         do_action('geodir_before_detail_fields');
2240 2240
         ?>
2241
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2241
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2242 2242
         <?php
2243 2243
         /**
2244 2244
          * Called at the top of the add listing page form for frontend.
@@ -2259,10 +2259,10 @@  discard block
 block discarded – undo
2259 2259
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2260 2260
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2261 2261
                  */
2262
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2262
+                echo apply_filters('geodir_add_listing_title_label', sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span>*</span> </label>
2263 2263
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2264 2264
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2265
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2265
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2266 2266
         </div>
2267 2267
         <?php
2268 2268
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2308,7 +2308,7 @@  discard block
 block discarded – undo
2308 2308
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2309 2309
         
2310 2310
         $desc_class = '';
2311
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2311
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2312 2312
             /**
2313 2313
              * Called on the add listing page form for frontend just before the description field.
2314 2314
              *
@@ -2321,7 +2321,7 @@  discard block
 block discarded – undo
2321 2321
             $desc_class = ' hidden';
2322 2322
         }
2323 2323
         ?>
2324
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2324
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2325 2325
             <label><?php
2326 2326
                 /**
2327 2327
                  * Filter the add listing page description input label.
@@ -2331,7 +2331,7 @@  discard block
 block discarded – undo
2331 2331
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2332 2332
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2333 2333
                  */
2334
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2334
+                echo apply_filters('geodir_add_listing_description_label', sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2335 2335
             <?php
2336 2336
             if ($show_editor) {
2337 2337
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2340,16 +2340,16 @@  discard block
 block discarded – undo
2340 2340
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2341 2341
                 </div>
2342 2342
             <?php if ($desc_limit != '') { ?>
2343
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2343
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2344 2344
             <?php } } else { ?>
2345 2345
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2346 2346
             <?php } if ($desc_limit_msg != '') { ?>
2347 2347
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2348 2348
             <?php } ?>
2349
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2349
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2350 2350
         </div>
2351 2351
         <?php
2352
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2352
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2353 2353
             /**
2354 2354
              * Called on the add listing page form for frontend just after the description field.
2355 2355
              *
@@ -2388,7 +2388,7 @@  discard block
 block discarded – undo
2388 2388
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2389 2389
         
2390 2390
         $tags_class = '';
2391
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2391
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2392 2392
             /**
2393 2393
              * Called on the add listing page form for frontend just before the tags field.
2394 2394
              *
@@ -2399,14 +2399,14 @@  discard block
 block discarded – undo
2399 2399
             $tags_class = ' hidden';
2400 2400
         }
2401 2401
         ?>
2402
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2402
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2403 2403
             <label><?php echo TAGKW_TEXT; ?></label>
2404 2404
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2405
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2406
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2405
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2406
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2407 2407
         </div>
2408 2408
         <?php
2409
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2409
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2410 2410
             /**
2411 2411
              * Called on the add listing page form for frontend just after the tags field.
2412 2412
              *
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
         $thumb_img_arr = array();
2433 2433
         $totImg = 0;
2434 2434
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2435
-            $post = (object)$gd_session->get('listing');
2435
+            $post = (object) $gd_session->get('listing');
2436 2436
             if (isset($post->post_images))
2437 2437
                 $curImages = trim($post->post_images, ",");
2438 2438
 
@@ -2445,7 +2445,7 @@  discard block
 block discarded – undo
2445 2445
             $listing_type = $post->listing_type;
2446 2446
 
2447 2447
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2448
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2448
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2449 2449
             $listing_type = $post->post_type;
2450 2450
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2451 2451
 
@@ -2459,7 +2459,7 @@  discard block
 block discarded – undo
2459 2459
                 //$curImages = $img->src.",";
2460 2460
             }
2461 2461
 
2462
-            $totImg = count((array)$thumb_img_arr);
2462
+            $totImg = count((array) $thumb_img_arr);
2463 2463
         }
2464 2464
 
2465 2465
         if ($curImages != '')
@@ -2480,15 +2480,15 @@  discard block
 block discarded – undo
2480 2480
         if ($show_image_input_box) {
2481 2481
             ?>
2482 2482
 
2483
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2483
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2484 2484
                 <?php if ($image_limit == 1) {
2485
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2485
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2486 2486
                 } ?>
2487 2487
                 <?php if ($image_limit > 1) {
2488
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2488
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2489 2489
                 } ?>
2490 2490
                 <?php if ($image_limit == '') {
2491
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2491
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2492 2492
                 } ?>
2493 2493
             </h5>
2494 2494
 
@@ -2503,11 +2503,11 @@  discard block
 block discarded – undo
2503 2503
                 <div
2504 2504
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2505 2505
                     id="<?php echo $id; ?>plupload-upload-ui">
2506
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2506
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2507 2507
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2508 2508
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2509 2509
                     <span class="ajaxnonceplu"
2510
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2510
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2511 2511
                     <?php if ($width && $height): ?>
2512 2512
                         <span class="plupload-resize"></span>
2513 2513
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2520,7 +2520,7 @@  discard block
 block discarded – undo
2520 2520
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2521 2521
                 </div>
2522 2522
                 <span
2523
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2523
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2524 2524
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2525 2525
             </div>
2526 2526
 
@@ -2532,7 +2532,7 @@  discard block
 block discarded – undo
2532 2532
          *
2533 2533
          * @since 1.0.0
2534 2534
          */
2535
-        do_action('geodir_after_main_form_fields');?>
2535
+        do_action('geodir_after_main_form_fields'); ?>
2536 2536
 
2537 2537
 
2538 2538
         <!-- add captcha code -->
@@ -2543,7 +2543,7 @@  discard block
 block discarded – undo
2543 2543
         </script>
2544 2544
         <noscript>
2545 2545
             <div>
2546
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2546
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2547 2547
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2548 2548
             </div>
2549 2549
         </noscript>
@@ -2553,10 +2553,10 @@  discard block
 block discarded – undo
2553 2553
         <!-- end captcha code -->
2554 2554
 
2555 2555
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2556
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2557
-                   class="geodir_button" <?php echo $submit_button;?>/>
2556
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2557
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2558 2558
             <span class="geodir_message_note"
2559
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2559
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2560 2560
         </div>
2561 2561
 
2562 2562
     </form>
@@ -2618,7 +2618,7 @@  discard block
 block discarded – undo
2618 2618
         class="<?php
2619 2619
         /** This action is documented in geodirectory_template_actions.php */
2620 2620
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2621
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2621
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2622 2622
     </div><!-- clearfix ends here-->
2623 2623
 <?php
2624 2624
 }
@@ -2638,11 +2638,11 @@  discard block
 block discarded – undo
2638 2638
 
2639 2639
     global $user_login;
2640 2640
     
2641
-    $is_enable_signup = get_option( 'users_can_register' );
2641
+    $is_enable_signup = get_option('users_can_register');
2642 2642
     
2643 2643
     ?>
2644 2644
     <script type="text/javascript">
2645
-        <?php if ( $user_login ) { ?>
2645
+        <?php if ($user_login) { ?>
2646 2646
         setTimeout(function () {
2647 2647
             try {
2648 2648
                 d = document.getElementById('user_pass');
@@ -2659,7 +2659,7 @@  discard block
 block discarded – undo
2659 2659
         <?php } ?>
2660 2660
     </script>
2661 2661
     <script type="text/javascript">
2662
-        <?php if ( $user_login ) { ?>
2662
+        <?php if ($user_login) { ?>
2663 2663
         setTimeout(function () {
2664 2664
             try {
2665 2665
                 d = document.getElementById('user_pass');
@@ -2684,7 +2684,7 @@  discard block
 block discarded – undo
2684 2684
         foreach ($errors as $errorsObj) {
2685 2685
             foreach ($errorsObj as $key => $val) {
2686 2686
                 for ($i = 0; $i < count($val); $i++) {
2687
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2687
+                    echo "<div class=error_msg_fix>".$val[$i].'</div>';
2688 2688
                     $registration_error_msg = 1;
2689 2689
                 }
2690 2690
             }
@@ -2701,10 +2701,10 @@  discard block
 block discarded – undo
2701 2701
              *
2702 2702
              * @since 1.0.0
2703 2703
              */
2704
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2704
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2705 2705
         </div>
2706 2706
 
2707
-    <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup ) { ?>
2707
+    <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup) { ?>
2708 2708
 
2709 2709
         <div class="registration_form">
2710 2710
             <?php
@@ -2713,7 +2713,7 @@  discard block
 block discarded – undo
2713 2713
              *
2714 2714
              * @since 1.0.0
2715 2715
              */
2716
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2716
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2717 2717
         </div>
2718 2718
 
2719 2719
     <?php } else { ?>
@@ -2725,10 +2725,10 @@  discard block
 block discarded – undo
2725 2725
              *
2726 2726
              * @since 1.0.0
2727 2727
              */
2728
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2728
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2729 2729
         </div>
2730 2730
         
2731
-        <?php if ( $is_enable_signup ) { ?>
2731
+        <?php if ($is_enable_signup) { ?>
2732 2732
             <div class="registration_form_r">
2733 2733
                 <?php
2734 2734
                 /**
@@ -2736,7 +2736,7 @@  discard block
 block discarded – undo
2736 2736
                  *
2737 2737
                  * @since 1.0.0
2738 2738
                  */
2739
-                include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2739
+                include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2740 2740
             </div>
2741 2741
         <?php } ?>
2742 2742
 
@@ -2773,12 +2773,12 @@  discard block
 block discarded – undo
2773 2773
     $gd_post_type = geodir_get_current_posttype();
2774 2774
     $post_type_info = get_post_type_object($gd_post_type);
2775 2775
 
2776
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2776
+    $add_string_in_title = __('All', 'geodirectory').' ';
2777 2777
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2778
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2778
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2779 2779
     }
2780 2780
 
2781
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2781
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2782 2782
     $single_name = $post_type_info->labels->singular_name;
2783 2783
 
2784 2784
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2786,12 +2786,12 @@  discard block
 block discarded – undo
2786 2786
     if (!empty($term)) {
2787 2787
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2788 2788
         if (!empty($current_term))
2789
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2789
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2790 2790
     }
2791 2791
 
2792 2792
 
2793 2793
     if (is_search()) {
2794
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2794
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2795 2795
 
2796 2796
     }
2797 2797
     /** This action is documented in geodirectory_template_actions.php */
@@ -2800,11 +2800,11 @@  discard block
 block discarded – undo
2800 2800
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2801 2801
 
2802 2802
     $title = $list_title;
2803
-    if(geodir_is_page('author')){
2803
+    if (geodir_is_page('author')) {
2804 2804
         $gd_page = 'author';
2805
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2805
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2806 2806
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2807
-        }else{
2807
+        } else {
2808 2808
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2809 2809
         }
2810 2810
 
@@ -2818,16 +2818,16 @@  discard block
 block discarded – undo
2818 2818
      * @param string $title The page title including variables.
2819 2819
      * @param string $gd_page The GeoDirectory page type if any.
2820 2820
      */
2821
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2821
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2822 2822
 
2823
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2823
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2824 2824
         /**
2825 2825
          * Filter the author page title text.
2826 2826
          *
2827 2827
          * @since 1.0.0
2828 2828
          * @param string $list_title The title for the page.
2829 2829
          */
2830
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2830
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2831 2831
 }
2832 2832
 
2833 2833
 
@@ -3032,19 +3032,19 @@  discard block
 block discarded – undo
3032 3032
     $post_type_info = get_post_type_object($gd_post_type);
3033 3033
 
3034 3034
     $pt_name = '';
3035
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
3035
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
3036 3036
 
3037 3037
     if (is_search()) {
3038
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
3038
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
3039 3039
 
3040 3040
     }
3041 3041
     /** This action is documented in geodirectory_template_actions.php */
3042 3042
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
3043 3043
     /** This action is documented in geodirectory_template_actions.php */
3044 3044
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
3045
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
3045
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
3046 3046
         /** This action is documented in geodirectory_template_actions.php */
3047
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
3047
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
3048 3048
 }
3049 3049
 
3050 3050
 // action for adding the listings page top widget area
@@ -3448,7 +3448,7 @@  discard block
 block discarded – undo
3448 3448
         $gd_post_type = geodir_get_current_posttype();
3449 3449
         $post_type_info = get_post_type_object($gd_post_type);
3450 3450
 
3451
-        $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3451
+        $list_title = __('Search', 'geodirectory').' '.__(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3452 3452
     }
3453 3453
     return $list_title;
3454 3454
 }
@@ -3465,7 +3465,7 @@  discard block
 block discarded – undo
3465 3465
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3466 3466
  * @param string $gd_page The geodirectory page type. Default null.
3467 3467
  */
3468
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3468
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3469 3469
     global $post;
3470 3470
 
3471 3471
     $gd_page_id = NULL;
@@ -3542,17 +3542,17 @@  discard block
 block discarded – undo
3542 3542
  * @param WP_Post $post           WP_Post object.
3543 3543
  * @return string Filtered SQL JOIN clause.
3544 3544
  */
3545
-function geodir_previous_next_post_join( $join, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3545
+function geodir_previous_next_post_join($join, $in_same_term, $excluded_terms, $taxonomy, $post) {
3546 3546
     global $plugin_prefix;
3547 3547
 
3548
-    if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3549
-        $join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID";
3548
+    if (!empty($post->post_type) && in_array($post->post_type, geodir_get_posttypes())) {
3549
+        $join .= " INNER JOIN ".$plugin_prefix.$post->post_type."_detail AS gd ON gd.post_id = p.ID";
3550 3550
     }
3551 3551
     
3552 3552
     return $join;
3553 3553
 }
3554
-add_filter( 'get_previous_post_join', 'geodir_previous_next_post_join', 10, 5 );
3555
-add_filter( 'get_next_post_join', 'geodir_previous_next_post_join', 10, 5 );
3554
+add_filter('get_previous_post_join', 'geodir_previous_next_post_join', 10, 5);
3555
+add_filter('get_next_post_join', 'geodir_previous_next_post_join', 10, 5);
3556 3556
 
3557 3557
 /**
3558 3558
  * Filters the WHERE clause in the SQL for an adjacent post query.
@@ -3570,35 +3570,35 @@  discard block
 block discarded – undo
3570 3570
  * @param WP_Post $post          WP_Post object.
3571 3571
  * @return string Filtered SQL WHERE clause.
3572 3572
  */
3573
-function geodir_previous_next_post_where( $where, $in_same_term, $excluded_terms, $taxonomy, $post ) {
3573
+function geodir_previous_next_post_where($where, $in_same_term, $excluded_terms, $taxonomy, $post) {
3574 3574
     global $wpdb, $plugin_prefix;
3575 3575
 
3576
-    if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
3576
+    if (!empty($post->post_type) && (!empty($post->country_slug) || !empty($post->region_slug) || !empty($post->city_slug)) && in_array($post->post_type, geodir_get_posttypes())) {
3577 3577
         $post_locations = '';
3578 3578
         $post_locations_var = array();
3579 3579
         
3580
-        if ( !empty( $post->country_slug ) ) {
3580
+        if (!empty($post->country_slug)) {
3581 3581
             $post_locations .= " AND post_locations LIKE %s";
3582
-            $post_locations_var[] = "%,[" . $post->country_slug . "]";
3582
+            $post_locations_var[] = "%,[".$post->country_slug."]";
3583 3583
         }
3584 3584
 
3585
-        if ( !empty( $post->region_slug ) ) {
3585
+        if (!empty($post->region_slug)) {
3586 3586
             $post_locations .= " AND post_locations LIKE %s";
3587
-            $post_locations_var[] = "%,[" . $post->region_slug . "],%";
3587
+            $post_locations_var[] = "%,[".$post->region_slug."],%";
3588 3588
         }
3589 3589
 
3590
-        if ( !empty( $post->city_slug ) ) {
3590
+        if (!empty($post->city_slug)) {
3591 3591
             $post_locations .= " AND post_locations LIKE %s";
3592
-            $post_locations_var[] = "[" . $post->city_slug . "],%";
3592
+            $post_locations_var[] = "[".$post->city_slug."],%";
3593 3593
         }
3594 3594
         
3595
-        $where .= $wpdb->prepare( $post_locations, $post_locations_var );
3595
+        $where .= $wpdb->prepare($post_locations, $post_locations_var);
3596 3596
     }
3597 3597
     
3598 3598
     return $where;
3599 3599
 }
3600
-add_filter( 'get_previous_post_where', 'geodir_previous_next_post_where', 10, 5 );
3601
-add_filter( 'get_next_post_where', 'geodir_previous_next_post_where', 10, 5 );
3600
+add_filter('get_previous_post_where', 'geodir_previous_next_post_where', 10, 5);
3601
+add_filter('get_next_post_where', 'geodir_previous_next_post_where', 10, 5);
3602 3602
 
3603 3603
 /**
3604 3604
  * Filter whether a post is able to be edited in the block editor.
@@ -3609,11 +3609,11 @@  discard block
 block discarded – undo
3609 3609
  * @param $post_type The post type being checked.
3610 3610
  * @return bool True if can be edited else False.
3611 3611
  */
3612
-function geodir_block_editor( $use_block_editor, $post_type ) {
3613
-	if ( $use_block_editor ) {
3612
+function geodir_block_editor($use_block_editor, $post_type) {
3613
+	if ($use_block_editor) {
3614 3614
 		$gd_post_types = geodir_get_posttypes();
3615 3615
 
3616
-		if ( ! empty( $gd_post_types ) && in_array( $post_type, $gd_post_types ) ) {
3616
+		if (!empty($gd_post_types) && in_array($post_type, $gd_post_types)) {
3617 3617
 			$use_block_editor = false;
3618 3618
 		}
3619 3619
 	}
@@ -3621,10 +3621,10 @@  discard block
 block discarded – undo
3621 3621
 	return $use_block_editor;
3622 3622
 }
3623 3623
 // Prevent Gutenberg block editing GD CPTs, we only allow editing of the template pages.
3624
-if ( ! empty( $GLOBALS['wp_version'] ) && version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ) ) {
3624
+if (!empty($GLOBALS['wp_version']) && version_compare($GLOBALS['wp_version'], '5.0-beta', '>')) {
3625 3625
 	// WP > 5 beta
3626
-	add_filter( 'use_block_editor_for_post_type', 'geodir_block_editor', 101, 2 );
3626
+	add_filter('use_block_editor_for_post_type', 'geodir_block_editor', 101, 2);
3627 3627
 } else {
3628 3628
 	// WP < 5 beta
3629
-	add_filter( 'gutenberg_can_edit_post_type', 'geodir_block_editor', 101, 2 );
3629
+	add_filter('gutenberg_can_edit_post_type', 'geodir_block_editor', 101, 2);
3630 3630
 }
3631 3631
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/cat-meta-functions/cat_meta.php 3 patches
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -203,8 +203,9 @@  discard block
 block discarded – undo
203 203
 #############################################################
204 204
 function manage_category_custom_fields($deprecated, $column_name, $term_id)
205 205
 {
206
-    if ($column_name == 'cat_ID_num')
207
-        echo $term_id;
206
+    if ($column_name == 'cat_ID_num') {
207
+            echo $term_id;
208
+    }
208 209
 
209 210
     if ($column_name == 'cat_icon') {
210 211
         $term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon');
@@ -240,8 +241,9 @@  discard block
 block discarded – undo
240 241
 
241 242
     if ($column_name == 'cat_default_img') {
242 243
         $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
243
-        if ($cat_default_img != '')
244
-            echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
244
+        if ($cat_default_img != '') {
245
+                    echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
246
+        }
245 247
 
246 248
     }
247 249
 }
@@ -249,11 +251,12 @@  discard block
 block discarded – undo
249 251
 function geodir_get_default_catimage($term_id, $post_type = 'gd_place')
250 252
 {
251 253
 
252
-    if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
253
-        return $cat_default_img;
254
-    else
255
-        return false;
256
-}
254
+    if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) {
255
+            return $cat_default_img;
256
+    } else {
257
+            return false;
258
+    }
259
+    }
257 260
 
258 261
 //Clear custom fields
259 262
 add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field');
Please login to merge, or discard this patch.
Indentation   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -11,146 +11,146 @@  discard block
 block discarded – undo
11 11
 //include the main class file
12 12
 require_once("Tax-meta-class.php");
13 13
 function geodir_set_tax_meta_fields() {
14
-    /*
14
+	/*
15 15
      * prefix of meta keys, optional
16 16
      * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_';
17 17
      *  you also can make prefix empty to disable it
18 18
      *
19 19
      */
20 20
 
21
-    $prefix = 'ct_';
22
-    /*
21
+	$prefix = 'ct_';
22
+	/*
23 23
      * configure your meta box
24 24
      */
25 25
 
26
-    $config = array(
27
-        'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
-        'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
-        'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
-        'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
-        'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
-        'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
33
-        'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34
-    );
26
+	$config = array(
27
+		'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
+		'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
+		'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
+		'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
+		'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
+		'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
33
+		'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34
+	);
35 35
 
36 36
 
37
-    /*
37
+	/*
38 38
      * Initiate your meta box
39 39
      */
40
-    $my_meta = new Geodir_Tax_Meta_Class($config);
41
-    $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
-    $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
-    $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44
-    /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
40
+	$my_meta = new Geodir_Tax_Meta_Class($config);
41
+	$my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
+	$my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
+	$my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44
+	/*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
45 45
 
46
-    $my_meta->addSelect($prefix . 'cat_schema',
47
-    /*
46
+	$my_meta->addSelect($prefix . 'cat_schema',
47
+	/*
48 48
      * Allows you to add/filter the cat schema types.
49 49
      *
50 50
      * @since 1.5.7
51 51
      */
52
-    apply_filters('geodir_cat_schemas',array(
53
-        '' => __('Default (LocalBusiness)', 'geodirectory'),
54
-        'AccountingService' => 'AccountingService',
55
-        'Attorney' => 'Attorney',
56
-        'AutoBodyShop' => 'AutoBodyShop',
57
-        'AutoDealer' => 'AutoDealer',
58
-        'AutoPartsStore' => 'AutoPartsStore',
59
-        'AutoRental' => 'AutoRental',
60
-        'AutoRepair' => 'AutoRepair',
61
-        'AutoWash' => 'AutoWash',
62
-        'Bakery' => 'Bakery',
63
-        'BarOrPub' => 'BarOrPub',
64
-        'BeautySalon' => 'BeautySalon',
65
-        'BedAndBreakfast' => 'BedAndBreakfast',
66
-        'BikeStore' => 'BikeStore',
67
-        'BookStore' => 'BookStore',
68
-        'CafeOrCoffeeShop' => 'CafeOrCoffeeShop',
69
-        'Campground' => 'Campground',
70
-        'ChildCare' => 'ChildCare',
71
-        'ClothingStore' => 'ClothingStore',
72
-        'ComputerStore' => 'ComputerStore',
73
-        'DaySpa' => 'DaySpa',
74
-        'Dentist' => 'Dentist',
75
-        'DryCleaningOrLaundry' => 'DryCleaningOrLaundry',
76
-        'Electrician' => 'Electrician',
77
-        'ElectronicsStore' => 'ElectronicsStore',
78
-        'EmergencyService' => 'EmergencyService',
79
-        'EntertainmentBusiness' => 'EntertainmentBusiness',
80
-        'Event' => 'Event',
81
-        'EventVenue' => 'EventVenue',
82
-        'ExerciseGym' => 'ExerciseGym',
83
-        'FinancialService' => 'FinancialService',
84
-        'Florist' => 'Florist',
85
-        'FoodEstablishment' => 'FoodEstablishment',
86
-        'FurnitureStore' => 'FurnitureStore',
87
-        'GardenStore' => 'GardenStore',
88
-        'GeneralContractor' => 'GeneralContractor',
89
-        'GolfCourse' => 'GolfCourse',
90
-        'HairSalon' => 'HairSalon',
91
-        'HardwareStore' => 'HardwareStore',
92
-        'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness',
93
-        'HobbyShop' => 'HobbyShop',
94
-        'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness',
95
-        'HomeGoodsStore' => 'HomeGoodsStore',
96
-        'Hospital' => 'Hospital',
97
-        'Hostel' => 'Hostel',
98
-        'Hotel' => 'Hotel',
99
-        'HousePainter' => 'HousePainter',
100
-        'HVACBusiness' => 'HVACBusiness',
101
-        'InsuranceAgency' => 'InsuranceAgency',
102
-        'JewelryStore' => 'JewelryStore',
103
-        'LiquorStore' => 'LiquorStore',
104
-        'Locksmith' => 'Locksmith',
105
-        'LodgingBusiness' => 'LodgingBusiness',
106
-        'MedicalClinic' => 'MedicalClinic',
107
-        'MensClothingStore' => 'MensClothingStore',
108
-        'MobilePhoneStore' => 'MobilePhoneStore',
109
-        'Motel' => 'Motel',
110
-        'MotorcycleDealer' => 'MotorcycleDealer',
111
-        'MotorcycleRepair' => 'MotorcycleRepair',
112
-        'MovingCompany' => 'MovingCompany',
113
-        'MusicStore' => 'MusicStore',
114
-        'NailSalon' => 'NailSalon',
115
-        'NightClub' => 'NightClub',
116
-        'Notary' => 'Notary',
117
-        'OfficeEquipmentStore' => 'OfficeEquipmentStore',
118
-        'Optician' => 'Optician',
119
-        'PetStore' => 'PetStore',
120
-        'Physician' => 'Physician',
121
-        'Plumber' => 'Plumber',
122
-        'ProfessionalService' => 'ProfessionalService',
123
-        'RealEstateAgent' => 'RealEstateAgent',
124
-        'Residence' => 'Residence',
125
-        'Restaurant' => 'Restaurant',
126
-        'RoofingContractor' => 'RoofingContractor',
127
-        'RVPark' => 'RVPark',
128
-        'School' => 'School',
129
-        'SelfStorage' => 'SelfStorage',
130
-        'ShoeStore' => 'ShoeStore',
131
-        'SkiResort' => 'SkiResort',
132
-        'SportingGoodsStore' => 'SportingGoodsStore',
133
-        'SportsClub' => 'SportsClub',
134
-        'Store' => 'Store',
135
-        'TattooParlor' => 'TattooParlor',
136
-        'Taxi' => 'Taxi',
137
-        'TennisComplex' => 'TennisComplex',
138
-        'TireShop' => 'TireShop',
139
-        'TouristAttraction' => 'TouristAttraction',
140
-        'ToyStore' => 'ToyStore',
141
-        'TravelAgency' => 'TravelAgency',
142
-        //'VacationRentals' => 'VacationRentals', // Not recognised by google yet
143
-        'VeterinaryCare' => 'VeterinaryCare',
144
-        'WholesaleStore' => 'WholesaleStore',
145
-        'Winery' => 'Winery'
146
-    )),
147
-    array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
52
+	apply_filters('geodir_cat_schemas',array(
53
+		'' => __('Default (LocalBusiness)', 'geodirectory'),
54
+		'AccountingService' => 'AccountingService',
55
+		'Attorney' => 'Attorney',
56
+		'AutoBodyShop' => 'AutoBodyShop',
57
+		'AutoDealer' => 'AutoDealer',
58
+		'AutoPartsStore' => 'AutoPartsStore',
59
+		'AutoRental' => 'AutoRental',
60
+		'AutoRepair' => 'AutoRepair',
61
+		'AutoWash' => 'AutoWash',
62
+		'Bakery' => 'Bakery',
63
+		'BarOrPub' => 'BarOrPub',
64
+		'BeautySalon' => 'BeautySalon',
65
+		'BedAndBreakfast' => 'BedAndBreakfast',
66
+		'BikeStore' => 'BikeStore',
67
+		'BookStore' => 'BookStore',
68
+		'CafeOrCoffeeShop' => 'CafeOrCoffeeShop',
69
+		'Campground' => 'Campground',
70
+		'ChildCare' => 'ChildCare',
71
+		'ClothingStore' => 'ClothingStore',
72
+		'ComputerStore' => 'ComputerStore',
73
+		'DaySpa' => 'DaySpa',
74
+		'Dentist' => 'Dentist',
75
+		'DryCleaningOrLaundry' => 'DryCleaningOrLaundry',
76
+		'Electrician' => 'Electrician',
77
+		'ElectronicsStore' => 'ElectronicsStore',
78
+		'EmergencyService' => 'EmergencyService',
79
+		'EntertainmentBusiness' => 'EntertainmentBusiness',
80
+		'Event' => 'Event',
81
+		'EventVenue' => 'EventVenue',
82
+		'ExerciseGym' => 'ExerciseGym',
83
+		'FinancialService' => 'FinancialService',
84
+		'Florist' => 'Florist',
85
+		'FoodEstablishment' => 'FoodEstablishment',
86
+		'FurnitureStore' => 'FurnitureStore',
87
+		'GardenStore' => 'GardenStore',
88
+		'GeneralContractor' => 'GeneralContractor',
89
+		'GolfCourse' => 'GolfCourse',
90
+		'HairSalon' => 'HairSalon',
91
+		'HardwareStore' => 'HardwareStore',
92
+		'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness',
93
+		'HobbyShop' => 'HobbyShop',
94
+		'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness',
95
+		'HomeGoodsStore' => 'HomeGoodsStore',
96
+		'Hospital' => 'Hospital',
97
+		'Hostel' => 'Hostel',
98
+		'Hotel' => 'Hotel',
99
+		'HousePainter' => 'HousePainter',
100
+		'HVACBusiness' => 'HVACBusiness',
101
+		'InsuranceAgency' => 'InsuranceAgency',
102
+		'JewelryStore' => 'JewelryStore',
103
+		'LiquorStore' => 'LiquorStore',
104
+		'Locksmith' => 'Locksmith',
105
+		'LodgingBusiness' => 'LodgingBusiness',
106
+		'MedicalClinic' => 'MedicalClinic',
107
+		'MensClothingStore' => 'MensClothingStore',
108
+		'MobilePhoneStore' => 'MobilePhoneStore',
109
+		'Motel' => 'Motel',
110
+		'MotorcycleDealer' => 'MotorcycleDealer',
111
+		'MotorcycleRepair' => 'MotorcycleRepair',
112
+		'MovingCompany' => 'MovingCompany',
113
+		'MusicStore' => 'MusicStore',
114
+		'NailSalon' => 'NailSalon',
115
+		'NightClub' => 'NightClub',
116
+		'Notary' => 'Notary',
117
+		'OfficeEquipmentStore' => 'OfficeEquipmentStore',
118
+		'Optician' => 'Optician',
119
+		'PetStore' => 'PetStore',
120
+		'Physician' => 'Physician',
121
+		'Plumber' => 'Plumber',
122
+		'ProfessionalService' => 'ProfessionalService',
123
+		'RealEstateAgent' => 'RealEstateAgent',
124
+		'Residence' => 'Residence',
125
+		'Restaurant' => 'Restaurant',
126
+		'RoofingContractor' => 'RoofingContractor',
127
+		'RVPark' => 'RVPark',
128
+		'School' => 'School',
129
+		'SelfStorage' => 'SelfStorage',
130
+		'ShoeStore' => 'ShoeStore',
131
+		'SkiResort' => 'SkiResort',
132
+		'SportingGoodsStore' => 'SportingGoodsStore',
133
+		'SportsClub' => 'SportsClub',
134
+		'Store' => 'Store',
135
+		'TattooParlor' => 'TattooParlor',
136
+		'Taxi' => 'Taxi',
137
+		'TennisComplex' => 'TennisComplex',
138
+		'TireShop' => 'TireShop',
139
+		'TouristAttraction' => 'TouristAttraction',
140
+		'ToyStore' => 'ToyStore',
141
+		'TravelAgency' => 'TravelAgency',
142
+		//'VacationRentals' => 'VacationRentals', // Not recognised by google yet
143
+		'VeterinaryCare' => 'VeterinaryCare',
144
+		'WholesaleStore' => 'WholesaleStore',
145
+		'Winery' => 'Winery'
146
+	)),
147
+	array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
148 148
 
149
-    // Finish Meta Box Declaration
150
-    $my_meta->Finish();
149
+	// Finish Meta Box Declaration
150
+	$my_meta->Finish();
151 151
 }
152 152
 if ( is_admin() ) {
153
-    add_action( 'init', 'geodir_set_tax_meta_fields', 10 );
153
+	add_action( 'init', 'geodir_set_tax_meta_fields', 10 );
154 154
 }
155 155
 
156 156
 
@@ -159,86 +159,86 @@  discard block
 block discarded – undo
159 159
 ##############################################################
160 160
 $gd_taxonomies = geodir_get_taxonomies();
161 161
 if (!empty($gd_taxonomies)) {
162
-    foreach ($gd_taxonomies as $gd_taxonomy) {
162
+	foreach ($gd_taxonomies as $gd_taxonomy) {
163 163
 
164
-        add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
165
-        add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
164
+		add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
165
+		add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
166 166
 
167
-    }
167
+	}
168 168
 }
169 169
 
170 170
 function addCat_column($columns)
171 171
 {
172
-    if (isset($columns['description']) && $posts = $columns['description']) {
173
-        unset($columns['description']);
174
-    }
172
+	if (isset($columns['description']) && $posts = $columns['description']) {
173
+		unset($columns['description']);
174
+	}
175 175
 
176
-    $columns['cat_icon'] = 'Icon';
177
-    $columns['cat_default_img'] = __('Default Image', 'geodirectory');
178
-    $columns['cat_ID_num'] = __('Cat ID', 'geodirectory');
179
-    return $columns;
176
+	$columns['cat_icon'] = 'Icon';
177
+	$columns['cat_default_img'] = __('Default Image', 'geodirectory');
178
+	$columns['cat_ID_num'] = __('Cat ID', 'geodirectory');
179
+	return $columns;
180 180
 }
181 181
 
182 182
 #############################################################
183 183
 function manage_category_custom_fields($deprecated, $column_name, $term_id)
184 184
 {
185
-    if ($column_name == 'cat_ID_num')
186
-        echo $term_id;
185
+	if ($column_name == 'cat_ID_num')
186
+		echo $term_id;
187 187
 
188
-    if ($column_name == 'cat_icon') {
189
-        $term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon');
188
+	if ($column_name == 'cat_icon') {
189
+		$term_icon_url = geodir_get_tax_meta($term_id, 'ct_cat_icon');
190 190
 
191
-        if ($term_icon_url != '') {
192
-            $file_info = pathinfo($term_icon_url['src']);
191
+		if ($term_icon_url != '') {
192
+			$file_info = pathinfo($term_icon_url['src']);
193 193
 
194
-            if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
195
-                $sub_dir = $file_info['dirname'];
196
-            } else {
197
-                $sub_dir = '';
198
-            }
194
+			if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
195
+				$sub_dir = $file_info['dirname'];
196
+			} else {
197
+				$sub_dir = '';
198
+			}
199 199
 
200
-            $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
201
-            $uploads_baseurl = $uploads['baseurl'];
202
-            $uploads_path = $uploads['path'];
200
+			$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
201
+			$uploads_baseurl = $uploads['baseurl'];
202
+			$uploads_path = $uploads['path'];
203 203
 
204
-            $file_name = $file_info['basename'];
204
+			$file_name = $file_info['basename'];
205 205
 
206
-            if (strpos($sub_dir, 'https://') !== false) {
207
-                $uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']);
208
-            } else {
209
-                $uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']);
210
-            }
211
-            $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
206
+			if (strpos($sub_dir, 'https://') !== false) {
207
+				$uploads['baseurl'] = str_replace('http://', 'https://', $uploads['baseurl']);
208
+			} else {
209
+				$uploads['baseurl'] = str_replace('https://', 'http://', $uploads['baseurl']);
210
+			}
211
+			$sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
212 212
 
213
-            $uploads_url = $uploads_baseurl . $sub_dir;
213
+			$uploads_url = $uploads_baseurl . $sub_dir;
214 214
 
215
-            $term_icon_url['src'] = $uploads_url . '/' . $file_name;
216
-            echo '<img src="' . $term_icon_url['src'] . '" />';
217
-        }
218
-    }
215
+			$term_icon_url['src'] = $uploads_url . '/' . $file_name;
216
+			echo '<img src="' . $term_icon_url['src'] . '" />';
217
+		}
218
+	}
219 219
 
220
-    if ($column_name == 'cat_default_img') {
221
-        $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
222
-        if ($cat_default_img != '')
223
-            echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
220
+	if ($column_name == 'cat_default_img') {
221
+		$cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
222
+		if ($cat_default_img != '')
223
+			echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
224 224
 
225
-    }
225
+	}
226 226
 }
227 227
 
228 228
 function geodir_get_default_catimage($term_id, $post_type = 'gd_place')
229 229
 {
230 230
 
231
-    if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
232
-        return $cat_default_img;
233
-    else
234
-        return false;
231
+	if ($cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
232
+		return $cat_default_img;
233
+	else
234
+		return false;
235 235
 }
236 236
 
237 237
 //Clear custom fields
238 238
 add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field');
239 239
 function geodir_tax_meta_clear_custom_field() {
240
-    if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])):
241
-        ?>
240
+	if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])):
241
+		?>
242 242
         <script type="text/javascript">
243 243
             jQuery(document).ready(function () {
244 244
                 jQuery('#addtag #submit').click(function () {
@@ -267,5 +267,5 @@  discard block
 block discarded – undo
267 267
             });
268 268
         </script>
269 269
     <?php
270
-    endif;
270
+	endif;
271 271
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
      */
25 25
 
26 26
     $config = array(
27
-        'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
-        'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
-        'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
-        'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
-        'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
-        'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
27
+        'id' => 'demo_meta_box', // meta box id, unique per meta box
28
+        'title' => __('Demo Meta Box', 'geodirectory'), // meta box title
29
+        'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies
30
+        'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional
31
+        'fields' => array(), // list of meta fields (can be added by field arrays)
32
+        'local_images' => false, // Use local or hosted images (meta box images for add/remove)
33 33
         'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34 34
     );
35 35
 
@@ -38,18 +38,18 @@  discard block
 block discarded – undo
38 38
      * Initiate your meta box
39 39
      */
40 40
     $my_meta = new Geodir_Tax_Meta_Class($config);
41
-    $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
-    $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
-    $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
41
+    $my_meta->addWysiwyg($prefix.'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
+    $my_meta->addImage($prefix.'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
+    $my_meta->addImage($prefix.'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44 44
     /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
45 45
 
46
-    $my_meta->addSelect($prefix . 'cat_schema',
46
+    $my_meta->addSelect($prefix.'cat_schema',
47 47
     /*
48 48
      * Allows you to add/filter the cat schema types.
49 49
      *
50 50
      * @since 1.5.7
51 51
      */
52
-    apply_filters('geodir_cat_schemas',array(
52
+    apply_filters('geodir_cat_schemas', array(
53 53
         '' => __('Default (LocalBusiness)', 'geodirectory'),
54 54
         'AccountingService' => 'AccountingService',
55 55
         'Attorney' => 'Attorney',
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
         'WholesaleStore' => 'WholesaleStore',
145 145
         'Winery' => 'Winery'
146 146
     )),
147
-    array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
147
+    array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory')."", 'std' => array('selectkey2')));
148 148
 
149 149
     // Finish Meta Box Declaration
150 150
     $my_meta->Finish();
151 151
 }
152
-if ( is_admin() ) {
153
-    add_action( 'init', 'geodir_set_tax_meta_fields', 10 );
152
+if (is_admin()) {
153
+    add_action('init', 'geodir_set_tax_meta_fields', 10);
154 154
 }
155 155
 
156 156
 
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 if (!empty($gd_taxonomies)) {
162 162
     foreach ($gd_taxonomies as $gd_taxonomy) {
163 163
 
164
-        add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
165
-        add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
164
+        add_filter('manage_edit-'.$gd_taxonomy.'_columns', 'addCat_column', 10, 2);
165
+        add_action('manage_'.$gd_taxonomy.'_custom_column', 'manage_category_custom_fields', 10, 3);
166 166
 
167 167
     }
168 168
 }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         if ($term_icon_url != '') {
192 192
             $file_info = pathinfo($term_icon_url['src']);
193 193
 
194
-            if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
194
+            if (isset($file_info['dirname']) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
195 195
                 $sub_dir = $file_info['dirname'];
196 196
             } else {
197 197
                 $sub_dir = '';
@@ -210,17 +210,17 @@  discard block
 block discarded – undo
210 210
             }
211 211
             $sub_dir = str_replace($uploads['baseurl'], '', $sub_dir);
212 212
 
213
-            $uploads_url = $uploads_baseurl . $sub_dir;
213
+            $uploads_url = $uploads_baseurl.$sub_dir;
214 214
 
215
-            $term_icon_url['src'] = $uploads_url . '/' . $file_name;
216
-            echo '<img src="' . $term_icon_url['src'] . '" />';
215
+            $term_icon_url['src'] = $uploads_url.'/'.$file_name;
216
+            echo '<img src="'.$term_icon_url['src'].'" />';
217 217
         }
218 218
     }
219 219
 
220 220
     if ($column_name == 'cat_default_img') {
221 221
         $cat_default_img = geodir_get_tax_meta($term_id, 'ct_cat_default_img');
222 222
         if ($cat_default_img != '')
223
-            echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
223
+            echo '<img src="'.$cat_default_img['src'].'" style="max-height:60px;max-width:60px;"/>';
224 224
 
225 225
     }
226 226
 }
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
                             jQuery("#addtag iframe").contents().find("body").html('');
259 259
                             jQuery('#addtag [rel="ct_cat_default_img"]').removeClass('at-delete_image_button').addClass('at-upload_image_button');
260 260
                             jQuery('#addtag [rel="ct_cat_icon"]').removeClass('at-delete_image_button').addClass('at-upload_image_button');
261
-                            jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image','geodirectory');?>');
262
-                            jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image','geodirectory');?>');
261
+                            jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image', 'geodirectory'); ?>');
262
+                            jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image', 'geodirectory'); ?>');
263 263
                         }
264 264
                     }, 1000);
265 265
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/X.php 3 patches
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         echo '<div class="x-main full" role="main">';
184 184
     } elseif ($stack == 'ethos') {
185 185
         echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">';
186
-    }else{
186
+    } else{
187 187
         echo '<div class="x-container max width offset">';
188 188
     }
189 189
 }
@@ -344,7 +344,9 @@  discard block
 block discarded – undo
344 344
                     echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
345 345
                     if (is_category()) {
346 346
                         $the_cat = get_category(get_query_var('cat'), false);
347
-                        if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter);
347
+                        if ($the_cat->parent != 0) {
348
+                        	echo get_category_parents($the_cat->parent, TRUE, $delimiter);
349
+                        }
348 350
                         echo $current_before . single_cat_title('', false) . $current_after;
349 351
                     } elseif (x_is_product_category()) {
350 352
                         echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after;
@@ -379,7 +381,9 @@  discard block
 block discarded – undo
379 381
                         $breadcrumbs = array_reverse($breadcrumbs);
380 382
                         for ($i = 0; $i < count($breadcrumbs); $i++) {
381 383
                             echo $breadcrumbs[$i];
382
-                            if ($i != count($breadcrumbs) - 1) echo $delimiter;
384
+                            if ($i != count($breadcrumbs) - 1) {
385
+                            	echo $delimiter;
386
+                            }
383 387
                         }
384 388
                         echo $delimiter . $current_before . $page_title . $current_after;
385 389
                     } elseif (is_tag()) {
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 {
123 123
     $classes[] = 'geodir-x';
124 124
 
125
-    if(isset($_REQUEST['geodir_search'])){
125
+    if (isset($_REQUEST['geodir_search'])) {
126 126
         $classes[] = 'geodir-x-search';
127 127
     }
128 128
     return $classes;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         echo '<div class="x-main full" role="main">';
188 188
     } elseif ($stack == 'ethos') {
189 189
         echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">';
190
-    }else{
190
+    } else {
191 191
         echo '<div class="x-container max width offset">';
192 192
     }
193 193
 }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 {
222 222
     $content_class = ' entry-wrap ';
223 223
 
224
-    echo '<div class="x-main left ' . $class . $content_class . ' " role="main">';
224
+    echo '<div class="x-main left '.$class.$content_class.' " role="main">';
225 225
 }
226 226
 
227 227
 /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_x_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
249 249
 {
250
-    echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">';
250
+    echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="'.$itemtype.'">';
251 251
 }
252 252
 
253 253
 /**
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
             // 8. Get shop title.
320 320
             //
321 321
 
322
-            GLOBAL $post,$wp;
322
+            GLOBAL $post, $wp;
323 323
 
324 324
             if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) {
325 325
                 geodir_breadcrumb();
@@ -327,57 +327,57 @@  discard block
 block discarded – undo
327 327
 
328 328
                 $stack = x_get_stack();
329 329
                 $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1
330
-                $home_text = '<span class="home"><i class="x-icon-home"></i></span>';               // 2
331
-                $home_link = home_url();                                                            // 3
332
-                $current_before = '<span class="current">';                                              // 4
333
-                $current_after = '</span>';                                                             // 5
334
-                $page_title = get_the_title();                                                       // 6
335
-                $blog_title = get_the_title(get_option('page_for_posts', true));                 // 7
336
-                $shop_title = get_theme_mod('x_' . $stack . '_shop_title');                        // 8
330
+                $home_text = '<span class="home"><i class="x-icon-home"></i></span>'; // 2
331
+                $home_link = home_url(); // 3
332
+                $current_before = '<span class="current">'; // 4
333
+                $current_after = '</span>'; // 5
334
+                $page_title = get_the_title(); // 6
335
+                $blog_title = get_the_title(get_option('page_for_posts', true)); // 7
336
+                $shop_title = get_theme_mod('x_'.$stack.'_shop_title'); // 8
337 337
 
338 338
                 if (function_exists('woocommerce_get_page_id')) {
339 339
                     $shop_url = x_get_shop_link();
340
-                    $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>';
340
+                    $shop_link = '<a href="'.$shop_url.'">'.$shop_title.'</a>';
341 341
                 }
342 342
 
343 343
                 if (is_front_page()) {
344
-                    echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>';
344
+                    echo '<div class="x-breadcrumbs">'.$current_before.$home_text.$current_after.'</div>';
345 345
                 } elseif (is_home()) {
346
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>';
346
+                    echo '<div class="x-breadcrumbs"><a href="'.$home_link.'">'.$home_text.'</a>'.$delimiter.$current_before.$blog_title.$current_after.'</div>';
347 347
                 } else {
348
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
348
+                    echo '<div class="x-breadcrumbs"><a href="'.$home_link.'">'.$home_text.'</a>'.$delimiter;
349 349
                     if (is_category()) {
350 350
                         $the_cat = get_category(get_query_var('cat'), false);
351 351
                         if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter);
352
-                        echo $current_before . single_cat_title('', false) . $current_after;
352
+                        echo $current_before.single_cat_title('', false).$current_after;
353 353
                     } elseif (x_is_product_category()) {
354
-                        echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after;
354
+                        echo $shop_link.$delimiter.$current_before.single_cat_title('', false).$current_after;
355 355
                     } elseif (x_is_product_tag()) {
356
-                        echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after;
356
+                        echo $shop_link.$delimiter.$current_before.single_tag_title('', false).$current_after;
357 357
                     } elseif (is_search()) {
358
-                        echo $current_before . __('Search Results for ', '__x__') . '&#8220;' . get_search_query() . '&#8221;' . $current_after;
358
+                        echo $current_before.__('Search Results for ', '__x__').'&#8220;'.get_search_query().'&#8221;'.$current_after;
359 359
                     } elseif (is_singular('post')) {
360 360
                         if (get_option('page_for_posts') == is_front_page()) {
361
-                            echo $current_before . $page_title . $current_after;
361
+                            echo $current_before.$page_title.$current_after;
362 362
                         } else {
363
-                            echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
363
+                            echo '<a href="'.get_permalink(get_option('page_for_posts')).'" title="'.esc_attr(__('See All Posts', '__x__')).'">'.$blog_title.'</a>'.$delimiter.$current_before.$page_title.$current_after;
364 364
                         }
365 365
                     } elseif (x_is_portfolio()) {
366
-                        echo $current_before . get_the_title() . $current_after;
366
+                        echo $current_before.get_the_title().$current_after;
367 367
                     } elseif (x_is_portfolio_item()) {
368 368
                         $link = x_get_parent_portfolio_link();
369 369
                         $title = x_get_parent_portfolio_title();
370
-                        echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
370
+                        echo '<a href="'.$link.'" title="'.esc_attr(__('See All Posts', '__x__')).'">'.$title.'</a>'.$delimiter.$current_before.$page_title.$current_after;
371 371
                     } elseif (x_is_product()) {
372
-                        echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
372
+                        echo $shop_link.$delimiter.$current_before.$page_title.$current_after;
373 373
                     } elseif (is_page() && !$post->post_parent) {
374
-                        echo $current_before . $page_title . $current_after;
374
+                        echo $current_before.$page_title.$current_after;
375 375
                     } elseif (is_page() && $post->post_parent) {
376 376
                         $parent_id = $post->post_parent;
377 377
                         $breadcrumbs = array();
378 378
                         while ($parent_id) {
379 379
                             $page = get_page($parent_id);
380
-                            $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
380
+                            $breadcrumbs[] = '<a href="'.get_permalink($page->ID).'">'.get_the_title($page->ID).'</a>';
381 381
                             $parent_id = $page->post_parent;
382 382
                         }
383 383
                         $breadcrumbs = array_reverse($breadcrumbs);
@@ -385,24 +385,24 @@  discard block
 block discarded – undo
385 385
                             echo $breadcrumbs[$i];
386 386
                             if ($i != count($breadcrumbs) - 1) echo $delimiter;
387 387
                         }
388
-                        echo $delimiter . $current_before . $page_title . $current_after;
388
+                        echo $delimiter.$current_before.$page_title.$current_after;
389 389
                     } elseif (is_tag()) {
390
-                        echo $current_before . single_tag_title('', false) . $current_after;
390
+                        echo $current_before.single_tag_title('', false).$current_after;
391 391
                     } elseif (is_author()) {
392 392
                         GLOBAL $author;
393 393
                         $userdata = get_userdata($author);
394
-                        echo $current_before . __('Posts by ', '__x__') . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';
394
+                        echo $current_before.__('Posts by ', '__x__').'&#8220;'.$userdata->display_name.$current_after.'&#8221;';
395 395
                     } elseif (is_404()) {
396
-                        echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after;
396
+                        echo $current_before.__('404 (Page Not Found)', '__x__').$current_after;
397 397
                     } elseif (is_archive()) {
398 398
                         if (x_is_shop()) {
399
-                            echo $current_before . $shop_title . $current_after;
399
+                            echo $current_before.$shop_title.$current_after;
400 400
                         } else {
401
-                            echo $current_before . __('Archives ', '__x__') . $current_after;
401
+                            echo $current_before.__('Archives ', '__x__').$current_after;
402 402
                         }
403 403
                     }
404 404
                     if (get_query_var('paged')) {
405
-                        echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>';
405
+                        echo ' <span class="current" style="white-space: nowrap;">('.__('Page', '__x__').' '.get_query_var('paged').')</span>';
406 406
                     }
407 407
                     echo '</div>';
408 408
                 }
Please login to merge, or discard this patch.
Indentation   +218 added lines, -218 removed lines patch added patch discarded remove patch
@@ -22,60 +22,60 @@  discard block
 block discarded – undo
22 22
 function geodir_x_action_calls()
23 23
 {
24 24
 
25
-    /* ACTIONS
25
+	/* ACTIONS
26 26
     ****************************************************************************************/
27 27
 
28
-    // Add body class for styling purposes
29
-    add_filter('body_class', 'geodir_x_body_class');
28
+	// Add body class for styling purposes
29
+	add_filter('body_class', 'geodir_x_body_class');
30 30
 
31
-    // HOME TOP SIDEBAR
32
-    //remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
33
-    //remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
34
-    //add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 );
35
-    add_action('geodir_before_search_form', 'geodir_x_search_container_open');
36
-    add_action('geodir_after_search_form', 'geodir_x_search_container_close');
31
+	// HOME TOP SIDEBAR
32
+	//remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
33
+	//remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 );
34
+	//add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 );
35
+	add_action('geodir_before_search_form', 'geodir_x_search_container_open');
36
+	add_action('geodir_after_search_form', 'geodir_x_search_container_close');
37 37
 
38
-    // WRAPPER OPEN ACTIONS
39
-    remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10);
40
-    add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9);
38
+	// WRAPPER OPEN ACTIONS
39
+	remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10);
40
+	add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9);
41 41
 
42
-    // WRAPPER CLOSE ACTIONS
43
-    remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10);
44
-    add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11);
42
+	// WRAPPER CLOSE ACTIONS
43
+	remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10);
44
+	add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11);
45 45
 
46
-    // WRAPPER CONTENT OPEN ACTIONS
47
-    remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10);
48
-    add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3);
46
+	// WRAPPER CONTENT OPEN ACTIONS
47
+	remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10);
48
+	add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3);
49 49
 
50
-    // WRAPPER CONTENT CLOSE ACTIONS
51
-    remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10);
52
-    add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11);
50
+	// WRAPPER CONTENT CLOSE ACTIONS
51
+	remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10);
52
+	add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11);
53 53
 
54
-    // SIDEBAR RIGHT OPEN ACTIONS
55
-    remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10);
56
-    add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4);
54
+	// SIDEBAR RIGHT OPEN ACTIONS
55
+	remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10);
56
+	add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4);
57 57
 
58
-    // SIDEBAR RIGHT CLOSE ACTIONS
59
-    remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10);
60
-    add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1);
58
+	// SIDEBAR RIGHT CLOSE ACTIONS
59
+	remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10);
60
+	add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1);
61 61
 
62
-    // REMOVE BREADCRUMBS
63
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
64
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
65
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
66
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
67
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
68
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
62
+	// REMOVE BREADCRUMBS
63
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
64
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
65
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
66
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
67
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
68
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
69 69
 
70
-    // make top section wide
71
-    remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
72
-    remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
73
-    remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
74
-    remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
75
-    remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
76
-    remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
70
+	// make top section wide
71
+	remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
72
+	remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
73
+	remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
74
+	remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
75
+	remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
76
+	remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
77 77
 
78
-    add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5);
78
+	add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5);
79 79
 
80 80
 
81 81
 } // Close geodir_x_action_calls
@@ -92,17 +92,17 @@  discard block
 block discarded – undo
92 92
 function gd_X_compat_add_top_section_back()
93 93
 {
94 94
 
95
-    if (is_page_geodir_home() || geodir_is_page('location') || geodir_is_page('home')) {
96
-        geodir_action_geodir_sidebar_home_top();
97
-    } elseif (geodir_is_page('listing')) {
98
-        geodir_action_geodir_sidebar_listings_top();
99
-    } elseif (geodir_is_page('detail')) {
100
-        geodir_action_geodir_sidebar_detail_top();
101
-    } elseif (geodir_is_page('search')) {
102
-        geodir_action_geodir_sidebar_search_top();
103
-    } elseif (geodir_is_page('author')) {
104
-        geodir_action_geodir_sidebar_author_top();
105
-    }
95
+	if (is_page_geodir_home() || geodir_is_page('location') || geodir_is_page('home')) {
96
+		geodir_action_geodir_sidebar_home_top();
97
+	} elseif (geodir_is_page('listing')) {
98
+		geodir_action_geodir_sidebar_listings_top();
99
+	} elseif (geodir_is_page('detail')) {
100
+		geodir_action_geodir_sidebar_detail_top();
101
+	} elseif (geodir_is_page('search')) {
102
+		geodir_action_geodir_sidebar_search_top();
103
+	} elseif (geodir_is_page('author')) {
104
+		geodir_action_geodir_sidebar_author_top();
105
+	}
106 106
 
107 107
 
108 108
 }
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
  */
121 121
 function geodir_x_body_class($classes)
122 122
 {
123
-    $classes[] = 'geodir-x';
123
+	$classes[] = 'geodir-x';
124 124
 
125
-    if(isset($_REQUEST['geodir_search'])){
126
-        $classes[] = 'geodir-x-search';
127
-    }
128
-    return $classes;
125
+	if(isset($_REQUEST['geodir_search'])){
126
+		$classes[] = 'geodir-x-search';
127
+	}
128
+	return $classes;
129 129
 }
130 130
 
131 131
 /**
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
  */
138 138
 function geodir_x_home_sidebar()
139 139
 {
140
-    //if ( geodir_is_geodir_page() ) {
141
-    global $wp;
142
-    if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) {
143
-        echo '<div class="x-main full">';
144
-        dynamic_sidebar('geodir_home_top');
145
-        echo '</div>';
146
-    }
147
-    //}
140
+	//if ( geodir_is_geodir_page() ) {
141
+	global $wp;
142
+	if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) {
143
+		echo '<div class="x-main full">';
144
+		dynamic_sidebar('geodir_home_top');
145
+		echo '</div>';
146
+	}
147
+	//}
148 148
 }
149 149
 
150 150
 /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
  */
156 156
 function geodir_x_search_container_open()
157 157
 {
158
-    echo '<div class="x-container-fluid x-container max">';
158
+	echo '<div class="x-container-fluid x-container max">';
159 159
 }
160 160
 
161 161
 /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
  */
167 167
 function geodir_x_search_container_close()
168 168
 {
169
-    echo '</div>';
169
+	echo '</div>';
170 170
 }
171 171
 
172 172
 /**
@@ -177,19 +177,19 @@  discard block
 block discarded – undo
177 177
  */
178 178
 function geodir_x_action_wrapper_open()
179 179
 {
180
-    $stack = x_get_stack();
181
-
182
-    if ($stack == 'integrity') {
183
-        echo '<div class="x-container-fluid x-container max width offset">';
184
-    } elseif ($stack == 'renew') {
185
-        echo '<div class="x-container-fluid x-container max width offset cf">';
186
-    } elseif ($stack == 'icon') {
187
-        echo '<div class="x-main full" role="main">';
188
-    } elseif ($stack == 'ethos') {
189
-        echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">';
190
-    }else{
191
-        echo '<div class="x-container max width offset">';
192
-    }
180
+	$stack = x_get_stack();
181
+
182
+	if ($stack == 'integrity') {
183
+		echo '<div class="x-container-fluid x-container max width offset">';
184
+	} elseif ($stack == 'renew') {
185
+		echo '<div class="x-container-fluid x-container max width offset cf">';
186
+	} elseif ($stack == 'icon') {
187
+		echo '<div class="x-main full" role="main">';
188
+	} elseif ($stack == 'ethos') {
189
+		echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">';
190
+	}else{
191
+		echo '<div class="x-container max width offset">';
192
+	}
193 193
 }
194 194
 
195 195
 /**
@@ -200,12 +200,12 @@  discard block
 block discarded – undo
200 200
  */
201 201
 function geodir_x_action_wrapper_close()
202 202
 {
203
-    $stack = x_get_stack();
204
-    if ($stack == 'ethos') {
205
-        echo '</div></div>';
206
-    } else {
207
-        echo '</div>';
208
-    }
203
+	$stack = x_get_stack();
204
+	if ($stack == 'ethos') {
205
+		echo '</div></div>';
206
+	} else {
207
+		echo '</div>';
208
+	}
209 209
 }
210 210
 
211 211
 /**
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
  */
220 220
 function geodir_x_action_wrapper_content_open($type = '', $id = '', $class = '')
221 221
 {
222
-    $content_class = ' entry-wrap ';
222
+	$content_class = ' entry-wrap ';
223 223
 
224
-    echo '<div class="x-main left ' . $class . $content_class . ' " role="main">';
224
+	echo '<div class="x-main left ' . $class . $content_class . ' " role="main">';
225 225
 }
226 226
 
227 227
 /**
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
  */
233 233
 function geodir_x_action_wrapper_content_close()
234 234
 {
235
-    echo '</div>';
235
+	echo '</div>';
236 236
 }
237 237
 
238 238
 /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_x_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
249 249
 {
250
-    echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">';
250
+	echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">';
251 251
 }
252 252
 
253 253
 /**
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
  */
260 260
 function geodir_x_action_sidebar_right_close($type = '')
261 261
 {
262
-    echo '</aside>';
262
+	echo '</aside>';
263 263
 }
264 264
 
265 265
 add_filter('geodir_breadcrumb', 'geodir_x_breadcrumb');
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
  */
274 274
 function geodir_x_breadcrumb($breadcrumb)
275 275
 {
276
-    $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb);
277
-    $breadcrumb = str_replace('<li>', '', $breadcrumb);
278
-    $breadcrumb = str_replace('</li>', '', $breadcrumb);
279
-    $breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb);
280
-    $breadcrumb = str_replace('</ul></div>', '', $breadcrumb);
281
-    return $breadcrumb;
276
+	$breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb);
277
+	$breadcrumb = str_replace('<li>', '', $breadcrumb);
278
+	$breadcrumb = str_replace('</li>', '', $breadcrumb);
279
+	$breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb);
280
+	$breadcrumb = str_replace('</ul></div>', '', $breadcrumb);
281
+	return $breadcrumb;
282 282
 }
283 283
 
284 284
 add_filter('geodir_breadcrumb_separator', 'geodir_x_breadcrumb_separator');
@@ -292,125 +292,125 @@  discard block
 block discarded – undo
292 292
  */
293 293
 function geodir_x_breadcrumb_separator($separator)
294 294
 {
295
-    $separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator);
296
-    return $separator;
295
+	$separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator);
296
+	return $separator;
297 297
 }
298 298
 
299 299
 if (!function_exists('x_breadcrumbs')) :
300
-    /**
301
-     * breadcrumbs.
302
-     *
303
-     * @since 1.0.0
304
-     * @package GeoDirectory
305
-     */
306
-    function x_breadcrumbs()
307
-    {
308
-
309
-        if (x_get_option('x_breadcrumb_display', '1')) {
310
-
311
-            //
312
-            // 1. Delimiter between crumbs.
313
-            // 2. Output text for the "Home" link.
314
-            // 3. Link to the home page.
315
-            // 4. Tag before the current crumb.
316
-            // 5. Tag after the current crumb.
317
-            // 6. Get page title.
318
-            // 7. Get blog title.
319
-            // 8. Get shop title.
320
-            //
321
-
322
-            GLOBAL $post,$wp;
323
-
324
-            if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) {
325
-                geodir_breadcrumb();
326
-            } else {
327
-
328
-                $stack = x_get_stack();
329
-                $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1
330
-                $home_text = '<span class="home"><i class="x-icon-home"></i></span>';               // 2
331
-                $home_link = home_url();                                                            // 3
332
-                $current_before = '<span class="current">';                                              // 4
333
-                $current_after = '</span>';                                                             // 5
334
-                $page_title = get_the_title();                                                       // 6
335
-                $blog_title = get_the_title(get_option('page_for_posts', true));                 // 7
336
-                $shop_title = get_theme_mod('x_' . $stack . '_shop_title');                        // 8
337
-
338
-                if (function_exists('woocommerce_get_page_id')) {
339
-                    $shop_url = x_get_shop_link();
340
-                    $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>';
341
-                }
342
-
343
-                if (is_front_page()) {
344
-                    echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>';
345
-                } elseif (is_home()) {
346
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>';
347
-                } else {
348
-                    echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
349
-                    if (is_category()) {
350
-                        $the_cat = get_category(get_query_var('cat'), false);
351
-                        if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter);
352
-                        echo $current_before . single_cat_title('', false) . $current_after;
353
-                    } elseif (x_is_product_category()) {
354
-                        echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after;
355
-                    } elseif (x_is_product_tag()) {
356
-                        echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after;
357
-                    } elseif (is_search()) {
358
-                        echo $current_before . __('Search Results for ', '__x__') . '&#8220;' . get_search_query() . '&#8221;' . $current_after;
359
-                    } elseif (is_singular('post')) {
360
-                        if (get_option('page_for_posts') == is_front_page()) {
361
-                            echo $current_before . $page_title . $current_after;
362
-                        } else {
363
-                            echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
364
-                        }
365
-                    } elseif (x_is_portfolio()) {
366
-                        echo $current_before . get_the_title() . $current_after;
367
-                    } elseif (x_is_portfolio_item()) {
368
-                        $link = x_get_parent_portfolio_link();
369
-                        $title = x_get_parent_portfolio_title();
370
-                        echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
371
-                    } elseif (x_is_product()) {
372
-                        echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
373
-                    } elseif (is_page() && !$post->post_parent) {
374
-                        echo $current_before . $page_title . $current_after;
375
-                    } elseif (is_page() && $post->post_parent) {
376
-                        $parent_id = $post->post_parent;
377
-                        $breadcrumbs = array();
378
-                        while ($parent_id) {
379
-                            $page = get_page($parent_id);
380
-                            $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
381
-                            $parent_id = $page->post_parent;
382
-                        }
383
-                        $breadcrumbs = array_reverse($breadcrumbs);
384
-                        for ($i = 0; $i < count($breadcrumbs); $i++) {
385
-                            echo $breadcrumbs[$i];
386
-                            if ($i != count($breadcrumbs) - 1) echo $delimiter;
387
-                        }
388
-                        echo $delimiter . $current_before . $page_title . $current_after;
389
-                    } elseif (is_tag()) {
390
-                        echo $current_before . single_tag_title('', false) . $current_after;
391
-                    } elseif (is_author()) {
392
-                        GLOBAL $author;
393
-                        $userdata = get_userdata($author);
394
-                        echo $current_before . __('Posts by ', '__x__') . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';
395
-                    } elseif (is_404()) {
396
-                        echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after;
397
-                    } elseif (is_archive()) {
398
-                        if (x_is_shop()) {
399
-                            echo $current_before . $shop_title . $current_after;
400
-                        } else {
401
-                            echo $current_before . __('Archives ', '__x__') . $current_after;
402
-                        }
403
-                    }
404
-                    if (get_query_var('paged')) {
405
-                        echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>';
406
-                    }
407
-                    echo '</div>';
408
-                }
409
-
410
-            }
411
-
412
-        }
413
-    } // ends my geodir check
300
+	/**
301
+	 * breadcrumbs.
302
+	 *
303
+	 * @since 1.0.0
304
+	 * @package GeoDirectory
305
+	 */
306
+	function x_breadcrumbs()
307
+	{
308
+
309
+		if (x_get_option('x_breadcrumb_display', '1')) {
310
+
311
+			//
312
+			// 1. Delimiter between crumbs.
313
+			// 2. Output text for the "Home" link.
314
+			// 3. Link to the home page.
315
+			// 4. Tag before the current crumb.
316
+			// 5. Tag after the current crumb.
317
+			// 6. Get page title.
318
+			// 7. Get blog title.
319
+			// 8. Get shop title.
320
+			//
321
+
322
+			GLOBAL $post,$wp;
323
+
324
+			if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) {
325
+				geodir_breadcrumb();
326
+			} else {
327
+
328
+				$stack = x_get_stack();
329
+				$delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1
330
+				$home_text = '<span class="home"><i class="x-icon-home"></i></span>';               // 2
331
+				$home_link = home_url();                                                            // 3
332
+				$current_before = '<span class="current">';                                              // 4
333
+				$current_after = '</span>';                                                             // 5
334
+				$page_title = get_the_title();                                                       // 6
335
+				$blog_title = get_the_title(get_option('page_for_posts', true));                 // 7
336
+				$shop_title = get_theme_mod('x_' . $stack . '_shop_title');                        // 8
337
+
338
+				if (function_exists('woocommerce_get_page_id')) {
339
+					$shop_url = x_get_shop_link();
340
+					$shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>';
341
+				}
342
+
343
+				if (is_front_page()) {
344
+					echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>';
345
+				} elseif (is_home()) {
346
+					echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>';
347
+				} else {
348
+					echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
349
+					if (is_category()) {
350
+						$the_cat = get_category(get_query_var('cat'), false);
351
+						if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter);
352
+						echo $current_before . single_cat_title('', false) . $current_after;
353
+					} elseif (x_is_product_category()) {
354
+						echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after;
355
+					} elseif (x_is_product_tag()) {
356
+						echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after;
357
+					} elseif (is_search()) {
358
+						echo $current_before . __('Search Results for ', '__x__') . '&#8220;' . get_search_query() . '&#8221;' . $current_after;
359
+					} elseif (is_singular('post')) {
360
+						if (get_option('page_for_posts') == is_front_page()) {
361
+							echo $current_before . $page_title . $current_after;
362
+						} else {
363
+							echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
364
+						}
365
+					} elseif (x_is_portfolio()) {
366
+						echo $current_before . get_the_title() . $current_after;
367
+					} elseif (x_is_portfolio_item()) {
368
+						$link = x_get_parent_portfolio_link();
369
+						$title = x_get_parent_portfolio_title();
370
+						echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
371
+					} elseif (x_is_product()) {
372
+						echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
373
+					} elseif (is_page() && !$post->post_parent) {
374
+						echo $current_before . $page_title . $current_after;
375
+					} elseif (is_page() && $post->post_parent) {
376
+						$parent_id = $post->post_parent;
377
+						$breadcrumbs = array();
378
+						while ($parent_id) {
379
+							$page = get_page($parent_id);
380
+							$breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
381
+							$parent_id = $page->post_parent;
382
+						}
383
+						$breadcrumbs = array_reverse($breadcrumbs);
384
+						for ($i = 0; $i < count($breadcrumbs); $i++) {
385
+							echo $breadcrumbs[$i];
386
+							if ($i != count($breadcrumbs) - 1) echo $delimiter;
387
+						}
388
+						echo $delimiter . $current_before . $page_title . $current_after;
389
+					} elseif (is_tag()) {
390
+						echo $current_before . single_tag_title('', false) . $current_after;
391
+					} elseif (is_author()) {
392
+						GLOBAL $author;
393
+						$userdata = get_userdata($author);
394
+						echo $current_before . __('Posts by ', '__x__') . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';
395
+					} elseif (is_404()) {
396
+						echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after;
397
+					} elseif (is_archive()) {
398
+						if (x_is_shop()) {
399
+							echo $current_before . $shop_title . $current_after;
400
+						} else {
401
+							echo $current_before . __('Archives ', '__x__') . $current_after;
402
+						}
403
+					}
404
+					if (get_query_var('paged')) {
405
+						echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>';
406
+					}
407
+					echo '</div>';
408
+				}
409
+
410
+			}
411
+
412
+		}
413
+	} // ends my geodir check
414 414
 endif;
415 415
 
416 416
 
@@ -425,8 +425,8 @@  discard block
 block discarded – undo
425 425
  */
426 426
 function geodir_x_location_switcher_menu_li_class($class)
427 427
 {
428
-    $class .= " menu-item-has-children ";
429
-    return $class;
428
+	$class .= " menu-item-has-children ";
429
+	return $class;
430 430
 }
431 431
 
432 432
 add_filter('geodir_sub_menu_li_class', 'geodir_x_sub_menu_li_class', 10, 1);
@@ -440,6 +440,6 @@  discard block
 block discarded – undo
440 440
  */
441 441
 function geodir_x_sub_menu_li_class($class)
442 442
 {
443
-    $class .= " menu-item-has-children ";
444
-    return $class;
443
+	$class .= " menu-item-has-children ";
444
+	return $class;
445 445
 }
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Kleo.php 3 patches
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 
11 11
 // Page titles translatable CPT names
12 12
 function geodir_kelo_title_translation( $args) {
13
-    if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14
-        $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
-    }elseif(function_exists('geodir_is_geodir_page')){
16
-        $args['title'] = __($args['title'],'geodirectory');
17
-    }
13
+	if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14
+		$args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
+	}elseif(function_exists('geodir_is_geodir_page')){
16
+		$args['title'] = __($args['title'],'geodirectory');
17
+	}
18 18
 
19
-    return $args;
19
+	return $args;
20 20
 }
21 21
 add_filter( 'kleo_title_args', 'geodir_kelo_title_translation', 10, 1 );
22 22
 
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
  * @return object Modified query object.
32 32
  */
33 33
 function geodir_kleo_search_filter( $query ) {
34
-    if ( !empty( $query->is_search ) && geodir_is_page('search') && is_search() ) {
35
-        $query->set( 'post_type', 'any' );
36
-    }
37
-    return $query;
34
+	if ( !empty( $query->is_search ) && geodir_is_page('search') && is_search() ) {
35
+		$query->set( 'post_type', 'any' );
36
+	}
37
+	return $query;
38 38
 }
39 39
 if ( !is_admin() ) {
40
-    add_filter( 'pre_get_posts', 'geodir_kleo_search_filter', 11 );
40
+	add_filter( 'pre_get_posts', 'geodir_kleo_search_filter', 11 );
41 41
 }
42 42
 
43 43
 if( ! function_exists( 'kleo_title' ) ){
44
-    function kleo_title(){ return geodir_kleo_custom_the_title();}
44
+	function kleo_title(){ return geodir_kleo_custom_the_title();}
45 45
 }
46 46
 
47 47
 /**
@@ -53,109 +53,109 @@  discard block
 block discarded – undo
53 53
 function geodir_kleo_custom_the_title()
54 54
 {
55 55
 
56
-    $output = '';
57
-    if (is_tag()) {
58
-        $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
59
-    }
60
-    elseif(is_tax()) {
61
-        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62
-        $output = $term->name;
63
-    }
64
-    elseif ( is_category() ) {
65
-        $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
66
-    }
67
-    elseif (is_day())
68
-    {
69
-        $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
70
-    }
71
-    elseif (is_month())
72
-    {
73
-        $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
74
-    }
75
-    elseif (is_year())
76
-    {
77
-        $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
78
-    }
79
-    elseif (is_author())  {
80
-        $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81
-        $output = __('Author Archive','kleo_framework')." ";
82
-
83
-        if( isset( $curauth->nickname ) ) {
84
-            $output .= __('for:','kleo_framework')." ".$curauth->nickname;
85
-        }
86
-    }
87
-    elseif ( is_archive() )  {
88
-        $output = post_type_archive_title( '', false );
89
-    }
90
-    elseif (is_search())
91
-    {
92
-        global $wp_query;
93
-        if(!empty($wp_query->found_posts))
94
-        {
95
-            if($wp_query->found_posts > 1)
96
-            {
97
-                $output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
98
-            }
99
-            else
100
-            {
101
-                $output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
102
-            }
103
-        }
104
-        else
105
-        {
106
-            if(!empty($_GET['s']))
107
-            {
108
-                $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
109
-            }
110
-            else
111
-            {
112
-                $output = __('To search the site please enter a valid term','kleo_framework');
113
-            }
114
-        }
115
-
116
-    }
117
-    elseif ( is_front_page() && !is_home() ) {
118
-        $output = get_the_title(get_option('page_on_front'));
119
-
120
-    } elseif ( is_home() ) {
121
-        if (get_option('page_for_posts')) {
122
-            $output = get_the_title(get_option('page_for_posts'));
123
-        } else {
124
-            $output = __( 'Blog', 'kleo_framework' );
125
-        }
126
-
127
-    } elseif ( is_404() ) {
128
-        $output = __('Error 404 - Page not found','kleo_framework');
129
-    }
130
-    else {
131
-        $output = get_the_title();
132
-    }
133
-
134
-    if (isset($_GET['paged']) && !empty($_GET['paged']))
135
-    {
136
-        $output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")";
137
-    }
138
-
139
-
140
-    $gd_page = '';
141
-    if(geodir_is_page('pt')){
142
-        $gd_page = 'pt';
143
-        $output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144
-    }
145
-    elseif(geodir_is_page('listing')){
146
-        $gd_page = 'listing';
147
-        $output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148
-    }
149
-
150
-
151
-
152
-    /**
153
-     * Filter page meta title to replace variables.
154
-     *
155
-     * @since 1.5.4
156
-     * @param string $title The page title including variables.
157
-     * @param string $gd_page The GeoDirectory page type if any.
158
-     */
159
-    return apply_filters('geodir_seo_meta_title', __($output, 'geodirectory'), $gd_page);
56
+	$output = '';
57
+	if (is_tag()) {
58
+		$output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
59
+	}
60
+	elseif(is_tax()) {
61
+		$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62
+		$output = $term->name;
63
+	}
64
+	elseif ( is_category() ) {
65
+		$output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
66
+	}
67
+	elseif (is_day())
68
+	{
69
+		$output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
70
+	}
71
+	elseif (is_month())
72
+	{
73
+		$output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
74
+	}
75
+	elseif (is_year())
76
+	{
77
+		$output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
78
+	}
79
+	elseif (is_author())  {
80
+		$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81
+		$output = __('Author Archive','kleo_framework')." ";
82
+
83
+		if( isset( $curauth->nickname ) ) {
84
+			$output .= __('for:','kleo_framework')." ".$curauth->nickname;
85
+		}
86
+	}
87
+	elseif ( is_archive() )  {
88
+		$output = post_type_archive_title( '', false );
89
+	}
90
+	elseif (is_search())
91
+	{
92
+		global $wp_query;
93
+		if(!empty($wp_query->found_posts))
94
+		{
95
+			if($wp_query->found_posts > 1)
96
+			{
97
+				$output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
98
+			}
99
+			else
100
+			{
101
+				$output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
102
+			}
103
+		}
104
+		else
105
+		{
106
+			if(!empty($_GET['s']))
107
+			{
108
+				$output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
109
+			}
110
+			else
111
+			{
112
+				$output = __('To search the site please enter a valid term','kleo_framework');
113
+			}
114
+		}
115
+
116
+	}
117
+	elseif ( is_front_page() && !is_home() ) {
118
+		$output = get_the_title(get_option('page_on_front'));
119
+
120
+	} elseif ( is_home() ) {
121
+		if (get_option('page_for_posts')) {
122
+			$output = get_the_title(get_option('page_for_posts'));
123
+		} else {
124
+			$output = __( 'Blog', 'kleo_framework' );
125
+		}
126
+
127
+	} elseif ( is_404() ) {
128
+		$output = __('Error 404 - Page not found','kleo_framework');
129
+	}
130
+	else {
131
+		$output = get_the_title();
132
+	}
133
+
134
+	if (isset($_GET['paged']) && !empty($_GET['paged']))
135
+	{
136
+		$output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")";
137
+	}
138
+
139
+
140
+	$gd_page = '';
141
+	if(geodir_is_page('pt')){
142
+		$gd_page = 'pt';
143
+		$output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144
+	}
145
+	elseif(geodir_is_page('listing')){
146
+		$gd_page = 'listing';
147
+		$output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148
+	}
149
+
150
+
151
+
152
+	/**
153
+	 * Filter page meta title to replace variables.
154
+	 *
155
+	 * @since 1.5.4
156
+	 * @param string $title The page title including variables.
157
+	 * @param string $gd_page The GeoDirectory page type if any.
158
+	 */
159
+	return apply_filters('geodir_seo_meta_title', __($output, 'geodirectory'), $gd_page);
160 160
 
161 161
 }
162 162
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Page titles translatable CPT names
12
-function geodir_kelo_title_translation( $args) {
13
-    if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14
-        $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
-    }elseif(function_exists('geodir_is_geodir_page')){
16
-        $args['title'] = __($args['title'],'geodirectory');
12
+function geodir_kelo_title_translation($args) {
13
+    if (function_exists('geodir_is_geodir_page') && geodir_is_page('preview')) {
14
+        $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])), 'geodirectory');
15
+    }elseif (function_exists('geodir_is_geodir_page')) {
16
+        $args['title'] = __($args['title'], 'geodirectory');
17 17
     }
18 18
 
19 19
     return $args;
20 20
 }
21
-add_filter( 'kleo_title_args', 'geodir_kelo_title_translation', 10, 1 );
21
+add_filter('kleo_title_args', 'geodir_kelo_title_translation', 10, 1);
22 22
 
23 23
 /**
24 24
  * Fix search returns all the posts for Kleo theme.
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
  * @param object $query Current query object.
31 31
  * @return object Modified query object.
32 32
  */
33
-function geodir_kleo_search_filter( $query ) {
34
-    if ( !empty( $query->is_search ) && geodir_is_page('search') && is_search() ) {
35
-        $query->set( 'post_type', 'any' );
33
+function geodir_kleo_search_filter($query) {
34
+    if (!empty($query->is_search) && geodir_is_page('search') && is_search()) {
35
+        $query->set('post_type', 'any');
36 36
     }
37 37
     return $query;
38 38
 }
39
-if ( !is_admin() ) {
40
-    add_filter( 'pre_get_posts', 'geodir_kleo_search_filter', 11 );
39
+if (!is_admin()) {
40
+    add_filter('pre_get_posts', 'geodir_kleo_search_filter', 11);
41 41
 }
42 42
 
43
-if( ! function_exists( 'kleo_title' ) ){
44
-    function kleo_title(){ return geodir_kleo_custom_the_title();}
43
+if (!function_exists('kleo_title')) {
44
+    function kleo_title() { return geodir_kleo_custom_the_title(); }
45 45
 }
46 46
 
47 47
 /**
@@ -55,77 +55,77 @@  discard block
 block discarded – undo
55 55
 
56 56
     $output = '';
57 57
     if (is_tag()) {
58
-        $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
58
+        $output = __('Tag Archive for:', 'kleo_framework')." ".single_tag_title('', false);
59 59
     }
60
-    elseif(is_tax()) {
60
+    elseif (is_tax()) {
61 61
         $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62 62
         $output = $term->name;
63 63
     }
64
-    elseif ( is_category() ) {
65
-        $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
64
+    elseif (is_category()) {
65
+        $output = __('Archive for category:', 'kleo_framework')." ".single_cat_title('', false);
66 66
     }
67 67
     elseif (is_day())
68 68
     {
69
-        $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
69
+        $output = __('Archive for date:', 'kleo_framework')." ".get_the_time('F jS, Y');
70 70
     }
71 71
     elseif (is_month())
72 72
     {
73
-        $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
73
+        $output = __('Archive for month:', 'kleo_framework')." ".get_the_time('F, Y');
74 74
     }
75 75
     elseif (is_year())
76 76
     {
77
-        $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
77
+        $output = __('Archive for year:', 'kleo_framework')." ".get_the_time('Y');
78 78
     }
79
-    elseif (is_author())  {
79
+    elseif (is_author()) {
80 80
         $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81
-        $output = __('Author Archive','kleo_framework')." ";
81
+        $output = __('Author Archive', 'kleo_framework')." ";
82 82
 
83
-        if( isset( $curauth->nickname ) ) {
84
-            $output .= __('for:','kleo_framework')." ".$curauth->nickname;
83
+        if (isset($curauth->nickname)) {
84
+            $output .= __('for:', 'kleo_framework')." ".$curauth->nickname;
85 85
         }
86 86
     }
87
-    elseif ( is_archive() )  {
88
-        $output = post_type_archive_title( '', false );
87
+    elseif (is_archive()) {
88
+        $output = post_type_archive_title('', false);
89 89
     }
90 90
     elseif (is_search())
91 91
     {
92 92
         global $wp_query;
93
-        if(!empty($wp_query->found_posts))
93
+        if (!empty($wp_query->found_posts))
94 94
         {
95
-            if($wp_query->found_posts > 1)
95
+            if ($wp_query->found_posts > 1)
96 96
             {
97
-                $output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
97
+                $output = $wp_query->found_posts." ".__('search results for:', 'kleo_framework')." ".esc_attr(get_search_query());
98 98
             }
99 99
             else
100 100
             {
101
-                $output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
101
+                $output = $wp_query->found_posts." ".__('search result for:', 'kleo_framework')." ".esc_attr(get_search_query());
102 102
             }
103 103
         }
104 104
         else
105 105
         {
106
-            if(!empty($_GET['s']))
106
+            if (!empty($_GET['s']))
107 107
             {
108
-                $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
108
+                $output = __('Search results for:', 'kleo_framework')." ".esc_attr(get_search_query());
109 109
             }
110 110
             else
111 111
             {
112
-                $output = __('To search the site please enter a valid term','kleo_framework');
112
+                $output = __('To search the site please enter a valid term', 'kleo_framework');
113 113
             }
114 114
         }
115 115
 
116 116
     }
117
-    elseif ( is_front_page() && !is_home() ) {
117
+    elseif (is_front_page() && !is_home()) {
118 118
         $output = get_the_title(get_option('page_on_front'));
119 119
 
120
-    } elseif ( is_home() ) {
120
+    } elseif (is_home()) {
121 121
         if (get_option('page_for_posts')) {
122 122
             $output = get_the_title(get_option('page_for_posts'));
123 123
         } else {
124
-            $output = __( 'Blog', 'kleo_framework' );
124
+            $output = __('Blog', 'kleo_framework');
125 125
         }
126 126
 
127
-    } elseif ( is_404() ) {
128
-        $output = __('Error 404 - Page not found','kleo_framework');
127
+    } elseif (is_404()) {
128
+        $output = __('Error 404 - Page not found', 'kleo_framework');
129 129
     }
130 130
     else {
131 131
         $output = get_the_title();
@@ -133,16 +133,16 @@  discard block
 block discarded – undo
133 133
 
134 134
     if (isset($_GET['paged']) && !empty($_GET['paged']))
135 135
     {
136
-        $output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")";
136
+        $output .= " (".__('Page', 'kleo_framework')." ".$_GET['paged'].")";
137 137
     }
138 138
 
139 139
 
140 140
     $gd_page = '';
141
-    if(geodir_is_page('pt')){
141
+    if (geodir_is_page('pt')) {
142 142
         $gd_page = 'pt';
143 143
         $output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144 144
     }
145
-    elseif(geodir_is_page('listing')){
145
+    elseif (geodir_is_page('listing')) {
146 146
         $gd_page = 'listing';
147 147
         $output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148 148
     }
Please login to merge, or discard this patch.
Braces   +15 added lines, -29 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 function geodir_kelo_title_translation( $args) {
13 13
     if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){
14 14
         $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory');
15
-    }elseif(function_exists('geodir_is_geodir_page')){
15
+    } elseif(function_exists('geodir_is_geodir_page')){
16 16
         $args['title'] = __($args['title'],'geodirectory');
17 17
     }
18 18
 
@@ -56,38 +56,30 @@  discard block
 block discarded – undo
56 56
     $output = '';
57 57
     if (is_tag()) {
58 58
         $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false);
59
-    }
60
-    elseif(is_tax()) {
59
+    } elseif(is_tax()) {
61 60
         $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
62 61
         $output = $term->name;
63
-    }
64
-    elseif ( is_category() ) {
62
+    } elseif ( is_category() ) {
65 63
         $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false);
66
-    }
67
-    elseif (is_day())
64
+    } elseif (is_day())
68 65
     {
69 66
         $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y');
70
-    }
71
-    elseif (is_month())
67
+    } elseif (is_month())
72 68
     {
73 69
         $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y');
74
-    }
75
-    elseif (is_year())
70
+    } elseif (is_year())
76 71
     {
77 72
         $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y');
78
-    }
79
-    elseif (is_author())  {
73
+    } elseif (is_author())  {
80 74
         $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
81 75
         $output = __('Author Archive','kleo_framework')." ";
82 76
 
83 77
         if( isset( $curauth->nickname ) ) {
84 78
             $output .= __('for:','kleo_framework')." ".$curauth->nickname;
85 79
         }
86
-    }
87
-    elseif ( is_archive() )  {
80
+    } elseif ( is_archive() )  {
88 81
         $output = post_type_archive_title( '', false );
89
-    }
90
-    elseif (is_search())
82
+    } elseif (is_search())
91 83
     {
92 84
         global $wp_query;
93 85
         if(!empty($wp_query->found_posts))
@@ -95,26 +87,22 @@  discard block
 block discarded – undo
95 87
             if($wp_query->found_posts > 1)
96 88
             {
97 89
                 $output =  $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() );
98
-            }
99
-            else
90
+            } else
100 91
             {
101 92
                 $output =  $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() );
102 93
             }
103
-        }
104
-        else
94
+        } else
105 95
         {
106 96
             if(!empty($_GET['s']))
107 97
             {
108 98
                 $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() );
109
-            }
110
-            else
99
+            } else
111 100
             {
112 101
                 $output = __('To search the site please enter a valid term','kleo_framework');
113 102
             }
114 103
         }
115 104
 
116
-    }
117
-    elseif ( is_front_page() && !is_home() ) {
105
+    } elseif ( is_front_page() && !is_home() ) {
118 106
         $output = get_the_title(get_option('page_on_front'));
119 107
 
120 108
     } elseif ( is_home() ) {
@@ -126,8 +114,7 @@  discard block
 block discarded – undo
126 114
 
127 115
     } elseif ( is_404() ) {
128 116
         $output = __('Error 404 - Page not found','kleo_framework');
129
-    }
130
-    else {
117
+    } else {
131 118
         $output = get_the_title();
132 119
     }
133 120
 
@@ -141,8 +128,7 @@  discard block
 block discarded – undo
141 128
     if(geodir_is_page('pt')){
142 129
         $gd_page = 'pt';
143 130
         $output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : '';
144
-    }
145
-    elseif(geodir_is_page('listing')){
131
+    } elseif(geodir_is_page('listing')){
146 132
         $gd_page = 'listing';
147 133
         $output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : '';
148 134
     }
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/wp-cli.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 * @param array $args
22 22
 	 * @param array $assoc_args
23 23
 	 */
24
-	public function count( $args, $assoc_args ) {
24
+	public function count($args, $assoc_args) {
25 25
 		$sessions = WP_Session_Utils::count_sessions();
26 26
 
27
-		\WP_CLI::line( sprintf( '%d sessions currently exist.', absint( $sessions ) ) );
27
+		\WP_CLI::line(sprintf('%d sessions currently exist.', absint($sessions)));
28 28
 	}
29 29
 
30 30
 	/**
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 	 * @param array $args
54 54
 	 * @param array $assoc_args
55 55
 	 */
56
-	public function delete( $args, $assoc_args ) {
57
-		if ( isset( $assoc_args['limit'] ) ) {
58
-			$limit = absint( $assoc_args['limit'] );
56
+	public function delete($args, $assoc_args) {
57
+		if (isset($assoc_args['limit'])) {
58
+			$limit = absint($assoc_args['limit']);
59 59
 
60
-			$count = WP_Session_Utils::delete_old_sessions( $limit );
60
+			$count = WP_Session_Utils::delete_old_sessions($limit);
61 61
 
62
-			if ( $count > 0 ) {
63
-				\WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );
62
+			if ($count > 0) {
63
+				\WP_CLI::line(sprintf('Deleted %d sessions.', $count));
64 64
 			}
65 65
 
66 66
 			// Clear memory
@@ -69,32 +69,32 @@  discard block
 block discarded – undo
69 69
 		}
70 70
 
71 71
 		// Determine if we're deleting all sessions or just a subset.
72
-		$all = isset( $assoc_args['all'] );
72
+		$all = isset($assoc_args['all']);
73 73
 
74 74
 		/**
75 75
 		 * Determine the size of each batch for deletion.
76 76
 		 *
77 77
 		 * @param int
78 78
 		 */
79
-		$batch = isset( $assoc_args['batch'] ) ? absint( $assoc_args['batch'] ) : apply_filters( 'wp_session_delete_batch_size', 1000 );
79
+		$batch = isset($assoc_args['batch']) ? absint($assoc_args['batch']) : apply_filters('wp_session_delete_batch_size', 1000);
80 80
 
81
-		switch ( $all ) {
81
+		switch ($all) {
82 82
 			case true:
83 83
 				$count = WP_Session_Utils::delete_all_sessions();
84 84
 
85
-				\WP_CLI::line( sprintf( 'Deleted all %d sessions.', $count ) );
85
+				\WP_CLI::line(sprintf('Deleted all %d sessions.', $count));
86 86
 				break;
87 87
 			case false:
88 88
 				do {
89
-					$count = WP_Session_Utils::delete_old_sessions( $batch );
89
+					$count = WP_Session_Utils::delete_old_sessions($batch);
90 90
 
91
-					if ( $count > 0 ) {
92
-						\WP_CLI::line( sprintf( 'Deleted %d sessions.', $count ) );
91
+					if ($count > 0) {
92
+						\WP_CLI::line(sprintf('Deleted %d sessions.', $count));
93 93
 					}
94 94
 
95 95
 					// Clear memory
96 96
 					self::free_up_memory();
97
-				} while ( $count > 0 );
97
+				} while ($count > 0);
98 98
 				break;
99 99
 		}
100 100
 	}
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 	 * @param array $args
121 121
 	 * @param array $assoc_args
122 122
 	 */
123
-	public function generate( $args, $assoc_args ) {
124
-		$count = absint( $args[0] );
125
-		$date  = isset( $assoc_args['expires'] ) ? $assoc_args['expires'] : null;
123
+	public function generate($args, $assoc_args) {
124
+		$count = absint($args[0]);
125
+		$date  = isset($assoc_args['expires']) ? $assoc_args['expires'] : null;
126 126
 
127
-		$notify = \WP_CLI\Utils\make_progress_bar( 'Generating sessions', $count );
127
+		$notify = \WP_CLI\Utils\make_progress_bar('Generating sessions', $count);
128 128
 
129
-		for ( $i = 0; $i < $count; $i ++ ) {
130
-			WP_Session_Utils::create_dummy_session( $date );
129
+		for ($i = 0; $i < $count; $i++) {
130
+			WP_Session_Utils::create_dummy_session($date);
131 131
 			$notify->tick();
132 132
 		}
133 133
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		global $wp_object_cache, $wpdb;
145 145
 		$wpdb->queries = array();
146 146
 
147
-		if ( ! is_object( $wp_object_cache ) ) {
147
+		if (!is_object($wp_object_cache)) {
148 148
 			return;
149 149
 		}
150 150
 
@@ -155,4 +155,4 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 }
157 157
 
158
-\WP_CLI::add_command( 'session', 'WP_Session_Command' );
159 158
\ No newline at end of file
159
+\WP_CLI::add_command('session', 'WP_Session_Command');
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/class-wp-session.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
 			$cookie = stripslashes( $_COOKIE[WP_SESSION_COOKIE] );
74 74
 			$cookie_crumbs = explode( '||', $cookie );
75 75
 
76
-            $this->session_id = preg_replace("/[^A-Za-z0-9_]/", '', $cookie_crumbs[0] );
77
-            $this->expires = absint( $cookie_crumbs[1] );
78
-            $this->exp_variant = absint( $cookie_crumbs[2] );
76
+			$this->session_id = preg_replace("/[^A-Za-z0-9_]/", '', $cookie_crumbs[0] );
77
+			$this->expires = absint( $cookie_crumbs[1] );
78
+			$this->exp_variant = absint( $cookie_crumbs[2] );
79 79
 
80 80
 			// Update the session expiration if we're past the variant time
81 81
 			if ( time() > $this->exp_variant ) {
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 	}
119 119
 
120 120
 	/**
121
-	* Set the session cookie
122
-	* @uses apply_filters Calls `wp_session_cookie_secure` to set the $secure parameter of setcookie()
123
-	* @uses apply_filters Calls `wp_session_cookie_httponly` to set the $httponly parameter of setcookie()
124
-	*/
121
+	 * Set the session cookie
122
+	 * @uses apply_filters Calls `wp_session_cookie_secure` to set the $secure parameter of setcookie()
123
+	 * @uses apply_filters Calls `wp_session_cookie_httponly` to set the $httponly parameter of setcookie()
124
+	 */
125 125
 	protected function set_cookie() {
126 126
 		if ( !defined( 'GD_TESTING_MODE' ) ) {
127 127
 			try {
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @return bool|WP_Session
54 54
 	 */
55 55
 	public static function get_instance() {
56
-		if ( ! self::$instance ) {
56
+		if (!self::$instance) {
57 57
 			self::$instance = new self();
58 58
 		}
59 59
 
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 	 * @uses apply_filters Calls `wp_session_expiration` to determine how long until sessions expire.
70 70
 	 */
71 71
 	protected function __construct() {
72
-		if ( isset( $_COOKIE[WP_SESSION_COOKIE] ) ) {
73
-			$cookie = stripslashes( $_COOKIE[WP_SESSION_COOKIE] );
74
-			$cookie_crumbs = explode( '||', $cookie );
72
+		if (isset($_COOKIE[WP_SESSION_COOKIE])) {
73
+			$cookie = stripslashes($_COOKIE[WP_SESSION_COOKIE]);
74
+			$cookie_crumbs = explode('||', $cookie);
75 75
 
76
-            $this->session_id = preg_replace("/[^A-Za-z0-9_]/", '', $cookie_crumbs[0] );
77
-            $this->expires = absint( $cookie_crumbs[1] );
78
-            $this->exp_variant = absint( $cookie_crumbs[2] );
76
+            $this->session_id = preg_replace("/[^A-Za-z0-9_]/", '', $cookie_crumbs[0]);
77
+            $this->expires = absint($cookie_crumbs[1]);
78
+            $this->exp_variant = absint($cookie_crumbs[2]);
79 79
 
80 80
 			// Update the session expiration if we're past the variant time
81
-			if ( time() > $this->exp_variant ) {
81
+			if (time() > $this->exp_variant) {
82 82
 				$this->set_expiration();
83
-				delete_option( "_wp_session_expires_{$this->session_id}" );
84
-				add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' );
83
+				delete_option("_wp_session_expires_{$this->session_id}");
84
+				add_option("_wp_session_expires_{$this->session_id}", $this->expires, '', 'no');
85 85
 			}
86 86
 		} else {
87 87
 			$this->session_id = WP_Session_Utils::generate_id();
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 	 * @uses apply_filters Calls `wp_session_expiration` to get the standard expiration time for sessions.
114 114
 	 */
115 115
 	protected function set_expiration() {
116
-		$this->exp_variant = time() + (int) apply_filters( 'wp_session_expiration_variant', 24 * 60 );
117
-		$this->expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
116
+		$this->exp_variant = time() + (int) apply_filters('wp_session_expiration_variant', 24 * 60);
117
+		$this->expires = time() + (int) apply_filters('wp_session_expiration', 30 * 60);
118 118
 	}
119 119
 
120 120
 	/**
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
 	* @uses apply_filters Calls `wp_session_cookie_httponly` to set the $httponly parameter of setcookie()
124 124
 	*/
125 125
 	protected function set_cookie() {
126
-		if ( !defined( 'GD_TESTING_MODE' ) ) {
126
+		if (!defined('GD_TESTING_MODE')) {
127 127
 			try {
128 128
 				$secure = apply_filters('wp_session_cookie_secure', false);
129 129
 				$httponly = apply_filters('wp_session_cookie_httponly', false);
130
-				setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN, $secure, $httponly );
131
-			} catch(Exception $e) {
132
-				error_log( 'Set Cookie Error: ' . $e->getMessage() );
130
+				setcookie(WP_SESSION_COOKIE, $this->session_id.'||'.$this->expires.'||'.$this->exp_variant, $this->expires, COOKIEPATH, COOKIE_DOMAIN, $secure, $httponly);
131
+			} catch (Exception $e) {
132
+				error_log('Set Cookie Error: '.$e->getMessage());
133 133
 			}
134 134
 		}
135 135
 	}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @return array
143 143
 	 */
144 144
 	protected function read_data() {
145
-		$this->container = get_option( "_wp_session_{$this->session_id}", array() );
145
+		$this->container = get_option("_wp_session_{$this->session_id}", array());
146 146
 
147 147
 		return $this->container;
148 148
 	}
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
 	public function write_data() {
154 154
 		$option_key = "_wp_session_{$this->session_id}";
155 155
 		
156
-		if ( false === get_option( $option_key ) ) {
157
-			add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' );
158
-			add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' );
156
+		if (false === get_option($option_key)) {
157
+			add_option("_wp_session_{$this->session_id}", $this->container, '', 'no');
158
+			add_option("_wp_session_expires_{$this->session_id}", $this->expires, '', 'no');
159 159
 		} else {
160
-			delete_option( "_wp_session_{$this->session_id}" );
161
-			add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' );
160
+			delete_option("_wp_session_{$this->session_id}");
161
+			add_option("_wp_session_{$this->session_id}", $this->container, '', 'no');
162 162
 		}
163 163
 	}
164 164
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 * @return string
169 169
 	 */
170 170
 	public function json_out() {
171
-		return json_encode( $this->container );
171
+		return json_encode($this->container);
172 172
 	}
173 173
 
174 174
 	/**
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @return bool
180 180
 	 */
181
-	public function json_in( $data ) {
182
-		$array = json_decode( $data );
181
+	public function json_in($data) {
182
+		$array = json_decode($data);
183 183
 
184
-		if ( is_array( $array ) ) {
184
+		if (is_array($array)) {
185 185
 			$this->container = $array;
186 186
 			return true;
187 187
 		}
@@ -194,9 +194,9 @@  discard block
 block discarded – undo
194 194
 	 *
195 195
 	 * @param bool $delete_old Flag whether or not to delete the old session data from the server.
196 196
 	 */
197
-	public function regenerate_id( $delete_old = false ) {
198
-		if ( $delete_old ) {
199
-			delete_option( "_wp_session_{$this->session_id}" );
197
+	public function regenerate_id($delete_old = false) {
198
+		if ($delete_old) {
199
+			delete_option("_wp_session_{$this->session_id}");
200 200
 		}
201 201
 
202 202
 		$this->session_id = WP_Session_Utils::generate_id();
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/class-recursive-arrayaccess.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @param array $data
38 38
 	 */
39
-	protected function __construct( $data = array() ) {
40
-		foreach ( $data as $key => $value ) {
41
-			$this[ $key ] = $value;
39
+	protected function __construct($data = array()) {
40
+		foreach ($data as $key => $value) {
41
+			$this[$key] = $value;
42 42
 		}
43 43
 	}
44 44
 
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 	 * Allow deep copies of objects
47 47
 	 */
48 48
 	public function __clone() {
49
-		foreach ( $this->container as $key => $value ) {
50
-			if ( $value instanceof self ) {
51
-				$this[ $key ] = clone $value;
49
+		foreach ($this->container as $key => $value) {
50
+			if ($value instanceof self) {
51
+				$this[$key] = clone $value;
52 52
 			}
53 53
 		}
54 54
 	}
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	public function toArray() {
62 62
 		$data = $this->container;
63
-		foreach ( $data as $key => $value ) {
64
-			if ( $value instanceof self ) {
65
-				$data[ $key ] = $value->toArray();
63
+		foreach ($data as $key => $value) {
64
+			if ($value instanceof self) {
65
+				$data[$key] = $value->toArray();
66 66
 			}
67 67
 		}
68 68
 		return $data;
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 	 *
82 82
 	 * @return boolean true on success or false on failure.
83 83
 	 */
84
-	public function offsetExists( $offset ) {
85
-		return isset( $this->container[ $offset ]) ;
84
+	public function offsetExists($offset) {
85
+		return isset($this->container[$offset]);
86 86
 	}
87 87
 
88 88
 	/**
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 	 *
95 95
 	 * @return mixed Can return all value types.
96 96
 	 */
97
-	public function offsetGet( $offset ) {
98
-		return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null;
97
+	public function offsetGet($offset) {
98
+		return isset($this->container[$offset]) ? $this->container[$offset] : null;
99 99
 	}
100 100
 
101 101
 	/**
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @return void
110 110
 	 */
111
-	public function offsetSet( $offset, $data ) {
112
-		if ( is_array( $data ) ) {
113
-			$data = new self( $data );
111
+	public function offsetSet($offset, $data) {
112
+		if (is_array($data)) {
113
+			$data = new self($data);
114 114
 		}
115
-		if ( $offset === null ) { // don't forget this!
115
+		if ($offset === null) { // don't forget this!
116 116
 			$this->container[] = $data;
117 117
 		} else {
118
-			$this->container[ $offset ] = $data;
118
+			$this->container[$offset] = $data;
119 119
 		}
120 120
 
121 121
 		$this->dirty = true;
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
 	 *
131 131
 	 * @return void
132 132
 	 */
133
-	public function offsetUnset( $offset ) {
134
-		unset( $this->container[ $offset ] );
133
+	public function offsetUnset($offset) {
134
+		unset($this->container[$offset]);
135 135
 
136 136
 		$this->dirty = true;
137 137
 	}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 * @return mixed
150 150
 	 */
151 151
 	public function current() {
152
-		return current( $this->container );
152
+		return current($this->container);
153 153
 	}
154 154
 
155 155
 	/**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 * @return mixed
161 161
 	 */
162 162
 	public function key() {
163
-		return key( $this->container );
163
+		return key($this->container);
164 164
 	}
165 165
 
166 166
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 * @return void
172 172
 	 */
173 173
 	public function next() {
174
-		next( $this->container );
174
+		next($this->container);
175 175
 	}
176 176
 
177 177
 	/**
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 * @return void
183 183
 	 */
184 184
 	public function rewind() {
185
-		reset( $this->container );
185
+		reset($this->container);
186 186
 	}
187 187
 
188 188
 	/**
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	 * @return bool
194 194
 	 */
195 195
 	public function valid() {
196
-		return $this->offsetExists( $this->key() );
196
+		return $this->offsetExists($this->key());
197 197
 	}
198 198
 
199 199
 	/*****************************************************************/
@@ -208,6 +208,6 @@  discard block
 block discarded – undo
208 208
 	 * @return int
209 209
 	 */
210 210
 	public function count() {
211
-		return count( $this->container );
211
+		return count($this->container);
212 212
 	}
213 213
 }
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/class-wp-session-utils.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,11 +99,11 @@
 block discarded – undo
99 99
 
100 100
 		// Delete expired sessions
101 101
 		if ( ! empty( $expired ) ) {
102
-		    $placeholders = array_fill( 0, count( $expired ), '%s' );
103
-		    $format = implode( ', ', $placeholders );
104
-		    $query = "DELETE FROM $wpdb->options WHERE option_name IN ($format)";
102
+			$placeholders = array_fill( 0, count( $expired ), '%s' );
103
+			$format = implode( ', ', $placeholders );
104
+			$query = "DELETE FROM $wpdb->options WHERE option_name IN ($format)";
105 105
 
106
-		    $prepared = $wpdb->prepare( $query, $expired );
106
+			$prepared = $wpdb->prepare( $query, $expired );
107 107
 			$wpdb->query( $prepared );
108 108
 		}
109 109
 
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 		 *
24 24
 		 * @param string $query Database count query
25 25
 		 */
26
-		$query = apply_filters( 'wp_session_count_query', $query );
26
+		$query = apply_filters('wp_session_count_query', $query);
27 27
 
28
-		$sessions = $wpdb->get_var( $query );
28
+		$sessions = $wpdb->get_var($query);
29 29
 
30
-		return absint( $sessions );
30
+		return absint($sessions);
31 31
 	}
32 32
 
33 33
 	/**
@@ -35,33 +35,33 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param null|string $date
37 37
 	 */
38
-	public static function create_dummy_session( $date = null ) {
38
+	public static function create_dummy_session($date = null) {
39 39
 		// Generate our date
40
-		if ( null !== $date ) {
41
-			$time = strtotime( $date );
40
+		if (null !== $date) {
41
+			$time = strtotime($date);
42 42
 
43
-			if ( false === $time ) {
43
+			if (false === $time) {
44 44
 				$date = null;
45 45
 			} else {
46
-				$expires = date( 'U', strtotime( $date ) );
46
+				$expires = date('U', strtotime($date));
47 47
 			}
48 48
 		}
49 49
 
50 50
 		// If null was passed, or if the string parsing failed, fall back on a default
51
-		if ( null === $date ) {
51
+		if (null === $date) {
52 52
 			/**
53 53
 			 * Filter the expiration of the session in the database
54 54
 			 *
55 55
 			 * @param int
56 56
 			 */
57
-			$expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
57
+			$expires = time() + (int) apply_filters('wp_session_expiration', 30 * 60);
58 58
 		}
59 59
 
60 60
 		$session_id = self::generate_id();
61 61
 
62 62
 		// Store the session
63
-		add_option( "_wp_session_{$session_id}", array(), '', 'no' );
64
-		add_option( "_wp_session_expires_{$session_id}", $expires, '', 'no' );
63
+		add_option("_wp_session_{$session_id}", array(), '', 'no');
64
+		add_option("_wp_session_expires_{$session_id}", $expires, '', 'no');
65 65
 	}
66 66
 
67 67
 	/**
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return int Sessions deleted.
75 75
 	 */
76
-	public static function delete_old_sessions( $limit = 1000 ) {
76
+	public static function delete_old_sessions($limit = 1000) {
77 77
 		global $wpdb;
78 78
 
79
-		$limit = absint( $limit );
80
-		$keys = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%' ORDER BY option_value ASC LIMIT 0, {$limit}" );
79
+		$limit = absint($limit);
80
+		$keys = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%' ORDER BY option_value ASC LIMIT 0, {$limit}");
81 81
 
82 82
 		$now = time();
83 83
 		$expired = array();
84 84
 		$count = 0;
85 85
 
86
-		foreach( $keys as $expiration ) {
86
+		foreach ($keys as $expiration) {
87 87
 			$key = $expiration->option_name;
88 88
 			$expires = $expiration->option_value;
89 89
 
90
-			if ( $now > $expires ) {
91
-				$session_id = preg_replace("/[^A-Za-z0-9_]/", '', substr( $key, 20 ) );
90
+			if ($now > $expires) {
91
+				$session_id = preg_replace("/[^A-Za-z0-9_]/", '', substr($key, 20));
92 92
 
93 93
 				$expired[] = $key;
94 94
 				$expired[] = "_wp_session_{$session_id}";
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 		}
99 99
 
100 100
 		// Delete expired sessions
101
-		if ( ! empty( $expired ) ) {
102
-		    $placeholders = array_fill( 0, count( $expired ), '%s' );
103
-		    $format = implode( ', ', $placeholders );
101
+		if (!empty($expired)) {
102
+		    $placeholders = array_fill(0, count($expired), '%s');
103
+		    $format = implode(', ', $placeholders);
104 104
 		    $query = "DELETE FROM $wpdb->options WHERE option_name IN ($format)";
105 105
 
106
-		    $prepared = $wpdb->prepare( $query, $expired );
107
-			$wpdb->query( $prepared );
106
+		    $prepared = $wpdb->prepare($query, $expired);
107
+			$wpdb->query($prepared);
108 108
 		}
109 109
 
110 110
 		return $count;
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 	public static function delete_all_sessions() {
121 121
 		global $wpdb;
122 122
 
123
-		$count = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_wp_session_%'" );
123
+		$count = $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_wp_session_%'");
124 124
 
125
-		return (int) ( $count / 2 );
125
+		return (int) ($count / 2);
126 126
 	}
127 127
 
128 128
 	/**
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
 	 * @return string
132 132
 	 */
133 133
 	public static function generate_id() {
134
-		require_once( ABSPATH . 'wp-includes/class-phpass.php' );
135
-		$hash = new PasswordHash( 8, false );
134
+		require_once(ABSPATH.'wp-includes/class-phpass.php');
135
+		$hash = new PasswordHash(8, false);
136 136
 
137
-		return md5( $hash->get_random_bytes( 32 ) );
137
+		return md5($hash->get_random_bytes(32));
138 138
 	}
139 139
 } 
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/wp-session.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
  *
34 34
  * @param string $data
35 35
  */
36
-function wp_session_decode( $data ) {
36
+function wp_session_decode($data) {
37 37
 	$wp_session = WP_Session::get_instance();
38 38
 
39
-	return $wp_session->json_in( $data );
39
+	return $wp_session->json_in($data);
40 40
 }
41 41
 
42 42
 /**
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
  *
58 58
  * @return bool
59 59
  */
60
-function wp_session_regenerate_id( $delete_old_session = false ) {
60
+function wp_session_regenerate_id($delete_old_session = false) {
61 61
 	$wp_session = WP_Session::get_instance();
62 62
 
63
-	$wp_session->regenerate_id( $delete_old_session );
63
+	$wp_session->regenerate_id($delete_old_session);
64 64
 
65 65
 	return true;
66 66
 }
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
  */
75 75
 function wp_session_start() {
76 76
 	$wp_session = WP_Session::get_instance();
77
-	do_action( 'wp_session_start' );
77
+	do_action('wp_session_start');
78 78
 
79 79
 	return $wp_session->session_started();
80 80
 }
81
-if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) {
82
-	add_action( 'plugins_loaded', 'wp_session_start' );
81
+if (!defined('WP_CLI') || false === WP_CLI) {
82
+	add_action('plugins_loaded', 'wp_session_start');
83 83
 }
84 84
 
85 85
 /**
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 function wp_session_status() {
91 91
 	$wp_session = WP_Session::get_instance();
92 92
 
93
-	if ( $wp_session->session_started() ) {
93
+	if ($wp_session->session_started()) {
94 94
 		return PHP_SESSION_ACTIVE;
95 95
 	}
96 96
 
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
 	$wp_session = WP_Session::get_instance();
114 114
 
115 115
 	$wp_session->write_data();
116
-	do_action( 'wp_session_commit' );
116
+	do_action('wp_session_commit');
117 117
 }
118
-if ( ! defined( 'WP_CLI' ) || false === WP_CLI ) {
119
-	add_action( 'shutdown', 'wp_session_write_close' );
118
+if (!defined('WP_CLI') || false === WP_CLI) {
119
+	add_action('shutdown', 'wp_session_write_close');
120 120
 }
121 121
 
122 122
 /**
@@ -127,33 +127,33 @@  discard block
 block discarded – undo
127 127
  * of a scheduled task or cron job.
128 128
  */
129 129
 function wp_session_cleanup() {
130
-	if ( defined( 'WP_SETUP_CONFIG' ) ) {
130
+	if (defined('WP_SETUP_CONFIG')) {
131 131
 		return;
132 132
 	}
133 133
 
134
-	if ( ! defined( 'WP_INSTALLING' ) ) {
134
+	if (!defined('WP_INSTALLING')) {
135 135
 		/**
136 136
 		 * Determine the size of each batch for deletion.
137 137
 		 *
138 138
 		 * @param int
139 139
 		 */
140
-		$batch_size = apply_filters( 'wp_session_delete_batch_size', 1000 );
140
+		$batch_size = apply_filters('wp_session_delete_batch_size', 1000);
141 141
 
142 142
 		// Delete a batch of old sessions
143
-		WP_Session_Utils::delete_old_sessions( $batch_size );
143
+		WP_Session_Utils::delete_old_sessions($batch_size);
144 144
 	}
145 145
 
146 146
 	// Allow other plugins to hook in to the garbage collection process.
147
-	do_action( 'wp_session_cleanup' );
147
+	do_action('wp_session_cleanup');
148 148
 }
149
-add_action( 'wp_session_garbage_collection', 'wp_session_cleanup' );
149
+add_action('wp_session_garbage_collection', 'wp_session_cleanup');
150 150
 
151 151
 /**
152 152
  * Register the garbage collector as a twice daily event.
153 153
  */
154 154
 function wp_session_register_garbage_collection() {
155
-	if ( ! wp_next_scheduled( 'wp_session_garbage_collection' ) ) {
156
-		wp_schedule_event( time(), 'hourly', 'wp_session_garbage_collection' );
155
+	if (!wp_next_scheduled('wp_session_garbage_collection')) {
156
+		wp_schedule_event(time(), 'hourly', 'wp_session_garbage_collection');
157 157
 	}
158 158
 }
159
-add_action( 'wp', 'wp_session_register_garbage_collection' );
159
+add_action('wp', 'wp_session_register_garbage_collection');
Please login to merge, or discard this patch.