Test Failed
Push — master ( 7a266a...e0908c )
by Stiofan
55:02
created
geodirectory-functions/custom_field_html.php 3 patches
Indentation   +334 added lines, -334 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 global $post_type;
19 19
 
20 20
 if (!isset($field_info->post_type)) {
21
-    $post_type = sanitize_text_field($_REQUEST['listing_type']);
21
+	$post_type = sanitize_text_field($_REQUEST['listing_type']);
22 22
 } else
23
-    $post_type = $field_info->post_type;
23
+	$post_type = $field_info->post_type;
24 24
 
25 25
 //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){
26 26
 //    $cf_arr = geodir_custom_fields_predefined($post_type);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 $field_admin_title = '';
50 50
 if (isset($field_info->admin_title))
51
-    $field_admin_title = $field_info->admin_title;
51
+	$field_admin_title = $field_info->admin_title;
52 52
 
53 53
 $default = isset($field_info->is_admin) ? $field_info->is_admin : '';
54 54
 
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
 //print_r($field_info);
69 69
 
70 70
 if (isset($cf['icon']) && strpos($cf['icon'], ' fa-') !== false) {
71
-    $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
71
+	$field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
72 72
 }elseif(isset($cf['icon']) && $cf['icon']){
73
-    $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>';
73
+	$field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>';
74 74
 }else{
75
-    $field_icon = '<i class="fas fa-cog" aria-hidden="true"></i>';
75
+	$field_icon = '<i class="fas fa-cog" aria-hidden="true"></i>';
76 76
 }
77 77
 
78 78
 if(isset($cf['name']) && $cf['name']){
79
-    $field_type_name = $cf['name'];
79
+	$field_type_name = $cf['name'];
80 80
 }else{
81
-    $field_type_name = $field_type;
81
+	$field_type_name = $field_type;
82 82
 }
83 83
 
84 84
 if (isset($field_info->data_type) && $field_info->data_type == 'VARCHAR') {
85
-    $field_info->data_type = 'XVARCHAR';
85
+	$field_info->data_type = 'XVARCHAR';
86 86
 }
87 87
 
88 88
 ?>
@@ -92,45 +92,45 @@  discard block
 block discarded – undo
92 92
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')" >
93 93
         <?php
94 94
 
95
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
96
-        ?>
95
+		$nonce = wp_create_nonce('custom_fields_' . $result_str);
96
+		?>
97 97
 
98 98
         <?php if (!$default): ?>
99 99
             <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
100 100
                  onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
101 101
                  class="handlediv close"><i class="fas fa-times" aria-hidden="true"></i></div>
102 102
         <?php endif;
103
-        if ($field_type == 'fieldset') {
104
-            ?>
103
+		if ($field_type == 'fieldset') {
104
+			?>
105 105
             <i class="fas fa-long-arrow-alt-left " aria-hidden="true"></i>
106 106
             <i class="fas fa-long-arrow-alt-right " aria-hidden="true"></i>
107 107
             <b style="cursor:pointer;"
108 108
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
109 109
         <?php
110
-        } else {echo $field_icon;
111
-            ?>
110
+		} else {echo $field_icon;
111
+			?>
112 112
             <b style="cursor:pointer;"
113 113
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b>
114 114
         <?php
115
-        }
116
-        ?>
115
+		}
116
+		?>
117 117
     </div>
118 118
 
119 119
     <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
120 120
     <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
121 121
          style="display:<?php if ($field_ins_upd == 'submit') {
122
-             echo 'block;';
123
-         } else {
124
-             echo 'none;';
125
-         } ?>">
122
+			 echo 'block;';
123
+		 } else {
124
+			 echo 'none;';
125
+		 } ?>">
126 126
         <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/>
127 127
         <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
128 128
         <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
129 129
         <input type="hidden" name="field_type_key" id="field_type_key" value="<?php echo $field_type_key; ?>"/>
130 130
         <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/>
131 131
         <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
132
-            echo $field_info->data_type;
133
-        } ?>"/>
132
+			echo $field_info->data_type;
133
+		} ?>"/>
134 134
         <input type="hidden" name="is_active" id="is_active" value="1"/>
135 135
 
136 136
         <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?>
@@ -142,37 +142,37 @@  discard block
 block discarded – undo
142 142
 
143 143
             <?php
144 144
 
145
-            // data_type
146
-            if(has_filter("geodir_cfa_data_type_{$field_type}")){
145
+			// data_type
146
+			if(has_filter("geodir_cfa_data_type_{$field_type}")){
147 147
 
148
-                echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
148
+				echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
149 149
 
150
-            }else{
151
-                $value = '';
152
-                if (isset($field_info->data_type)) {
153
-                    $value = esc_attr($field_info->data_type);
154
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
155
-                    $value = $cf['defaults']['data_type'];
156
-                }
157
-                ?>
150
+			}else{
151
+				$value = '';
152
+				if (isset($field_info->data_type)) {
153
+					$value = esc_attr($field_info->data_type);
154
+				}elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
155
+					$value = $cf['defaults']['data_type'];
156
+				}
157
+				?>
158 158
                 <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/>
159 159
             <?php
160
-            }
160
+			}
161 161
 
162 162
 
163
-            // admin_title
164
-            if(has_filter("geodir_cfa_admin_title_{$field_type}")){
163
+			// admin_title
164
+			if(has_filter("geodir_cfa_admin_title_{$field_type}")){
165 165
 
166
-                echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
166
+				echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
167 167
 
168
-            }else{
169
-                $value = '';
170
-                if (isset($field_info->admin_title)) {
171
-                    $value = esc_attr($field_info->admin_title);
172
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
173
-                    $value = $cf['defaults']['admin_title'];
174
-                }
175
-                ?>
168
+			}else{
169
+				$value = '';
170
+				if (isset($field_info->admin_title)) {
171
+					$value = esc_attr($field_info->admin_title);
172
+				}elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
173
+					$value = $cf['defaults']['admin_title'];
174
+				}
175
+				?>
176 176
                 <li>
177 177
                     <label for="admin_title" class="gd-cf-tooltip-wrap">
178 178
                         <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Admin title :', 'geodirectory'); ?>
@@ -186,22 +186,22 @@  discard block
 block discarded – undo
186 186
                     </div>
187 187
                 </li>
188 188
                 <?php
189
-            }
189
+			}
190 190
 
191 191
 
192
-            // site_title
193
-            if(has_filter("geodir_cfa_site_title_{$field_type}")){
192
+			// site_title
193
+			if(has_filter("geodir_cfa_site_title_{$field_type}")){
194 194
 
195
-                echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
195
+				echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
196 196
 
197
-            }else{
198
-                $value = '';
199
-                if (isset($field_info->site_title)) {
200
-                    $value = esc_attr($field_info->site_title);
201
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
202
-                    $value = $cf['defaults']['site_title'];
203
-                }
204
-                ?>
197
+			}else{
198
+				$value = '';
199
+				if (isset($field_info->site_title)) {
200
+					$value = esc_attr($field_info->site_title);
201
+				}elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
202
+					$value = $cf['defaults']['site_title'];
203
+				}
204
+				?>
205 205
                 <li>
206 206
                     <label for="site_title" class="gd-cf-tooltip-wrap"> <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend title :', 'geodirectory'); ?>
207 207
                         <div class="gdcf-tooltip">
@@ -214,22 +214,22 @@  discard block
 block discarded – undo
214 214
                     </div>
215 215
                 </li>
216 216
                 <?php
217
-            }
217
+			}
218 218
 
219 219
 
220
-            // admin_desc
221
-            if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
220
+			// admin_desc
221
+			if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
222 222
 
223
-                echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
223
+				echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
224 224
 
225
-            }else{
226
-                $value = '';
227
-                if (isset($field_info->admin_desc)) {
228
-                    $value = esc_attr($field_info->admin_desc);
229
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
230
-                    $value = $cf['defaults']['admin_desc'];
231
-                }
232
-                ?>
225
+			}else{
226
+				$value = '';
227
+				if (isset($field_info->admin_desc)) {
228
+					$value = esc_attr($field_info->admin_desc);
229
+				}elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
230
+					$value = $cf['defaults']['admin_desc'];
231
+				}
232
+				?>
233 233
                 <li>
234 234
                     <label for="admin_desc" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend description :', 'geodirectory'); ?>
235 235
                         <div class="gdcf-tooltip">
@@ -241,23 +241,23 @@  discard block
 block discarded – undo
241 241
                     </div>
242 242
                 </li>
243 243
                 <?php
244
-            }
244
+			}
245 245
 
246 246
 
247 247
 
248
-            // htmlvar_name
249
-            if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
248
+			// htmlvar_name
249
+			if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
250 250
 
251
-                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
251
+				echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
252 252
 
253
-            }else{
254
-                $value = '';
255
-                if (isset($field_info->htmlvar_name)) {
256
-                    $value = esc_attr($field_info->htmlvar_name);
257
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
258
-                    $value = $cf['defaults']['htmlvar_name'];
259
-                }
260
-                ?>
253
+			}else{
254
+				$value = '';
255
+				if (isset($field_info->htmlvar_name)) {
256
+					$value = esc_attr($field_info->htmlvar_name);
257
+				}elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
258
+					$value = $cf['defaults']['htmlvar_name'];
259
+				}
260
+				?>
261 261
                 <li>
262 262
                     <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
263 263
                         <div class="gdcf-tooltip">
@@ -267,29 +267,29 @@  discard block
 block discarded – undo
267 267
                     <div class="gd-cf-input-wrap">
268 268
                         <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>"
269 269
                                value="<?php if ($value) {
270
-                                   echo preg_replace('/geodir_/', '', $value, 1);
271
-                               }?>" <?php if ($default) {
272
-                            echo 'readonly="readonly"';
273
-                        }?> />
270
+								   echo preg_replace('/geodir_/', '', $value, 1);
271
+							   }?>" <?php if ($default) {
272
+							echo 'readonly="readonly"';
273
+						}?> />
274 274
                     </div>
275 275
                 </li>
276 276
                 <?php
277
-            }
277
+			}
278 278
 
279 279
 
280
-            // is_active
281
-            if(has_filter("geodir_cfa_is_active_{$field_type}")){
280
+			// is_active
281
+			if(has_filter("geodir_cfa_is_active_{$field_type}")){
282 282
 
283
-                echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
283
+				echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
284 284
 
285
-            }else{
286
-                $value = '';
287
-                if (isset($field_info->is_active)) {
288
-                    $value = esc_attr($field_info->is_active);
289
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
290
-                    $value = $cf['defaults']['is_active'];
291
-                }
292
-                ?>
285
+			}else{
286
+				$value = '';
287
+				if (isset($field_info->is_active)) {
288
+					$value = esc_attr($field_info->is_active);
289
+				}elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
290
+					$value = $cf['defaults']['is_active'];
291
+				}
292
+				?>
293 293
                 <li <?php echo $field_display; ?>>
294 294
                     <label for="is_active" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Is active :', 'geodirectory'); ?>
295 295
                         <div class="gdcf-tooltip">
@@ -300,35 +300,35 @@  discard block
 block discarded – undo
300 300
 
301 301
                         <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
302 302
                             <?php if ($value == '1') {
303
-                                echo 'checked';
304
-                            } ?>/>
303
+								echo 'checked';
304
+							} ?>/>
305 305
                         <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
306 306
 
307 307
                         <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
308 308
                             <?php if ($value == '0' || !$value) {
309
-                                echo 'checked';
310
-                            } ?>/>
309
+								echo 'checked';
310
+							} ?>/>
311 311
                         <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
312 312
 
313 313
                     </div>
314 314
                 </li>
315 315
                 <?php
316
-            }
316
+			}
317 317
 
318 318
 
319
-            // for_admin_use
320
-            if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
319
+			// for_admin_use
320
+			if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
321 321
 
322
-                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
322
+				echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
323 323
 
324
-            }else{
325
-                $value = '';
326
-                if (isset($field_info->for_admin_use)) {
327
-                    $value = esc_attr($field_info->for_admin_use);
328
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
329
-                    $value = $cf['defaults']['for_admin_use'];
330
-                }
331
-                ?>
324
+			}else{
325
+				$value = '';
326
+				if (isset($field_info->for_admin_use)) {
327
+					$value = esc_attr($field_info->for_admin_use);
328
+				}elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
329
+					$value = $cf['defaults']['for_admin_use'];
330
+				}
331
+				?>
332 332
                 <li>
333 333
                     <label for="for_admin_use" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('For admin use only? :', 'geodirectory'); ?>
334 334
                         <div class="gdcf-tooltip">
@@ -339,47 +339,47 @@  discard block
 block discarded – undo
339 339
 
340 340
                         <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled"  value="1"
341 341
                             <?php if ($value == '1') {
342
-                                echo 'checked';
343
-                            } ?>/>
342
+								echo 'checked';
343
+							} ?>/>
344 344
                         <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
345 345
 
346 346
                         <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0"
347 347
                             <?php if ($value == '0' || !$value) {
348
-                                echo 'checked';
349
-                            } ?>/>
348
+								echo 'checked';
349
+							} ?>/>
350 350
                         <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
351 351
 
352 352
                     </div>
353 353
                 </li>
354 354
                 <?php
355
-            }
355
+			}
356 356
 
357 357
 
358
-            // default_value
359
-            if(has_filter("geodir_cfa_default_value_{$field_type}")){
358
+			// default_value
359
+			if(has_filter("geodir_cfa_default_value_{$field_type}")){
360 360
 
361
-                echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
361
+				echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
362 362
 
363
-            }else{
364
-                $value = '';
365
-                if (isset($field_info->default_value)) {
366
-                    $value = esc_attr($field_info->default_value);
367
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
368
-                    $value = $cf['defaults']['default_value'];
369
-                }
370
-                ?>
363
+			}else{
364
+				$value = '';
365
+				if (isset($field_info->default_value)) {
366
+					$value = esc_attr($field_info->default_value);
367
+				}elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
368
+					$value = $cf['defaults']['default_value'];
369
+				}
370
+				?>
371 371
                 <li>
372 372
                     <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
373 373
                         <div class="gdcf-tooltip">
374 374
                             <?php
375
-                            if ($field_type == 'checkbox') {
376
-                                _e('Should the checkbox be checked by default?', 'geodirectory');
377
-                            } else if ($field_type == 'email') {
378
-                                _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
379
-                            } else {
380
-                                _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
381
-                            }
382
-                            ?>
375
+							if ($field_type == 'checkbox') {
376
+								_e('Should the checkbox be checked by default?', 'geodirectory');
377
+							} else if ($field_type == 'email') {
378
+								_e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
379
+							} else {
380
+								_e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
381
+							}
382
+							?>
383 383
                         </div>
384 384
                     </label>
385 385
                     <div class="gd-cf-input-wrap">
@@ -396,22 +396,22 @@  discard block
 block discarded – undo
396 396
                     </div>
397 397
                 </li>
398 398
                 <?php
399
-            }
399
+			}
400 400
 
401 401
 
402
-            // show_in
403
-            if(has_filter("geodir_cfa_show_in_{$field_type}")){
402
+			// show_in
403
+			if(has_filter("geodir_cfa_show_in_{$field_type}")){
404 404
 
405
-                echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
405
+				echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
406 406
 
407
-            }else{
408
-                $value = '';
409
-                if (isset($field_info->show_in)) {
410
-                    $value = esc_attr($field_info->show_in);
411
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
412
-                    $value = esc_attr($cf['defaults']['show_in']);
413
-                }
414
-                ?>
407
+			}else{
408
+				$value = '';
409
+				if (isset($field_info->show_in)) {
410
+					$value = esc_attr($field_info->show_in);
411
+				}elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
412
+					$value = esc_attr($cf['defaults']['show_in']);
413
+				}
414
+				?>
415 415
                 <li>
416 416
                     <label for="show_in" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Show in what locations?:', 'geodirectory'); ?>
417 417
                         <div class="gdcf-tooltip">
@@ -422,41 +422,41 @@  discard block
 block discarded – undo
422 422
 
423 423
                         <?php
424 424
 
425
-                        /*
425
+						/*
426 426
 						 * We wrap the key values in [] so we can search the DB easier with a LIKE query.
427 427
 						 */
428
-                        $show_in_locations = array(
429
-                            "[detail]" => __("Details page sidebar", 'geodirectory'),
430
-                            "[moreinfo]" => __("More info tab", 'geodirectory'),
431
-                            "[listing]" => __("Listings page", 'geodirectory'),
432
-                            "[owntab]" => __("Details page own tab", 'geodirectory'),
433
-                            "[mapbubble]" => __("Map bubble", 'geodirectory'),
434
-                        );
435
-
436
-                        /**
437
-                         * Filter the locations array for where to display custom fields.
438
-                         *
439
-                         * @since 1.6.6
440
-                         * @param array $show_in_locations The array of locations and descriptions.
441
-                         * @param object $field_info The field being displayed info.
442
-                         * @param string $field_info The type of field.
443
-                         */
444
-                        $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
445
-
446
-
447
-                        // remove some locations for some field types
448
-
449
-                        // don't show new tab option for some types
450
-                        if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
451
-                        }else{
452
-                            unset($show_in_locations['[owntab]']);
453
-                        }
454
-
455
-                        if(!$display_on_listing){
456
-                            unset($show_in_locations['[listings]']);
457
-                        }
458
-
459
-                        ?>
428
+						$show_in_locations = array(
429
+							"[detail]" => __("Details page sidebar", 'geodirectory'),
430
+							"[moreinfo]" => __("More info tab", 'geodirectory'),
431
+							"[listing]" => __("Listings page", 'geodirectory'),
432
+							"[owntab]" => __("Details page own tab", 'geodirectory'),
433
+							"[mapbubble]" => __("Map bubble", 'geodirectory'),
434
+						);
435
+
436
+						/**
437
+						 * Filter the locations array for where to display custom fields.
438
+						 *
439
+						 * @since 1.6.6
440
+						 * @param array $show_in_locations The array of locations and descriptions.
441
+						 * @param object $field_info The field being displayed info.
442
+						 * @param string $field_info The type of field.
443
+						 */
444
+						$show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
445
+
446
+
447
+						// remove some locations for some field types
448
+
449
+						// don't show new tab option for some types
450
+						if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
451
+						}else{
452
+							unset($show_in_locations['[owntab]']);
453
+						}
454
+
455
+						if(!$display_on_listing){
456
+							unset($show_in_locations['[listings]']);
457
+						}
458
+
459
+						?>
460 460
 
461 461
                         <select multiple="multiple" name="show_in[]"
462 462
                                 id="show_in"
@@ -466,38 +466,38 @@  discard block
 block discarded – undo
466 466
                                 option-ajaxchosen="false">
467 467
                             <?php
468 468
 
469
-                            $show_in_values = explode(',',$value);
469
+							$show_in_values = explode(',',$value);
470 470
 
471
-                            foreach( $show_in_locations as $key => $val){
472
-                                $selected = '';
471
+							foreach( $show_in_locations as $key => $val){
472
+								$selected = '';
473 473
 
474
-                                if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
475
-                                    $selected = 'selected';
476
-                                }
474
+								if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
475
+									$selected = 'selected';
476
+								}
477 477
 
478
-                                ?>
478
+								?>
479 479
                                 <option  value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option>
480 480
                                 <?php
481
-                            }
482
-                            ?>
481
+							}
482
+							?>
483 483
                         </select>
484 484
                     </div>
485 485
                 </li>
486 486
                 <?php
487
-            }
487
+			}
488 488
 
489 489
 
490
-            // advanced_editor
491
-            if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
490
+			// advanced_editor
491
+			if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
492 492
 
493
-                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
493
+				echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
494 494
 
495
-            }
495
+			}
496 496
 
497 497
 
498 498
 
499 499
 
500
-            ?>
500
+			?>
501 501
 
502 502
 
503 503
             <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?>
@@ -510,38 +510,38 @@  discard block
 block discarded – undo
510 510
 
511 511
             <?php
512 512
 
513
-            $pricearr = array();
514
-            if (isset($field_info->packages) && $field_info->packages != '') {
515
-                $pricearr = explode(',', trim($field_info->packages, ','));
516
-            } else {
517
-                $package_info = array();
513
+			$pricearr = array();
514
+			if (isset($field_info->packages) && $field_info->packages != '') {
515
+				$pricearr = explode(',', trim($field_info->packages, ','));
516
+			} else {
517
+				$package_info = array();
518 518
 
519
-                $package_info = geodir_post_package_info($package_info, '', $post_type);
520
-                $pricearr[] = $package_info->pid;
521
-            }
519
+				$package_info = geodir_post_package_info($package_info, '', $post_type);
520
+				$pricearr[] = $package_info->pid;
521
+			}
522 522
 
523
-            ob_start()
524
-            ?>
523
+			ob_start()
524
+			?>
525 525
 
526 526
             <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple">
527 527
                 <?php
528
-                if (!empty($pricearr)) {
529
-                    foreach ($pricearr as $val) {
530
-                        ?>
528
+				if (!empty($pricearr)) {
529
+					foreach ($pricearr as $val) {
530
+						?>
531 531
                         <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php
532
-                    }
533
-                }
534
-                ?>
532
+					}
533
+				}
534
+				?>
535 535
             </select>
536 536
 
537 537
             <?php
538
-            $html = ob_get_clean();
538
+			$html = ob_get_clean();
539 539
 
540 540
 			/**
541 541
 			 * Filter the price packages list.
542 542
 			 *
543 543
 			 * Filter the price packages list in custom field form in admin
544
-             * custom fields settings.
544
+			 * custom fields settings.
545 545
 			 *
546 546
 			 * @since 1.0.0
547 547
 			 *
@@ -550,25 +550,25 @@  discard block
 block discarded – undo
550 550
 			 */
551 551
 			echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info);
552 552
 
553
-            ?>
553
+			?>
554 554
 
555 555
 
556 556
 
557 557
             <?php
558 558
 
559
-            // is_required
560
-            if(has_filter("geodir_cfa_is_required_{$field_type}")){
559
+			// is_required
560
+			if(has_filter("geodir_cfa_is_required_{$field_type}")){
561 561
 
562
-                echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
562
+				echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
563 563
 
564
-            }else{
565
-                $value = '';
566
-                if (isset($field_info->is_required)) {
567
-                    $value = esc_attr($field_info->is_required);
568
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
569
-                    $value = $cf['defaults']['is_required'];
570
-                }
571
-                ?>
564
+			}else{
565
+				$value = '';
566
+				if (isset($field_info->is_required)) {
567
+					$value = esc_attr($field_info->is_required);
568
+				}elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
569
+					$value = $cf['defaults']['is_required'];
570
+				}
571
+				?>
572 572
                 <li>
573 573
                     <label for="is_required" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Is required :', 'geodirectory'); ?>
574 574
                         <div class="gdcf-tooltip">
@@ -580,14 +580,14 @@  discard block
 block discarded – undo
580 580
 
581 581
                         <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled"  value="1"
582 582
                             <?php if ($value == '1') {
583
-                                echo 'checked';
584
-                            } ?>/>
583
+								echo 'checked';
584
+							} ?>/>
585 585
                         <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
586 586
 
587 587
                         <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0"
588 588
                             <?php if ($value == '0' || !$value) {
589
-                                echo 'checked';
590
-                            } ?>/>
589
+								echo 'checked';
590
+							} ?>/>
591 591
                         <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
592 592
 
593 593
                     </div>
@@ -595,21 +595,21 @@  discard block
 block discarded – undo
595 595
                 </li>
596 596
 
597 597
                 <?php
598
-            }
598
+			}
599 599
 
600
-            // required_msg
601
-            if(has_filter("geodir_cfa_required_msg_{$field_type}")){
600
+			// required_msg
601
+			if(has_filter("geodir_cfa_required_msg_{$field_type}")){
602 602
 
603
-                echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
603
+				echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
604 604
 
605
-            }else{
606
-                $value = '';
607
-                if (isset($field_info->required_msg)) {
608
-                    $value = esc_attr($field_info->required_msg);
609
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
610
-                    $value = $cf['defaults']['required_msg'];
611
-                }
612
-                ?>
605
+			}else{
606
+				$value = '';
607
+				if (isset($field_info->required_msg)) {
608
+					$value = esc_attr($field_info->required_msg);
609
+				}elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
610
+					$value = $cf['defaults']['required_msg'];
611
+				}
612
+				?>
613 613
                 <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>>
614 614
                     <label for="required_msg" class="gd-cf-tooltip-wrap">
615 615
                         <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
@@ -623,38 +623,38 @@  discard block
 block discarded – undo
623 623
                     </div>
624 624
                 </li>
625 625
                 <?php
626
-            }
626
+			}
627 627
 
628 628
 
629
-            // required_msg
630
-            if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
629
+			// required_msg
630
+			if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
631 631
 
632
-                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
632
+				echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
633 633
 
634
-            }
634
+			}
635 635
 
636 636
 
637
-            // extra_fields
638
-            if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
637
+			// extra_fields
638
+			if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
639 639
 
640
-                echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
640
+				echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
641 641
 
642
-            }
642
+			}
643 643
 
644 644
 
645
-            // field_icon
646
-            if(has_filter("geodir_cfa_field_icon_{$field_type}")){
645
+			// field_icon
646
+			if(has_filter("geodir_cfa_field_icon_{$field_type}")){
647 647
 
648
-                echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
648
+				echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
649 649
 
650
-            }else{
651
-                $value = '';
652
-                if (isset($field_info->field_icon)) {
653
-                    $value = esc_attr($field_info->field_icon);
654
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
655
-                    $value = $cf['defaults']['field_icon'];
656
-                }
657
-                ?>
650
+			}else{
651
+				$value = '';
652
+				if (isset($field_info->field_icon)) {
653
+					$value = esc_attr($field_info->field_icon);
654
+				}elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
655
+					$value = $cf['defaults']['field_icon'];
656
+				}
657
+				?>
658 658
                 <li>
659 659
                     <h3><?php echo __('Custom css', 'geodirectory'); ?></h3>
660 660
 
@@ -672,22 +672,22 @@  discard block
 block discarded – undo
672 672
 
673 673
                 </li>
674 674
                 <?php
675
-            }
675
+			}
676 676
 
677 677
 
678
-            // css_class
679
-            if(has_filter("geodir_cfa_css_class_{$field_type}")){
678
+			// css_class
679
+			if(has_filter("geodir_cfa_css_class_{$field_type}")){
680 680
 
681
-                echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
681
+				echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
682 682
 
683
-            }else{
684
-                $value = '';
685
-                if (isset($field_info->css_class)) {
686
-                    $value = esc_attr($field_info->css_class);
687
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
688
-                    $value = $cf['defaults']['css_class'];
689
-                }
690
-                ?>
683
+			}else{
684
+				$value = '';
685
+				if (isset($field_info->css_class)) {
686
+					$value = esc_attr($field_info->css_class);
687
+				}elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
688
+					$value = $cf['defaults']['css_class'];
689
+				}
690
+				?>
691 691
                 <li>
692 692
 
693 693
                     <label for="css_class" class="gd-cf-tooltip-wrap">
@@ -700,47 +700,47 @@  discard block
 block discarded – undo
700 700
                     <div class="gd-cf-input-wrap">
701 701
                         <input type="text" name="css_class" id="css_class"
702 702
                                value="<?php if (isset($field_info->css_class)) {
703
-                                   echo esc_attr($field_info->css_class);
704
-                               }?>"/>
703
+								   echo esc_attr($field_info->css_class);
704
+							   }?>"/>
705 705
                     </div>
706 706
                 </li>
707 707
                 <?php
708
-            }
708
+			}
709 709
 
710 710
 
711
-            // cat_sort
712
-            if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
711
+			// cat_sort
712
+			if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
713 713
 
714
-                echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
714
+				echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
715 715
 
716
-            }else{
717
-                $value = '';
718
-                $hide_cat_sort  ='';
719
-                if (isset($field_info->cat_sort)) {
720
-                    $value = esc_attr($field_info->cat_sort);
721
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
722
-                    $value = $cf['defaults']['cat_sort'];
723
-                    $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
724
-                }
716
+			}else{
717
+				$value = '';
718
+				$hide_cat_sort  ='';
719
+				if (isset($field_info->cat_sort)) {
720
+					$value = esc_attr($field_info->cat_sort);
721
+				}elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
722
+					$value = $cf['defaults']['cat_sort'];
723
+					$hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
724
+				}
725 725
 
726
-                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
727
-                ?>
726
+				$hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
727
+				?>
728 728
                 <li <?php echo $hide_cat_sort ;?>>
729 729
                     <h3><?php
730
-                        /**
731
-                         * Filter the section title.
732
-                         *
733
-                         * Filter the section title in custom field form in admin
734
-                         * custom fields settings.
735
-                         *
736
-                         * @since 1.0.0
737
-                         *
738
-                         * @param string $title Title of the section.
739
-                         * @param string $field_type Current field type.
740
-                         */
741
-                        echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
742
-
743
-                        ?></h3>
730
+						/**
731
+						 * Filter the section title.
732
+						 *
733
+						 * Filter the section title in custom field form in admin
734
+						 * custom fields settings.
735
+						 *
736
+						 * @since 1.0.0
737
+						 *
738
+						 * @param string $title Title of the section.
739
+						 * @param string $field_type Current field type.
740
+						 */
741
+						echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
742
+
743
+						?></h3>
744 744
                     <label for="cat_sort" class="gd-cf-tooltip-wrap">
745 745
                         <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
746 746
                         <div class="gdcf-tooltip">
@@ -752,42 +752,42 @@  discard block
 block discarded – undo
752 752
 
753 753
                         <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled"  value="1"
754 754
                             <?php if ($value == '1') {
755
-                                echo 'checked';
756
-                            } ?>/>
755
+								echo 'checked';
756
+							} ?>/>
757 757
                         <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
758 758
 
759 759
                         <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0"
760 760
                             <?php if (!$value) {
761
-                                echo 'checked';
762
-                            } ?>/>
761
+								echo 'checked';
762
+							} ?>/>
763 763
                         <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
764 764
 
765 765
                     </div>
766 766
                 </li>
767 767
                 <?php
768
-            }
769
-
770
-
771
-
772
-            switch ($field_type):
773
-                case 'html':
774
-                case 'file':
775
-                case 'url':
776
-                case 'fieldset':
777
-                    break;
778
-                default:
779
-
780
-                    /**
781
-                     * Called at the end of the advanced custom fields settings page loop.
782
-                     *
783
-                     * Can be used to add or deal with different settings types.
784
-                     *
785
-                     * @since 1.0.0
786
-                     * @since 1.6.6 $cf param added.
787
-                     * @param object $field_info The current fields info.
788
-                     * @param array $cf The custom field settings
789
-                     */
790
-                    do_action('geodir_advance_custom_fields', $field_info,$cf);?>
768
+			}
769
+
770
+
771
+
772
+			switch ($field_type):
773
+				case 'html':
774
+				case 'file':
775
+				case 'url':
776
+				case 'fieldset':
777
+					break;
778
+				default:
779
+
780
+					/**
781
+					 * Called at the end of the advanced custom fields settings page loop.
782
+					 *
783
+					 * Can be used to add or deal with different settings types.
784
+					 *
785
+					 * @since 1.0.0
786
+					 * @since 1.6.6 $cf param added.
787
+					 * @param object $field_info The current fields info.
788
+					 * @param array $cf The custom field settings
789
+					 */
790
+					do_action('geodir_advance_custom_fields', $field_info,$cf);?>
791 791
 
792 792
 
793 793
                 <?php endswitch; ?>
Please login to merge, or discard this patch.
Spacing   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 $cf = (isset($cf_arr[$field_type_key])) ? $cf_arr[$field_type_key] : '';
40 40
 
41 41
 
42
-if(isset($field_info->extra_fields)){$extra_fields = $field_info->extra_fields;}
42
+if (isset($field_info->extra_fields)) {$extra_fields = $field_info->extra_fields; }
43 43
 $field_info = stripslashes_deep($field_info); // strip slashes from labels
44
-if(isset($field_info->extra_fields)){$field_info->extra_fields = $extra_fields;}
44
+if (isset($field_info->extra_fields)) {$field_info->extra_fields = $extra_fields; }
45 45
 
46 46
 
47
-$nonce = wp_create_nonce('custom_fields_' . $result_str);
47
+$nonce = wp_create_nonce('custom_fields_'.$result_str);
48 48
 
49 49
 $field_admin_title = '';
50 50
 if (isset($field_info->admin_title))
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
 
70 70
 if (isset($cf['icon']) && strpos($cf['icon'], ' fa-') !== false) {
71 71
     $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
72
-}elseif(isset($cf['icon']) && $cf['icon']){
72
+}elseif (isset($cf['icon']) && $cf['icon']) {
73 73
     $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>';
74
-}else{
74
+} else {
75 75
     $field_icon = '<i class="fas fa-cog" aria-hidden="true"></i>';
76 76
 }
77 77
 
78
-if(isset($cf['name']) && $cf['name']){
78
+if (isset($cf['name']) && $cf['name']) {
79 79
     $field_type_name = $cf['name'];
80
-}else{
80
+} else {
81 81
     $field_type_name = $field_type;
82 82
 }
83 83
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')" >
93 93
         <?php
94 94
 
95
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
95
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
96 96
         ?>
97 97
 
98 98
         <?php if (!$default): ?>
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
             <i class="fas fa-long-arrow-alt-left " aria-hidden="true"></i>
106 106
             <i class="fas fa-long-arrow-alt-right " aria-hidden="true"></i>
107 107
             <b style="cursor:pointer;"
108
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
108
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b>
109 109
         <?php
110 110
         } else {echo $field_icon;
111 111
             ?>
112 112
             <b style="cursor:pointer;"
113
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b>
113
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type_name.')'); ?></b>
114 114
         <?php
115 115
         }
116 116
         ?>
@@ -133,43 +133,43 @@  discard block
 block discarded – undo
133 133
         } ?>"/>
134 134
         <input type="hidden" name="is_active" id="is_active" value="1"/>
135 135
 
136
-        <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?>
137
-        <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" />
138
-        <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" />
139
-        <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : '';?>" />
136
+        <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : ''; ?>" /><?php // show in sidebar value?>
137
+        <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" />
138
+        <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" />
139
+        <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : ''; ?>" />
140 140
 
141 141
         <ul class="widefat post fixed" border="0" style="width:100%;">
142 142
 
143 143
             <?php
144 144
 
145 145
             // data_type
146
-            if(has_filter("geodir_cfa_data_type_{$field_type}")){
146
+            if (has_filter("geodir_cfa_data_type_{$field_type}")) {
147 147
 
148
-                echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
148
+                echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info);
149 149
 
150
-            }else{
150
+            } else {
151 151
                 $value = '';
152 152
                 if (isset($field_info->data_type)) {
153 153
                     $value = esc_attr($field_info->data_type);
154
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
154
+                }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
155 155
                     $value = $cf['defaults']['data_type'];
156 156
                 }
157 157
                 ?>
158
-                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/>
158
+                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/>
159 159
             <?php
160 160
             }
161 161
 
162 162
 
163 163
             // admin_title
164
-            if(has_filter("geodir_cfa_admin_title_{$field_type}")){
164
+            if (has_filter("geodir_cfa_admin_title_{$field_type}")) {
165 165
 
166
-                echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
166
+                echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info);
167 167
 
168
-            }else{
168
+            } else {
169 169
                 $value = '';
170 170
                 if (isset($field_info->admin_title)) {
171 171
                     $value = esc_attr($field_info->admin_title);
172
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
172
+                }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) {
173 173
                     $value = $cf['defaults']['admin_title'];
174 174
                 }
175 175
                 ?>
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     </label>
183 183
                     <div class="gd-cf-input-wrap">
184 184
                         <input type="text" name="admin_title" id="admin_title"
185
-                               value="<?php echo $value;?>"/>
185
+                               value="<?php echo $value; ?>"/>
186 186
                     </div>
187 187
                 </li>
188 188
                 <?php
@@ -190,15 +190,15 @@  discard block
 block discarded – undo
190 190
 
191 191
 
192 192
             // site_title
193
-            if(has_filter("geodir_cfa_site_title_{$field_type}")){
193
+            if (has_filter("geodir_cfa_site_title_{$field_type}")) {
194 194
 
195
-                echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
195
+                echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info);
196 196
 
197
-            }else{
197
+            } else {
198 198
                 $value = '';
199 199
                 if (isset($field_info->site_title)) {
200 200
                     $value = esc_attr($field_info->site_title);
201
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
201
+                }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) {
202 202
                     $value = $cf['defaults']['site_title'];
203 203
                 }
204 204
                 ?>
@@ -218,15 +218,15 @@  discard block
 block discarded – undo
218 218
 
219 219
 
220 220
             // admin_desc
221
-            if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
221
+            if (has_filter("geodir_cfa_admin_desc_{$field_type}")) {
222 222
 
223
-                echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
223
+                echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info);
224 224
 
225
-            }else{
225
+            } else {
226 226
                 $value = '';
227 227
                 if (isset($field_info->admin_desc)) {
228 228
                     $value = esc_attr($field_info->admin_desc);
229
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
229
+                }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) {
230 230
                     $value = $cf['defaults']['admin_desc'];
231 231
                 }
232 232
                 ?>
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
                         </div>
238 238
                     </label>
239 239
                     <div class="gd-cf-input-wrap">
240
-                        <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/>
240
+                        <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/>
241 241
                     </div>
242 242
                 </li>
243 243
                 <?php
@@ -246,26 +246,26 @@  discard block
 block discarded – undo
246 246
 
247 247
 
248 248
             // htmlvar_name
249
-            if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
249
+            if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) {
250 250
 
251
-                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
251
+                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info);
252 252
 
253
-            }else{
253
+            } else {
254 254
                 $value = '';
255 255
                 if (isset($field_info->htmlvar_name)) {
256 256
                     $value = esc_attr($field_info->htmlvar_name);
257
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
257
+                }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) {
258 258
                     $value = $cf['defaults']['htmlvar_name'];
259 259
                 }
260 260
                 ?>
261 261
                 <li>
262
-                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
262
+                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory'); ?>
263 263
                         <div class="gdcf-tooltip">
264 264
                             <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?>
265 265
                         </div>
266 266
                     </label>
267 267
                     <div class="gd-cf-input-wrap">
268
-                        <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>"
268
+                        <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory'); ?>"
269 269
                                value="<?php if ($value) {
270 270
                                    echo preg_replace('/geodir_/', '', $value, 1);
271 271
                                }?>" <?php if ($default) {
@@ -278,15 +278,15 @@  discard block
 block discarded – undo
278 278
 
279 279
 
280 280
             // is_active
281
-            if(has_filter("geodir_cfa_is_active_{$field_type}")){
281
+            if (has_filter("geodir_cfa_is_active_{$field_type}")) {
282 282
 
283
-                echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
283
+                echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info);
284 284
 
285
-            }else{
285
+            } else {
286 286
                 $value = '';
287 287
                 if (isset($field_info->is_active)) {
288 288
                     $value = esc_attr($field_info->is_active);
289
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
289
+                }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) {
290 290
                     $value = $cf['defaults']['is_active'];
291 291
                 }
292 292
                 ?>
@@ -298,17 +298,17 @@  discard block
 block discarded – undo
298 298
                     </label>
299 299
                     <div class="gd-cf-input-wrap gd-switch">
300 300
 
301
-                        <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
301
+                        <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
302 302
                             <?php if ($value == '1') {
303 303
                                 echo 'checked';
304 304
                             } ?>/>
305
-                        <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
305
+                        <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
306 306
 
307
-                        <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
307
+                        <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
308 308
                             <?php if ($value == '0' || !$value) {
309 309
                                 echo 'checked';
310 310
                             } ?>/>
311
-                        <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
311
+                        <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
312 312
 
313 313
                     </div>
314 314
                 </li>
@@ -317,15 +317,15 @@  discard block
 block discarded – undo
317 317
 
318 318
 
319 319
             // for_admin_use
320
-            if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
320
+            if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) {
321 321
 
322
-                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
322
+                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info);
323 323
 
324
-            }else{
324
+            } else {
325 325
                 $value = '';
326 326
                 if (isset($field_info->for_admin_use)) {
327 327
                     $value = esc_attr($field_info->for_admin_use);
328
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
328
+                }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) {
329 329
                     $value = $cf['defaults']['for_admin_use'];
330 330
                 }
331 331
                 ?>
@@ -337,17 +337,17 @@  discard block
 block discarded – undo
337 337
                     </label>
338 338
                     <div class="gd-cf-input-wrap gd-switch">
339 339
 
340
-                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled"  value="1"
340
+                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled"  value="1"
341 341
                             <?php if ($value == '1') {
342 342
                                 echo 'checked';
343 343
                             } ?>/>
344
-                        <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
344
+                        <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
345 345
 
346
-                        <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0"
346
+                        <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0"
347 347
                             <?php if ($value == '0' || !$value) {
348 348
                                 echo 'checked';
349 349
                             } ?>/>
350
-                        <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
350
+                        <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
351 351
 
352 352
                     </div>
353 353
                 </li>
@@ -356,20 +356,20 @@  discard block
 block discarded – undo
356 356
 
357 357
 
358 358
             // default_value
359
-            if(has_filter("geodir_cfa_default_value_{$field_type}")){
359
+            if (has_filter("geodir_cfa_default_value_{$field_type}")) {
360 360
 
361
-                echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
361
+                echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info);
362 362
 
363
-            }else{
363
+            } else {
364 364
                 $value = '';
365 365
                 if (isset($field_info->default_value)) {
366 366
                     $value = esc_attr($field_info->default_value);
367
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
367
+                }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) {
368 368
                     $value = $cf['defaults']['default_value'];
369 369
                 }
370 370
                 ?>
371 371
                 <li>
372
-                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
372
+                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?>
373 373
                         <div class="gdcf-tooltip">
374 374
                             <?php
375 375
                             if ($field_type == 'checkbox') {
@@ -386,12 +386,12 @@  discard block
 block discarded – undo
386 386
                         <?php if ($field_type == 'checkbox') { ?>
387 387
                             <select name="default_value" id="default_value">
388 388
                                 <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option>
389
-                                <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option>
389
+                                <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option>
390 390
                             </select>
391 391
                         <?php } else if ($field_type == 'email') { ?>
392
-                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
392
+                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
393 393
                         <?php } else { ?>
394
-                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
394
+                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
395 395
                         <?php } ?>
396 396
                     </div>
397 397
                 </li>
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
 
401 401
 
402 402
             // show_in
403
-            if(has_filter("geodir_cfa_show_in_{$field_type}")){
403
+            if (has_filter("geodir_cfa_show_in_{$field_type}")) {
404 404
 
405
-                echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
405
+                echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info);
406 406
 
407
-            }else{
407
+            } else {
408 408
                 $value = '';
409 409
                 if (isset($field_info->show_in)) {
410 410
                     $value = esc_attr($field_info->show_in);
411
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
411
+                }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) {
412 412
                     $value = esc_attr($cf['defaults']['show_in']);
413 413
                 }
414 414
                 ?>
@@ -441,18 +441,18 @@  discard block
 block discarded – undo
441 441
                          * @param object $field_info The field being displayed info.
442 442
                          * @param string $field_info The type of field.
443 443
                          */
444
-                        $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
444
+                        $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type);
445 445
 
446 446
 
447 447
                         // remove some locations for some field types
448 448
 
449 449
                         // don't show new tab option for some types
450
-                        if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
451
-                        }else{
450
+                        if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
451
+                        } else {
452 452
                             unset($show_in_locations['[owntab]']);
453 453
                         }
454 454
 
455
-                        if(!$display_on_listing){
455
+                        if (!$display_on_listing) {
456 456
                             unset($show_in_locations['[listings]']);
457 457
                         }
458 458
 
@@ -466,17 +466,17 @@  discard block
 block discarded – undo
466 466
                                 option-ajaxchosen="false">
467 467
                             <?php
468 468
 
469
-                            $show_in_values = explode(',',$value);
469
+                            $show_in_values = explode(',', $value);
470 470
 
471
-                            foreach( $show_in_locations as $key => $val){
471
+                            foreach ($show_in_locations as $key => $val) {
472 472
                                 $selected = '';
473 473
 
474
-                                if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
474
+                                if (is_array($show_in_values) && in_array($key, $show_in_values)) {
475 475
                                     $selected = 'selected';
476 476
                                 }
477 477
 
478 478
                                 ?>
479
-                                <option  value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option>
479
+                                <option  value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option>
480 480
                                 <?php
481 481
                             }
482 482
                             ?>
@@ -488,9 +488,9 @@  discard block
 block discarded – undo
488 488
 
489 489
 
490 490
             // advanced_editor
491
-            if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
491
+            if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) {
492 492
 
493
-                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
493
+                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info);
494 494
 
495 495
             }
496 496
 
@@ -501,10 +501,10 @@  discard block
 block discarded – undo
501 501
 
502 502
 
503 503
             <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?>
504
-            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/>
504
+            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/>
505 505
 
506 506
             <?php // we dont need to show the sort order ?>
507
-            <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order);} ?>"/>
507
+            <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order); } ?>"/>
508 508
 
509 509
 
510 510
 
@@ -557,15 +557,15 @@  discard block
 block discarded – undo
557 557
             <?php
558 558
 
559 559
             // is_required
560
-            if(has_filter("geodir_cfa_is_required_{$field_type}")){
560
+            if (has_filter("geodir_cfa_is_required_{$field_type}")) {
561 561
 
562
-                echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
562
+                echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info);
563 563
 
564
-            }else{
564
+            } else {
565 565
                 $value = '';
566 566
                 if (isset($field_info->is_required)) {
567 567
                     $value = esc_attr($field_info->is_required);
568
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
568
+                }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) {
569 569
                     $value = $cf['defaults']['is_required'];
570 570
                 }
571 571
                 ?>
@@ -578,17 +578,17 @@  discard block
 block discarded – undo
578 578
 
579 579
                     <div class="gd-cf-input-wrap gd-switch">
580 580
 
581
-                        <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled"  value="1"
581
+                        <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled"  value="1"
582 582
                             <?php if ($value == '1') {
583 583
                                 echo 'checked';
584 584
                             } ?>/>
585
-                        <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
585
+                        <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
586 586
 
587
-                        <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0"
587
+                        <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0"
588 588
                             <?php if ($value == '0' || !$value) {
589 589
                                 echo 'checked';
590 590
                             } ?>/>
591
-                        <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
591
+                        <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
592 592
 
593 593
                     </div>
594 594
 
@@ -598,19 +598,19 @@  discard block
 block discarded – undo
598 598
             }
599 599
 
600 600
             // required_msg
601
-            if(has_filter("geodir_cfa_required_msg_{$field_type}")){
601
+            if (has_filter("geodir_cfa_required_msg_{$field_type}")) {
602 602
 
603
-                echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
603
+                echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info);
604 604
 
605
-            }else{
605
+            } else {
606 606
                 $value = '';
607 607
                 if (isset($field_info->required_msg)) {
608 608
                     $value = esc_attr($field_info->required_msg);
609
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
609
+                }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) {
610 610
                     $value = $cf['defaults']['required_msg'];
611 611
                 }
612 612
                 ?>
613
-                <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>>
613
+                <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'"; }?>>
614 614
                     <label for="required_msg" class="gd-cf-tooltip-wrap">
615 615
                         <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
616 616
                         <div class="gdcf-tooltip">
@@ -627,31 +627,31 @@  discard block
 block discarded – undo
627 627
 
628 628
 
629 629
             // required_msg
630
-            if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
630
+            if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) {
631 631
 
632
-                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
632
+                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info);
633 633
 
634 634
             }
635 635
 
636 636
 
637 637
             // extra_fields
638
-            if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
638
+            if (has_filter("geodir_cfa_extra_fields_{$field_type}")) {
639 639
 
640
-                echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
640
+                echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info);
641 641
 
642 642
             }
643 643
 
644 644
 
645 645
             // field_icon
646
-            if(has_filter("geodir_cfa_field_icon_{$field_type}")){
646
+            if (has_filter("geodir_cfa_field_icon_{$field_type}")) {
647 647
 
648
-                echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
648
+                echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info);
649 649
 
650
-            }else{
650
+            } else {
651 651
                 $value = '';
652 652
                 if (isset($field_info->field_icon)) {
653 653
                     $value = esc_attr($field_info->field_icon);
654
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
654
+                }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) {
655 655
                     $value = $cf['defaults']['field_icon'];
656 656
                 }
657 657
                 ?>
@@ -662,12 +662,12 @@  discard block
 block discarded – undo
662 662
                     <label for="field_icon" class="gd-cf-tooltip-wrap">
663 663
                         <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?>
664 664
                         <div class="gdcf-tooltip">
665
-                            <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fas fa-home"', 'geodirectory');?>
665
+                            <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fas fa-home"', 'geodirectory'); ?>
666 666
                         </div>
667 667
                     </label>
668 668
                     <div class="gd-cf-input-wrap">
669 669
                         <input type="text" name="field_icon" id="field_icon"
670
-                               value="<?php echo $value;?>"/>
670
+                               value="<?php echo $value; ?>"/>
671 671
                     </div>
672 672
 
673 673
                 </li>
@@ -676,15 +676,15 @@  discard block
 block discarded – undo
676 676
 
677 677
 
678 678
             // css_class
679
-            if(has_filter("geodir_cfa_css_class_{$field_type}")){
679
+            if (has_filter("geodir_cfa_css_class_{$field_type}")) {
680 680
 
681
-                echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
681
+                echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info);
682 682
 
683
-            }else{
683
+            } else {
684 684
                 $value = '';
685 685
                 if (isset($field_info->css_class)) {
686 686
                     $value = esc_attr($field_info->css_class);
687
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
687
+                }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) {
688 688
                     $value = $cf['defaults']['css_class'];
689 689
                 }
690 690
                 ?>
@@ -693,8 +693,8 @@  discard block
 block discarded – undo
693 693
                     <label for="css_class" class="gd-cf-tooltip-wrap">
694 694
                         <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?>
695 695
                         <div class="gdcf-tooltip">
696
-                            <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
697
-                            <?php if($field_type=='multiselect'){_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory');}?>
696
+                            <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?>
697
+                            <?php if ($field_type == 'multiselect') {_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory'); }?>
698 698
                         </div>
699 699
                     </label>
700 700
                     <div class="gd-cf-input-wrap">
@@ -709,23 +709,23 @@  discard block
 block discarded – undo
709 709
 
710 710
 
711 711
             // cat_sort
712
-            if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
712
+            if (has_filter("geodir_cfa_cat_sort_{$field_type}")) {
713 713
 
714
-                echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
714
+                echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info);
715 715
 
716
-            }else{
716
+            } else {
717 717
                 $value = '';
718
-                $hide_cat_sort  ='';
718
+                $hide_cat_sort = '';
719 719
                 if (isset($field_info->cat_sort)) {
720 720
                     $value = esc_attr($field_info->cat_sort);
721
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
721
+                }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) {
722 722
                     $value = $cf['defaults']['cat_sort'];
723
-                    $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
723
+                    $hide_cat_sort = ($value === false) ? "style='display:none;'" : '';
724 724
                 }
725 725
 
726
-                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
726
+                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : '';
727 727
                 ?>
728
-                <li <?php echo $hide_cat_sort ;?>>
728
+                <li <?php echo $hide_cat_sort; ?>>
729 729
                     <h3><?php
730 730
                         /**
731 731
                          * Filter the section title.
@@ -744,23 +744,23 @@  discard block
 block discarded – undo
744 744
                     <label for="cat_sort" class="gd-cf-tooltip-wrap">
745 745
                         <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
746 746
                         <div class="gdcf-tooltip">
747
-                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?>
747
+                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?>
748 748
                         </div>
749 749
                     </label>
750 750
 
751 751
                     <div class="gd-cf-input-wrap gd-switch">
752 752
 
753
-                        <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled"  value="1"
753
+                        <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled"  value="1"
754 754
                             <?php if ($value == '1') {
755 755
                                 echo 'checked';
756 756
                             } ?>/>
757
-                        <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
757
+                        <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
758 758
 
759
-                        <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0"
759
+                        <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0"
760 760
                             <?php if (!$value) {
761 761
                                 echo 'checked';
762 762
                             } ?>/>
763
-                        <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
763
+                        <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
764 764
 
765 765
                     </div>
766 766
                 </li>
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
                      * @param object $field_info The current fields info.
788 788
                      * @param array $cf The custom field settings
789 789
                      */
790
-                    do_action('geodir_advance_custom_fields', $field_info,$cf);?>
790
+                    do_action('geodir_advance_custom_fields', $field_info, $cf); ?>
791 791
 
792 792
 
793 793
                 <?php endswitch; ?>
@@ -799,10 +799,10 @@  discard block
 block discarded – undo
799 799
                     <h3></h3>
800 800
                 </label>
801 801
                 <div class="gd-cf-input-wrap">
802
-                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
802
+                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
803 803
                            onclick="save_field('<?php echo esc_attr($result_str); ?>')"/>
804 804
                     <?php if (!$default): ?>
805
-                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
805
+                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
806 806
                                                             onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')"
807 807
                                                             class="button"/></a>
808 808
                     <?php endif; ?>
Please login to merge, or discard this patch.
Braces   +38 added lines, -36 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 if (!isset($field_info->post_type)) {
21 21
     $post_type = sanitize_text_field($_REQUEST['listing_type']);
22
-} else
23
-    $post_type = $field_info->post_type;
22
+} else {
23
+    $post_type = $field_info->post_type;
24
+}
24 25
 
25 26
 //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){
26 27
 //    $cf_arr = geodir_custom_fields_predefined($post_type);
@@ -47,8 +48,9 @@  discard block
 block discarded – undo
47 48
 $nonce = wp_create_nonce('custom_fields_' . $result_str);
48 49
 
49 50
 $field_admin_title = '';
50
-if (isset($field_info->admin_title))
51
-    $field_admin_title = $field_info->admin_title;
51
+if (isset($field_info->admin_title)) {
52
+    $field_admin_title = $field_info->admin_title;
53
+}
52 54
 
53 55
 $default = isset($field_info->is_admin) ? $field_info->is_admin : '';
54 56
 
@@ -69,15 +71,15 @@  discard block
 block discarded – undo
69 71
 
70 72
 if (isset($cf['icon']) && strpos($cf['icon'], ' fa-') !== false) {
71 73
     $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
72
-}elseif(isset($cf['icon']) && $cf['icon']){
74
+} elseif(isset($cf['icon']) && $cf['icon']){
73 75
     $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>';
74
-}else{
76
+} else{
75 77
     $field_icon = '<i class="fas fa-cog" aria-hidden="true"></i>';
76 78
 }
77 79
 
78 80
 if(isset($cf['name']) && $cf['name']){
79 81
     $field_type_name = $cf['name'];
80
-}else{
82
+} else{
81 83
     $field_type_name = $field_type;
82 84
 }
83 85
 
@@ -147,11 +149,11 @@  discard block
 block discarded – undo
147 149
 
148 150
                 echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
149 151
 
150
-            }else{
152
+            } else{
151 153
                 $value = '';
152 154
                 if (isset($field_info->data_type)) {
153 155
                     $value = esc_attr($field_info->data_type);
154
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
156
+                } elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
155 157
                     $value = $cf['defaults']['data_type'];
156 158
                 }
157 159
                 ?>
@@ -165,11 +167,11 @@  discard block
 block discarded – undo
165 167
 
166 168
                 echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
167 169
 
168
-            }else{
170
+            } else{
169 171
                 $value = '';
170 172
                 if (isset($field_info->admin_title)) {
171 173
                     $value = esc_attr($field_info->admin_title);
172
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
174
+                } elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
173 175
                     $value = $cf['defaults']['admin_title'];
174 176
                 }
175 177
                 ?>
@@ -194,11 +196,11 @@  discard block
 block discarded – undo
194 196
 
195 197
                 echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
196 198
 
197
-            }else{
199
+            } else{
198 200
                 $value = '';
199 201
                 if (isset($field_info->site_title)) {
200 202
                     $value = esc_attr($field_info->site_title);
201
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
203
+                } elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
202 204
                     $value = $cf['defaults']['site_title'];
203 205
                 }
204 206
                 ?>
@@ -222,11 +224,11 @@  discard block
 block discarded – undo
222 224
 
223 225
                 echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
224 226
 
225
-            }else{
227
+            } else{
226 228
                 $value = '';
227 229
                 if (isset($field_info->admin_desc)) {
228 230
                     $value = esc_attr($field_info->admin_desc);
229
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
231
+                } elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
230 232
                     $value = $cf['defaults']['admin_desc'];
231 233
                 }
232 234
                 ?>
@@ -250,11 +252,11 @@  discard block
 block discarded – undo
250 252
 
251 253
                 echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
252 254
 
253
-            }else{
255
+            } else{
254 256
                 $value = '';
255 257
                 if (isset($field_info->htmlvar_name)) {
256 258
                     $value = esc_attr($field_info->htmlvar_name);
257
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
259
+                } elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
258 260
                     $value = $cf['defaults']['htmlvar_name'];
259 261
                 }
260 262
                 ?>
@@ -282,11 +284,11 @@  discard block
 block discarded – undo
282 284
 
283 285
                 echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
284 286
 
285
-            }else{
287
+            } else{
286 288
                 $value = '';
287 289
                 if (isset($field_info->is_active)) {
288 290
                     $value = esc_attr($field_info->is_active);
289
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
291
+                } elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
290 292
                     $value = $cf['defaults']['is_active'];
291 293
                 }
292 294
                 ?>
@@ -321,11 +323,11 @@  discard block
 block discarded – undo
321 323
 
322 324
                 echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
323 325
 
324
-            }else{
326
+            } else{
325 327
                 $value = '';
326 328
                 if (isset($field_info->for_admin_use)) {
327 329
                     $value = esc_attr($field_info->for_admin_use);
328
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
330
+                } elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
329 331
                     $value = $cf['defaults']['for_admin_use'];
330 332
                 }
331 333
                 ?>
@@ -360,11 +362,11 @@  discard block
 block discarded – undo
360 362
 
361 363
                 echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
362 364
 
363
-            }else{
365
+            } else{
364 366
                 $value = '';
365 367
                 if (isset($field_info->default_value)) {
366 368
                     $value = esc_attr($field_info->default_value);
367
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
369
+                } elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
368 370
                     $value = $cf['defaults']['default_value'];
369 371
                 }
370 372
                 ?>
@@ -404,11 +406,11 @@  discard block
 block discarded – undo
404 406
 
405 407
                 echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
406 408
 
407
-            }else{
409
+            } else{
408 410
                 $value = '';
409 411
                 if (isset($field_info->show_in)) {
410 412
                     $value = esc_attr($field_info->show_in);
411
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
413
+                } elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
412 414
                     $value = esc_attr($cf['defaults']['show_in']);
413 415
                 }
414 416
                 ?>
@@ -448,7 +450,7 @@  discard block
 block discarded – undo
448 450
 
449 451
                         // don't show new tab option for some types
450 452
                         if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
451
-                        }else{
453
+                        } else{
452 454
                             unset($show_in_locations['[owntab]']);
453 455
                         }
454 456
 
@@ -561,11 +563,11 @@  discard block
 block discarded – undo
561 563
 
562 564
                 echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
563 565
 
564
-            }else{
566
+            } else{
565 567
                 $value = '';
566 568
                 if (isset($field_info->is_required)) {
567 569
                     $value = esc_attr($field_info->is_required);
568
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
570
+                } elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
569 571
                     $value = $cf['defaults']['is_required'];
570 572
                 }
571 573
                 ?>
@@ -602,11 +604,11 @@  discard block
 block discarded – undo
602 604
 
603 605
                 echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
604 606
 
605
-            }else{
607
+            } else{
606 608
                 $value = '';
607 609
                 if (isset($field_info->required_msg)) {
608 610
                     $value = esc_attr($field_info->required_msg);
609
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
611
+                } elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
610 612
                     $value = $cf['defaults']['required_msg'];
611 613
                 }
612 614
                 ?>
@@ -647,11 +649,11 @@  discard block
 block discarded – undo
647 649
 
648 650
                 echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
649 651
 
650
-            }else{
652
+            } else{
651 653
                 $value = '';
652 654
                 if (isset($field_info->field_icon)) {
653 655
                     $value = esc_attr($field_info->field_icon);
654
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
656
+                } elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
655 657
                     $value = $cf['defaults']['field_icon'];
656 658
                 }
657 659
                 ?>
@@ -680,11 +682,11 @@  discard block
 block discarded – undo
680 682
 
681 683
                 echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
682 684
 
683
-            }else{
685
+            } else{
684 686
                 $value = '';
685 687
                 if (isset($field_info->css_class)) {
686 688
                     $value = esc_attr($field_info->css_class);
687
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
689
+                } elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
688 690
                     $value = $cf['defaults']['css_class'];
689 691
                 }
690 692
                 ?>
@@ -713,12 +715,12 @@  discard block
 block discarded – undo
713 715
 
714 716
                 echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
715 717
 
716
-            }else{
718
+            } else{
717 719
                 $value = '';
718 720
                 $hide_cat_sort  ='';
719 721
                 if (isset($field_info->cat_sort)) {
720 722
                     $value = esc_attr($field_info->cat_sort);
721
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
723
+                } elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
722 724
                     $value = $cf['defaults']['cat_sort'];
723 725
                     $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
724 726
                 }
Please login to merge, or discard this patch.
geodirectory-functions/custom_functions.php 2 patches
Spacing   +718 added lines, -718 removed lines patch added patch discarded remove patch
@@ -52,31 +52,31 @@  discard block
 block discarded – undo
52 52
 				jQuery(listSel).children('li').switchClass('gridview_onehalf gridview_onethird gridview_onefourth', 'gridview_onefifth', 600);
53 53
 			}
54 54
 
55
-			jQuery.post("<?php echo geodir_get_ajax_url();?>&gd_listing_view=" + val, function (data) {
55
+			jQuery.post("<?php echo geodir_get_ajax_url(); ?>&gd_listing_view=" + val, function (data) {
56 56
 				//alert(data );
57 57
 			});
58 58
 		}
59 59
 	</script>
60 60
 	<div class="geodir-list-view-select">
61 61
 		<select name="gd_list_view" id="gd_list_view" onchange="geodir_list_view_select(this);">
62
-			<?php $listing_view = (int) $gd_session->get( 'gd_listing_view' ); ?>
63
-			<option value=""><?php _e( 'View:', 'geodirectory' ); ?></option>
62
+			<?php $listing_view = (int) $gd_session->get('gd_listing_view'); ?>
63
+			<option value=""><?php _e('View:', 'geodirectory'); ?></option>
64 64
 			<option
65
-				value="1" <?php selected( 1, $listing_view ); ?>><?php _e( 'View: List', 'geodirectory' ); ?></option>
65
+				value="1" <?php selected(1, $listing_view); ?>><?php _e('View: List', 'geodirectory'); ?></option>
66 66
 			<option
67
-				value="2" <?php selected( 2, $listing_view ); ?>><?php _e( 'View: Grid 2', 'geodirectory' ); ?></option>
67
+				value="2" <?php selected(2, $listing_view); ?>><?php _e('View: Grid 2', 'geodirectory'); ?></option>
68 68
 			<option
69
-				value="3" <?php selected( 3, $listing_view ); ?>><?php _e( 'View: Grid 3', 'geodirectory' ); ?></option>
69
+				value="3" <?php selected(3, $listing_view); ?>><?php _e('View: Grid 3', 'geodirectory'); ?></option>
70 70
 			<option
71
-				value="4" <?php selected( 4, $listing_view ); ?>><?php _e( 'View: Grid 4', 'geodirectory' ); ?></option>
71
+				value="4" <?php selected(4, $listing_view); ?>><?php _e('View: Grid 4', 'geodirectory'); ?></option>
72 72
 			<option
73
-				value="5" <?php selected( 5, $listing_view ); ?>><?php _e( 'View: Grid 5', 'geodirectory' ); ?></option>
73
+				value="5" <?php selected(5, $listing_view); ?>><?php _e('View: Grid 5', 'geodirectory'); ?></option>
74 74
 		</select>
75 75
 	</div>
76 76
 	<?php
77 77
 }
78 78
 
79
-add_action( 'geodir_before_listing', 'geodir_list_view_select', 100 );
79
+add_action('geodir_before_listing', 'geodir_list_view_select', 100);
80 80
 
81 81
 /**
82 82
  * Limit the listing excerpt.
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
  * @global object $post          The current post object.
92 92
  * @return string The modified excerpt.
93 93
  */
94
-function geodir_max_excerpt( $charlength ) {
94
+function geodir_max_excerpt($charlength) {
95 95
 	global $post;
96
-	if ( $charlength == '0' ) {
96
+	if ($charlength == '0') {
97 97
 		return;
98 98
 	}
99 99
 	$out = '';
@@ -101,46 +101,46 @@  discard block
 block discarded – undo
101 101
 	$temp_post = $post;
102 102
 	$excerpt   = get_the_excerpt();
103 103
 
104
-	$charlength ++;
105
-	$excerpt_more = function_exists( 'geodirf_excerpt_more' ) ? geodirf_excerpt_more( '' ) : geodir_excerpt_more( '' );
106
-	if ( geodir_utf8_strlen( $excerpt ) > $charlength ) {
107
-		if ( geodir_utf8_strlen( $excerpt_more ) > 0 && geodir_utf8_strpos( $excerpt, $excerpt_more ) !== false ) {
108
-			$excut = - ( geodir_utf8_strlen( $excerpt_more ) );
109
-			$subex = geodir_utf8_substr( $excerpt, 0, $excut );
110
-			if ( $charlength > 0 && geodir_utf8_strlen( $subex ) > $charlength ) {
111
-				$subex = geodir_utf8_substr( $subex, 0, $charlength );
104
+	$charlength++;
105
+	$excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
106
+	if (geodir_utf8_strlen($excerpt) > $charlength) {
107
+		if (geodir_utf8_strlen($excerpt_more) > 0 && geodir_utf8_strpos($excerpt, $excerpt_more) !== false) {
108
+			$excut = - (geodir_utf8_strlen($excerpt_more));
109
+			$subex = geodir_utf8_substr($excerpt, 0, $excut);
110
+			if ($charlength > 0 && geodir_utf8_strlen($subex) > $charlength) {
111
+				$subex = geodir_utf8_substr($subex, 0, $charlength);
112 112
 			}
113 113
 			$out .= $subex;
114 114
 		} else {
115
-			$subex   = geodir_utf8_substr( $excerpt, 0, $charlength - 5 );
116
-			$exwords = explode( ' ', $subex );
117
-			$excut   = - ( geodir_utf8_strlen( $exwords[ count( $exwords ) - 1 ] ) );
118
-			if ( $excut < 0 ) {
119
-				$out .= geodir_utf8_substr( $subex, 0, $excut );
115
+			$subex   = geodir_utf8_substr($excerpt, 0, $charlength - 5);
116
+			$exwords = explode(' ', $subex);
117
+			$excut   = - (geodir_utf8_strlen($exwords[count($exwords) - 1]));
118
+			if ($excut < 0) {
119
+				$out .= geodir_utf8_substr($subex, 0, $excut);
120 120
 			} else {
121 121
 				$out .= $subex;
122 122
 			}
123 123
 		}
124
-		$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
124
+		$out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
125 125
 		/**
126 126
 		 * Filter excerpt read more text.
127 127
 		 *
128 128
 		 * @since 1.0.0
129 129
 		 */
130
-		$out .= apply_filters( 'geodir_max_excerpt_end', __( 'Read more [...]', 'geodirectory' ) );
130
+		$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
131 131
 		$out .= '</a>';
132 132
 
133 133
 	} else {
134
-		if ( geodir_utf8_strlen( $excerpt_more ) > 0 && geodir_utf8_strpos( $excerpt, $excerpt_more ) !== false ) {
135
-			$excut = - ( geodir_utf8_strlen( $excerpt_more ) );
136
-			$out .= geodir_utf8_substr( $excerpt, 0, $excut );
137
-			$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
134
+		if (geodir_utf8_strlen($excerpt_more) > 0 && geodir_utf8_strpos($excerpt, $excerpt_more) !== false) {
135
+			$excut = - (geodir_utf8_strlen($excerpt_more));
136
+			$out .= geodir_utf8_substr($excerpt, 0, $excut);
137
+			$out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
138 138
 			/**
139 139
 			 * Filter excerpt read more text.
140 140
 			 *
141 141
 			 * @since 1.0.0
142 142
 			 */
143
-			$out .= apply_filters( 'geodir_max_excerpt_end', __( 'Read more [...]', 'geodirectory' ) );
143
+			$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
144 144
 			$out .= '</a>';
145 145
 		} else {
146 146
 			$out .= $excerpt;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
  *
164 164
  * @return object Returns filtered package info as an object.
165 165
  */
166
-function geodir_post_package_info( $package_info, $post = '', $post_type = '' ) {
166
+function geodir_post_package_info($package_info, $post = '', $post_type = '') {
167 167
 	$package_info['pid']              = 0;
168 168
 	$package_info['days']             = 0;
169 169
 	$package_info['amount']           = 0;
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 * @param object|string $post  The post object.
193 193
 	 * @param string $post_type    The post type.
194 194
 	 */
195
-	return (object) apply_filters( 'geodir_post_package_info', $package_info, $post, $post_type );
195
+	return (object) apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
196 196
 
197 197
 }
198 198
 
@@ -220,11 +220,11 @@  discard block
 block discarded – undo
220 220
  *
221 221
  * }
222 222
  */
223
-function geodir_send_inquiry( $request ) {
223
+function geodir_send_inquiry($request) {
224 224
 	global $wpdb;
225 225
 
226 226
 	// strip slashes from text
227
-	$request = ! empty( $request ) ? stripslashes_deep( $request ) : $request;
227
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
228 228
 
229 229
 	$yourname      = sanitize_text_field($request['inq_name']);
230 230
 	$youremail     = sanitize_email($request['inq_email']);
@@ -232,25 +232,25 @@  discard block
 block discarded – undo
232 232
 	$frnd_comments = sanitize_text_field($request['inq_msg']);
233 233
 	$pid           = absint($request['pid']);
234 234
 
235
-	$author_id  = '';
235
+	$author_id = '';
236 236
 
237
-	if ( $pid && 'publish' == get_post_status ( $pid  ) ) {
237
+	if ($pid && 'publish' == get_post_status($pid)) {
238 238
 
239
-		check_ajax_referer( 'send_inquiry_'.$pid );
239
+		check_ajax_referer('send_inquiry_'.$pid);
240 240
 
241 241
 		$p_post = get_post($pid);
242 242
 
243
-		$author_id  = $p_post->post_author;
243
+		$author_id = $p_post->post_author;
244 244
 
245
-	}else{
245
+	} else {
246 246
 		gd_die();
247 247
 	}
248 248
 
249
-	$to_email  = geodir_get_post_meta( $pid, 'geodir_email', true );
250
-	$to_name   = geodir_get_client_name( $author_id );
249
+	$to_email  = geodir_get_post_meta($pid, 'geodir_email', true);
250
+	$to_name   = geodir_get_client_name($author_id);
251 251
 
252
-	if ( $to_email == '' ) {
253
-		$to_email = get_option( 'admin_email' );
252
+	if ($to_email == '') {
253
+		$to_email = get_option('admin_email');
254 254
 	}
255 255
 
256 256
 	/**
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
 	 * }
272 272
 	 * @param string $type     The form type, default: `Enquiry`.
273 273
 	 */
274
-	do_action( 'geodir_after_send_enquiry', $request, 'Enquiry' );
274
+	do_action('geodir_after_send_enquiry', $request, 'Enquiry');
275 275
 
276 276
 	$client_message = $frnd_comments;
277
-	$client_message .= '<br>' . __( 'From :', 'geodirectory' ) . ' ' . $yourname . '<br>' . __( 'Phone :', 'geodirectory' ) . ' ' . $inq_phone . '<br>' . __( 'Email :', 'geodirectory' ) . ' ' . $youremail . '<br><br>' . __( 'Sent from', 'geodirectory' ) . ' - <b><a href="' . trailingslashit( home_url() ) . '">' . get_option( 'blogname' ) . '</a></b>.';
277
+	$client_message .= '<br>'.__('From :', 'geodirectory').' '.$yourname.'<br>'.__('Phone :', 'geodirectory').' '.$inq_phone.'<br>'.__('Email :', 'geodirectory').' '.$youremail.'<br><br>'.__('Sent from', 'geodirectory').' - <b><a href="'.trailingslashit(home_url()).'">'.get_option('blogname').'</a></b>.';
278 278
 	/**
279 279
 	 * Filter client message text.
280 280
 	 *
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 *
283 283
 	 * @param string $client_message Client message text.
284 284
 	 */
285
-	$client_message = apply_filters( 'geodir_inquiry_email_msg', $client_message );
285
+	$client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
286 286
 
287 287
 	/**
288 288
 	 * Called before the send enquiry email is sent.
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 	 *
302 302
 	 * }
303 303
 	 */
304
-	do_action( 'geodir_before_send_enquiry_email', $request );
305
-	if ( $to_email ) {
304
+	do_action('geodir_before_send_enquiry_email', $request);
305
+	if ($to_email) {
306 306
 		// strip slashes message
307
-		$client_message = stripslashes_deep( $client_message );
307
+		$client_message = stripslashes_deep($client_message);
308 308
 
309
-		geodir_sendEmail( $youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid'] );//To client email
309
+		geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']); //To client email
310 310
 	}
311 311
 
312 312
 	/**
@@ -326,12 +326,12 @@  discard block
 block discarded – undo
326 326
 	 *
327 327
 	 * }
328 328
 	 */
329
-	do_action( 'geodir_after_send_enquiry_email', $request );
330
-	$url = get_permalink( $pid );
331
-	if ( strstr( $url, '?' ) ) {
332
-		$url = $url . "&send_inquiry=success";
329
+	do_action('geodir_after_send_enquiry_email', $request);
330
+	$url = get_permalink($pid);
331
+	if (strstr($url, '?')) {
332
+		$url = $url."&send_inquiry=success";
333 333
 	} else {
334
-		$url = $url . "?send_inquiry=success";
334
+		$url = $url."?send_inquiry=success";
335 335
 	}
336 336
 	/**
337 337
 	 * Filter redirect url after the send enquiry email is sent.
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
 	 *
341 341
 	 * @param string $url Redirect url.
342 342
 	 */
343
-	$url = apply_filters( 'geodir_send_enquiry_after_submit_redirect', $url );
344
-	wp_redirect( $url );
343
+	$url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
344
+	wp_redirect($url);
345 345
 	gd_die();
346 346
 
347 347
 }
@@ -372,11 +372,11 @@  discard block
 block discarded – undo
372 372
  *
373 373
  * @deprecated 1.6.26
374 374
  */
375
-function geodir_send_friend( $request ) {
375
+function geodir_send_friend($request) {
376 376
 	global $wpdb;
377 377
 
378 378
 	// strip slashes from text
379
-	$request = ! empty( $request ) ? stripslashes_deep( $request ) : $request;
379
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
380 380
 
381 381
 	$yourname      = sanitize_text_field($request['yourname']);
382 382
 	$youremail     = sanitize_email($request['youremail']);
@@ -385,11 +385,11 @@  discard block
 block discarded – undo
385 385
 	$pid           = absint($request['pid']);
386 386
 	$to_email      = sanitize_email($request['to_email']);
387 387
 	$to_name       = sanitize_text_field($request['to_name']);
388
-	if ( $pid && 'publish' == get_post_status ( $pid  ) ) {
388
+	if ($pid && 'publish' == get_post_status($pid)) {
389 389
 
390
-		check_ajax_referer( 'send_to_frnd_'.$pid );
390
+		check_ajax_referer('send_to_frnd_'.$pid);
391 391
 
392
-	}else{
392
+	} else {
393 393
 		gd_die();
394 394
 	}
395 395
 
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
 	 *
413 413
 	 * }
414 414
 	 */
415
-	do_action( 'geodir_before_send_to_friend_email', $request );
416
-	geodir_sendEmail( $youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid'] );//To client email
415
+	do_action('geodir_before_send_to_friend_email', $request);
416
+	geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']); //To client email
417 417
 
418 418
 	/**
419 419
 	 * Called after the send to friend email is sent.
@@ -434,13 +434,13 @@  discard block
 block discarded – undo
434 434
 	 *
435 435
 	 * }
436 436
 	 */
437
-	do_action( 'geodir_after_send_to_friend_email', $request );
437
+	do_action('geodir_after_send_to_friend_email', $request);
438 438
 
439
-	$url = get_permalink( $pid );
440
-	if ( strstr( $url, '?' ) ) {
441
-		$url = $url . "&sendtofrnd=success";
439
+	$url = get_permalink($pid);
440
+	if (strstr($url, '?')) {
441
+		$url = $url."&sendtofrnd=success";
442 442
 	} else {
443
-		$url = $url . "?sendtofrnd=success";
443
+		$url = $url."?sendtofrnd=success";
444 444
 	}
445 445
 	/**
446 446
 	 * Filter redirect url after the send to friend email is sent.
@@ -449,8 +449,8 @@  discard block
 block discarded – undo
449 449
 	 *
450 450
 	 * @param string $url Redirect url.
451 451
 	 */
452
-	$url = apply_filters( 'geodir_send_to_friend_after_submit_redirect', $url );
453
-	wp_redirect( $url );
452
+	$url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
453
+	wp_redirect($url);
454 454
 	gd_die();
455 455
 }
456 456
 
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
  *
465 465
  * @param string $hash_key
466 466
  */
467
-function geodir_before_tab_content( $hash_key ) {
468
-	switch ( $hash_key ) {
467
+function geodir_before_tab_content($hash_key) {
468
+	switch ($hash_key) {
469 469
 		case 'post_info' :
470 470
 			echo '<div class="geodir-company_info field-group">';
471 471
 			break;
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 			 *
476 476
 			 * @since 1.0.0
477 477
 			 */
478
-			echo ' <div id="' . apply_filters( 'geodir_post_gallery_id', 'geodir-post-gallery' ) . '" class="clearfix" >';
478
+			echo ' <div id="'.apply_filters('geodir_post_gallery_id', 'geodir-post-gallery').'" class="clearfix" >';
479 479
 			break;
480 480
 		case 'reviews' :
481 481
 			echo '<div id="reviews-wrap" class="clearfix"> ';
@@ -499,8 +499,8 @@  discard block
 block discarded – undo
499 499
  *
500 500
  * @param string $hash_key
501 501
  */
502
-function geodir_after_tab_content( $hash_key ) {
503
-	switch ( $hash_key ) {
502
+function geodir_after_tab_content($hash_key) {
503
+	switch ($hash_key) {
504 504
 		case 'post_info' :
505 505
 			echo '</div>';
506 506
 			break;
@@ -531,25 +531,25 @@  discard block
 block discarded – undo
531 531
  * @global object $wpdb     WordPress Database object.
532 532
  * @return bool|null|string Returns default sort results, when the post type is valid. Otherwise returns false.
533 533
  */
534
-function geodir_get_posts_default_sort( $post_type ) {
534
+function geodir_get_posts_default_sort($post_type) {
535 535
 
536 536
 	global $wpdb;
537 537
 
538
-	if ( $post_type != '' ) {
538
+	if ($post_type != '') {
539 539
 
540 540
 		$all_postypes = geodir_get_posttypes();
541 541
 
542
-		if ( ! in_array( $post_type, $all_postypes ) ) {
542
+		if (!in_array($post_type, $all_postypes)) {
543 543
 			return false;
544 544
 		}
545 545
 
546
-		$sort_field_info = $wpdb->get_var( $wpdb->prepare( "select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where	post_type= %s and is_active=%d and is_default=%d", array(
546
+		$sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where	post_type= %s and is_active=%d and is_default=%d", array(
547 547
 			$post_type,
548 548
 			1,
549 549
 			1
550
-		) ) );
550
+		)));
551 551
 
552
-		if ( ! empty( $sort_field_info ) ) {
552
+		if (!empty($sort_field_info)) {
553 553
 			return $sort_field_info;
554 554
 		}
555 555
 
@@ -569,20 +569,20 @@  discard block
 block discarded – undo
569 569
  * @global object $wpdb     WordPress Database object.
570 570
  * @return bool|mixed|void Returns sort results, when the post type is valid. Otherwise returns false.
571 571
  */
572
-function geodir_get_sort_options( $post_type ) {
572
+function geodir_get_sort_options($post_type) {
573 573
 	global $wpdb;
574 574
 
575
-	if ( $post_type != '' ) {
575
+	if ($post_type != '') {
576 576
 		$all_postypes = geodir_get_posttypes();
577 577
 
578
-		if ( ! in_array( $post_type, $all_postypes ) ) {
578
+		if (!in_array($post_type, $all_postypes)) {
579 579
 			return false;
580 580
 		}
581 581
 
582
-		$sort_field_info = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array(
582
+		$sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array(
583 583
 			$post_type,
584 584
 			1
585
-		) ) );
585
+		)));
586 586
 
587 587
 		/**
588 588
 		 * Filter post sort options.
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 		 * @param array $sort_field_info Unfiltered sort field array.
593 593
 		 * @param string $post_type      Post type.
594 594
 		 */
595
-		return apply_filters( 'geodir_get_sort_options', $sort_field_info, $post_type );
595
+		return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
596 596
 	}
597 597
 
598 598
 }
@@ -613,63 +613,63 @@  discard block
 block discarded – undo
613 613
 	 *
614 614
 	 * @since 1.4.4
615 615
 	 */
616
-	if ( is_search() ) {
616
+	if (is_search()) {
617 617
 		return;
618 618
 	}
619 619
 
620 620
 	$sort_by = '';
621 621
 
622
-	if ( isset( $_REQUEST['sort_by'] ) ) {
622
+	if (isset($_REQUEST['sort_by'])) {
623 623
 		$sort_by = $_REQUEST['sort_by'];
624 624
 	}
625 625
 
626 626
 	$gd_post_type = geodir_get_current_posttype();
627 627
 
628
-	$sort_options = geodir_get_sort_options( $gd_post_type );
628
+	$sort_options = geodir_get_sort_options($gd_post_type);
629 629
 
630 630
 
631 631
 	$sort_field_options = '';
632 632
 
633
-	if ( ! empty( $sort_options ) ) {
634
-		foreach ( $sort_options as $sort ) {
635
-			$sort = stripslashes_deep( $sort ); // strip slashes
633
+	if (!empty($sort_options)) {
634
+		foreach ($sort_options as $sort) {
635
+			$sort = stripslashes_deep($sort); // strip slashes
636 636
 
637
-			$label = __( $sort->site_title, 'geodirectory' );
637
+			$label = __($sort->site_title, 'geodirectory');
638 638
 
639
-			if ( $sort->field_type == 'random' ) {
639
+			if ($sort->field_type == 'random') {
640 640
 				$key = $sort->field_type;
641
-				( $sort_by == $key || ( $sort->is_default == '1' && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = '';
642
-				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>';
641
+				($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
642
+				$sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
643 643
 			}
644 644
 
645
-			if ( $sort->htmlvar_name == 'comment_count' ) {
645
+			if ($sort->htmlvar_name == 'comment_count') {
646 646
 				$sort->htmlvar_name = 'rating_count';
647 647
 			}
648 648
 
649
-			if ( $sort->sort_asc ) {
650
-				$key   = $sort->htmlvar_name . '_asc';
649
+			if ($sort->sort_asc) {
650
+				$key   = $sort->htmlvar_name.'_asc';
651 651
 				$label = $sort->site_title;
652
-				if ( $sort->asc_title ) {
652
+				if ($sort->asc_title) {
653 653
 					$label = $sort->asc_title;
654 654
 				}
655
-				( $sort_by == $key || ( $sort->is_default == '1' && $sort->default_order == $key && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = '';
656
-				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>';
655
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
656
+				$sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
657 657
 			}
658 658
 
659
-			if ( $sort->sort_desc ) {
660
-				$key   = $sort->htmlvar_name . '_desc';
659
+			if ($sort->sort_desc) {
660
+				$key   = $sort->htmlvar_name.'_desc';
661 661
 				$label = $sort->site_title;
662
-				if ( $sort->desc_title ) {
662
+				if ($sort->desc_title) {
663 663
 					$label = $sort->desc_title;
664 664
 				}
665
-				( $sort_by == $key || ( $sort->is_default == '1' && $sort->default_order == $key && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = '';
666
-				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>';
665
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
666
+				$sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
667 667
 			}
668 668
 
669 669
 		}
670 670
 	}
671 671
 
672
-	if ( $sort_field_options != '' ) {
672
+	if ($sort_field_options != '') {
673 673
 
674 674
 		?>
675 675
 
@@ -678,9 +678,9 @@  discard block
 block discarded – undo
678 678
 			<select name="sort_by" id="sort_by" onchange="javascript:window.location=this.value;">
679 679
 
680 680
 				<option
681
-					value="<?php echo esc_url( add_query_arg( 'sort_by', '' ) ); ?>" <?php if ( $sort_by == '' ) {
681
+					value="<?php echo esc_url(add_query_arg('sort_by', '')); ?>" <?php if ($sort_by == '') {
682 682
 					echo 'selected="selected"';
683
-				} ?>><?php _e( 'Sort By', 'geodirectory' ); ?></option><?php
683
+				} ?>><?php _e('Sort By', 'geodirectory'); ?></option><?php
684 684
 
685 685
 				echo $sort_field_options; ?>
686 686
 
@@ -708,9 +708,9 @@  discard block
 block discarded – undo
708 708
  *
709 709
  * @return string Returns the section title.
710 710
  */
711
-function geodir_advance_customfields_heading( $title, $field_type ) {
711
+function geodir_advance_customfields_heading($title, $field_type) {
712 712
 
713
-	if ( in_array( $field_type, array( 'multiselect', 'textarea', 'taxonomy' ) ) ) {
713
+	if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
714 714
 		$title = '';
715 715
 	}
716 716
 
@@ -732,34 +732,34 @@  discard block
 block discarded – undo
732 732
  * @global object $gd_session       GeoDirectory Session object.
733 733
  * @return string Returns related posts html.
734 734
  */
735
-function geodir_related_posts_display( $request ) {
736
-	if ( ! empty( $request ) ) {
737
-		$before_title = ( isset( $request['before_title'] ) && ! empty( $request['before_title'] ) ) ? $request['before_title'] : '';
738
-		$after_title  = ( isset( $request['after_title'] ) && ! empty( $request['after_title'] ) ) ? $request['after_title'] : '';
739
-
740
-		$title               = ( isset( $request['title'] ) && ! empty( $request['title'] ) ) ? $request['title'] : __( 'Related Listings', 'geodirectory' );
741
-		$post_number         = ( isset( $request['post_number'] ) && ! empty( $request['post_number'] ) ) ? $request['post_number'] : '5';
742
-		$relate_to           = ( isset( $request['relate_to'] ) && ! empty( $request['relate_to'] ) ) ? $request['relate_to'] : 'category';
743
-		$layout              = ( isset( $request['layout'] ) && ! empty( $request['layout'] ) ) ? $request['layout'] : 'gridview_onehalf';
744
-		$add_location_filter = ( isset( $request['add_location_filter'] ) && ! empty( $request['add_location_filter'] ) ) ? $request['add_location_filter'] : '0';
745
-		$listing_width       = ( isset( $request['listing_width'] ) && ! empty( $request['listing_width'] ) ) ? $request['listing_width'] : '';
746
-		$list_sort           = ( isset( $request['list_sort'] ) && ! empty( $request['list_sort'] ) ) ? $request['list_sort'] : 'latest';
747
-		$character_count     = ( isset( $request['character_count'] ) && ! empty( $request['character_count'] ) ) ? $request['character_count'] : '';
735
+function geodir_related_posts_display($request) {
736
+	if (!empty($request)) {
737
+		$before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : '';
738
+		$after_title  = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : '';
739
+
740
+		$title               = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
741
+		$post_number         = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5';
742
+		$relate_to           = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category';
743
+		$layout              = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf';
744
+		$add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0';
745
+		$listing_width       = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : '';
746
+		$list_sort           = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest';
747
+		$character_count     = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : '';
748 748
 
749 749
 		global $wpdb, $post, $gd_session, $related_nearest, $related_parent_lat, $related_parent_lon;
750
-		$related_parent_lat   = !empty($post->post_latitude) && geodir_is_page( 'detail' ) ? $post->post_latitude : '';
751
-		$related_parent_lon   = !empty($post->post_longitude) && geodir_is_page( 'detail' ) ? $post->post_longitude : '';
750
+		$related_parent_lat   = !empty($post->post_latitude) && geodir_is_page('detail') ? $post->post_latitude : '';
751
+		$related_parent_lon   = !empty($post->post_longitude) && geodir_is_page('detail') ? $post->post_longitude : '';
752 752
 		$arr_detail_page_tabs = geodir_detail_page_tabs_list();
753 753
 
754 754
 		$related_listing_array = array();
755
-		if ( get_option( 'geodir_add_related_listing_posttypes' ) ) {
756
-			$related_listing_array = get_option( 'geodir_add_related_listing_posttypes' );
755
+		if (get_option('geodir_add_related_listing_posttypes')) {
756
+			$related_listing_array = get_option('geodir_add_related_listing_posttypes');
757 757
 		}
758
-		if ( isset($post->post_type) && in_array( $post->post_type, $related_listing_array ) ) {
758
+		if (isset($post->post_type) && in_array($post->post_type, $related_listing_array)) {
759 759
 			$arr_detail_page_tabs['related_listing']['is_display'] = true;
760 760
 		}
761 761
 
762
-		$is_display        = ! empty( $arr_detail_page_tabs['related_listing'] ) && isset( $arr_detail_page_tabs['related_listing']['is_display'] ) ? $arr_detail_page_tabs['related_listing']['is_display'] : false;
762
+		$is_display        = !empty($arr_detail_page_tabs['related_listing']) && isset($arr_detail_page_tabs['related_listing']['is_display']) ? $arr_detail_page_tabs['related_listing']['is_display'] : false;
763 763
 		$origi_post        = $post;
764 764
 		$post_type         = '';
765 765
 		$post_id           = '';
@@ -767,90 +767,90 @@  discard block
 block discarded – undo
767 767
 		$tax_field         = 'id';
768 768
 		$category          = array();
769 769
 
770
-		if ( isset( $_REQUEST['backandedit'] ) ) {
771
-			$post      = (object) $gd_session->get( 'listing' );
770
+		if (isset($_REQUEST['backandedit'])) {
771
+			$post      = (object) $gd_session->get('listing');
772 772
 			$post_type = $post->listing_type;
773
-			if ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) {
773
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
774 774
 				$post_id = $_REQUEST['pid'];
775 775
 			}
776
-		} elseif ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) {
777
-			$post      = geodir_get_post_info( $_REQUEST['pid'] );
776
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
777
+			$post      = geodir_get_post_info($_REQUEST['pid']);
778 778
 			$post_type = $post->post_type;
779 779
 			$post_id   = $_REQUEST['pid'];
780
-		} elseif ( isset( $post->post_type ) && $post->post_type != '' ) {
780
+		} elseif (isset($post->post_type) && $post->post_type != '') {
781 781
 			$post_type = $post->post_type;
782 782
 			$post_id   = $post->ID;
783 783
 		}
784 784
 
785
-		if ( $relate_to == 'category' ) {
785
+		if ($relate_to == 'category') {
786 786
 
787
-			$category_taxonomy = $post_type . $relate_to;
788
-			if ( isset( $post->{$category_taxonomy} ) && $post->{$category_taxonomy} != '' ) {
789
-				$category = explode( ',', trim( $post->{$category_taxonomy}, ',' ) );
787
+			$category_taxonomy = $post_type.$relate_to;
788
+			if (isset($post->{$category_taxonomy} ) && $post->{$category_taxonomy} != '') {
789
+				$category = explode(',', trim($post->{$category_taxonomy}, ','));
790 790
 			}
791 791
 
792
-		} elseif ( $relate_to == 'tags' ) {
792
+		} elseif ($relate_to == 'tags') {
793 793
 
794
-			$category_taxonomy = $post_type . '_' . $relate_to;
795
-			if ( $post->post_tags != '' ) {
796
-				$category = explode( ',', trim( $post->post_tags, ',' ) );
794
+			$category_taxonomy = $post_type.'_'.$relate_to;
795
+			if ($post->post_tags != '') {
796
+				$category = explode(',', trim($post->post_tags, ','));
797 797
 			}
798 798
 			$tax_field = 'name';
799 799
 		}
800 800
 
801 801
 		/* --- return false in invalid request --- */
802
-		if ( empty( $category ) ) {
802
+		if (empty($category)) {
803 803
 			return false;
804 804
 		}
805 805
 
806 806
 		$all_postypes = geodir_get_posttypes();
807 807
 
808
-		if ( ! in_array( $post_type, $all_postypes ) ) {
808
+		if (!in_array($post_type, $all_postypes)) {
809 809
 			return false;
810 810
 		}
811 811
 
812 812
 		/* --- return false in invalid request --- */
813 813
 
814 814
 		$location_url = '';
815
-		if ( $add_location_filter != '0' ) {
815
+		if ($add_location_filter != '0') {
816 816
 			$location_url             = array();
817
-			$geodir_show_location_url = get_option( 'geodir_show_location_url' );
817
+			$geodir_show_location_url = get_option('geodir_show_location_url');
818 818
 
819
-			$gd_city = get_query_var( 'gd_city' );
819
+			$gd_city = get_query_var('gd_city');
820 820
 
821
-			if ( $gd_city ) {
822
-				$gd_country = get_query_var( 'gd_country' );
823
-				$gd_region  = get_query_var( 'gd_region' );
821
+			if ($gd_city) {
822
+				$gd_country = get_query_var('gd_country');
823
+				$gd_region  = get_query_var('gd_region');
824 824
 			} else {
825 825
 				$location = geodir_get_default_location();
826 826
 
827
-				$gd_country = isset( $location->country_slug ) ? $location->country_slug : '';
828
-				$gd_region  = isset( $location->region_slug ) ? $location->region_slug : '';
829
-				$gd_city    = isset( $location->city_slug ) ? $location->city_slug : '';
827
+				$gd_country = isset($location->country_slug) ? $location->country_slug : '';
828
+				$gd_region  = isset($location->region_slug) ? $location->region_slug : '';
829
+				$gd_city    = isset($location->city_slug) ? $location->city_slug : '';
830 830
 			}
831 831
 
832
-			if ( $geodir_show_location_url == 'all' ) {
832
+			if ($geodir_show_location_url == 'all') {
833 833
 				$location_url[] = $gd_country;
834 834
 				$location_url[] = $gd_region;
835
-			} else if ( $geodir_show_location_url == 'country_city' ) {
835
+			} else if ($geodir_show_location_url == 'country_city') {
836 836
 				$location_url[] = $gd_country;
837
-			} else if ( $geodir_show_location_url == 'region_city' ) {
837
+			} else if ($geodir_show_location_url == 'region_city') {
838 838
 				$location_url[] = $gd_region;
839 839
 			}
840 840
 
841 841
 			$location_url[] = $gd_city;
842 842
 
843
-			$location_url = implode( '/', $location_url );
843
+			$location_url = implode('/', $location_url);
844 844
 		}
845 845
 
846 846
 
847
-		if ( ! empty( $category ) ) {
847
+		if (!empty($category)) {
848 848
 			global $geodir_add_location_url;
849 849
 			$geodir_add_location_url = '0';
850
-			if ( $add_location_filter != '0' ) {
850
+			if ($add_location_filter != '0') {
851 851
 				$geodir_add_location_url = '1';
852 852
 			}
853
-			$viewall_url             = get_term_link( (int) $category[0], $post_type . $category_taxonomy );
853
+			$viewall_url             = get_term_link((int) $category[0], $post_type.$category_taxonomy);
854 854
 			$geodir_add_location_url = null;
855 855
 		}
856 856
 		ob_start();
@@ -860,24 +860,24 @@  discard block
 block discarded – undo
860 860
 		<div class="geodir_locations geodir_location_listing">
861 861
 
862 862
 			<?php
863
-			if ( isset( $request['is_widget'] ) && $request['is_widget'] == '1' ) {
863
+			if (isset($request['is_widget']) && $request['is_widget'] == '1') {
864 864
 				/** geodir_before_title filter Documented in geodirectory_widgets.php */
865
-				$before_title = isset( $before_title ) ? $before_title : apply_filters( 'geodir_before_title', '<h3 class="widget-title">' );
865
+				$before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
866 866
 				/** geodir_after_title filter Documented in geodirectory_widgets.php */
867
-				$after_title = isset( $after_title ) ? $after_title : apply_filters( 'geodir_after_title', '</h3>' );
867
+				$after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
868 868
 				?>
869 869
 				<div class="location_list_heading clearfix">
870
-					<?php echo $before_title . $title . $after_title; ?>
870
+					<?php echo $before_title.$title.$after_title; ?>
871 871
 				</div>
872 872
 				<?php
873 873
 			}
874 874
 			$query_args = array(
875 875
 				'posts_per_page'   => $post_number,
876 876
 				'is_geodir_loop'   => true,
877
-				'gd_location'      => ( $add_location_filter ) ? true : false,
877
+				'gd_location'      => ($add_location_filter) ? true : false,
878 878
 				'post_type'        => $post_type,
879 879
 				'order_by'         => $list_sort,
880
-				'post__not_in'     => array( $post_id ),
880
+				'post__not_in'     => array($post_id),
881 881
 				'excerpt_length'   => $character_count,
882 882
 				'related_listings' => $is_display
883 883
 			);
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 				'terms'    => $category
889 889
 			);
890 890
 
891
-			$query_args['tax_query'] = array( $tax_query );
891
+			$query_args['tax_query'] = array($tax_query);
892 892
 
893 893
 			global $gridview_columns_widget, $post;
894 894
 
@@ -900,21 +900,21 @@  discard block
 block discarded – undo
900 900
 			 * @param array $query_args The query array.
901 901
 			 * @param array $request Related posts request array.
902 902
 			 */
903
-			$query_args = apply_filters( 'geodir_related_posts_widget_query_args', $query_args, $request );
903
+			$query_args = apply_filters('geodir_related_posts_widget_query_args', $query_args, $request);
904 904
 
905
-			query_posts( $query_args );
905
+			query_posts($query_args);
906 906
 
907
-			if ( strstr( $layout, 'gridview' ) ) {
908
-				$listing_view_exp = explode( '_', $layout );
907
+			if (strstr($layout, 'gridview')) {
908
+				$listing_view_exp = explode('_', $layout);
909 909
 				$gridview_columns_widget = $layout;
910 910
 				$layout           = $listing_view_exp[0];
911
-			} else if ( $layout == 'list' ) {
911
+			} else if ($layout == 'list') {
912 912
 				$gridview_columns_widget = '';
913 913
 			}
914 914
 			$related_posts = true;
915 915
 
916 916
 			$related_nearest = false;
917
-			if ( $list_sort == 'nearest' ) {
917
+			if ($list_sort == 'nearest') {
918 918
 				$related_nearest = true;
919 919
 			}
920 920
 
@@ -931,14 +931,14 @@  discard block
 block discarded – undo
931 931
 			 *
932 932
 			 * @since 1.0.0
933 933
 			 */
934
-			$template = apply_filters( "geodir_template_part-related-listing-listview", geodir_locate_template( 'widget-listing-listview' ) );
934
+			$template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('widget-listing-listview'));
935 935
 
936 936
 			/**
937 937
 			 * Includes related listing listview template.
938 938
 			 *
939 939
 			 * @since 1.0.0
940 940
 			 */
941
-			include( $template );
941
+			include($template);
942 942
 
943 943
 			wp_reset_query();
944 944
 			$post            = $origi_post;
@@ -966,12 +966,12 @@  discard block
 block discarded – undo
966 966
 function geodir_category_count_script() {
967 967
 	global $geodir_post_category_str;
968 968
 
969
-	if ( ! empty( $geodir_post_category_str ) ) {
970
-		$geodir_post_category_str = serialize( $geodir_post_category_str );
969
+	if (!empty($geodir_post_category_str)) {
970
+		$geodir_post_category_str = serialize($geodir_post_category_str);
971 971
 	}
972 972
 
973
-	$all_var['post_category_array'] = html_entity_decode( (string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8' );
974
-	$script                         = "var post_category_array = " . json_encode( $all_var ) . ';';
973
+	$all_var['post_category_array'] = html_entity_decode((string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8');
974
+	$script                         = "var post_category_array = ".json_encode($all_var).';';
975 975
 	echo '<script>';
976 976
 	echo $script;
977 977
 	echo '</script>';
@@ -986,8 +986,8 @@  discard block
 block discarded – undo
986 986
  * @return string Returns the default language.
987 987
  */
988 988
 function geodir_get_map_default_language() {
989
-	$geodir_default_map_language = get_option( 'geodir_default_map_language' );
990
-	if ( empty( $geodir_default_map_language ) ) {
989
+	$geodir_default_map_language = get_option('geodir_default_map_language');
990
+	if (empty($geodir_default_map_language)) {
991 991
 		$geodir_default_map_language = 'en';
992 992
 	}
993 993
 
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 	 *
999 999
 	 * @param string $geodir_default_map_language Default map language.
1000 1000
 	 */
1001
-	return apply_filters( 'geodir_default_map_language', $geodir_default_map_language );
1001
+	return apply_filters('geodir_default_map_language', $geodir_default_map_language);
1002 1002
 }
1003 1003
 
1004 1004
 /**
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
  * @return string Returns the api key.
1010 1010
  */
1011 1011
 function geodir_get_map_api_key() {
1012
-	$key = get_option( 'geodir_google_api_key' );
1012
+	$key = get_option('geodir_google_api_key');
1013 1013
 
1014 1014
 	/**
1015 1015
 	 * Filter Google maps api key.
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 	 *
1019 1019
 	 * @param string $key Google maps api key.
1020 1020
 	 */
1021
-	return apply_filters( 'geodir_google_api_key', $key );
1021
+	return apply_filters('geodir_google_api_key', $key);
1022 1022
 }
1023 1023
 
1024 1024
 
@@ -1038,20 +1038,20 @@  discard block
 block discarded – undo
1038 1038
 	global $wp, $post, $wp_query, $wpdb, $geodir_addon_list;
1039 1039
 
1040 1040
 	$is_geodir_page = geodir_is_geodir_page();
1041
-	if ( ! $is_geodir_page ) {
1041
+	if (!$is_geodir_page) {
1042 1042
 		return;
1043 1043
 	}// if non GD page, bail
1044 1044
 
1045 1045
 	$use_gd_meta = true;
1046
-	if ( ( class_exists( 'WPSEO_Frontend' ) || class_exists( 'All_in_One_SEO_Pack' ) ) && !geodir_disable_yoast_seo_metas() ) {
1046
+	if ((class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) && !geodir_disable_yoast_seo_metas()) {
1047 1047
 		$use_gd_meta = false;
1048 1048
 
1049
-		if ( geodir_is_page( 'search' ) ) {
1049
+		if (geodir_is_page('search')) {
1050 1050
 			$use_gd_meta = true;
1051 1051
 		}
1052 1052
 	}
1053 1053
 
1054
-	if ( ! $use_gd_meta ) {
1054
+	if (!$use_gd_meta) {
1055 1055
 		return;
1056 1056
 	}// bail if Yoast Wordpress SEO or All_in_One_SEO_Pack active.
1057 1057
 
@@ -1059,68 +1059,68 @@  discard block
 block discarded – undo
1059 1059
 
1060 1060
 	$all_postypes = geodir_get_posttypes();
1061 1061
 
1062
-	$geodir_taxonomies = geodir_get_taxonomies( '', true );
1062
+	$geodir_taxonomies = geodir_get_taxonomies('', true);
1063 1063
 
1064 1064
 	$meta_desc = '';
1065 1065
 	$meta_key  = '';
1066
-	if ( isset( $current_term->ID ) && $current_term->ID == geodir_location_page_id() ) {
1066
+	if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
1067 1067
 		/**
1068 1068
 		 * Filter SEO meta location description.
1069 1069
 		 *
1070 1070
 		 * @since 1.0.0
1071 1071
 		 */
1072
-		$meta_desc = apply_filters( 'geodir_seo_meta_location_description', '' );
1072
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', '');
1073 1073
 		$meta_desc .= '';
1074 1074
 	}
1075
-	if ( have_posts() && is_single() OR is_page() ) {
1076
-		while ( have_posts() ) {
1075
+	if (have_posts() && is_single() OR is_page()) {
1076
+		while (have_posts()) {
1077 1077
 			the_post();
1078 1078
 
1079
-			if ( has_excerpt() ) {
1080
-				$out_excerpt = strip_tags( strip_shortcodes( get_the_excerpt() ) );
1081
-				if ( empty( $out_excerpt ) ) {
1082
-					$out_excerpt = strip_tags( do_shortcode( get_the_excerpt() ) );
1079
+			if (has_excerpt()) {
1080
+				$out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt()));
1081
+				if (empty($out_excerpt)) {
1082
+					$out_excerpt = strip_tags(do_shortcode(get_the_excerpt()));
1083 1083
 				}
1084
-				$out_excerpt = str_replace( array( "\r\n", "\r", "\n" ), "", $out_excerpt );
1084
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
1085 1085
 			} else {
1086
-				$out_excerpt = str_replace( array( "\r\n", "\r", "\n" ), "", $post->post_content );
1087
-				$out_excerpt = strip_tags( strip_shortcodes( $out_excerpt ) );
1088
-				if ( empty( $out_excerpt ) ) {
1089
-					$out_excerpt = strip_tags( do_shortcode( $out_excerpt ) ); // parse short code from content
1086
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
1087
+				$out_excerpt = strip_tags(strip_shortcodes($out_excerpt));
1088
+				if (empty($out_excerpt)) {
1089
+					$out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content
1090 1090
 				}
1091
-				$out_excerpt = trim( wp_trim_words( $out_excerpt, 35, '' ), '.!?,;:-' );
1091
+				$out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-');
1092 1092
 			}
1093 1093
 
1094 1094
 			$meta_desc .= $out_excerpt;
1095 1095
 		}
1096
-	} elseif ( ( is_category() || is_tag() ) && isset( $current_term->taxonomy ) && in_array( $current_term->taxonomy, $geodir_taxonomies ) ) {
1097
-		if ( is_category() ) {
1098
-			$meta_desc .= __( "Posts related to Category:", 'geodirectory' ) . " " . geodir_utf8_ucfirst( single_cat_title( "", false ) );
1099
-		} elseif ( is_tag() ) {
1100
-			$meta_desc .= __( "Posts related to Tag:", 'geodirectory' ) . " " . geodir_utf8_ucfirst( single_tag_title( "", false ) );
1096
+	} elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1097
+		if (is_category()) {
1098
+			$meta_desc .= __("Posts related to Category:", 'geodirectory')." ".geodir_utf8_ucfirst(single_cat_title("", false));
1099
+		} elseif (is_tag()) {
1100
+			$meta_desc .= __("Posts related to Tag:", 'geodirectory')." ".geodir_utf8_ucfirst(single_tag_title("", false));
1101 1101
 		}
1102
-	} elseif ( isset( $current_term->taxonomy ) && in_array( $current_term->taxonomy, $geodir_taxonomies ) ) {
1103
-		$meta_desc .= isset( $current_term->description ) ? $current_term->description : '';
1102
+	} elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1103
+		$meta_desc .= isset($current_term->description) ? $current_term->description : '';
1104 1104
 	}
1105 1105
 
1106 1106
 
1107 1107
 	$geodir_post_type       = geodir_get_current_posttype();
1108
-	$geodir_post_type_info  = get_post_type_object( $geodir_post_type );
1109
-	$geodir_is_page_listing = geodir_is_page( 'listing' ) ? true : false;
1110
-
1111
-	$category_taxonomy = geodir_get_taxonomies( $geodir_post_type );
1112
-	$tag_taxonomy      = geodir_get_taxonomies( $geodir_post_type, true );
1113
-
1114
-	$geodir_is_category = isset( $category_taxonomy[0] ) && get_query_var( $category_taxonomy[0] ) ? get_query_var( $category_taxonomy[0] ) : false;
1115
-	$geodir_is_tag      = isset( $tag_taxonomy[0] ) && get_query_var( $tag_taxonomy[0] ) ? true : false;
1116
-
1117
-	$geodir_is_search        = geodir_is_page( 'search' ) ? true : false;
1118
-	$geodir_is_location      = geodir_is_page( 'location' ) ? true : false;
1119
-	$geodir_location_manager = isset( $geodir_addon_list['geodir_location_manager'] ) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1120
-	$godir_location_terms    = geodir_get_current_location_terms( 'query_vars' );
1121
-	$gd_city                 = $geodir_location_manager && isset( $godir_location_terms['gd_city'] ) ? $godir_location_terms['gd_city'] : null;
1122
-	$gd_region               = $geodir_location_manager && isset( $godir_location_terms['gd_region'] ) ? $godir_location_terms['gd_region'] : null;
1123
-	$gd_country              = $geodir_location_manager && isset( $godir_location_terms['gd_country'] ) ? $godir_location_terms['gd_country'] : null;
1108
+	$geodir_post_type_info  = get_post_type_object($geodir_post_type);
1109
+	$geodir_is_page_listing = geodir_is_page('listing') ? true : false;
1110
+
1111
+	$category_taxonomy = geodir_get_taxonomies($geodir_post_type);
1112
+	$tag_taxonomy      = geodir_get_taxonomies($geodir_post_type, true);
1113
+
1114
+	$geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false;
1115
+	$geodir_is_tag      = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false;
1116
+
1117
+	$geodir_is_search        = geodir_is_page('search') ? true : false;
1118
+	$geodir_is_location      = geodir_is_page('location') ? true : false;
1119
+	$geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1120
+	$godir_location_terms    = geodir_get_current_location_terms('query_vars');
1121
+	$gd_city                 = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : null;
1122
+	$gd_region               = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : null;
1123
+	$gd_country              = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : null;
1124 1124
 	/**
1125 1125
 	 * Filter the Everywhere text in location description.
1126 1126
 	 *
@@ -1128,108 +1128,108 @@  discard block
 block discarded – undo
1128 1128
 	 *
1129 1129
 	 * @param string $replace_location Everywhere text.
1130 1130
 	 */
1131
-	$replace_location        = apply_filters( 'geodir_location_description_everywhere_text', __( 'Everywhere', 'geodirectory' ) );
1131
+	$replace_location        = apply_filters('geodir_location_description_everywhere_text', __('Everywhere', 'geodirectory'));
1132 1132
 	$location_id             = null;
1133
-	if ( $geodir_location_manager ) {
1134
-		$sql           = $wpdb->prepare( "SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array( $gd_city ) );
1135
-		$location_id   = (int) $wpdb->get_var( $sql );
1133
+	if ($geodir_location_manager) {
1134
+		$sql           = $wpdb->prepare("SELECT location_id FROM ".POST_LOCATION_TABLE." WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1135
+		$location_id   = (int) $wpdb->get_var($sql);
1136 1136
 		$location_type = geodir_what_is_current_location();
1137
-		if ( $location_type == 'city' ) {
1138
-			$replace_location = geodir_get_current_location( array( 'what' => 'city', 'echo' => false ) );
1139
-		} elseif ( $location_type == 'region' ) {
1140
-			$replace_location = geodir_get_current_location( array( 'what' => 'region', 'echo' => false ) );
1141
-		} elseif ( $location_type == 'country' ) {
1142
-			$replace_location = geodir_get_current_location( array( 'what' => 'country', 'echo' => false ) );
1143
-			$replace_location = __( $replace_location, 'geodirectory' );
1144
-		}
1145
-		$country          = get_query_var( 'gd_country' );
1146
-		$region           = get_query_var( 'gd_region' );
1147
-		$city             = get_query_var( 'gd_city' );
1137
+		if ($location_type == 'city') {
1138
+			$replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
1139
+		} elseif ($location_type == 'region') {
1140
+			$replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
1141
+		} elseif ($location_type == 'country') {
1142
+			$replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
1143
+			$replace_location = __($replace_location, 'geodirectory');
1144
+		}
1145
+		$country          = get_query_var('gd_country');
1146
+		$region           = get_query_var('gd_region');
1147
+		$city             = get_query_var('gd_city');
1148 1148
 		$current_location = '';
1149
-		if ( $country != '' ) {
1150
-			$current_location = get_actual_location_name( 'country', $country, true );
1149
+		if ($country != '') {
1150
+			$current_location = get_actual_location_name('country', $country, true);
1151 1151
 		}
1152
-		if ( $region != '' ) {
1153
-			$current_location = get_actual_location_name( 'region', $region );
1152
+		if ($region != '') {
1153
+			$current_location = get_actual_location_name('region', $region);
1154 1154
 		}
1155
-		if ( $city != '' ) {
1156
-			$current_location = get_actual_location_name( 'city', $city );
1155
+		if ($city != '') {
1156
+			$current_location = get_actual_location_name('city', $city);
1157 1157
 		}
1158 1158
 		$replace_location = $current_location != '' ? $current_location : $replace_location;
1159 1159
 	}
1160 1160
 
1161 1161
 	$geodir_meta_keys = '';
1162 1162
 	$geodir_meta_desc = '';
1163
-	if ( $is_geodir_page && ! empty( $geodir_post_type_info ) ) {
1164
-		if ( $geodir_is_page_listing || $geodir_is_search || geodir_is_page( 'add-listing' ) ) {
1165
-			$geodir_meta_keys = isset( $geodir_post_type_info->seo['meta_keyword'] ) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1163
+	if ($is_geodir_page && !empty($geodir_post_type_info)) {
1164
+		if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
1165
+			$geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1166 1166
 
1167
-			$geodir_meta_desc = isset( $geodir_post_type_info->description ) ? $geodir_post_type_info->description : $geodir_meta_desc;
1168
-			$geodir_meta_desc = isset( $geodir_post_type_info->seo['meta_description'] ) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1167
+			$geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc;
1168
+			$geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1169 1169
 
1170
-			if ( $geodir_is_category ) {
1171
-				$category = $geodir_is_category ? get_term_by( 'slug', $geodir_is_category, $category_taxonomy[0] ) : null;
1172
-				if ( isset( $category->term_id ) && ! empty( $category->term_id ) ) {
1170
+			if ($geodir_is_category) {
1171
+				$category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : null;
1172
+				if (isset($category->term_id) && !empty($category->term_id)) {
1173 1173
 					$category_id   = $category->term_id;
1174
-					$category_desc = trim( $category->description ) != '' ? trim( $category->description ) : geodir_get_tax_meta( $category_id, 'ct_cat_top_desc', false, $geodir_post_type );
1175
-					if ( $location_id ) {
1176
-						$option_name    = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1177
-						$cat_loc_option = get_option( $option_name );
1178
-
1179
-						$gd_cat_loc_default = ! empty( $cat_loc_option ) && isset( $cat_loc_option['gd_cat_loc_default'] ) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1180
-						if ( ! $gd_cat_loc_default ) {
1181
-							$option_name   = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1182
-							$option        = get_option( $option_name );
1183
-							$category_desc = isset( $option['gd_cat_loc_desc'] ) && trim( $option['gd_cat_loc_desc'] ) != '' ? trim( $option['gd_cat_loc_desc'] ) : $category_desc;
1174
+					$category_desc = trim($category->description) != '' ? trim($category->description) : geodir_get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1175
+					if ($location_id) {
1176
+						$option_name    = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id;
1177
+						$cat_loc_option = get_option($option_name);
1178
+
1179
+						$gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1180
+						if (!$gd_cat_loc_default) {
1181
+							$option_name   = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id.'_'.$location_id;
1182
+							$option        = get_option($option_name);
1183
+							$category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1184 1184
 						}
1185 1185
 					}
1186
-					$geodir_meta_desc = __( "Posts related to Category:", 'geodirectory' ) . " " . geodir_utf8_ucfirst( single_cat_title( "", false ) ) . '. ' . $category_desc;
1186
+					$geodir_meta_desc = __("Posts related to Category:", 'geodirectory')." ".geodir_utf8_ucfirst(single_cat_title("", false)).'. '.$category_desc;
1187 1187
 				}
1188
-			} else if ( $geodir_is_tag ) {
1189
-				$geodir_meta_desc = __( "Posts related to Tag:", 'geodirectory' ) . " " . geodir_utf8_ucfirst( single_tag_title( "", false ) ) . '. ' . $geodir_meta_desc;
1188
+			} else if ($geodir_is_tag) {
1189
+				$geodir_meta_desc = __("Posts related to Tag:", 'geodirectory')." ".geodir_utf8_ucfirst(single_tag_title("", false)).'. '.$geodir_meta_desc;
1190 1190
 			}
1191 1191
 		}
1192 1192
 	}
1193 1193
 
1194 1194
 
1195 1195
 	$gd_page = '';
1196
-	if ( geodir_is_page( 'home' ) ) {
1196
+	if (geodir_is_page('home')) {
1197 1197
 		$gd_page   = 'home';
1198
-		$meta_desc = ( get_option( 'geodir_meta_desc_homepage' ) ) ? get_option( 'geodir_meta_desc_homepage' ) : $meta_desc;
1199
-	} elseif ( geodir_is_page( 'detail' ) ) {
1198
+		$meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1199
+	} elseif (geodir_is_page('detail')) {
1200 1200
 		$gd_page   = 'detail';
1201
-		$meta_desc = ( get_option( 'geodir_meta_desc_detail' ) ) ? get_option( 'geodir_meta_desc_detail' ) : $meta_desc;
1202
-	} elseif ( geodir_is_page( 'pt' ) ) {
1201
+		$meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1202
+	} elseif (geodir_is_page('pt')) {
1203 1203
 		$gd_page   = 'pt';
1204
-		$meta_desc = ( get_option( 'geodir_meta_desc_pt' ) ) ? get_option( 'geodir_meta_desc_pt' ) : $meta_desc;
1205
-	} elseif ( geodir_is_page( 'listing' ) ) {
1204
+		$meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1205
+	} elseif (geodir_is_page('listing')) {
1206 1206
 		$gd_page   = 'listing';
1207
-		$meta_desc = ( get_option( 'geodir_meta_desc_listing' ) ) ? get_option( 'geodir_meta_desc_listing' ) : $meta_desc;
1208
-	} elseif ( geodir_is_page( 'location' ) ) {
1207
+		$meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1208
+	} elseif (geodir_is_page('location')) {
1209 1209
 		$gd_page   = 'location';
1210
-		$meta_desc = ( get_option( 'geodir_meta_desc_location' ) ) ? get_option( 'geodir_meta_desc_location' ) : $meta_desc;
1211
-		$meta_desc = apply_filters( 'geodir_seo_meta_location_description', $meta_desc );
1210
+		$meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1211
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1212 1212
 
1213
-	} elseif ( geodir_is_page( 'search' ) ) {
1213
+	} elseif (geodir_is_page('search')) {
1214 1214
 		$gd_page   = 'search';
1215
-		$meta_desc = ( get_option( 'geodir_meta_desc_search' ) ) ? get_option( 'geodir_meta_desc_search' ) : $meta_desc;
1216
-	} elseif ( geodir_is_page( 'add-listing' ) ) {
1215
+		$meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1216
+	} elseif (geodir_is_page('add-listing')) {
1217 1217
 		$gd_page   = 'add-listing';
1218
-		$meta_desc = ( get_option( 'geodir_meta_desc_add-listing' ) ) ? get_option( 'geodir_meta_desc_add-listing' ) : $meta_desc;
1219
-	} elseif ( geodir_is_page( 'author' ) ) {
1218
+		$meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1219
+	} elseif (geodir_is_page('author')) {
1220 1220
 		$gd_page   = 'author';
1221
-		$meta_desc = ( get_option( 'geodir_meta_desc_author' ) ) ? get_option( 'geodir_meta_desc_author' ) : $meta_desc;
1222
-	} elseif ( geodir_is_page( 'login' ) ) {
1221
+		$meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1222
+	} elseif (geodir_is_page('login')) {
1223 1223
 		$gd_page   = 'login';
1224
-		$meta_desc = ( get_option( 'geodir_meta_desc_login' ) ) ? get_option( 'geodir_meta_desc_login' ) : $meta_desc;
1225
-	} elseif ( geodir_is_page( 'listing-success' ) ) {
1224
+		$meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1225
+	} elseif (geodir_is_page('listing-success')) {
1226 1226
 		$gd_page   = 'listing-success';
1227
-		$meta_desc = ( get_option( 'geodir_meta_desc_listing-success' ) ) ? get_option( 'geodir_meta_desc_listing-success' ) : $meta_desc;
1227
+		$meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1228 1228
 	}
1229 1229
 
1230 1230
 
1231
-	if ( $meta_desc ) {
1232
-		$meta_desc = stripslashes_deep( $meta_desc );
1231
+	if ($meta_desc) {
1232
+		$meta_desc = stripslashes_deep($meta_desc);
1233 1233
 		/**
1234 1234
 		 * Filter page description to replace variables.
1235 1235
 		 *
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
 		 * @param string $title   The page description including variables.
1239 1239
 		 * @param string $gd_page The GeoDirectory page type if any.
1240 1240
 		 */
1241
-		$meta_desc = apply_filters( 'geodir_seo_meta_description_pre', __( $meta_desc, 'geodirectory' ), $gd_page, '' );
1241
+		$meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'), $gd_page, '');
1242 1242
 
1243 1243
 		/**
1244 1244
 		 * Filter SEO meta description.
@@ -1247,20 +1247,20 @@  discard block
 block discarded – undo
1247 1247
 		 *
1248 1248
 		 * @param string $meta_desc Meta description content.
1249 1249
 		 */
1250
-		echo apply_filters( 'geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc );
1250
+		echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="'.$meta_desc.'" />', $meta_desc);
1251 1251
 	}
1252 1252
 
1253 1253
 	// meta keywords
1254
-	if ( isset( $post->post_type ) && in_array( $post->post_type, $all_postypes ) ) {
1255
-		$place_tags = wp_get_post_terms( $post->ID, $post->post_type . '_tags', array( "fields" => "names" ) );
1256
-		$place_cats = wp_get_post_terms( $post->ID, $post->post_type . 'category', array( "fields" => "names" ) );
1254
+	if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1255
+		$place_tags = wp_get_post_terms($post->ID, $post->post_type.'_tags', array("fields" => "names"));
1256
+		$place_cats = wp_get_post_terms($post->ID, $post->post_type.'category', array("fields" => "names"));
1257 1257
 
1258
-		$meta_key .= implode( ", ", array_merge( (array) $place_cats, (array) $place_tags ) );
1258
+		$meta_key .= implode(", ", array_merge((array) $place_cats, (array) $place_tags));
1259 1259
 	} else {
1260 1260
 		$posttags = get_the_tags();
1261
-		if ( $posttags ) {
1262
-			foreach ( $posttags as $tag ) {
1263
-				$meta_key .= $tag->name . ' ';
1261
+		if ($posttags) {
1262
+			foreach ($posttags as $tag) {
1263
+				$meta_key .= $tag->name.' ';
1264 1264
 			}
1265 1265
 		} else {
1266 1266
 //			$tags = get_tags( array( 'orderby' => 'count', 'order' => 'DESC' ) );
@@ -1276,20 +1276,20 @@  discard block
 block discarded – undo
1276 1276
 		}
1277 1277
 	}
1278 1278
 
1279
-	$meta_key         = $meta_key != '' ? rtrim( trim( $meta_key ), "," ) : $meta_key;
1280
-	$geodir_meta_keys = $geodir_meta_keys != '' ? ( $meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys ) : $meta_key;
1281
-	if ( $geodir_meta_keys != '' ) {
1282
-		$geodir_meta_keys = strip_tags( $geodir_meta_keys );
1283
-		$geodir_meta_keys = esc_html( $geodir_meta_keys );
1284
-		$geodir_meta_keys = geodir_strtolower( $geodir_meta_keys );
1285
-		$geodir_meta_keys = wp_html_excerpt( $geodir_meta_keys, 1000, '' );
1286
-		$geodir_meta_keys = str_replace( '%location%', $replace_location, $geodir_meta_keys );
1279
+	$meta_key         = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1280
+	$geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key.', '.$geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1281
+	if ($geodir_meta_keys != '') {
1282
+		$geodir_meta_keys = strip_tags($geodir_meta_keys);
1283
+		$geodir_meta_keys = esc_html($geodir_meta_keys);
1284
+		$geodir_meta_keys = geodir_strtolower($geodir_meta_keys);
1285
+		$geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, '');
1286
+		$geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
1287 1287
 
1288
-		$meta_key = rtrim( trim( $geodir_meta_keys ), "," );
1288
+		$meta_key = rtrim(trim($geodir_meta_keys), ",");
1289 1289
 	}
1290 1290
 
1291
-	if ( $meta_key ) {
1292
-		$meta_key = stripslashes_deep( $meta_key );
1291
+	if ($meta_key) {
1292
+		$meta_key = stripslashes_deep($meta_key);
1293 1293
 		/**
1294 1294
 		 * Filter SEO meta keywords.
1295 1295
 		 *
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 		 *
1298 1298
 		 * @param string $meta_desc Meta keywords.
1299 1299
 		 */
1300
-		echo apply_filters( 'geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key );
1300
+		echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="'.$meta_key.'" />', $meta_key);
1301 1301
 	}
1302 1302
 
1303 1303
 }
@@ -1317,8 +1317,8 @@  discard block
 block discarded – undo
1317 1317
 
1318 1318
 	$geodir_detail_page_tabs_array = geodir_detail_page_tabs_array();
1319 1319
 
1320
-	foreach ( $geodir_detail_page_tabs_array as $key => $tabs_obj ) {
1321
-		$geodir_detail_page_tabs_key_value_array[ $key ] = $tabs_obj['heading_text'];
1320
+	foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
1321
+		$geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text'];
1322 1322
 	}
1323 1323
 
1324 1324
 	return $geodir_detail_page_tabs_key_value_array;
@@ -1340,57 +1340,57 @@  discard block
 block discarded – undo
1340 1340
 	 * @since 1.0.0
1341 1341
 	 */
1342 1342
 	$arr_tabs['post_profile'] = array(
1343
-		'heading_text'  => __( 'Profile', 'geodirectory' ),
1343
+		'heading_text'  => __('Profile', 'geodirectory'),
1344 1344
 		'is_active_tab' => true,
1345
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_profile' ),
1345
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
1346 1346
 		'tab_content'   => ''
1347 1347
 	);
1348
-	$arr_tabs['post_info']    = array(
1349
-		'heading_text'  => __( 'More Info', 'geodirectory' ),
1348
+	$arr_tabs['post_info'] = array(
1349
+		'heading_text'  => __('More Info', 'geodirectory'),
1350 1350
 		'is_active_tab' => false,
1351
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_info' ),
1351
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
1352 1352
 		'tab_content'   => ''
1353 1353
 	);
1354 1354
 
1355 1355
 	$arr_tabs['post_images'] = array(
1356
-		'heading_text'  => __( 'Photos', 'geodirectory' ),
1356
+		'heading_text'  => __('Photos', 'geodirectory'),
1357 1357
 		'is_active_tab' => false,
1358
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_images' ),
1358
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
1359 1359
 		'tab_content'   => ''
1360 1360
 	);
1361 1361
 
1362 1362
 	$arr_tabs['post_video'] = array(
1363
-		'heading_text'  => __( 'Video', 'geodirectory' ),
1363
+		'heading_text'  => __('Video', 'geodirectory'),
1364 1364
 		'is_active_tab' => false,
1365
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_video' ),
1365
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
1366 1366
 		'tab_content'   => ''
1367 1367
 	);
1368 1368
 
1369 1369
 	$arr_tabs['special_offers'] = array(
1370
-		'heading_text'  => __( 'Special Offers', 'geodirectory' ),
1370
+		'heading_text'  => __('Special Offers', 'geodirectory'),
1371 1371
 		'is_active_tab' => false,
1372
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'special_offers' ),
1372
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
1373 1373
 		'tab_content'   => ''
1374 1374
 	);
1375 1375
 
1376 1376
 	$arr_tabs['post_map'] = array(
1377
-		'heading_text'  => __( 'Map', 'geodirectory' ),
1377
+		'heading_text'  => __('Map', 'geodirectory'),
1378 1378
 		'is_active_tab' => false,
1379
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_map' ),
1379
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
1380 1380
 		'tab_content'   => ''
1381 1381
 	);
1382 1382
 
1383 1383
 	$arr_tabs['reviews'] = array(
1384
-		'heading_text'  => __( 'Reviews', 'geodirectory' ),
1384
+		'heading_text'  => __('Reviews', 'geodirectory'),
1385 1385
 		'is_active_tab' => false,
1386
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'reviews' ),
1386
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
1387 1387
 		'tab_content'   => 'review display'
1388 1388
 	);
1389 1389
 
1390 1390
 	$arr_tabs['related_listing'] = array(
1391
-		'heading_text'  => __( 'Related Listing', 'geodirectory' ),
1391
+		'heading_text'  => __('Related Listing', 'geodirectory'),
1392 1392
 		'is_active_tab' => false,
1393
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'related_listing' ),
1393
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
1394 1394
 		'tab_content'   => ''
1395 1395
 	);
1396 1396
 
@@ -1399,7 +1399,7 @@  discard block
 block discarded – undo
1399 1399
 	 *
1400 1400
 	 * @since 1.0.0
1401 1401
 	 */
1402
-	return apply_filters( 'geodir_detail_page_tab_list_extend', $arr_tabs );
1402
+	return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
1403 1403
 
1404 1404
 
1405 1405
 }
@@ -1413,13 +1413,13 @@  discard block
 block discarded – undo
1413 1413
  * @return mixed|array Tabs array.
1414 1414
  */
1415 1415
 function geodir_detail_page_tabs_list() {
1416
-	$tabs_excluded = get_option( 'geodir_detail_page_tabs_excluded' );
1416
+	$tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
1417 1417
 	$tabs_array    = geodir_detail_page_tabs_array();
1418 1418
 
1419
-	if ( ! empty( $tabs_excluded ) ) {
1420
-		foreach ( $tabs_excluded as $tab ) {
1421
-			if ( array_key_exists( $tab, $tabs_array ) ) {
1422
-				unset( $tabs_array[ $tab ] );
1419
+	if (!empty($tabs_excluded)) {
1420
+		foreach ($tabs_excluded as $tab) {
1421
+			if (array_key_exists($tab, $tabs_array)) {
1422
+				unset($tabs_array[$tab]);
1423 1423
 			}
1424 1424
 		}
1425 1425
 	}
@@ -1443,66 +1443,66 @@  discard block
 block discarded – undo
1443 1443
 function geodir_show_detail_page_tabs() {
1444 1444
 	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields, $preview;
1445 1445
 
1446
-	$post_id            = ! empty( $post ) && isset( $post->ID ) ? (int) $post->ID : 0;
1447
-	$request_post_id    = ! empty( $_REQUEST['p'] ) ? (int) $_REQUEST['p'] : 0;
1448
-	$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
1446
+	$post_id            = !empty($post) && isset($post->ID) ? (int) $post->ID : 0;
1447
+	$request_post_id    = !empty($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
1448
+	$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
1449 1449
 
1450
-	if ( $is_backend_preview && ! $post_id > 0 && $request_post_id > 0 ) {
1451
-		$post = geodir_get_post_info( $request_post_id );
1452
-		setup_postdata( $post );
1450
+	if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
1451
+		$post = geodir_get_post_info($request_post_id);
1452
+		setup_postdata($post);
1453 1453
 	}
1454 1454
 
1455
-	$geodir_post_detail_fields = geodir_show_listing_info( 'moreinfo' );
1455
+	$geodir_post_detail_fields = geodir_show_listing_info('moreinfo');
1456 1456
 
1457 1457
 	$package_info = geodir_post_package_info(array(), $post, (!empty($post->post_type) ? $post->post_type : ''));
1458 1458
 	$image_limit = '';
1459 1459
 	if (defined('GEODIRPAYMENT_VERSION') && !empty($package_info) && isset($package_info->image_limit) && $package_info->image_limit !== '') {
1460
-		$image_limit = (int)$package_info->image_limit;
1460
+		$image_limit = (int) $package_info->image_limit;
1461 1461
 	}
1462 1462
 
1463
-	if ( geodir_is_page( 'detail' ) ) {
1464
-		$video                 = geodir_get_video( $post->ID );
1465
-		$special_offers        = geodir_get_special_offers( $post->ID );
1463
+	if (geodir_is_page('detail')) {
1464
+		$video                 = geodir_get_video($post->ID);
1465
+		$special_offers        = geodir_get_special_offers($post->ID);
1466 1466
 		$related_listing_array = array();
1467
-		if ( get_option( 'geodir_add_related_listing_posttypes' ) ) {
1468
-			$related_listing_array = get_option( 'geodir_add_related_listing_posttypes' );
1467
+		if (get_option('geodir_add_related_listing_posttypes')) {
1468
+			$related_listing_array = get_option('geodir_add_related_listing_posttypes');
1469 1469
 		}
1470 1470
 
1471
-		$excluded_tabs = get_option( 'geodir_detail_page_tabs_excluded' );
1472
-		if ( ! $excluded_tabs ) {
1471
+		$excluded_tabs = get_option('geodir_detail_page_tabs_excluded');
1472
+		if (!$excluded_tabs) {
1473 1473
 			$excluded_tabs = array();
1474 1474
 		}
1475 1475
 
1476 1476
 		$related_listing = '';
1477
-		if ( in_array( $post->post_type, $related_listing_array ) && ! in_array( 'related_listing', $excluded_tabs ) ) {
1477
+		if (in_array($post->post_type, $related_listing_array) && !in_array('related_listing', $excluded_tabs)) {
1478 1478
 			$request = array(
1479
-				'post_number'         => get_option( 'geodir_related_post_count' ),
1480
-				'relate_to'           => get_option( 'geodir_related_post_relate_to' ),
1481
-				'layout'              => get_option( 'geodir_related_post_listing_view' ),
1482
-				'add_location_filter' => get_option( 'geodir_related_post_location_filter' ),
1483
-				'list_sort'           => get_option( 'geodir_related_post_sortby' ),
1484
-				'character_count'     => get_option( 'geodir_related_post_excerpt' )
1479
+				'post_number'         => get_option('geodir_related_post_count'),
1480
+				'relate_to'           => get_option('geodir_related_post_relate_to'),
1481
+				'layout'              => get_option('geodir_related_post_listing_view'),
1482
+				'add_location_filter' => get_option('geodir_related_post_location_filter'),
1483
+				'list_sort'           => get_option('geodir_related_post_sortby'),
1484
+				'character_count'     => get_option('geodir_related_post_excerpt')
1485 1485
 			);
1486 1486
 
1487
-			if ( $post->post_type == 'gd_event' && defined( 'GDEVENTS_VERSION' ) ) {
1488
-				$related_listing = geodir_get_detail_page_related_events( $request );
1487
+			if ($post->post_type == 'gd_event' && defined('GDEVENTS_VERSION')) {
1488
+				$related_listing = geodir_get_detail_page_related_events($request);
1489 1489
 			} else {
1490
-				$related_listing = geodir_related_posts_display( $request );
1490
+				$related_listing = geodir_related_posts_display($request);
1491 1491
 			}
1492 1492
 
1493 1493
 		}
1494 1494
 
1495
-		$post_images = geodir_get_images( $post->ID, 'thumbnail' );
1495
+		$post_images = geodir_get_images($post->ID, 'thumbnail');
1496 1496
 		$thumb_image = '';
1497
-		if ( ! empty( $post_images ) ) {
1497
+		if (!empty($post_images)) {
1498 1498
 			$count = 1;
1499
-			foreach ( $post_images as $image ) {
1499
+			foreach ($post_images as $image) {
1500 1500
 				if ($image_limit !== '' && $count > $image_limit) {
1501 1501
 					break;
1502 1502
 				}
1503
-				$caption = ( ! empty( $image->caption ) ) ? $image->caption : '';
1504
-				$thumb_image .= '<a href="' . $image->src . '" title="' . $caption . '">';
1505
-				$thumb_image .= geodir_show_image( $image, 'thumbnail', true, false );
1503
+				$caption = (!empty($image->caption)) ? $image->caption : '';
1504
+				$thumb_image .= '<a href="'.$image->src.'" title="'.$caption.'">';
1505
+				$thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1506 1506
 				$thumb_image .= '</a>';
1507 1507
 				$count++;
1508 1508
 			}
@@ -1512,11 +1512,11 @@  discard block
 block discarded – undo
1512 1512
 		$map_args['map_canvas_name'] = 'detail_page_map_canvas';
1513 1513
 		$map_args['width']           = '600';
1514 1514
 		$map_args['height']          = '300';
1515
-		if ( $post->post_mapzoom ) {
1516
-			$map_args['zoom'] = '' . $post->post_mapzoom . '';
1515
+		if ($post->post_mapzoom) {
1516
+			$map_args['zoom'] = ''.$post->post_mapzoom.'';
1517 1517
 		}
1518 1518
 		$map_args['autozoom']                 = false;
1519
-		$map_args['scrollwheel']              = ( get_option( 'geodir_add_listing_mouse_scroll' ) ) ? 0 : 1;
1519
+		$map_args['scrollwheel']              = (get_option('geodir_add_listing_mouse_scroll')) ? 0 : 1;
1520 1520
 		$map_args['child_collapse']           = '0';
1521 1521
 		$map_args['enable_cat_filters']       = false;
1522 1522
 		$map_args['enable_text_search']       = false;
@@ -1525,29 +1525,29 @@  discard block
 block discarded – undo
1525 1525
 		$map_args['enable_jason_on_load']     = true;
1526 1526
 		$map_args['enable_map_direction']     = true;
1527 1527
 		$map_args['map_class_name']           = 'geodir-map-detail-page';
1528
-		$map_args['maptype']                  = ( ! empty( $post->post_mapview ) ) ? $post->post_mapview : 'ROADMAP';
1529
-	} else if ( geodir_is_page( 'preview' ) ) {
1530
-		$video          = isset( $post->geodir_video ) ? $post->geodir_video : '';
1531
-		$special_offers = isset( $post->geodir_special_offers ) ? $post->geodir_special_offers : '';
1528
+		$map_args['maptype']                  = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
1529
+	} else if (geodir_is_page('preview')) {
1530
+		$video          = isset($post->geodir_video) ? $post->geodir_video : '';
1531
+		$special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : '';
1532 1532
 
1533
-		if ( isset( $post->post_images ) ) {
1534
-			$post->post_images = trim( $post->post_images, "," );
1533
+		if (isset($post->post_images)) {
1534
+			$post->post_images = trim($post->post_images, ",");
1535 1535
 		}
1536 1536
 
1537
-		if ( isset( $post->post_images ) && ! empty( $post->post_images ) ) {
1538
-			$post_images = explode( ",", $post->post_images );
1537
+		if (isset($post->post_images) && !empty($post->post_images)) {
1538
+			$post_images = explode(",", $post->post_images);
1539 1539
 		}
1540 1540
 
1541 1541
 		$thumb_image = '';
1542
-		if ( ! empty( $post_images ) ) {
1542
+		if (!empty($post_images)) {
1543 1543
 			$count = 1;
1544
-			foreach ( $post_images as $image ) {
1545
-				if ( $image != '' ) {
1544
+			foreach ($post_images as $image) {
1545
+				if ($image != '') {
1546 1546
 					if ($image_limit !== '' && $count > $image_limit) {
1547 1547
 						break;
1548 1548
 					}
1549
-					$thumb_image .= '<a href="' . $image . '">';
1550
-					$thumb_image .= geodir_show_image( array( 'src' => $image ), 'thumbnail', true, false );
1549
+					$thumb_image .= '<a href="'.$image.'">';
1550
+					$thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1551 1551
 					$thumb_image .= '</a>';
1552 1552
 					$count++;
1553 1553
 				}
@@ -1555,18 +1555,18 @@  discard block
 block discarded – undo
1555 1555
 		}
1556 1556
 
1557 1557
 		global $map_jason;
1558
-		$marker_json      = $post->marker_json != '' ? json_decode( $post->marker_json, true ) : array();
1559
-		$marker_icon      = ( ! empty( $marker_json ) && ! empty( $marker_json['i'] ) ) ? $marker_json['i'] : '';
1560
-		$icon_size        = geodir_get_marker_size( $marker_icon );
1558
+		$marker_json      = $post->marker_json != '' ? json_decode($post->marker_json, true) : array();
1559
+		$marker_icon      = (!empty($marker_json) && !empty($marker_json['i'])) ? $marker_json['i'] : '';
1560
+		$icon_size        = geodir_get_marker_size($marker_icon);
1561 1561
 		$marker_json['w'] = $icon_size['w'];
1562 1562
 		$marker_json['h'] = $icon_size['h'];
1563
-		$map_jason[]      = json_encode( $marker_json );
1563
+		$map_jason[]      = json_encode($marker_json);
1564 1564
 
1565
-		$address_latitude  = isset( $post->post_latitude ) ? $post->post_latitude : '';
1566
-		$address_longitude = isset( $post->post_longitude ) ? $post->post_longitude : '';
1567
-		$mapview           = isset( $post->post_mapview ) ? $post->post_mapview : '';
1568
-		$mapzoom           = isset( $post->post_mapzoom ) ? $post->post_mapzoom : '';
1569
-		if ( ! $mapzoom ) {
1565
+		$address_latitude  = isset($post->post_latitude) ? $post->post_latitude : '';
1566
+		$address_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
1567
+		$mapview           = isset($post->post_mapview) ? $post->post_mapview : '';
1568
+		$mapzoom           = isset($post->post_mapzoom) ? $post->post_mapzoom : '';
1569
+		if (!$mapzoom) {
1570 1570
 			$mapzoom = 12;
1571 1571
 		}
1572 1572
 
@@ -1589,37 +1589,37 @@  discard block
 block discarded – undo
1589 1589
 		$map_args['map_class_name']           = 'geodir-map-preview-page';
1590 1590
 	}
1591 1591
 
1592
-	$arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1592
+	$arr_detail_page_tabs = geodir_detail_page_tabs_list(); // get this sooner so we can get the active tab for the user
1593 1593
 
1594 1594
 	$active_tab       = '';
1595 1595
 	$active_tab_name  = '';
1596 1596
 	$default_tab      = '';
1597 1597
 	$default_tab_name = '';
1598
-	foreach ( $arr_detail_page_tabs as $tab_index => $tabs ) {
1599
-		if ( isset( $tabs['is_active_tab'] ) && $tabs['is_active_tab'] && ! empty( $tabs['is_display'] ) && isset( $tabs['heading_text'] ) && $tabs['heading_text'] ) {
1598
+	foreach ($arr_detail_page_tabs as $tab_index => $tabs) {
1599
+		if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1600 1600
 			$active_tab      = $tab_index;
1601
-			$active_tab_name = __( $tabs['heading_text'], 'geodirectory' );
1601
+			$active_tab_name = __($tabs['heading_text'], 'geodirectory');
1602 1602
 		}
1603 1603
 
1604
-		if ( $default_tab === '' && ! empty( $tabs['is_display'] ) && ! empty( $tabs['heading_text'] ) ) {
1604
+		if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
1605 1605
 			$default_tab      = $tab_index;
1606
-			$default_tab_name = __( $tabs['heading_text'], 'geodirectory' );
1606
+			$default_tab_name = __($tabs['heading_text'], 'geodirectory');
1607 1607
 		}
1608 1608
 	}
1609 1609
 
1610
-	if ( $active_tab === '' && $default_tab !== '' ) { // Make first tab as a active tab if not any tab is active.
1611
-		if ( isset( $arr_detail_page_tabs[ $active_tab ] ) && isset( $arr_detail_page_tabs[ $active_tab ]['is_active_tab'] ) ) {
1612
-			$arr_detail_page_tabs[ $active_tab ]['is_active_tab'] = false;
1610
+	if ($active_tab === '' && $default_tab !== '') { // Make first tab as a active tab if not any tab is active.
1611
+		if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
1612
+			$arr_detail_page_tabs[$active_tab]['is_active_tab'] = false;
1613 1613
 		}
1614 1614
 
1615
-		$arr_detail_page_tabs[ $default_tab ]['is_active_tab'] = true;
1615
+		$arr_detail_page_tabs[$default_tab]['is_active_tab'] = true;
1616 1616
 		$active_tab                                            = $default_tab;
1617 1617
 		$active_tab_name                                       = $default_tab_name;
1618 1618
 	}
1619
-	$tab_list = ( get_option( 'geodir_disable_tabs', false ) ) ? true : false;
1619
+	$tab_list = (get_option('geodir_disable_tabs', false)) ? true : false;
1620 1620
 	?>
1621 1621
 	<div class="geodir-tabs" id="gd-tabs" style="position:relative;">
1622
-		<?php if ( ! $tab_list ){ ?>
1622
+		<?php if (!$tab_list) { ?>
1623 1623
 		<div id="geodir-tab-mobile-menu">
1624 1624
 			<i class="fas fa-bars"></i>
1625 1625
 			<span class="geodir-mobile-active-tab"><?php echo $active_tab_name; ?></span>
@@ -1634,26 +1634,26 @@  discard block
 block discarded – undo
1634 1634
 			 * @since 1.0.0
1635 1635
 			 * @see   'geodir_after_tab_list'
1636 1636
 			 */
1637
-			do_action( 'geodir_before_tab_list' ); ?>
1637
+			do_action('geodir_before_tab_list'); ?>
1638 1638
 			<?php
1639 1639
 
1640
-			foreach ( $arr_detail_page_tabs as $tab_index => $detail_page_tab ) {
1641
-				if ( $detail_page_tab['is_display'] ) {
1640
+			foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1641
+				if ($detail_page_tab['is_display']) {
1642 1642
 
1643
-					if ( ! $tab_list ) {
1643
+					if (!$tab_list) {
1644 1644
 						?>
1645 1645
 						<dt></dt> <!-- added to comply with validation -->
1646
-						<dd <?php if ( $detail_page_tab['is_active_tab'] ){ ?>class="geodir-tab-active"<?php } ?> ><a
1646
+						<dd <?php if ($detail_page_tab['is_active_tab']) { ?>class="geodir-tab-active"<?php } ?> ><a
1647 1647
 								data-tab="#<?php echo $tab_index; ?>"
1648
-								data-status="enable"><?php _e( $detail_page_tab['heading_text'], 'geodirectory' ); ?></a>
1648
+								data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a>
1649 1649
 						</dd>
1650 1650
 						<?php
1651 1651
 					}
1652 1652
 					ob_start() // start tab content buffering
1653 1653
 					?>
1654 1654
 					<li id="<?php echo $tab_index; ?>Tab">
1655
-						<?php if ( $tab_list ) {
1656
-							$tab_title = '<span class="gd-tab-list-title" ><a href="#' . $tab_index . '">' . __( $detail_page_tab['heading_text'], 'geodirectory' ) . '</a></span><hr />';
1655
+						<?php if ($tab_list) {
1656
+							$tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'], 'geodirectory').'</a></span><hr />';
1657 1657
 							/**
1658 1658
 							 * Filter the tab list title html.
1659 1659
 							 *
@@ -1663,7 +1663,7 @@  discard block
 block discarded – undo
1663 1663
 							 * @param string $tab_index      The tab index type.
1664 1664
 							 * @param array $detail_page_tab The array of values including title text.
1665 1665
 							 */
1666
-							echo apply_filters( 'geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab );
1666
+							echo apply_filters('geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab);
1667 1667
 						} ?>
1668 1668
 						<div id="<?php echo $tab_index; ?>" class="hash-offset"></div>
1669 1669
 						<?php
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
 						 *
1675 1675
 						 * @param string $tab_index The tab name ID.
1676 1676
 						 */
1677
-						do_action( 'geodir_before_tab_content', $tab_index );
1677
+						do_action('geodir_before_tab_content', $tab_index);
1678 1678
 
1679 1679
 						/**
1680 1680
 						 * Called before the details tab content is output per tab.
@@ -1684,21 +1684,21 @@  discard block
 block discarded – undo
1684 1684
 						 * @since 1.0.0
1685 1685
 						 * @todo  do we need this if we have the hook above? 'geodir_before_tab_content'
1686 1686
 						 */
1687
-						do_action( 'geodir_before_' . $tab_index . '_tab_content' );
1687
+						do_action('geodir_before_'.$tab_index.'_tab_content');
1688 1688
 						/// write a code to generate content of each tab
1689
-						switch ( $tab_index ) {
1689
+						switch ($tab_index) {
1690 1690
 							case 'post_profile':
1691 1691
 								/**
1692 1692
 								 * Called before the listing description content on the details page tab.
1693 1693
 								 *
1694 1694
 								 * @since 1.0.0
1695 1695
 								 */
1696
-								do_action( 'geodir_before_description_on_listing_detail' );
1697
-								if ( geodir_is_page( 'detail' ) ) {
1696
+								do_action('geodir_before_description_on_listing_detail');
1697
+								if (geodir_is_page('detail')) {
1698 1698
 									the_content();
1699 1699
 								} else {
1700 1700
 									/** This action is documented in geodirectory_template_actions.php */
1701
-									echo apply_filters( 'the_content', stripslashes( $post->post_desc ) );
1701
+									echo apply_filters('the_content', stripslashes($post->post_desc));
1702 1702
 								}
1703 1703
 
1704 1704
 								/**
@@ -1706,7 +1706,7 @@  discard block
 block discarded – undo
1706 1706
 								 *
1707 1707
 								 * @since 1.0.0
1708 1708
 								 */
1709
-								do_action( 'geodir_after_description_on_listing_detail' );
1709
+								do_action('geodir_after_description_on_listing_detail');
1710 1710
 								break;
1711 1711
 							case 'post_info':
1712 1712
 								echo $geodir_post_detail_fields;
@@ -1716,32 +1716,32 @@  discard block
 block discarded – undo
1716 1716
 								break;
1717 1717
 							case 'post_video':
1718 1718
 								// some browsers hide $_POST data if used for embeds so we replace with a placeholder
1719
-								if ( $preview ) {
1720
-									if ( $video ) {
1721
-										echo "<span class='gd-video-embed-preview' ><p class='gd-video-preview-text'><i class=\"fas fa-video\" aria-hidden=\"true\"></i><br />" . __( 'Video Preview Placeholder', 'geodirectory' ) . "</p></span>";
1719
+								if ($preview) {
1720
+									if ($video) {
1721
+										echo "<span class='gd-video-embed-preview' ><p class='gd-video-preview-text'><i class=\"fas fa-video\" aria-hidden=\"true\"></i><br />".__('Video Preview Placeholder', 'geodirectory')."</p></span>";
1722 1722
 									}
1723 1723
 								} else {
1724 1724
 
1725 1725
 									// stop payment manager filtering content length
1726
-									$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1727
-									if ( false !== $filter_priority ) {
1728
-										remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1726
+									$filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1727
+									if (false !== $filter_priority) {
1728
+										remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1729 1729
 									}
1730 1730
 
1731 1731
 									/** This action is documented in geodirectory_template_actions.php */
1732
-									echo apply_filters( 'the_content', stripslashes( $video ) );// we apply the_content filter so oembed works also;
1732
+									echo apply_filters('the_content', stripslashes($video)); // we apply the_content filter so oembed works also;
1733 1733
 
1734
-									if ( false !== $filter_priority ) {
1735
-										add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1734
+									if (false !== $filter_priority) {
1735
+										add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1736 1736
 									}
1737 1737
 								}
1738 1738
 								break;
1739 1739
 							case 'special_offers':
1740
-								echo apply_filters( 'gd_special_offers_content', wpautop( stripslashes( $special_offers ) ) );
1740
+								echo apply_filters('gd_special_offers_content', wpautop(stripslashes($special_offers)));
1741 1741
 
1742 1742
 								break;
1743 1743
 							case 'post_map':
1744
-								geodir_draw_map( $map_args );
1744
+								geodir_draw_map($map_args);
1745 1745
 								break;
1746 1746
 							case 'reviews':
1747 1747
 								comments_template();
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
 								echo $related_listing;
1751 1751
 								break;
1752 1752
 							default: {
1753
-								if ( ( isset( $post->{$tab_index} ) || ( ! isset( $post->{$tab_index} ) && ( strpos( $tab_index, 'gd_tab_' ) !== false || $tab_index == 'link_business' ) ) ) && ! empty( $detail_page_tab['tab_content'] ) ) {
1753
+								if ((isset($post->{$tab_index} ) || (!isset($post->{$tab_index} ) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
1754 1754
 									echo $detail_page_tab['tab_content'];
1755 1755
 								}
1756 1756
 							}
@@ -1762,7 +1762,7 @@  discard block
 block discarded – undo
1762 1762
 						 *
1763 1763
 						 * @since 1.0.0
1764 1764
 						 */
1765
-						do_action( 'geodir_after_tab_content', $tab_index );
1765
+						do_action('geodir_after_tab_content', $tab_index);
1766 1766
 
1767 1767
 						/**
1768 1768
 						 * Called after the details tab content is output per tab.
@@ -1772,7 +1772,7 @@  discard block
 block discarded – undo
1772 1772
 						 * @since 1.0.0
1773 1773
 						 * @todo  do we need this if we have the hook above? 'geodir_after_tab_content'
1774 1774
 						 */
1775
-						do_action( 'geodir_after_' . $tab_index . '_tab_content' );
1775
+						do_action('geodir_after_'.$tab_index.'_tab_content');
1776 1776
 						?> </li>
1777 1777
 					<?php
1778 1778
 					/**
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
 					 *
1781 1781
 					 * @since 1.0.0
1782 1782
 					 */
1783
-					$arr_detail_page_tabs[ $tab_index ]['tab_content'] = apply_filters( "geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean() );
1783
+					$arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_".$detail_page_tab['tab_content']."_tab_content", ob_get_clean());
1784 1784
 				} // end of if for is_display
1785 1785
 			}// end of foreach
1786 1786
 
@@ -1790,14 +1790,14 @@  discard block
 block discarded – undo
1790 1790
 			 * @since 1.0.0
1791 1791
 			 * @see   'geodir_before_tab_list'
1792 1792
 			 */
1793
-			do_action( 'geodir_after_tab_list' );
1793
+			do_action('geodir_after_tab_list');
1794 1794
 			?>
1795
-			<?php if ( ! $tab_list ){ ?></dl><?php } ?>
1796
-		<ul class="geodir-tabs-content entry-content <?php if ( $tab_list ) { ?>geodir-tabs-list<?php } ?>"
1795
+			<?php if (!$tab_list) { ?></dl><?php } ?>
1796
+		<ul class="geodir-tabs-content entry-content <?php if ($tab_list) { ?>geodir-tabs-list<?php } ?>"
1797 1797
 		    style="position:relative;">
1798 1798
 			<?php
1799
-			foreach ( $arr_detail_page_tabs as $detail_page_tab ) {
1800
-				if ( $detail_page_tab['is_display'] && ! empty( $detail_page_tab['tab_content'] ) ) {
1799
+			foreach ($arr_detail_page_tabs as $detail_page_tab) {
1800
+				if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
1801 1801
 					echo $detail_page_tab['tab_content'];
1802 1802
 				}// end of if
1803 1803
 			}// end of foreach
@@ -1807,11 +1807,11 @@  discard block
 block discarded – undo
1807 1807
 			 *
1808 1808
 			 * @since 1.0.0
1809 1809
 			 */
1810
-			do_action( 'geodir_add_tab_content' ); ?>
1810
+			do_action('geodir_add_tab_content'); ?>
1811 1811
 		</ul>
1812 1812
 		<!--gd-tabs-content ul end-->
1813 1813
 	</div>
1814
-	<?php if ( ! $tab_list ) { ?>
1814
+	<?php if (!$tab_list) { ?>
1815 1815
 		<script>
1816 1816
 			if (window.location.hash && window.location.hash.indexOf('&') === -1 && jQuery(window.location.hash + 'Tab').length) {
1817 1817
 				hashVal = window.location.hash;
@@ -1843,31 +1843,31 @@  discard block
 block discarded – undo
1843 1843
  *
1844 1844
  * @return mixed Image file.
1845 1845
  */
1846
-function geodir_exif( $file ) {
1847
-	if ( empty( $file ) || ! is_array( $file ) ) {
1846
+function geodir_exif($file) {
1847
+	if (empty($file) || !is_array($file)) {
1848 1848
 		return $file;
1849 1849
 	}
1850 1850
 
1851
-	$file_path = ! empty( $file['tmp_name'] ) ? sanitize_text_field( $file['tmp_name'] ) : '';
1852
-	if ( ! ( $file_path && file_exists( $file_path ) ) ) {
1851
+	$file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : '';
1852
+	if (!($file_path && file_exists($file_path))) {
1853 1853
 		return $file;
1854 1854
 	}
1855 1855
 	$file['file'] = $file_path;
1856 1856
 
1857
-	if ( ! file_is_valid_image( $file_path ) ) {
1857
+	if (!file_is_valid_image($file_path)) {
1858 1858
 		return $file; // Bail if file is not an image.
1859 1859
 	}
1860 1860
 
1861
-	if ( ! function_exists( 'wp_get_image_editor' ) ) {
1861
+	if (!function_exists('wp_get_image_editor')) {
1862 1862
 		return $file;
1863 1863
 	}
1864 1864
 
1865 1865
 	$mime_type = $file['type'];
1866 1866
 	$exif      = array();
1867
-	if ( $mime_type == 'image/jpeg' && function_exists( 'exif_read_data' ) ) {
1867
+	if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1868 1868
 		try {
1869
-			$exif = exif_read_data( $file_path );
1870
-		} catch ( Exception $e ) {
1869
+			$exif = exif_read_data($file_path);
1870
+		} catch (Exception $e) {
1871 1871
 			$exif = array();
1872 1872
 		}
1873 1873
 	}
@@ -1876,13 +1876,13 @@  discard block
 block discarded – undo
1876 1876
 	$flip        = false;
1877 1877
 	$modify      = false;
1878 1878
 	$orientation = 0;
1879
-	if ( ! empty( $exif ) && isset( $exif['Orientation'] ) ) {
1880
-		switch ( (int) $exif['Orientation'] ) {
1879
+	if (!empty($exif) && isset($exif['Orientation'])) {
1880
+		switch ((int) $exif['Orientation']) {
1881 1881
 			case 1:
1882 1882
 				// do nothing
1883 1883
 				break;
1884 1884
 			case 2:
1885
-				$flip   = array( false, true );
1885
+				$flip   = array(false, true);
1886 1886
 				$modify = true;
1887 1887
 				break;
1888 1888
 			case 3:
@@ -1891,13 +1891,13 @@  discard block
 block discarded – undo
1891 1891
 				$modify      = true;
1892 1892
 				break;
1893 1893
 			case 4:
1894
-				$flip   = array( true, false );
1894
+				$flip   = array(true, false);
1895 1895
 				$modify = true;
1896 1896
 				break;
1897 1897
 			case 5:
1898 1898
 				$orientation = - 90;
1899 1899
 				$rotate      = true;
1900
-				$flip        = array( false, true );
1900
+				$flip        = array(false, true);
1901 1901
 				$modify      = true;
1902 1902
 				break;
1903 1903
 			case 6:
@@ -1908,7 +1908,7 @@  discard block
 block discarded – undo
1908 1908
 			case 7:
1909 1909
 				$orientation = - 270;
1910 1910
 				$rotate      = true;
1911
-				$flip        = array( false, true );
1911
+				$flip        = array(false, true);
1912 1912
 				$modify      = true;
1913 1913
 				break;
1914 1914
 			case 8:
@@ -1934,31 +1934,31 @@  discard block
 block discarded – undo
1934 1934
 	 * @param int|null $quality Image Compression quality between 1-100% scale. Default null.
1935 1935
 	 * @param string $quality   Image mime type.
1936 1936
 	 */
1937
-	$quality = apply_filters( 'geodir_image_upload_set_quality', $quality, $mime_type );
1938
-	if ( $quality !== null ) {
1937
+	$quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
1938
+	if ($quality !== null) {
1939 1939
 		$modify = true;
1940 1940
 	}
1941 1941
 
1942
-	if ( ! $modify ) {
1942
+	if (!$modify) {
1943 1943
 		return $file; // no change
1944 1944
 	}
1945 1945
 
1946
-	$image = wp_get_image_editor( $file_path );
1947
-	if ( ! is_wp_error( $image ) ) {
1948
-		if ( $rotate ) {
1949
-			$image->rotate( $orientation );
1946
+	$image = wp_get_image_editor($file_path);
1947
+	if (!is_wp_error($image)) {
1948
+		if ($rotate) {
1949
+			$image->rotate($orientation);
1950 1950
 		}
1951 1951
 
1952
-		if ( ! empty( $flip ) ) {
1953
-			$image->flip( $flip[0], $flip[1] );
1952
+		if (!empty($flip)) {
1953
+			$image->flip($flip[0], $flip[1]);
1954 1954
 		}
1955 1955
 
1956
-		if ( $quality !== null ) {
1957
-			$image->set_quality( (int) $quality );
1956
+		if ($quality !== null) {
1957
+			$image->set_quality((int) $quality);
1958 1958
 		}
1959 1959
 
1960
-		$result = $image->save( $file_path );
1961
-		if ( ! is_wp_error( $result ) ) {
1960
+		$result = $image->save($file_path);
1961
+		if (!is_wp_error($result)) {
1962 1962
 			$file['file']     = $result['path'];
1963 1963
 			$file['tmp_name'] = $result['path'];
1964 1964
 		}
@@ -1986,7 +1986,7 @@  discard block
 block discarded – undo
1986 1986
  *
1987 1987
  * @return string Returns the recent reviews html.
1988 1988
  */
1989
-function geodir_get_recent_reviews( $g_size = 60, $no_comments = 5, $comment_lenth = 60, $show_pass_post = false ) {
1989
+function geodir_get_recent_reviews($g_size = 60, $no_comments = 5, $comment_lenth = 60, $show_pass_post = false) {
1990 1990
 	global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session, $table_prefix;
1991 1991
 	$tablecomments = $wpdb->comments;
1992 1992
 	$tableposts    = $wpdb->posts;
@@ -1996,17 +1996,17 @@  discard block
 block discarded – undo
1996 1996
 	$region_filter  = '';
1997 1997
 	$country_filter = '';
1998 1998
 
1999
-	if ( $gd_session->get( 'gd_multi_location' ) ) {
2000
-		if ( $gd_ses_country = $gd_session->get( 'gd_country' ) ) {
2001
-			$country_filter = $wpdb->prepare( " AND r.post_country=%s ", str_replace( "-", " ", $gd_ses_country ) );
1999
+	if ($gd_session->get('gd_multi_location')) {
2000
+		if ($gd_ses_country = $gd_session->get('gd_country')) {
2001
+			$country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
2002 2002
 		}
2003 2003
 
2004
-		if ( $gd_ses_region = $gd_session->get( 'gd_region' ) ) {
2005
-			$region_filter = $wpdb->prepare( " AND r.post_region=%s ", str_replace( "-", " ", $gd_ses_region ) );
2004
+		if ($gd_ses_region = $gd_session->get('gd_region')) {
2005
+			$region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
2006 2006
 		}
2007 2007
 
2008
-		if ( $gd_ses_city = $gd_session->get( 'gd_city' ) ) {
2009
-			$city_filter = $wpdb->prepare( " AND r.post_city=%s ", str_replace( "-", " ", $gd_ses_city ) );
2008
+		if ($gd_ses_city = $gd_session->get('gd_city')) {
2009
+			$city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
2010 2010
 		}
2011 2011
 	}
2012 2012
 
@@ -2017,84 +2017,84 @@  discard block
 block discarded – undo
2017 2017
 		$lang_code = ICL_LANGUAGE_CODE;
2018 2018
 
2019 2019
 		if ($lang_code) {
2020
-			$join .= " JOIN " . $table_prefix . "icl_translations AS icltr2 ON icltr2.element_id = c.comment_post_ID AND p.ID = icltr2.element_id AND CONCAT('post_', p.post_type) = icltr2.element_type LEFT JOIN " . $table_prefix . "icl_translations AS icltr_comment ON icltr_comment.element_id = c.comment_ID AND icltr_comment.element_type = 'comment'";
2021
-			$where .= " AND icltr2.language_code = '" . $lang_code . "' AND (icltr_comment.language_code IS NULL OR icltr_comment.language_code = icltr2.language_code)";
2020
+			$join .= " JOIN ".$table_prefix."icl_translations AS icltr2 ON icltr2.element_id = c.comment_post_ID AND p.ID = icltr2.element_id AND CONCAT('post_', p.post_type) = icltr2.element_type LEFT JOIN ".$table_prefix."icl_translations AS icltr_comment ON icltr_comment.element_id = c.comment_ID AND icltr_comment.element_type = 'comment'";
2021
+			$where .= " AND icltr2.language_code = '".$lang_code."' AND (icltr_comment.language_code IS NULL OR icltr_comment.language_code = icltr2.language_code)";
2022 2022
 		}
2023 2023
 	}
2024 2024
 
2025
-	$request = "SELECT r.id AS ID, r.post_type, r.comment_id AS comment_ID, r.post_date AS comment_date, r.overall_rating, r.user_id, r.post_id FROM " . GEODIR_REVIEW_TABLE . " AS r JOIN " . $wpdb->comments . " AS c ON c.comment_ID = r.comment_id JOIN " . $wpdb->posts . " AS p ON p.ID = c.comment_post_ID " . $join . " WHERE c.comment_parent = 0 AND c.comment_approved = 1 AND r.status = 1 AND r.overall_rating >= 1 AND p.post_status = 'publish' " . $where . " ORDER BY r.post_date DESC, r.id DESC LIMIT ". $no_comments;
2025
+	$request = "SELECT r.id AS ID, r.post_type, r.comment_id AS comment_ID, r.post_date AS comment_date, r.overall_rating, r.user_id, r.post_id FROM ".GEODIR_REVIEW_TABLE." AS r JOIN ".$wpdb->comments." AS c ON c.comment_ID = r.comment_id JOIN ".$wpdb->posts." AS p ON p.ID = c.comment_post_ID ".$join." WHERE c.comment_parent = 0 AND c.comment_approved = 1 AND r.status = 1 AND r.overall_rating >= 1 AND p.post_status = 'publish' ".$where." ORDER BY r.post_date DESC, r.id DESC LIMIT ".$no_comments;
2026 2026
 
2027
-	$comments = $wpdb->get_results( $request );
2027
+	$comments = $wpdb->get_results($request);
2028 2028
 
2029
-	foreach ( $comments as $comment ) {
2029
+	foreach ($comments as $comment) {
2030 2030
 		// Set the extra comment info needed.
2031
-		$comment_extra = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID" );
2031
+		$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
2032 2032
 		$comment->comment_content      = $comment_extra->comment_content;
2033 2033
 		$comment->comment_author       = $comment_extra->comment_author;
2034 2034
 		$comment->comment_author_email = $comment_extra->comment_author_email;
2035 2035
 
2036 2036
 		$comment_id      = '';
2037 2037
 		$comment_id      = $comment->comment_ID;
2038
-		$comment_content = strip_tags( $comment->comment_content );
2038
+		$comment_content = strip_tags($comment->comment_content);
2039 2039
 
2040
-		$comment_content = preg_replace( '#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content );
2040
+		$comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
2041 2041
 
2042
-		$permalink            = get_permalink( $comment->ID ) . "#comment-" . $comment->comment_ID;
2042
+		$permalink            = get_permalink($comment->ID)."#comment-".$comment->comment_ID;
2043 2043
 		$comment_author_email = $comment->comment_author_email;
2044 2044
 		$comment_post_ID      = $comment->post_id;
2045 2045
 
2046
-		$post_title        = get_the_title( $comment_post_ID );
2047
-		$permalink         = get_permalink( $comment_post_ID );
2048
-		$comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
2049
-		$read_more         = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __( 'Read more', 'geodirectory' ) . '</a>';
2046
+		$post_title        = get_the_title($comment_post_ID);
2047
+		$permalink         = get_permalink($comment_post_ID);
2048
+		$comment_permalink = $permalink."#comment-".$comment->comment_ID;
2049
+		$read_more         = '<a class="comment_excerpt" href="'.$comment_permalink.'">'.__('Read more', 'geodirectory').'</a>';
2050 2050
 
2051
-		$comment_content_length = strlen( $comment_content );
2052
-		if ( $comment_content_length > $comment_lenth ) {
2053
-			$comment_excerpt = geodir_utf8_substr( $comment_content, 0, $comment_lenth ) . '... ' . $read_more;
2051
+		$comment_content_length = strlen($comment_content);
2052
+		if ($comment_content_length > $comment_lenth) {
2053
+			$comment_excerpt = geodir_utf8_substr($comment_content, 0, $comment_lenth).'... '.$read_more;
2054 2054
 		} else {
2055 2055
 			$comment_excerpt = $comment_content;
2056 2056
 		}
2057 2057
 
2058
-		if ( $comment->user_id ) {
2059
-			$user_profile_url = get_author_posts_url( $comment->user_id );
2058
+		if ($comment->user_id) {
2059
+			$user_profile_url = get_author_posts_url($comment->user_id);
2060 2060
 		} else {
2061 2061
 			$user_profile_url = '';
2062 2062
 		}
2063 2063
 
2064
-		if ( $comment_id ) {
2064
+		if ($comment_id) {
2065 2065
 			$comments_echo .= '<li class="clearfix">';
2066
-			$comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
2067
-			if ( function_exists( 'get_avatar' ) ) {
2068
-				if ( ! isset( $comment->comment_type ) ) {
2069
-					if ( $user_profile_url ) {
2070
-						$comments_echo .= '<a href="' . $user_profile_url . '">';
2066
+			$comments_echo .= "<span class=\"li".$comment_id." geodir_reviewer_image\">";
2067
+			if (function_exists('get_avatar')) {
2068
+				if (!isset($comment->comment_type)) {
2069
+					if ($user_profile_url) {
2070
+						$comments_echo .= '<a href="'.$user_profile_url.'">';
2071 2071
 					}
2072
-					$comments_echo .= get_avatar( $comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2073
-					if ( $user_profile_url ) {
2072
+					$comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2073
+					if ($user_profile_url) {
2074 2074
 						$comments_echo .= '</a>';
2075 2075
 					}
2076
-				} elseif ( ( isset( $comment->comment_type ) && $comment->comment_type == 'trackback' ) || ( isset( $comment->comment_type ) && $comment->comment_type == 'pingback' ) ) {
2077
-					if ( $user_profile_url ) {
2078
-						$comments_echo .= '<a href="' . $user_profile_url . '">';
2076
+				} elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
2077
+					if ($user_profile_url) {
2078
+						$comments_echo .= '<a href="'.$user_profile_url.'">';
2079 2079
 					}
2080
-					$comments_echo .= get_avatar( $comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2080
+					$comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2081 2081
 				}
2082
-			} elseif ( function_exists( 'gravatar' ) ) {
2083
-				if ( $user_profile_url ) {
2084
-					$comments_echo .= '<a href="' . $user_profile_url . '">';
2082
+			} elseif (function_exists('gravatar')) {
2083
+				if ($user_profile_url) {
2084
+					$comments_echo .= '<a href="'.$user_profile_url.'">';
2085 2085
 				}
2086 2086
 				$comments_echo .= "<img src=\"";
2087
-				if ( '' == $comment->comment_type ) {
2088
-					$comments_echo .= gravatar( $comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2089
-					if ( $user_profile_url ) {
2087
+				if ('' == $comment->comment_type) {
2088
+					$comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2089
+					if ($user_profile_url) {
2090 2090
 						$comments_echo .= '</a>';
2091 2091
 					}
2092
-				} elseif ( ( 'trackback' == $comment->comment_type ) || ( 'pingback' == $comment->comment_type ) ) {
2093
-					if ( $user_profile_url ) {
2094
-						$comments_echo .= '<a href="' . $user_profile_url . '">';
2092
+				} elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
2093
+					if ($user_profile_url) {
2094
+						$comments_echo .= '<a href="'.$user_profile_url.'">';
2095 2095
 					}
2096
-					$comments_echo .= gravatar( $comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2097
-					if ( $user_profile_url ) {
2096
+					$comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2097
+					if ($user_profile_url) {
2098 2098
 						$comments_echo .= '</a>';
2099 2099
 					}
2100 2100
 				}
@@ -2105,17 +2105,17 @@  discard block
 block discarded – undo
2105 2105
 
2106 2106
 			$comments_echo .= '<span class="geodir_reviewer_content">';
2107 2107
 			$author_link = apply_filters('geodir_reviewer_content_author_link', true);
2108
-			if ( $comment->user_id && $author_link ) {
2109
-				$comments_echo .= '<a href="' . get_author_posts_url( $comment->user_id ) . '">';
2108
+			if ($comment->user_id && $author_link) {
2109
+				$comments_echo .= '<a href="'.get_author_posts_url($comment->user_id).'">';
2110 2110
 			}
2111
-			$comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
2112
-			if ( $comment->user_id && $author_link ) {
2111
+			$comments_echo .= '<span class="geodir_reviewer_author">'.$comment->comment_author.'</span> ';
2112
+			if ($comment->user_id && $author_link) {
2113 2113
 				$comments_echo .= '</a>';
2114 2114
 			}
2115
-			$comments_echo .= '<span class="geodir_reviewer_reviewed">' . __( 'reviewed', 'geodirectory' ) . '</span> ';
2116
-			$comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
2117
-			$comments_echo .= geodir_get_rating_stars( $comment->overall_rating, $comment_post_ID );
2118
-			$comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
2115
+			$comments_echo .= '<span class="geodir_reviewer_reviewed">'.__('reviewed', 'geodirectory').'</span> ';
2116
+			$comments_echo .= '<a href="'.$permalink.'" class="geodir_reviewer_title">'.$post_title.'</a>';
2117
+			$comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
2118
+			$comments_echo .= '<p class="geodir_reviewer_text">'.$comment_excerpt.'';
2119 2119
 			//echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
2120 2120
 			$comments_echo .= '</p>';
2121 2121
 
@@ -2135,25 +2135,25 @@  discard block
 block discarded – undo
2135 2135
  * @return array Returns post categories as an array.
2136 2136
  */
2137 2137
 function geodir_home_map_cats_key_value_array() {
2138
-	$post_types = geodir_get_posttypes( 'object' );
2138
+	$post_types = geodir_get_posttypes('object');
2139 2139
 
2140 2140
 	$return = array();
2141
-	if ( ! empty( $post_types ) ) {
2142
-		foreach ( $post_types as $key => $post_type ) {
2143
-			$cpt_name       = __( $post_type->labels->singular_name, 'geodirectory' );
2144
-			$post_type_name = sprintf( __( '%s Categories', 'geodirectory' ), $cpt_name );
2145
-			$taxonomies     = geodir_get_taxonomies( $key );
2146
-			$cat_taxonomy   = ! empty( $taxonomies[0] ) ? $taxonomies[0] : null;
2147
-			$cat_terms      = $cat_taxonomy ? get_terms( $cat_taxonomy ) : null;
2148
-
2149
-			if ( ! empty( $cat_terms ) ) {
2150
-				$return[ 'optgroup_start-' . $key ] = $post_type_name;
2151
-
2152
-				foreach ( $cat_terms as $cat_term ) {
2153
-					$return[ $key . '_' . $cat_term->term_id ] = $cat_term->name;
2141
+	if (!empty($post_types)) {
2142
+		foreach ($post_types as $key => $post_type) {
2143
+			$cpt_name       = __($post_type->labels->singular_name, 'geodirectory');
2144
+			$post_type_name = sprintf(__('%s Categories', 'geodirectory'), $cpt_name);
2145
+			$taxonomies     = geodir_get_taxonomies($key);
2146
+			$cat_taxonomy   = !empty($taxonomies[0]) ? $taxonomies[0] : null;
2147
+			$cat_terms      = $cat_taxonomy ? get_terms($cat_taxonomy) : null;
2148
+
2149
+			if (!empty($cat_terms)) {
2150
+				$return['optgroup_start-'.$key] = $post_type_name;
2151
+
2152
+				foreach ($cat_terms as $cat_term) {
2153
+					$return[$key.'_'.$cat_term->term_id] = $cat_term->name;
2154 2154
 				}
2155 2155
 
2156
-				$return[ 'optgroup_end-' . $key ] = $post_type_name;
2156
+				$return['optgroup_end-'.$key] = $post_type_name;
2157 2157
 			}
2158 2158
 		}
2159 2159
 	}
@@ -2169,14 +2169,14 @@  discard block
 block discarded – undo
2169 2169
  * @package GeoDirectory
2170 2170
  */
2171 2171
 function geodir_twitter_tweet_button() {
2172
-	if ( isset( $_GET['gde'] ) ) {
2173
-		$link = '?url=' . urlencode( geodir_curPageURL() );
2172
+	if (isset($_GET['gde'])) {
2173
+		$link = '?url='.urlencode(geodir_curPageURL());
2174 2174
 	} else {
2175 2175
 		$link = '';
2176 2176
 	}
2177 2177
 	?>
2178 2178
 	<a href="http://twitter.com/share<?php echo $link; ?>"
2179
-	   class="twitter-share-button"><?php _e( 'Tweet', 'geodirectory' ); ?></a>
2179
+	   class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
2180 2180
 	<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
2181 2181
 	<?php
2182 2182
 }
@@ -2193,10 +2193,10 @@  discard block
 block discarded – undo
2193 2193
 function geodir_fb_like_button() {
2194 2194
 	global $post;
2195 2195
 	?>
2196
-	<iframe <?php if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) ) {
2196
+	<iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
2197 2197
 		echo 'allowtransparency="true"';
2198 2198
 	} ?> class="facebook"
2199
-	     src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode( get_permalink( $post->ID ) ); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light"
2199
+	     src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light"
2200 2200
 	     style="border:none; overflow:hidden; width:100px; height:20px"></iframe>
2201 2201
 	<?php
2202 2202
 }
@@ -2227,7 +2227,7 @@  discard block
 block discarded – undo
2227 2227
 
2228 2228
 
2229 2229
 function geodir_listing_bounce_map_pin_on_hover() {
2230
-	if ( get_option( 'geodir_listing_hover_bounce_map_pin', true ) ) {
2230
+	if (get_option('geodir_listing_hover_bounce_map_pin', true)) {
2231 2231
 		?>
2232 2232
 		<script>
2233 2233
 			jQuery(function ($) {
@@ -2250,44 +2250,44 @@  discard block
 block discarded – undo
2250 2250
 	}
2251 2251
 }
2252 2252
 
2253
-add_action( 'geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10 );
2253
+add_action('geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10);
2254 2254
 
2255
-add_action( 'geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1 );
2256
-function geodir_output_favourite_html_listings( $post_id ) {
2257
-	geodir_favourite_html( '', $post_id );
2255
+add_action('geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1);
2256
+function geodir_output_favourite_html_listings($post_id) {
2257
+	geodir_favourite_html('', $post_id);
2258 2258
 }
2259 2259
 
2260
-add_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2 );
2261
-function geodir_output_pinpoint_html_listings( $post_id, $post = array() ) {
2260
+add_action('geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2261
+function geodir_output_pinpoint_html_listings($post_id, $post = array()) {
2262 2262
 	global $wp_query;
2263 2263
 
2264 2264
 	$show_pin_point = $wp_query->is_main_query();
2265 2265
 
2266
-	if ( ! empty( $post ) && ! empty( $show_pin_point ) && is_active_widget( false, "", "geodir_map_v3_listing_map" ) ) {
2267
-		$term_icon_url = geodir_get_tax_meta( $post->default_category, 'ct_cat_icon', false, $post->post_type );
2268
-		$marker_icon   = isset( $term_icon_url['src'] ) ? $term_icon_url['src'] : get_option( 'geodir_default_marker_icon' );
2266
+	if (!empty($post) && !empty($show_pin_point) && is_active_widget(false, "", "geodir_map_v3_listing_map")) {
2267
+		$term_icon_url = geodir_get_tax_meta($post->default_category, 'ct_cat_icon', false, $post->post_type);
2268
+		$marker_icon   = isset($term_icon_url['src']) ? $term_icon_url['src'] : get_option('geodir_default_marker_icon');
2269 2269
 		?>
2270 2270
 		<span class="geodir-pinpoint"
2271
-		      style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters( 'geodir_listing_listview_pinpoint_inner_content', '', 'listing' ); ?></span>
2271
+		      style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters('geodir_listing_listview_pinpoint_inner_content', '', 'listing'); ?></span>
2272 2272
 		<a class="geodir-pinpoint-link" href="javascript:void(0)"
2273 2273
 		   onclick="if(typeof openMarker=='function'){openMarker('listing_map_canvas' ,'<?php echo $post->ID; ?>')}"
2274 2274
 		   onmouseover="if(typeof animate_marker=='function'){animate_marker('listing_map_canvas' ,'<?php echo $post->ID; ?>')}"
2275
-		   onmouseout="if(typeof stop_marker_animation=='function'){stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')}"><?php _e( 'Pinpoint', 'geodirectory' ); ?></a>
2275
+		   onmouseout="if(typeof stop_marker_animation=='function'){stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')}"><?php _e('Pinpoint', 'geodirectory'); ?></a>
2276 2276
 		<?php
2277 2277
 	}
2278 2278
 }
2279 2279
 
2280 2280
 function geodir_search_form_submit_button() {
2281 2281
 
2282
-	$new_style = get_option( 'geodir_show_search_old_search_from' ) ? false : true;
2282
+	$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2283 2283
 
2284
-	if ( $new_style ) {
2284
+	if ($new_style) {
2285 2285
 		$default_search_button_label = '<i class="fas fa-search" aria-hidden="true"></i>';
2286
-	}else{
2286
+	} else {
2287 2287
 		$default_search_button_label = 'Search';
2288 2288
 	}
2289
-	if ( get_option( 'geodir_search_button_label' ) && get_option( 'geodir_search_button_label' ) != 'Search' ) {
2290
-		$default_search_button_label = __( get_option( 'geodir_search_button_label' ), 'geodirectory' );
2289
+	if (get_option('geodir_search_button_label') && get_option('geodir_search_button_label') != 'Search') {
2290
+		$default_search_button_label = __(get_option('geodir_search_button_label'), 'geodirectory');
2291 2291
 	}
2292 2292
 
2293 2293
 	/**
@@ -2299,78 +2299,78 @@  discard block
 block discarded – undo
2299 2299
 	 *
2300 2300
 	 * @param string $default_search_button_label The current search button text.
2301 2301
 	 */
2302
-	$default_search_button_label = apply_filters( 'geodir_search_default_search_button_text', $default_search_button_label );
2302
+	$default_search_button_label = apply_filters('geodir_search_default_search_button_text', $default_search_button_label);
2303 2303
 
2304 2304
 	$fa_class = '';
2305
-	if ( strpos( $default_search_button_label, '&#' ) !== false ) {
2305
+	if (strpos($default_search_button_label, '&#') !== false) {
2306 2306
 		$fa_class = 'fa';
2307 2307
 	}
2308 2308
 
2309 2309
 
2310
-	if ( $new_style ) {
2310
+	if ($new_style) {
2311 2311
 		?>
2312
-		<button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e( $default_search_button_label ,'geodirectory'); ?></button>
2313
-	<?php }else{?>
2314
-		<input type="button" value="<?php esc_attr_e( $default_search_button_label ); ?>"
2312
+		<button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e($default_search_button_label, 'geodirectory'); ?></button>
2313
+	<?php } else {?>
2314
+		<input type="button" value="<?php esc_attr_e($default_search_button_label); ?>"
2315 2315
 		       class="geodir_submit_search <?php echo $fa_class; ?>"/>
2316 2316
 	<?php }
2317 2317
 }
2318 2318
 
2319
-add_action( 'geodir_before_search_button', 'geodir_search_form_submit_button', 5000 );
2319
+add_action('geodir_before_search_button', 'geodir_search_form_submit_button', 5000);
2320 2320
 
2321 2321
 function geodir_search_form_post_type_input() {
2322 2322
 	global $geodir_search_post_type;
2323
-	$post_types     = apply_filters( 'geodir_search_form_post_types', geodir_get_posttypes( 'object' ) );
2323
+	$post_types     = apply_filters('geodir_search_form_post_types', geodir_get_posttypes('object'));
2324 2324
 	$curr_post_type = $geodir_search_post_type;
2325 2325
 
2326
-	if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
2326
+	if (!empty($post_types) && count((array) $post_types) > 1) {
2327 2327
 
2328
-		foreach ( $post_types as $post_type => $info ){
2328
+		foreach ($post_types as $post_type => $info) {
2329 2329
 			global $wpdb;
2330
-			$has_posts = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type ) );
2331
-			if ( ! $has_posts ) {
2330
+			$has_posts = $wpdb->get_row($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type));
2331
+			if (!$has_posts) {
2332 2332
 				unset($post_types->{$post_type});
2333 2333
 			}
2334 2334
 		}
2335 2335
 
2336
-		if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
2336
+		if (!empty($post_types) && count((array) $post_types) > 1) {
2337 2337
 
2338
-			$new_style = get_option( 'geodir_show_search_old_search_from' ) ? false : true;
2339
-			if ( $new_style ) {
2338
+			$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2339
+			if ($new_style) {
2340 2340
 				echo "<div class='gd-search-input-wrapper gd-search-field-cpt'>";
2341 2341
 			}
2342 2342
 			?>
2343 2343
 			<select name="stype" class="search_by_post">
2344
-				<?php foreach ( $post_types as $post_type => $info ):
2344
+				<?php foreach ($post_types as $post_type => $info):
2345 2345
 					global $wpdb;
2346 2346
 					?>
2347 2347
 
2348
-					<option data-label="<?php echo get_post_type_archive_link( $post_type ); ?>"
2349
-					        value="<?php echo $post_type; ?>" <?php if ( isset( $_REQUEST['stype'] ) ) {
2350
-						if ( $post_type == $_REQUEST['stype'] ) {
2348
+					<option data-label="<?php echo get_post_type_archive_link($post_type); ?>"
2349
+					        value="<?php echo $post_type; ?>" <?php if (isset($_REQUEST['stype'])) {
2350
+						if ($post_type == $_REQUEST['stype']) {
2351 2351
 							echo 'selected="selected"';
2352 2352
 						}
2353
-					} elseif ( $curr_post_type == $post_type ) {
2353
+					} elseif ($curr_post_type == $post_type) {
2354 2354
 						echo 'selected="selected"';
2355
-					} ?>><?php _e( geodir_utf8_ucfirst( $info->labels->name ), 'geodirectory' ); ?></option>
2355
+					} ?>><?php _e(geodir_utf8_ucfirst($info->labels->name), 'geodirectory'); ?></option>
2356 2356
 
2357 2357
 				<?php endforeach; ?>
2358 2358
 			</select>
2359 2359
 			<?php
2360
-			if ( $new_style ) {
2360
+			if ($new_style) {
2361 2361
 				echo "</div>";
2362 2362
 			}
2363
-		}else{
2364
-			if(! empty( $post_types )){
2365
-				$pt_arr = (array)$post_types;
2366
-				echo '<input type="hidden" name="stype" value="' . key( $pt_arr  ) . '"  />';
2367
-			}else{
2363
+		} else {
2364
+			if (!empty($post_types)) {
2365
+				$pt_arr = (array) $post_types;
2366
+				echo '<input type="hidden" name="stype" value="'.key($pt_arr).'"  />';
2367
+			} else {
2368 2368
 				echo '<input type="hidden" name="stype" value="gd_place"  />';
2369 2369
 			}
2370 2370
 
2371 2371
 		}
2372 2372
 
2373
-	}elseif ( ! empty( $post_types ) ) {
2373
+	}elseif (!empty($post_types)) {
2374 2374
 		echo '<input type="hidden" name="stype" value="gd_place"  />';
2375 2375
 	}
2376 2376
 }
@@ -2378,27 +2378,27 @@  discard block
 block discarded – undo
2378 2378
 function geodir_search_form_search_input() {
2379 2379
 
2380 2380
 	$default_search_for_text = SEARCH_FOR_TEXT;
2381
-	if ( get_option( 'geodir_search_field_default_text' ) ) {
2382
-		$default_search_for_text = __( get_option( 'geodir_search_field_default_text' ), 'geodirectory' );
2381
+	if (get_option('geodir_search_field_default_text')) {
2382
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
2383 2383
 	}
2384 2384
 
2385 2385
 	$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2386
-	if($new_style){
2386
+	if ($new_style) {
2387 2387
 		echo "<div class='gd-search-input-wrapper gd-search-field-search'>";
2388 2388
 	}
2389 2389
 	?>
2390 2390
 	<input class="search_text" name="s"
2391
-	       value="<?php if ( isset( $_REQUEST['s'] ) && trim( $_REQUEST['s'] ) != '' ) {
2392
-		       $search_term = esc_attr( stripslashes_deep( $_REQUEST['s'] ) );
2391
+	       value="<?php if (isset($_REQUEST['s']) && trim($_REQUEST['s']) != '') {
2392
+		       $search_term = esc_attr(stripslashes_deep($_REQUEST['s']));
2393 2393
 		       echo $search_term;
2394 2394
 	       } else {
2395 2395
 		       echo $default_search_for_text;
2396 2396
 	       } ?>" type="text"
2397
-	       onblur="if (this.value.trim() == '') {this.value = '<?php echo esc_sql( $default_search_for_text ); ?>';}"
2398
-	       onfocus="if (this.value == '<?php echo esc_sql( $default_search_for_text ); ?>') {this.value = '';}"
2397
+	       onblur="if (this.value.trim() == '') {this.value = '<?php echo esc_sql($default_search_for_text); ?>';}"
2398
+	       onfocus="if (this.value == '<?php echo esc_sql($default_search_for_text); ?>') {this.value = '';}"
2399 2399
 	       onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);">
2400 2400
 	<?php
2401
-	if($new_style){
2401
+	if ($new_style) {
2402 2402
 		echo "</div>";
2403 2403
 	}
2404 2404
 }
@@ -2406,12 +2406,12 @@  discard block
 block discarded – undo
2406 2406
 function geodir_search_form_near_input() {
2407 2407
 
2408 2408
 	$default_near_text = NEAR_TEXT;
2409
-	if ( get_option( 'geodir_near_field_default_text' ) ) {
2410
-		$default_near_text = __( get_option( 'geodir_near_field_default_text' ), 'geodirectory' );
2409
+	if (get_option('geodir_near_field_default_text')) {
2410
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
2411 2411
 	}
2412 2412
 
2413
-	if ( isset( $_REQUEST['snear'] ) && $_REQUEST['snear'] != '' ) {
2414
-		$near = esc_attr( stripslashes_deep( $_REQUEST['snear'] ) );
2413
+	if (isset($_REQUEST['snear']) && $_REQUEST['snear'] != '') {
2414
+		$near = esc_attr(stripslashes_deep($_REQUEST['snear']));
2415 2415
 	} else {
2416 2416
 		$near = $default_near_text;
2417 2417
 	}
@@ -2425,7 +2425,7 @@  discard block
 block discarded – undo
2425 2425
 	 * @since 1.6.9
2426 2426
 	 * @param string $curr_post_type The current post type.
2427 2427
 	 */
2428
-	$near_input_extra = apply_filters('geodir_near_input_extra','',$curr_post_type);
2428
+	$near_input_extra = apply_filters('geodir_near_input_extra', '', $curr_post_type);
2429 2429
 
2430 2430
 
2431 2431
 	/**
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
 	 * @param string $near              The current near value.
2439 2439
 	 * @param string $default_near_text The default near value.
2440 2440
 	 */
2441
-	$near = apply_filters( 'geodir_search_near_text', $near, $default_near_text );
2441
+	$near = apply_filters('geodir_search_near_text', $near, $default_near_text);
2442 2442
 	/**
2443 2443
 	 * Filter the default "Near" text value for the search form.
2444 2444
 	 *
@@ -2449,7 +2449,7 @@  discard block
 block discarded – undo
2449 2449
 	 * @param string $near              The current near value.
2450 2450
 	 * @param string $default_near_text The default near value.
2451 2451
 	 */
2452
-	$default_near_text = apply_filters( 'geodir_search_default_near_text', $default_near_text, $near );
2452
+	$default_near_text = apply_filters('geodir_search_default_near_text', $default_near_text, $near);
2453 2453
 	/**
2454 2454
 	 * Filter the class for the near search input.
2455 2455
 	 *
@@ -2457,10 +2457,10 @@  discard block
 block discarded – undo
2457 2457
 	 *
2458 2458
 	 * @param string $class The class for the HTML near input, default is blank.
2459 2459
 	 */
2460
-	$near_class = apply_filters( 'geodir_search_near_class', '' );
2460
+	$near_class = apply_filters('geodir_search_near_class', '');
2461 2461
 
2462 2462
 	$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2463
-	if($new_style){
2463
+	if ($new_style) {
2464 2464
 		echo "<div class='gd-search-input-wrapper gd-search-field-near' $near_input_extra>";
2465 2465
 
2466 2466
 		do_action('geodir_before_near_input');
@@ -2468,30 +2468,30 @@  discard block
 block discarded – undo
2468 2468
 
2469 2469
 	?>
2470 2470
 	<input name="snear" class="snear <?php echo $near_class; ?>" type="text" value="<?php echo $near; ?>"
2471
-	       onblur="if (this.value.trim() == '') {this.value = ('<?php echo esc_sql( $near ); ?>' != '' ? '<?php echo esc_sql( $near ); ?>' : '<?php echo $default_near_text; ?>');}"
2472
-	       onfocus="if (this.value == '<?php echo $default_near_text; ?>' || this.value =='<?php echo esc_sql( $near ); ?>') {this.value = '';}"
2473
-	       onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);" <?php echo $near_input_extra;?>/>
2471
+	       onblur="if (this.value.trim() == '') {this.value = ('<?php echo esc_sql($near); ?>' != '' ? '<?php echo esc_sql($near); ?>' : '<?php echo $default_near_text; ?>');}"
2472
+	       onfocus="if (this.value == '<?php echo $default_near_text; ?>' || this.value =='<?php echo esc_sql($near); ?>') {this.value = '';}"
2473
+	       onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);" <?php echo $near_input_extra; ?>/>
2474 2474
 	<?php
2475
-	if($new_style){
2475
+	if ($new_style) {
2476 2476
 		do_action('geodir_after_near_input');
2477 2477
 
2478 2478
 		echo "</div>";
2479 2479
 	}
2480 2480
 }
2481 2481
 
2482
-add_action( 'geodir_search_form_inputs', 'geodir_search_form_post_type_input', 10 );
2483
-add_action( 'geodir_search_form_inputs', 'geodir_search_form_search_input', 20 );
2484
-add_action( 'geodir_search_form_inputs', 'geodir_search_form_near_input', 30 );
2482
+add_action('geodir_search_form_inputs', 'geodir_search_form_post_type_input', 10);
2483
+add_action('geodir_search_form_inputs', 'geodir_search_form_search_input', 20);
2484
+add_action('geodir_search_form_inputs', 'geodir_search_form_near_input', 30);
2485 2485
 
2486
-function geodir_get_search_post_type($pt=''){
2486
+function geodir_get_search_post_type($pt = '') {
2487 2487
 	global $geodir_search_post_type;
2488 2488
 
2489
-	if($pt!=''){return $geodir_search_post_type = $pt;}
2490
-	if(!empty($geodir_search_post_type)){ return $geodir_search_post_type;}
2489
+	if ($pt != '') {return $geodir_search_post_type = $pt; }
2490
+	if (!empty($geodir_search_post_type)) { return $geodir_search_post_type; }
2491 2491
 
2492 2492
 	$geodir_search_post_type = geodir_get_current_posttype();
2493 2493
 
2494
-	if(!$geodir_search_post_type) {
2494
+	if (!$geodir_search_post_type) {
2495 2495
 		$geodir_search_post_type = geodir_get_default_posttype();
2496 2496
 	}
2497 2497
 
@@ -2499,7 +2499,7 @@  discard block
 block discarded – undo
2499 2499
 	return $geodir_search_post_type;
2500 2500
 }
2501 2501
 
2502
-function geodir_search_form(){
2502
+function geodir_search_form() {
2503 2503
 
2504 2504
 	geodir_get_search_post_type();
2505 2505
 
@@ -2509,8 +2509,8 @@  discard block
 block discarded – undo
2509 2509
 	die();
2510 2510
 }
2511 2511
 
2512
-add_action( 'wp_ajax_geodir_search_form', 'geodir_search_form' );
2513
-add_action( 'wp_ajax_nopriv_geodir_search_form', 'geodir_search_form' );
2512
+add_action('wp_ajax_geodir_search_form', 'geodir_search_form');
2513
+add_action('wp_ajax_nopriv_geodir_search_form', 'geodir_search_form');
2514 2514
 
2515 2515
 /**
2516 2516
  * Check wpml active or not.
@@ -2584,7 +2584,7 @@  discard block
 block discarded – undo
2584 2584
 		}
2585 2585
 	}
2586 2586
 }
2587
-add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 );
2587
+add_filter('icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4);
2588 2588
 
2589 2589
 /**
2590 2590
  * Duplicate post listing manually after listing saved.
@@ -2608,7 +2608,7 @@  discard block
 block discarded – undo
2608 2608
 		foreach ($post_duplicates as $lang => $dup_post_id) {
2609 2609
 			geodir_icl_make_duplicate($post_id, $lang, $request_info, $dup_post_id, true);
2610 2610
 		}
2611
-		do_action( 'geodir_wpml_listing_duplicated', $post_id, $request_info );
2611
+		do_action('geodir_wpml_listing_duplicated', $post_id, $request_info);
2612 2612
 	}
2613 2613
 }
2614 2614
 
@@ -2627,7 +2627,7 @@  discard block
 block discarded – undo
2627 2627
 function geodir_wpml_duplicate_post_reviews($master_post_id, $tr_post_id, $lang) {
2628 2628
 	global $wpdb;
2629 2629
 
2630
-	$reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A);
2630
+	$reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM ".GEODIR_REVIEW_TABLE." WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A);
2631 2631
 
2632 2632
 	if (!empty($reviews)) {
2633 2633
 		foreach ($reviews as $review) {
@@ -2656,15 +2656,15 @@  discard block
 block discarded – undo
2656 2656
 	global $wpdb, $plugin_prefix;
2657 2657
 
2658 2658
 	$post_type = get_post_type($master_post_id);
2659
-	$post_table = $plugin_prefix . $post_type . '_detail';
2659
+	$post_table = $plugin_prefix.$post_type.'_detail';
2660 2660
 
2661
-	$query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id));
2662
-	$data = (array)$wpdb->get_row($query);
2661
+	$query = $wpdb->prepare("SELECT * FROM ".$post_table." WHERE post_id = %d", array($master_post_id));
2662
+	$data = (array) $wpdb->get_row($query);
2663 2663
 
2664
-	if ( !empty( $data ) ) {
2665
-		$data = apply_filters( 'geodir_icl_duplicate_post_data', $data, $master_post_id, $tr_post_id, $lang );
2664
+	if (!empty($data)) {
2665
+		$data = apply_filters('geodir_icl_duplicate_post_data', $data, $master_post_id, $tr_post_id, $lang);
2666 2666
 		$data['post_id'] = $tr_post_id;
2667
-		unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category']);
2667
+		unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type.'category']);
2668 2668
 		$wpdb->update($post_table, $data, array('post_id' => $tr_post_id));
2669 2669
 		return true;
2670 2670
 	}
@@ -2689,7 +2689,7 @@  discard block
 block discarded – undo
2689 2689
 	global $sitepress, $wpdb;
2690 2690
 	$post_type = get_post_type($master_post_id);
2691 2691
 
2692
-	remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language
2692
+	remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language
2693 2693
 
2694 2694
 	$taxonomies = get_object_taxonomies($post_type);
2695 2695
 	foreach ($taxonomies as $taxonomy) {
@@ -2698,9 +2698,9 @@  discard block
 block discarded – undo
2698 2698
 
2699 2699
 		if ($terms) {
2700 2700
 			foreach ($terms as $term) {
2701
-				$tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang);
2701
+				$tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang);
2702 2702
 
2703
-				if (!is_null($tr_id)){
2703
+				if (!is_null($tr_id)) {
2704 2704
 					// not using get_term - unfiltered get_term
2705 2705
 					$translated_term = $wpdb->get_row($wpdb->prepare("
2706 2706
                         SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $taxonomy));
@@ -2709,14 +2709,14 @@  discard block
 block discarded – undo
2709 2709
 				}
2710 2710
 			}
2711 2711
 
2712
-			if (!is_taxonomy_hierarchical($taxonomy)){
2713
-				$terms_array = array_unique( array_map( 'intval', $terms_array ) );
2712
+			if (!is_taxonomy_hierarchical($taxonomy)) {
2713
+				$terms_array = array_unique(array_map('intval', $terms_array));
2714 2714
 			}
2715 2715
 
2716 2716
 			wp_set_post_terms($tr_post_id, $terms_array, $taxonomy);
2717 2717
 
2718
-			if ($taxonomy == $post_type . 'category') {
2719
-				geodir_set_postcat_structure($tr_post_id, $post_type . 'category');
2718
+			if ($taxonomy == $post_type.'category') {
2719
+				geodir_set_postcat_structure($tr_post_id, $post_type.'category');
2720 2720
 			}
2721 2721
 		}
2722 2722
 	}
@@ -2737,15 +2737,15 @@  discard block
 block discarded – undo
2737 2737
 function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) {
2738 2738
 	global $wpdb;
2739 2739
 
2740
-	$query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
2740
+	$query = $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
2741 2741
 	$wpdb->query($query);
2742 2742
 
2743
-	$query = $wpdb->prepare("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id));
2743
+	$query = $wpdb->prepare("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id));
2744 2744
 	$post_images = $wpdb->get_results($query);
2745 2745
 
2746
-	if ( !empty( $post_images ) ) {
2747
-		foreach ( $post_images as $post_image) {
2748
-			$image_data = (array)$post_image;
2746
+	if (!empty($post_images)) {
2747
+		foreach ($post_images as $post_image) {
2748
+			$image_data = (array) $post_image;
2749 2749
 			unset($image_data['ID']);
2750 2750
 			$image_data['post_id'] = $tr_post_id;
2751 2751
 
@@ -2778,13 +2778,13 @@  discard block
 block discarded – undo
2778 2778
 function geodir_wpml_duplicate_post_review($master_comment_id, $master_post_id, $tr_post_id, $lang) {
2779 2779
 	global $wpdb, $plugin_prefix, $sitepress;
2780 2780
 
2781
-	$review = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A);
2781
+	$review = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A);
2782 2782
 
2783 2783
 	if (empty($review)) {
2784 2784
 		return false;
2785 2785
 	}
2786 2786
 	if ($review['post_id'] != $master_post_id) {
2787
-		$wpdb->query($wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id));
2787
+		$wpdb->query($wpdb->prepare("UPDATE ".GEODIR_REVIEW_TABLE." SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id));
2788 2788
 		geodir_update_postrating($master_post_id, $post_type);
2789 2789
 	}
2790 2790
 
@@ -2795,9 +2795,9 @@  discard block
 block discarded – undo
2795 2795
 	}
2796 2796
 
2797 2797
 	$post_type = get_post_type($master_post_id);
2798
-	$post_table = $plugin_prefix . $post_type . '_detail';
2798
+	$post_table = $plugin_prefix.$post_type.'_detail';
2799 2799
 
2800
-	$translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM " . $post_table . " WHERE post_id = %d", $tr_post_id), ARRAY_A);
2800
+	$translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM ".$post_table." WHERE post_id = %d", $tr_post_id), ARRAY_A);
2801 2801
 	if (empty($translated_post)) {
2802 2802
 		return false;
2803 2803
 	}
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
 		unset($review['id']);
2816 2816
 	}
2817 2817
 
2818
-	$tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id));
2818
+	$tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id));
2819 2819
 
2820 2820
 	if ($tr_review_id) { // update review
2821 2821
 		$wpdb->update(GEODIR_REVIEW_TABLE, $review, array('id' => $tr_review_id));
@@ -2828,8 +2828,8 @@  discard block
 block discarded – undo
2828 2828
 		geodir_update_postrating($tr_post_id, $post_type);
2829 2829
 
2830 2830
 		if (defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_review') && $sitepress->get_setting('sync_comments_on_duplicates')) {
2831
-			$wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_COMMENTS_REVIEWS_TABLE . " WHERE comment_id = %d", array($tr_comment_id)));
2832
-			$likes = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_COMMENTS_REVIEWS_TABLE . " WHERE comment_id=%d ORDER BY like_date ASC", $master_comment_id, $tr_post_id), ARRAY_A);
2831
+			$wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_COMMENTS_REVIEWS_TABLE." WHERE comment_id = %d", array($tr_comment_id)));
2832
+			$likes = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_COMMENTS_REVIEWS_TABLE." WHERE comment_id=%d ORDER BY like_date ASC", $master_comment_id, $tr_post_id), ARRAY_A);
2833 2833
 
2834 2834
 			if (!empty($likes)) {
2835 2835
 				foreach ($likes as $like) {
@@ -2931,7 +2931,7 @@  discard block
 block discarded – undo
2931 2931
  * @return bool True if review star disabled, otherwise false.
2932 2932
  */
2933 2933
 function geodir_rating_disabled_post_types() {
2934
-	$post_types = get_option( 'geodir_disable_rating_cpt' );
2934
+	$post_types = get_option('geodir_disable_rating_cpt');
2935 2935
 
2936 2936
 	/**
2937 2937
 	 * Filter the post types array which have rating disabled.
@@ -2940,7 +2940,7 @@  discard block
 block discarded – undo
2940 2940
 	 *
2941 2941
 	 * @param array $post_types Array of post types which have rating starts disabled.
2942 2942
 	 */
2943
-	return apply_filters( 'geodir_rating_disabled_post_types', $post_types );
2943
+	return apply_filters('geodir_rating_disabled_post_types', $post_types);
2944 2944
 }
2945 2945
 
2946 2946
 /**
@@ -2952,30 +2952,30 @@  discard block
 block discarded – undo
2952 2952
  * @param bool $taxonomy Whether $post_type is taxonomy or not.
2953 2953
  * @return bool True if review star disabled, otherwise false.
2954 2954
  */
2955
-function geodir_cpt_has_rating_disabled( $post_type = '', $taxonomy = false ) {
2955
+function geodir_cpt_has_rating_disabled($post_type = '', $taxonomy = false) {
2956 2956
 	$post_types = geodir_rating_disabled_post_types();
2957 2957
 
2958
-	if ( empty( $post_types ) ) {
2958
+	if (empty($post_types)) {
2959 2959
 		return false;
2960 2960
 	}
2961 2961
 
2962
-	if ( is_int( $post_type ) ) {
2963
-		$post_type = get_post_type( $post_type );
2962
+	if (is_int($post_type)) {
2963
+		$post_type = get_post_type($post_type);
2964 2964
 	}
2965 2965
 
2966
-	if ( $taxonomy && !empty( $post_types ) ) {
2966
+	if ($taxonomy && !empty($post_types)) {
2967 2967
 		$posttypes = array();
2968 2968
 
2969
-		foreach ( $post_types as $posttype ) {
2970
-			$posttypes[] = $posttype . 'category';
2971
-			$posttypes[] = $posttype . '_tags';
2969
+		foreach ($post_types as $posttype) {
2970
+			$posttypes[] = $posttype.'category';
2971
+			$posttypes[] = $posttype.'_tags';
2972 2972
 		}
2973 2973
 
2974 2974
 		$post_types = $posttypes;
2975 2975
 	}
2976 2976
 
2977 2977
 	$return = false;
2978
-	if ( $post_type != '' && !empty( $post_types ) && in_array( $post_type, $post_types ) ) {
2978
+	if ($post_type != '' && !empty($post_types) && in_array($post_type, $post_types)) {
2979 2979
 		$return = true;
2980 2980
 	}
2981 2981
 
@@ -2990,7 +2990,7 @@  discard block
 block discarded – undo
2990 2990
  * @return bool True if Yoast SEO disabled on GD pages.
2991 2991
  */
2992 2992
 function geodir_disable_yoast_seo_metas() {
2993
-	return (bool)get_option( 'geodir_disable_yoast_meta' );
2993
+	return (bool) get_option('geodir_disable_yoast_meta');
2994 2994
 }
2995 2995
 
2996 2996
 /**
@@ -3001,30 +3001,30 @@  discard block
 block discarded – undo
3001 3001
  * @param int $post_id The post ID.
3002 3002
  * @return bool True if allowed.
3003 3003
  */
3004
-function geodir_wpml_allowed_to_duplicate( $post_id ) {
3004
+function geodir_wpml_allowed_to_duplicate($post_id) {
3005 3005
 	$allowed = false;
3006 3006
 
3007
-	if ( !geodir_is_wpml() || empty( $post_id ) ) {
3007
+	if (!geodir_is_wpml() || empty($post_id)) {
3008 3008
 		return $allowed;
3009 3009
 	}
3010 3010
 
3011
-	$user_id = (int)get_current_user_id();
3011
+	$user_id = (int) get_current_user_id();
3012 3012
 
3013
-	if ( empty( $user_id ) ) {
3013
+	if (empty($user_id)) {
3014 3014
 		return $allowed;
3015 3015
 	}
3016 3016
 
3017
-	$post_type = get_post_type( $post_id );
3018
-	if ( !geodir_wpml_is_post_type_translated( $post_type ) || get_post_meta( $post_id, '_icl_lang_duplicate_of', true ) ) {
3017
+	$post_type = get_post_type($post_id);
3018
+	if (!geodir_wpml_is_post_type_translated($post_type) || get_post_meta($post_id, '_icl_lang_duplicate_of', true)) {
3019 3019
 		return $allowed;
3020 3020
 	}
3021 3021
 
3022
-	if ( geodir_listing_belong_to_current_user( $post_id ) ) {
3022
+	if (geodir_listing_belong_to_current_user($post_id)) {
3023 3023
 		$allowed = true;
3024 3024
 	}
3025 3025
 
3026
-	$disable_cpts = get_option( 'geodir_wpml_disable_duplicate' );
3027
-	if ( $allowed && !empty( $disable_cpts ) && in_array( $post_type, $disable_cpts ) ) {
3026
+	$disable_cpts = get_option('geodir_wpml_disable_duplicate');
3027
+	if ($allowed && !empty($disable_cpts) && in_array($post_type, $disable_cpts)) {
3028 3028
 		$allowed = false;
3029 3029
 	}
3030 3030
 
@@ -3034,7 +3034,7 @@  discard block
 block discarded – undo
3034 3034
 	 * @param bool $allowed True if allowed.
3035 3035
 	 * @param int $post_id The post ID.
3036 3036
 	 */
3037
-	return apply_filters( 'geodir_wpml_allowed_to_duplicate', $allowed, $post_id );
3037
+	return apply_filters('geodir_wpml_allowed_to_duplicate', $allowed, $post_id);
3038 3038
 }
3039 3039
 
3040 3040
 /**
@@ -3049,61 +3049,61 @@  discard block
 block discarded – undo
3049 3049
  * @param string $content_html The output html of the geodir_edit_post_link() function.
3050 3050
  * @return string Filtered html of the geodir_edit_post_link() function.
3051 3051
  */
3052
-function geodir_wpml_frontend_duplicate_listing( $content_html ) {
3052
+function geodir_wpml_frontend_duplicate_listing($content_html) {
3053 3053
 	global $post, $preview, $sitepress;
3054 3054
 
3055
-	if ( !empty( $post->ID ) && !$preview && geodir_is_page( 'detail' ) && geodir_wpml_allowed_to_duplicate( $post->ID ) ) {
3055
+	if (!empty($post->ID) && !$preview && geodir_is_page('detail') && geodir_wpml_allowed_to_duplicate($post->ID)) {
3056 3056
 		$post_id = $post->ID;
3057
-		$element_type = 'post_' . get_post_type( $post_id );
3058
-		$original_post_id = $sitepress->get_original_element_id( $post_id, $element_type );
3057
+		$element_type = 'post_'.get_post_type($post_id);
3058
+		$original_post_id = $sitepress->get_original_element_id($post_id, $element_type);
3059 3059
 
3060
-		if ( $original_post_id == $post_id ) {
3060
+		if ($original_post_id == $post_id) {
3061 3061
 			$wpml_languages = $sitepress->get_active_languages();
3062
-			$post_language = $sitepress->get_language_for_element( $post_id, $element_type );
3062
+			$post_language = $sitepress->get_language_for_element($post_id, $element_type);
3063 3063
 
3064
-			if ( !empty( $wpml_languages ) && isset( $wpml_languages[ $post_language ] ) ) {
3065
-				unset( $wpml_languages[ $post_language ] );
3064
+			if (!empty($wpml_languages) && isset($wpml_languages[$post_language])) {
3065
+				unset($wpml_languages[$post_language]);
3066 3066
 			}
3067 3067
 
3068
-			if ( !empty( $wpml_languages ) ) {
3069
-				$trid  = $sitepress->get_element_trid( $post_id, $element_type );
3070
-				$element_translations = $sitepress->get_element_translations( $trid, $element_type );
3071
-				$duplicates = $sitepress->get_duplicates( $post_id );
3068
+			if (!empty($wpml_languages)) {
3069
+				$trid = $sitepress->get_element_trid($post_id, $element_type);
3070
+				$element_translations = $sitepress->get_element_translations($trid, $element_type);
3071
+				$duplicates = $sitepress->get_duplicates($post_id);
3072 3072
 
3073
-				$wpml_content = '<div class="geodir-company_info gd-detail-duplicate"><h3 class="widget-title">' . __( 'Translate Listing', 'geodirectory' ) . '</h3>';
3073
+				$wpml_content = '<div class="geodir-company_info gd-detail-duplicate"><h3 class="widget-title">'.__('Translate Listing', 'geodirectory').'</h3>';
3074 3074
 				$wpml_content .= '<table class="gd-duplicate-table" style="width:100%;margin:0"><tbody>';
3075
-				$wpml_content .= '<tr style="border-bottom:solid 1px #efefef"><th style="padding:0 2px 2px 2px">' . __( 'Language', 'geodirectory' ) . '</th><th style="width:25px;"></th><th style="width:5em;text-align:center">' . __( 'Translate', 'geodirectory' ) . '</th></tr>';
3075
+				$wpml_content .= '<tr style="border-bottom:solid 1px #efefef"><th style="padding:0 2px 2px 2px">'.__('Language', 'geodirectory').'</th><th style="width:25px;"></th><th style="width:5em;text-align:center">'.__('Translate', 'geodirectory').'</th></tr>';
3076 3076
 
3077 3077
 				$needs_translation = false;
3078 3078
 
3079
-				foreach ( $wpml_languages as $lang_code => $lang ) {
3079
+				foreach ($wpml_languages as $lang_code => $lang) {
3080 3080
 					$duplicates_text = '';
3081 3081
 					$translated = false;
3082 3082
 
3083
-					if ( !empty( $element_translations ) && isset( $element_translations[$lang_code] ) ) {
3083
+					if (!empty($element_translations) && isset($element_translations[$lang_code])) {
3084 3084
 						$translated = true;
3085 3085
 
3086
-						if ( !empty( $duplicates ) && isset( $duplicates[$lang_code] ) ) {
3087
-							$duplicates_text = ' ' . __( '(duplicate)', 'geodirectory' );
3086
+						if (!empty($duplicates) && isset($duplicates[$lang_code])) {
3087
+							$duplicates_text = ' '.__('(duplicate)', 'geodirectory');
3088 3088
 						}
3089 3089
 					} else {
3090 3090
 						$needs_translation = true;
3091 3091
 					}
3092 3092
 
3093
-					$wpml_content .= '<tr><td style="padding:4px">' . $lang['english_name'] . $duplicates_text . '</td><td>&nbsp;</td><td style="text-align:center;">';
3093
+					$wpml_content .= '<tr><td style="padding:4px">'.$lang['english_name'].$duplicates_text.'</td><td>&nbsp;</td><td style="text-align:center;">';
3094 3094
 
3095
-					if ( $translated ) {
3095
+					if ($translated) {
3096 3096
 						$wpml_content .= '<i class="fas fa-check" style="color:orange"></i>';
3097 3097
 					} else {
3098
-						$wpml_content .= '<input name="gd_icl_dup[]" value="' . $lang_code . '" title="' . esc_attr__( 'Create duplicate', 'geodirectory' ) . '" type="checkbox">';
3098
+						$wpml_content .= '<input name="gd_icl_dup[]" value="'.$lang_code.'" title="'.esc_attr__('Create duplicate', 'geodirectory').'" type="checkbox">';
3099 3099
 					}
3100 3100
 
3101 3101
 					$wpml_content .= '</td></tr>';
3102 3102
 				}
3103 3103
 
3104
-				if ( $needs_translation ) {
3105
-					$nonce = wp_create_nonce( 'geodir_duplicate_nonce' );
3106
-					$wpml_content .= '<tr><td>&nbsp;</td><td style="vertical-align:middle;padding-top:13px"><i style="display:none" class="fas fa-spin fa-sync"></i></td><td style="padding:15px 3px 3px 3px;text-align:right"><button data-nonce="' . esc_attr( $nonce ) . '" data-post-id="' . $post_id . '" id="gd_make_duplicates" class="button-secondary">' . __( 'Duplicate', 'geodirectory' ) . '</button></td></tr>';
3104
+				if ($needs_translation) {
3105
+					$nonce = wp_create_nonce('geodir_duplicate_nonce');
3106
+					$wpml_content .= '<tr><td>&nbsp;</td><td style="vertical-align:middle;padding-top:13px"><i style="display:none" class="fas fa-spin fa-sync"></i></td><td style="padding:15px 3px 3px 3px;text-align:right"><button data-nonce="'.esc_attr($nonce).'" data-post-id="'.$post_id.'" id="gd_make_duplicates" class="button-secondary">'.__('Duplicate', 'geodirectory').'</button></td></tr>';
3107 3107
 				}
3108 3108
 
3109 3109
 				$wpml_content .= '</tbody></table>';
@@ -3125,12 +3125,12 @@  discard block
 block discarded – undo
3125 3125
  * @param array $settings GD design settings array.
3126 3126
  * @return array Filtered GD design settings array..
3127 3127
  */
3128
-function geodir_wpml_duplicate_settings( $settings = array() ) {
3128
+function geodir_wpml_duplicate_settings($settings = array()) {
3129 3129
 	$new_settings = array();
3130 3130
 
3131
-	foreach ( $settings as $key => $setting ) {
3131
+	foreach ($settings as $key => $setting) {
3132 3132
 
3133
-		if ( isset( $setting['type'] ) && $setting['type'] == 'sectionend' && $setting['id'] == 'detail_page_settings' ) {
3133
+		if (isset($setting['type']) && $setting['type'] == 'sectionend' && $setting['id'] == 'detail_page_settings') {
3134 3134
 			$new_settings[] = array(
3135 3135
 				'name' => __('Disable WPML duplicate translation', 'geodirectory'),
3136 3136
 				'desc' => __('Select post types to disable front end WPML duplicate translation. For selected post types the WPML duplicate option will be disabled from listing detail page sidebar.', 'geodirectory'),
@@ -3158,12 +3158,12 @@  discard block
 block discarded – undo
3158 3158
  * @param string $taxonomy name/slug of a taxonomy.
3159 3159
  * @return bool true if the taxonomy is currently set to being translatable in WPML.
3160 3160
  */
3161
-function geodir_wpml_is_taxonomy_translated( $taxonomy ) {
3162
-	if ( empty( $taxonomy ) || !geodir_is_wpml() || !function_exists( 'is_taxonomy_translated' ) ) {
3161
+function geodir_wpml_is_taxonomy_translated($taxonomy) {
3162
+	if (empty($taxonomy) || !geodir_is_wpml() || !function_exists('is_taxonomy_translated')) {
3163 3163
 		return false;
3164 3164
 	}
3165 3165
 
3166
-	if ( is_taxonomy_translated( $taxonomy ) ) {
3166
+	if (is_taxonomy_translated($taxonomy)) {
3167 3167
 		return true;
3168 3168
 	}
3169 3169
 
@@ -3178,12 +3178,12 @@  discard block
 block discarded – undo
3178 3178
  * @param string $post_type name/slug of a post_type.
3179 3179
  * @return bool true if the post_type is currently set to being translatable in WPML.
3180 3180
  */
3181
-function geodir_wpml_is_post_type_translated( $post_type ) {
3182
-	if ( empty( $post_type ) || !geodir_is_wpml() || !function_exists( 'is_post_type_translated' ) ) {
3181
+function geodir_wpml_is_post_type_translated($post_type) {
3182
+	if (empty($post_type) || !geodir_is_wpml() || !function_exists('is_post_type_translated')) {
3183 3183
 		return false;
3184 3184
 	}
3185 3185
 
3186
-	if ( is_post_type_translated( $post_type ) ) {
3186
+	if (is_post_type_translated($post_type)) {
3187 3187
 		return true;
3188 3188
 	}
3189 3189
 
@@ -3205,12 +3205,12 @@  discard block
 block discarded – undo
3205 3205
  *
3206 3206
  * @return int|NULL
3207 3207
  */
3208
-function geodir_wpml_object_id( $element_id, $element_type = 'post', $return_original_if_missing = false, $ulanguage_code = null ) {
3209
-	if ( geodir_is_wpml() ) {
3210
-		if ( function_exists( 'wpml_object_id_filter' ) ) {
3211
-			return apply_filters( 'wpml_object_id', $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
3208
+function geodir_wpml_object_id($element_id, $element_type = 'post', $return_original_if_missing = false, $ulanguage_code = null) {
3209
+	if (geodir_is_wpml()) {
3210
+		if (function_exists('wpml_object_id_filter')) {
3211
+			return apply_filters('wpml_object_id', $element_id, $element_type, $return_original_if_missing, $ulanguage_code);
3212 3212
 		} else {
3213
-			return icl_object_id( $element_id, $element_type, $return_original_if_missing, $ulanguage_code );
3213
+			return icl_object_id($element_id, $element_type, $return_original_if_missing, $ulanguage_code);
3214 3214
 		}
3215 3215
 	}
3216 3216
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
 		$author_id  = $p_post->post_author;
244 244
 
245
-	}else{
245
+	} else{
246 246
 		gd_die();
247 247
 	}
248 248
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 
390 390
 		check_ajax_referer( 'send_to_frnd_'.$pid );
391 391
 
392
-	}else{
392
+	} else{
393 393
 		gd_die();
394 394
 	}
395 395
 
@@ -2283,7 +2283,7 @@  discard block
 block discarded – undo
2283 2283
 
2284 2284
 	if ( $new_style ) {
2285 2285
 		$default_search_button_label = '<i class="fas fa-search" aria-hidden="true"></i>';
2286
-	}else{
2286
+	} else{
2287 2287
 		$default_search_button_label = 'Search';
2288 2288
 	}
2289 2289
 	if ( get_option( 'geodir_search_button_label' ) && get_option( 'geodir_search_button_label' ) != 'Search' ) {
@@ -2310,7 +2310,7 @@  discard block
 block discarded – undo
2310 2310
 	if ( $new_style ) {
2311 2311
 		?>
2312 2312
 		<button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e( $default_search_button_label ,'geodirectory'); ?></button>
2313
-	<?php }else{?>
2313
+	<?php } else{?>
2314 2314
 		<input type="button" value="<?php esc_attr_e( $default_search_button_label ); ?>"
2315 2315
 		       class="geodir_submit_search <?php echo $fa_class; ?>"/>
2316 2316
 	<?php }
@@ -2360,17 +2360,17 @@  discard block
 block discarded – undo
2360 2360
 			if ( $new_style ) {
2361 2361
 				echo "</div>";
2362 2362
 			}
2363
-		}else{
2363
+		} else{
2364 2364
 			if(! empty( $post_types )){
2365 2365
 				$pt_arr = (array)$post_types;
2366 2366
 				echo '<input type="hidden" name="stype" value="' . key( $pt_arr  ) . '"  />';
2367
-			}else{
2367
+			} else{
2368 2368
 				echo '<input type="hidden" name="stype" value="gd_place"  />';
2369 2369
 			}
2370 2370
 
2371 2371
 		}
2372 2372
 
2373
-	}elseif ( ! empty( $post_types ) ) {
2373
+	} elseif ( ! empty( $post_types ) ) {
2374 2374
 		echo '<input type="hidden" name="stype" value="gd_place"  />';
2375 2375
 	}
2376 2376
 }
Please login to merge, or discard this patch.
geodirectory-functions/template_functions.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 if ($is_wpml && !empty($wp->query_vars['page_id'])) {
69 69
                     wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type)));
70 70
                 } else {
71
-                    wp_redirect(trailingslashit(get_site_url()) . $pagename . '/?listing_type=' . $post_type);
71
+                    wp_redirect(trailingslashit(get_site_url()).$pagename.'/?listing_type='.$post_type);
72 72
                 }
73 73
                 gd_die();
74 74
             }
@@ -126,21 +126,21 @@  discard block
 block discarded – undo
126 126
         case 'listing-listview':
127 127
             $template = locate_template(array("geodirectory/listing-listview.php"));
128 128
             if (!$template) {
129
-                $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php';
129
+                $template = geodir_plugin_path().'/geodirectory-templates/listing-listview.php';
130 130
             }
131 131
             return $template;
132 132
             break;
133 133
         case 'widget-listing-listview':
134 134
             $template = locate_template(array("geodirectory/widget-listing-listview.php"));
135 135
             if (!$template) {
136
-                $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php';
136
+                $template = geodir_plugin_path().'/geodirectory-templates/widget-listing-listview.php';
137 137
             }
138 138
             return $template;
139 139
             break;
140 140
 		case 'email-message':
141 141
             $template = locate_template(array("geodirectory/email-message.php"));
142 142
             if (!$template) {
143
-                $template = geodir_plugin_path() . '/geodirectory-templates/email-message.php';
143
+                $template = geodir_plugin_path().'/geodirectory-templates/email-message.php';
144 144
             }
145 145
             return $template;
146 146
             break;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
         $template = geodir_locate_template('signup');
200 200
 
201
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
201
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-signup.php';
202 202
 
203 203
         /**
204 204
          * Filter the signup template path.
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
     if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) {
213 213
         if (!geodir_is_default_location_set()) {
214 214
             global $information;
215
-            $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>');
215
+            $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>');
216 216
 
217 217
             $template = geodir_locate_template('information');
218 218
 
219
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
219
+            if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php';
220 220
             /**
221 221
              * Filter the information template path.
222 222
              *
@@ -228,10 +228,10 @@  discard block
 block discarded – undo
228 228
         // check if pid exists in the record if yes then check if this post belongs to the user who is logged in.
229 229
         if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
230 230
             /// WPML
231
-            if (geodir_wpml_is_post_type_translated(get_post_type((int)$_GET['pid'])) && $duplicate_of = wpml_get_master_post_from_duplicate((int)$_GET['pid'])) {
231
+            if (geodir_wpml_is_post_type_translated(get_post_type((int) $_GET['pid'])) && $duplicate_of = wpml_get_master_post_from_duplicate((int) $_GET['pid'])) {
232 232
                 global $sitepress;
233 233
                 
234
-                $lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_' . get_post_type($duplicate_of));
234
+                $lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_'.get_post_type($duplicate_of));
235 235
                 $sitepress->switch_lang($lang_of_duplicate, true);
236 236
         
237 237
                 $redirect_to = get_permalink(geodir_add_listing_page_id());
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             if (!$is_current_user_owner) {
251 251
                 $template = geodir_locate_template('information');
252 252
 
253
-                if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
253
+                if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php';
254 254
                 /**
255 255
                  * Filter the information template path.
256 256
                  *
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         $template = geodir_locate_template('add-listing');
274 274
 
275
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php';
275
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/add-listing.php';
276 276
         /**
277 277
          * Filter the add listing template path.
278 278
          *
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         $template = geodir_locate_template('preview');
291 291
 
292
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
292
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php';
293 293
         /**
294 294
          * Filter the preview template path.
295 295
          *
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
         $template = geodir_locate_template('success');
307 307
 
308
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php';
308
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-success.php';
309 309
         /**
310 310
          * Filter the success template path.
311 311
          *
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
         $template = geodir_locate_template('detail');
322 322
 
323
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php';
323
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php';
324 324
         /**
325 325
          * Filter the detail template path.
326 326
          *
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
         $template = geodir_locate_template('listing');
337 337
 
338
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php';
338
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-listing.php';
339 339
         /**
340 340
          * Filter the listing template path.
341 341
          *
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
         $template = geodir_locate_template('search');
352 352
 
353
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php';
353
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-search.php';
354 354
         /**
355 355
          * Filter the search template path.
356 356
          *
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
         $template = geodir_locate_template('author');
367 367
 
368
-        if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php';
368
+        if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-author.php';
369 369
         /**
370 370
          * Filter the author template path.
371 371
          *
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 
377 377
     }
378 378
 
379
-    if ( geodir_is_page('home') || geodir_is_page('location')) {
379
+    if (geodir_is_page('home') || geodir_is_page('location')) {
380 380
 
381 381
         global $post, $wp_query;
382 382
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
             $template = geodir_locate_template('geodir-home');
388 388
 
389
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php';
389
+            if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-home.php';
390 390
             /**
391 391
              * Filter the home page template path.
392 392
              *
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 
400 400
             $template = geodir_locate_template('location');
401 401
 
402
-            if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php';
402
+            if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-location.php';
403 403
             /**
404 404
              * Filter the location template path.
405 405
              *
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
      */
442 442
     do_action("geodir_get_template_part_{$slug}", $slug, $name);
443 443
     $templates = array();
444
-    $name = (string)$name;
444
+    $name = (string) $name;
445 445
     if ('' !== $name) {
446 446
         $template_name = "{$slug}-{$name}.php";
447 447
 
@@ -449,14 +449,14 @@  discard block
 block discarded – undo
449 449
         $template_name = "{$slug}.php";
450 450
     }
451 451
 
452
-    if (!locate_template(array("geodirectory/" . $template_name))) :
452
+    if (!locate_template(array("geodirectory/".$template_name))) :
453 453
         /**
454 454
          * Filter the template part with slug and name.
455 455
          *
456 456
          * @since 1.0.0
457 457
          * @param string $template_name The template name.
458 458
          */
459
-        $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name);
459
+        $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path().'/geodirectory-templates/'.$template_name);
460 460
         /**
461 461
          * Includes the template part with slug and name.
462 462
          *
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
          */
465 465
         include($template);
466 466
     else:
467
-        locate_template(array("geodirectory/" . $template_name), true, false);
467
+        locate_template(array("geodirectory/".$template_name), true, false);
468 468
     endif;
469 469
 
470 470
 }
@@ -492,9 +492,9 @@  discard block
 block discarded – undo
492 492
     $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL;
493 493
 
494 494
     if ($gdp_post_id && $gdp_post_type) {
495
-        $append_class = 'gd-post-' . $gdp_post_type;
495
+        $append_class = 'gd-post-'.$gdp_post_type;
496 496
         $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : '';
497
-        $class = $class != '' ? $class . ' ' . $append_class : $append_class;
497
+        $class = $class != '' ? $class.' '.$append_class : $append_class;
498 498
     }
499 499
 
500 500
     return $class;
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 	 */
527 527
 	$message = apply_filters('geodir_message_listing_not_found', $message, $template_listview, $favorite);
528 528
 	
529
-	echo '<li class="no-listing">' . $message . '</li>';
529
+	echo '<li class="no-listing">'.$message.'</li>';
530 530
 }
531 531
 
532 532
 /**
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 function geodir_convert_listing_view_class($columns = '') {
556 556
 	$class = '';
557 557
 	
558
-	switch ((int)$columns) {
558
+	switch ((int) $columns) {
559 559
 		case 1:
560 560
 			$class = '';
561 561
 		break;
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 		$html .= '<option value=""></option>';
621 621
 		if (!empty($star_texts) && is_array($star_texts)) {
622 622
 			foreach ($star_texts as $i => $text) {
623
-				$html .= '<option ' . selected((int)($i + 1), (int)$default, false) . ' value="' . (int)($i + 1) . '">' . $text . '</option>';
623
+				$html .= '<option '.selected((int) ($i + 1), (int) $default, false).' value="'.(int) ($i + 1).'">'.$text.'</option>';
624 624
 			}
625 625
 		} else {
626 626
 			$html .= '<option value="1">1</option>';
@@ -649,14 +649,14 @@  discard block
 block discarded – undo
649 649
 function geodir_font_awesome_rating_stars_html($html, $rating, $star_count = 5) {
650 650
 	if (get_option('geodir_reviewrating_enable_font_awesome') == '1') {
651 651
 		$rating = min($rating, $star_count);
652
-		$full_stars = floor( $rating );
653
-		$half_stars = ceil( $rating - $full_stars );
652
+		$full_stars = floor($rating);
653
+		$half_stars = ceil($rating - $full_stars);
654 654
 		$empty_stars = $star_count - $full_stars - $half_stars;
655 655
 		
656 656
 		$html = '<div class="gd-star-rating gd-fa-star-rating">';
657
-		$html .= str_repeat( '<i class="fas fa-star gd-full-star"></i>', $full_stars );
658
-		$html .= str_repeat( '<i class="fas fa-star-half-alt gd-half-star"></i>', $half_stars );
659
-		$html .= str_repeat( '<i class="far fa-star gd-empty-star"></i>', $empty_stars);
657
+		$html .= str_repeat('<i class="fas fa-star gd-full-star"></i>', $full_stars);
658
+		$html .= str_repeat('<i class="fas fa-star-half-alt gd-half-star"></i>', $half_stars);
659
+		$html .= str_repeat('<i class="far fa-star gd-empty-star"></i>', $empty_stars);
660 660
 		$html .= '</div>';
661 661
 	}
662 662
 
@@ -675,48 +675,48 @@  discard block
 block discarded – undo
675 675
 		$full_color = get_option('geodir_reviewrating_fa_full_rating_color', '#757575');
676 676
 		if ($full_color != '#757575') {
677 677
 			echo '<style type="text/css">.br-theme-fontawesome-stars .br-widget a.br-active:after,.br-theme-fontawesome-stars .br-widget a.br-selected:after,
678
-			.gd-star-rating svg.svg-inline--fa {color:' . stripslashes($full_color) . '!important;}</style>';
678
+			.gd-star-rating svg.svg-inline--fa {color:' . stripslashes($full_color).'!important;}</style>';
679 679
 		}
680 680
 	}
681 681
 }
682 682
 
683
-function geodir_parse_shortcodes( $content, $shortcode, $first = true ) {
684
-    if ( empty( $content ) || empty( $shortcode ) ) {
683
+function geodir_parse_shortcodes($content, $shortcode, $first = true) {
684
+    if (empty($content) || empty($shortcode)) {
685 685
         return array();
686 686
     }
687 687
     
688
-    if ( false === strpos( $content, '[' ) ) {
688
+    if (false === strpos($content, '[')) {
689 689
         return array();
690 690
     }
691 691
 
692
-    if ( ! has_shortcode( $content, $shortcode ) ) {
692
+    if (!has_shortcode($content, $shortcode)) {
693 693
         return array();
694 694
     }
695 695
 
696 696
     $shortcodes = array();
697
-    if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) ) {
698
-        foreach ( $matches as $match ) {
699
-            if ( $shortcode === $match[2] ) {
700
-                $shortcode_attrs = shortcode_parse_atts( $match[3] );
701
-                if ( ! is_array( $shortcode_attrs ) ) {
697
+    if (preg_match_all('/'.get_shortcode_regex().'/s', $content, $matches, PREG_SET_ORDER)) {
698
+        foreach ($matches as $match) {
699
+            if ($shortcode === $match[2]) {
700
+                $shortcode_attrs = shortcode_parse_atts($match[3]);
701
+                if (!is_array($shortcode_attrs)) {
702 702
                     $shortcode_attrs = array();
703 703
                 }
704 704
                 $shortcode_attrs['shortcode_tag'] = $shortcode;
705
-                if ( !empty( $match[5] ) ) {
705
+                if (!empty($match[5])) {
706 706
                     $shortcode_attrs['shortcode_content'] = $match[5];
707 707
                 }
708 708
                 $shortcodes[] = $shortcode_attrs;
709
-                if ( $first === true ) {
709
+                if ($first === true) {
710 710
                     break;
711 711
                 }
712 712
             }
713 713
         }
714
-        if ( $first === true && !empty( $shortcodes ) ) {
714
+        if ($first === true && !empty($shortcodes)) {
715 715
             $shortcodes = $shortcodes[0];
716 716
         }
717 717
     }
718 718
 
719
-    return apply_filters( 'geodir_parse_shortcodes', $shortcodes, $content, $shortcode, $first );
719
+    return apply_filters('geodir_parse_shortcodes', $shortcodes, $content, $shortcode, $first);
720 720
 }
721 721
 
722 722
 /**
@@ -730,14 +730,14 @@  discard block
 block discarded – undo
730 730
  * @param array $email_vars     The email parameters.
731 731
  * @return string Filtered email message.
732 732
  */
733
-function geodir_email_wrap_message( $message, $email_type = '', $email_vars = array() ) {
733
+function geodir_email_wrap_message($message, $email_type = '', $email_vars = array()) {
734 734
 	global $geodir_email_content, $geodir_email_type, $geodir_email_vars;
735 735
 
736 736
 	$geodir_email_content = $message;
737 737
 	$geodir_email_type = $email_type;
738 738
 	$geodir_email_vars = $email_vars;
739 739
 
740
-	$template = apply_filters( "geodir_template_part-email-content", geodir_locate_template( 'email-message' ) );
740
+	$template = apply_filters("geodir_template_part-email-content", geodir_locate_template('email-message'));
741 741
 
742 742
 	ob_start();
743 743
 	/**
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
 	 *
746 746
 	 * @since 1.6.26
747 747
 	 */
748
-	include( $template );
748
+	include($template);
749 749
 
750 750
 	$content = ob_get_clean();
751 751
 
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
  * @param string $post_id       The post ID.
771 771
  * @param string $user_id       The user ID.
772 772
  */
773
-function geodir_email_wrap_user_message( $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id ) {
773
+function geodir_email_wrap_user_message($message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id) {
774 774
 	$email_vars = array();
775 775
 	$email_vars['message_type'] = $message_type;
776 776
 	$email_vars['fromEmail'] = $fromEmail;
@@ -783,9 +783,9 @@  discard block
 block discarded – undo
783 783
 	$email_vars['post_id'] = $post_id;
784 784
 	$email_vars['user_id'] = $user_id;
785 785
 
786
-	return geodir_email_wrap_message( $message, $message_type, $email_vars );
786
+	return geodir_email_wrap_message($message, $message_type, $email_vars);
787 787
 }
788
-add_filter( 'geodir_sendEmail_message', 'geodir_email_wrap_user_message', 10, 11 );
788
+add_filter('geodir_sendEmail_message', 'geodir_email_wrap_user_message', 10, 11);
789 789
 
790 790
 /**
791 791
  * Filter the admin email message.
@@ -799,13 +799,13 @@  discard block
 block discarded – undo
799 799
  * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
800 800
  * @param string $custom_1     Custom data to be sent.
801 801
  */
802
-function geodir_email_wrap_admin_message( $message, $page_id, $user_id, $message_type, $custom_1 ) {
802
+function geodir_email_wrap_admin_message($message, $page_id, $user_id, $message_type, $custom_1) {
803 803
 	$email_vars = array();
804 804
 	$email_vars['message_type'] = $message_type;
805 805
 	$email_vars['page_id'] = $page_id;
806 806
 	$email_vars['user_id'] = $user_id;
807 807
 	$email_vars['custom_1'] = $custom_1;
808 808
 
809
-	return geodir_email_wrap_message( $message, $message_type, $email_vars );
809
+	return geodir_email_wrap_message($message, $message_type, $email_vars);
810 810
 }
811
-add_filter( 'geodir_adminEmail_message', 'geodir_email_wrap_admin_message', 10, 5 );
812 811
\ No newline at end of file
812
+add_filter('geodir_adminEmail_message', 'geodir_email_wrap_admin_message', 10, 5);
813 813
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_output_functions.php 2 patches
Indentation   +1554 added lines, -1554 removed lines patch added patch discarded remove patch
@@ -21,84 +21,84 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function geodir_cf_checkbox($html,$location,$cf,$p=''){
23 23
 
24
-    // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
27
-
28
-    if(!is_array($cf) && $cf!=''){
29
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
31
-    }
32
-
33
-    $html_var = $cf['htmlvar_name'];
34
-
35
-    // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
-        /**
38
-         * Filter the checkbox html by location.
39
-         *
40
-         * @param string $html The html to filter.
41
-         * @param array $cf The custom field array.
42
-         * @since 1.6.6
43
-         */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
-    }
46
-
47
-    // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
-        /**
50
-         * Filter the checkbox html by individual custom field.
51
-         *
52
-         * @param string $html The html to filter.
53
-         * @param string $location The location to output the html.
54
-         * @param array $cf The custom field array.
55
-         * @since 1.6.6
56
-         */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
-    }
59
-
60
-    // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
-        /**
63
-         * Filter the checkbox html by field type key.
64
-         *
65
-         * @param string $html The html to filter.
66
-         * @param string $location The location to output the html.
67
-         * @param array $cf The custom field array.
68
-         * @since 1.6.6
69
-         */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
-    }
72
-
73
-    // If not html then we run the standard output.
74
-    if(empty($html)){
75
-
76
-        if ( (int) $post->{$html_var} == 1 ):
77
-
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
80
-            else:
81
-                $html_val = __( 'No', 'geodirectory' );
82
-            endif;
83
-
84
-            $field_icon = geodir_field_icon_proccess($cf);
85
-            if (strpos($field_icon, 'http') !== false) {
86
-                $field_icon_af = '';
87
-            } elseif ($field_icon == '') {
88
-                $field_icon_af = '';
89
-            } else {
90
-                $field_icon_af = $field_icon;
91
-                $field_icon = '';
92
-            }
93
-
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
97
-        endif;
98
-
99
-    }
100
-
101
-    return $html;
24
+	// check we have the post value
25
+	if(is_int($p)){$post = geodir_get_post_info($p);}
26
+	else{ global $post;}
27
+
28
+	if(!is_array($cf) && $cf!=''){
29
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
+		if(!$cf){return NULL;}
31
+	}
32
+
33
+	$html_var = $cf['htmlvar_name'];
34
+
35
+	// Check if there is a location specific filter.
36
+	if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
+		/**
38
+		 * Filter the checkbox html by location.
39
+		 *
40
+		 * @param string $html The html to filter.
41
+		 * @param array $cf The custom field array.
42
+		 * @since 1.6.6
43
+		 */
44
+		$html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
+	}
46
+
47
+	// Check if there is a custom field specific filter.
48
+	if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
+		/**
50
+		 * Filter the checkbox html by individual custom field.
51
+		 *
52
+		 * @param string $html The html to filter.
53
+		 * @param string $location The location to output the html.
54
+		 * @param array $cf The custom field array.
55
+		 * @since 1.6.6
56
+		 */
57
+		$html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
+	}
59
+
60
+	// Check if there is a custom field key specific filter.
61
+	if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
+		/**
63
+		 * Filter the checkbox html by field type key.
64
+		 *
65
+		 * @param string $html The html to filter.
66
+		 * @param string $location The location to output the html.
67
+		 * @param array $cf The custom field array.
68
+		 * @since 1.6.6
69
+		 */
70
+		$html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
+	}
72
+
73
+	// If not html then we run the standard output.
74
+	if(empty($html)){
75
+
76
+		if ( (int) $post->{$html_var} == 1 ):
77
+
78
+			if ( $post->{$html_var} == '1' ):
79
+				$html_val = __( 'Yes', 'geodirectory' );
80
+			else:
81
+				$html_val = __( 'No', 'geodirectory' );
82
+			endif;
83
+
84
+			$field_icon = geodir_field_icon_proccess($cf);
85
+			if (strpos($field_icon, 'http') !== false) {
86
+				$field_icon_af = '';
87
+			} elseif ($field_icon == '') {
88
+				$field_icon_af = '';
89
+			} else {
90
+				$field_icon_af = $field_icon;
91
+				$field_icon = '';
92
+			}
93
+
94
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
+			$html .= '</span>' . $html_val . '</div>';
97
+		endif;
98
+
99
+	}
100
+
101
+	return $html;
102 102
 }
103 103
 add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
104 104
 
@@ -115,71 +115,71 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function geodir_cf_fieldset($html,$location,$cf,$p=''){
117 117
 
118
-    // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
121
-
122
-    if(!is_array($cf) && $cf!=''){
123
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
125
-    }
126
-
127
-    $html_var = $cf['htmlvar_name'];
128
-
129
-    // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
-        /**
132
-         * Filter the fieldset html by location.
133
-         *
134
-         * @param string $html The html to filter.
135
-         * @param array $cf The custom field array.
136
-         * @since 1.6.6
137
-         */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
-    }
140
-
141
-    // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
-        /**
144
-         * Filter the fieldset html by individual custom field.
145
-         *
146
-         * @param string $html The html to filter.
147
-         * @param string $location The location to output the html.
148
-         * @param array $cf The custom field array.
149
-         * @since 1.6.6
150
-         */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
-    }
153
-
154
-    // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
-        /**
157
-         * Filter the fieldset html by field type key.
158
-         *
159
-         * @param string $html The html to filter.
160
-         * @param string $location The location to output the html.
161
-         * @param array $cf The custom field array.
162
-         * @since 1.6.6
163
-         */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
-    }
166
-
167
-    // If not html then we run the standard output.
168
-    if(empty($html)){
169
-
170
-        global $field_set_start;
171
-        $fieldset_class = 'fieldset-'.sanitize_html_class(sanitize_title_with_dashes($cf['site_title']));
172
-
173
-        if ($field_set_start == 1) {
174
-            $html = '';
175
-        } else {
176
-            $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
177
-            //$field_set_start = 1;
178
-        }
179
-
180
-    }
181
-
182
-    return $html;
118
+	// check we have the post value
119
+	if(is_int($p)){$post = geodir_get_post_info($p);}
120
+	else{ global $post;}
121
+
122
+	if(!is_array($cf) && $cf!=''){
123
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
+		if(!$cf){return NULL;}
125
+	}
126
+
127
+	$html_var = $cf['htmlvar_name'];
128
+
129
+	// Check if there is a location specific filter.
130
+	if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
+		/**
132
+		 * Filter the fieldset html by location.
133
+		 *
134
+		 * @param string $html The html to filter.
135
+		 * @param array $cf The custom field array.
136
+		 * @since 1.6.6
137
+		 */
138
+		$html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
+	}
140
+
141
+	// Check if there is a custom field specific filter.
142
+	if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
+		/**
144
+		 * Filter the fieldset html by individual custom field.
145
+		 *
146
+		 * @param string $html The html to filter.
147
+		 * @param string $location The location to output the html.
148
+		 * @param array $cf The custom field array.
149
+		 * @since 1.6.6
150
+		 */
151
+		$html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
+	}
153
+
154
+	// Check if there is a custom field key specific filter.
155
+	if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
+		/**
157
+		 * Filter the fieldset html by field type key.
158
+		 *
159
+		 * @param string $html The html to filter.
160
+		 * @param string $location The location to output the html.
161
+		 * @param array $cf The custom field array.
162
+		 * @since 1.6.6
163
+		 */
164
+		$html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
+	}
166
+
167
+	// If not html then we run the standard output.
168
+	if(empty($html)){
169
+
170
+		global $field_set_start;
171
+		$fieldset_class = 'fieldset-'.sanitize_html_class(sanitize_title_with_dashes($cf['site_title']));
172
+
173
+		if ($field_set_start == 1) {
174
+			$html = '';
175
+		} else {
176
+			$html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
177
+			//$field_set_start = 1;
178
+		}
179
+
180
+	}
181
+
182
+	return $html;
183 183
 }
184 184
 add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
185 185
 
@@ -196,106 +196,106 @@  discard block
 block discarded – undo
196 196
  */
197 197
 function geodir_cf_url($html,$location,$cf,$p=''){
198 198
 
199
-    // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
202
-
203
-    if(!is_array($cf) && $cf!=''){
204
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
206
-    }
207
-
208
-    $html_var = $cf['htmlvar_name'];
209
-
210
-    // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
-        /**
213
-         * Filter the url html by location.
214
-         *
215
-         * @param string $html The html to filter.
216
-         * @param array $cf The custom field array.
217
-         * @since 1.6.6
218
-         */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
-    }
221
-
222
-    // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
-        /**
225
-         * Filter the url html by individual custom field.
226
-         *
227
-         * @param string $html The html to filter.
228
-         * @param string $location The location to output the html.
229
-         * @param array $cf The custom field array.
230
-         * @since 1.6.6
231
-         */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
-    }
234
-
235
-    // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
-        /**
238
-         * Filter the url html by field type key.
239
-         *
240
-         * @param string $html The html to filter.
241
-         * @param string $location The location to output the html.
242
-         * @param array $cf The custom field array.
243
-         * @since 1.6.6
244
-         */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
-    }
247
-
248
-    // If not html then we run the standard output.
249
-    if(empty($html)){
250
-
251
-        if ($post->{$cf['htmlvar_name']}):
252
-
253
-            $field_icon = geodir_field_icon_proccess($cf);
254
-            if (strpos($field_icon, 'http') !== false) {
255
-                $field_icon_af = '';
256
-            } elseif ($field_icon == '') {
257
-
258
-                if ($cf['name'] == 'geodir_facebook') {
259
-                    $field_icon_af = '<i class="fab fa-facebook-square"></i>';
260
-                } elseif ($cf['name'] == 'geodir_twitter') {
261
-                    $field_icon_af = '<i class="fab fa-twitter-square"></i>';
262
-                } else {
263
-                    $field_icon_af = '<i class="fas fa-link"></i>';
264
-                }
265
-
266
-            } else {
267
-                $field_icon_af = $field_icon;
268
-                $field_icon = '';
269
-            }
270
-
271
-            $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
-
273
-
274
-            $website = !empty($a_url['url']) ? $a_url['url'] : '';
275
-            $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
-            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
-
279
-
280
-
281
-            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
-            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
-            /**
284
-             * Filter custom field website name.
285
-             *
286
-             * @since 1.0.0
287
-             *
288
-             * @param string $title Website Title.
289
-             * @param string $website Website URL.
290
-             * @param int $post->ID Post ID.
291
-             */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
-
294
-        endif;
295
-
296
-    }
297
-
298
-    return $html;
199
+	// check we have the post value
200
+	if(is_int($p)){$post = geodir_get_post_info($p);}
201
+	else{ global $post;}
202
+
203
+	if(!is_array($cf) && $cf!=''){
204
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
+		if(!$cf){return NULL;}
206
+	}
207
+
208
+	$html_var = $cf['htmlvar_name'];
209
+
210
+	// Check if there is a location specific filter.
211
+	if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
+		/**
213
+		 * Filter the url html by location.
214
+		 *
215
+		 * @param string $html The html to filter.
216
+		 * @param array $cf The custom field array.
217
+		 * @since 1.6.6
218
+		 */
219
+		$html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
+	}
221
+
222
+	// Check if there is a custom field specific filter.
223
+	if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
+		/**
225
+		 * Filter the url html by individual custom field.
226
+		 *
227
+		 * @param string $html The html to filter.
228
+		 * @param string $location The location to output the html.
229
+		 * @param array $cf The custom field array.
230
+		 * @since 1.6.6
231
+		 */
232
+		$html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
+	}
234
+
235
+	// Check if there is a custom field key specific filter.
236
+	if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
+		/**
238
+		 * Filter the url html by field type key.
239
+		 *
240
+		 * @param string $html The html to filter.
241
+		 * @param string $location The location to output the html.
242
+		 * @param array $cf The custom field array.
243
+		 * @since 1.6.6
244
+		 */
245
+		$html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
+	}
247
+
248
+	// If not html then we run the standard output.
249
+	if(empty($html)){
250
+
251
+		if ($post->{$cf['htmlvar_name']}):
252
+
253
+			$field_icon = geodir_field_icon_proccess($cf);
254
+			if (strpos($field_icon, 'http') !== false) {
255
+				$field_icon_af = '';
256
+			} elseif ($field_icon == '') {
257
+
258
+				if ($cf['name'] == 'geodir_facebook') {
259
+					$field_icon_af = '<i class="fab fa-facebook-square"></i>';
260
+				} elseif ($cf['name'] == 'geodir_twitter') {
261
+					$field_icon_af = '<i class="fab fa-twitter-square"></i>';
262
+				} else {
263
+					$field_icon_af = '<i class="fas fa-link"></i>';
264
+				}
265
+
266
+			} else {
267
+				$field_icon_af = $field_icon;
268
+				$field_icon = '';
269
+			}
270
+
271
+			$a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
+
273
+
274
+			$website = !empty($a_url['url']) ? $a_url['url'] : '';
275
+			$title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
+			if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
+			$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
+
279
+
280
+
281
+			// all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
+			$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
+			/**
284
+			 * Filter custom field website name.
285
+			 *
286
+			 * @since 1.0.0
287
+			 *
288
+			 * @param string $title Website Title.
289
+			 * @param string $website Website URL.
290
+			 * @param int $post->ID Post ID.
291
+			 */
292
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
+
294
+		endif;
295
+
296
+	}
297
+
298
+	return $html;
299 299
 }
300 300
 add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
301 301
 
@@ -312,80 +312,80 @@  discard block
 block discarded – undo
312 312
  */
313 313
 function geodir_cf_phone($html,$location,$cf,$p=''){
314 314
 
315
-    // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
318
-
319
-    if(!is_array($cf) && $cf!=''){
320
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
322
-    }
323
-
324
-    $html_var = $cf['htmlvar_name'];
325
-
326
-    // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
-        /**
329
-         * Filter the phone html by location.
330
-         *
331
-         * @param string $html The html to filter.
332
-         * @param array $cf The custom field array.
333
-         * @since 1.6.6
334
-         */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
-    }
337
-
338
-    // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
-        /**
341
-         * Filter the phone html by individual custom field.
342
-         *
343
-         * @param string $html The html to filter.
344
-         * @param string $location The location to output the html.
345
-         * @param array $cf The custom field array.
346
-         * @since 1.6.6
347
-         */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
-    }
350
-
351
-    // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
-        /**
354
-         * Filter the phone html by field type key.
355
-         *
356
-         * @param string $html The html to filter.
357
-         * @param string $location The location to output the html.
358
-         * @param array $cf The custom field array.
359
-         * @since 1.6.6
360
-         */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
-    }
363
-
364
-    // If not html then we run the standard output.
365
-    if(empty($html)){
366
-
367
-        if ($post->{$cf['htmlvar_name']}):
368
-
369
-            $field_icon = geodir_field_icon_proccess($cf);
370
-            if (strpos($field_icon, 'http') !== false) {
371
-                $field_icon_af = '';
372
-            } elseif ($field_icon == '') {
373
-                $field_icon_af = '<i class="fas fa-phone"></i>';
374
-            } else {
375
-                $field_icon_af = $field_icon;
376
-                $field_icon = '';
377
-            }
378
-
379
-
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
-
384
-        endif;
385
-
386
-    }
387
-
388
-    return $html;
315
+	// check we have the post value
316
+	if(is_int($p)){$post = geodir_get_post_info($p);}
317
+	else{ global $post;}
318
+
319
+	if(!is_array($cf) && $cf!=''){
320
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
+		if(!$cf){return NULL;}
322
+	}
323
+
324
+	$html_var = $cf['htmlvar_name'];
325
+
326
+	// Check if there is a location specific filter.
327
+	if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
+		/**
329
+		 * Filter the phone html by location.
330
+		 *
331
+		 * @param string $html The html to filter.
332
+		 * @param array $cf The custom field array.
333
+		 * @since 1.6.6
334
+		 */
335
+		$html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
+	}
337
+
338
+	// Check if there is a custom field specific filter.
339
+	if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
+		/**
341
+		 * Filter the phone html by individual custom field.
342
+		 *
343
+		 * @param string $html The html to filter.
344
+		 * @param string $location The location to output the html.
345
+		 * @param array $cf The custom field array.
346
+		 * @since 1.6.6
347
+		 */
348
+		$html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
+	}
350
+
351
+	// Check if there is a custom field key specific filter.
352
+	if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
+		/**
354
+		 * Filter the phone html by field type key.
355
+		 *
356
+		 * @param string $html The html to filter.
357
+		 * @param string $location The location to output the html.
358
+		 * @param array $cf The custom field array.
359
+		 * @since 1.6.6
360
+		 */
361
+		$html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
+	}
363
+
364
+	// If not html then we run the standard output.
365
+	if(empty($html)){
366
+
367
+		if ($post->{$cf['htmlvar_name']}):
368
+
369
+			$field_icon = geodir_field_icon_proccess($cf);
370
+			if (strpos($field_icon, 'http') !== false) {
371
+				$field_icon_af = '';
372
+			} elseif ($field_icon == '') {
373
+				$field_icon_af = '<i class="fas fa-phone"></i>';
374
+			} else {
375
+				$field_icon_af = $field_icon;
376
+				$field_icon = '';
377
+			}
378
+
379
+
380
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
+					$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
+			$html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
+
384
+		endif;
385
+
386
+	}
387
+
388
+	return $html;
389 389
 }
390 390
 add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
391 391
 
@@ -402,85 +402,85 @@  discard block
 block discarded – undo
402 402
  */
403 403
 function geodir_cf_time($html,$location,$cf,$p=''){
404 404
 
405
-    // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
408
-
409
-    if(!is_array($cf) && $cf!=''){
410
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
412
-    }
413
-
414
-    $html_var = $cf['htmlvar_name'];
415
-
416
-    // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
-        /**
419
-         * Filter the time html by location.
420
-         *
421
-         * @param string $html The html to filter.
422
-         * @param array $cf The custom field array.
423
-         * @since 1.6.6
424
-         */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
-    }
427
-
428
-    // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
-        /**
431
-         * Filter the time html by individual custom field.
432
-         *
433
-         * @param string $html The html to filter.
434
-         * @param string $location The location to output the html.
435
-         * @param array $cf The custom field array.
436
-         * @since 1.6.6
437
-         */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
-    }
440
-
441
-    // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
-        /**
444
-         * Filter the time html by field type key.
445
-         *
446
-         * @param string $html The html to filter.
447
-         * @param string $location The location to output the html.
448
-         * @param array $cf The custom field array.
449
-         * @since 1.6.6
450
-         */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
-    }
453
-
454
-    // If not html then we run the standard output.
455
-    if(empty($html)){
456
-
457
-        if ($post->{$cf['htmlvar_name']}):
458
-
459
-            $value = '';
460
-            if ($post->{$cf['htmlvar_name']} != '')
461
-                //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
-                $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
-
464
-            $field_icon = geodir_field_icon_proccess($cf);
465
-            if (strpos($field_icon, 'http') !== false) {
466
-                $field_icon_af = '';
467
-            } elseif ($field_icon == '') {
468
-                $field_icon_af = '<i class="far fa-clock"></i>';
469
-            } else {
470
-                $field_icon_af = $field_icon;
471
-                $field_icon = '';
472
-            }
473
-
474
-
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
478
-
479
-        endif;
480
-
481
-    }
482
-
483
-    return $html;
405
+	// check we have the post value
406
+	if(is_int($p)){$post = geodir_get_post_info($p);}
407
+	else{ global $post;}
408
+
409
+	if(!is_array($cf) && $cf!=''){
410
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
+		if(!$cf){return NULL;}
412
+	}
413
+
414
+	$html_var = $cf['htmlvar_name'];
415
+
416
+	// Check if there is a location specific filter.
417
+	if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
+		/**
419
+		 * Filter the time html by location.
420
+		 *
421
+		 * @param string $html The html to filter.
422
+		 * @param array $cf The custom field array.
423
+		 * @since 1.6.6
424
+		 */
425
+		$html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
+	}
427
+
428
+	// Check if there is a custom field specific filter.
429
+	if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
+		/**
431
+		 * Filter the time html by individual custom field.
432
+		 *
433
+		 * @param string $html The html to filter.
434
+		 * @param string $location The location to output the html.
435
+		 * @param array $cf The custom field array.
436
+		 * @since 1.6.6
437
+		 */
438
+		$html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
+	}
440
+
441
+	// Check if there is a custom field key specific filter.
442
+	if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
+		/**
444
+		 * Filter the time html by field type key.
445
+		 *
446
+		 * @param string $html The html to filter.
447
+		 * @param string $location The location to output the html.
448
+		 * @param array $cf The custom field array.
449
+		 * @since 1.6.6
450
+		 */
451
+		$html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
+	}
453
+
454
+	// If not html then we run the standard output.
455
+	if(empty($html)){
456
+
457
+		if ($post->{$cf['htmlvar_name']}):
458
+
459
+			$value = '';
460
+			if ($post->{$cf['htmlvar_name']} != '')
461
+				//$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
+				$value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
+
464
+			$field_icon = geodir_field_icon_proccess($cf);
465
+			if (strpos($field_icon, 'http') !== false) {
466
+				$field_icon_af = '';
467
+			} elseif ($field_icon == '') {
468
+				$field_icon_af = '<i class="far fa-clock"></i>';
469
+			} else {
470
+				$field_icon_af = $field_icon;
471
+				$field_icon = '';
472
+			}
473
+
474
+
475
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
+			$html .= '</span>' . $value . '</div>';
478
+
479
+		endif;
480
+
481
+	}
482
+
483
+	return $html;
484 484
 }
485 485
 add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
486 486
 
@@ -496,111 +496,111 @@  discard block
 block discarded – undo
496 496
  * @return string The html to output for the custom field.
497 497
  */
498 498
 function geodir_cf_datepicker($html,$location,$cf,$p=''){
499
-    global $preview;
500
-    // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
503
-
504
-    if(!is_array($cf) && $cf!=''){
505
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
507
-    }
508
-
509
-    $html_var = $cf['htmlvar_name'];
510
-
511
-    // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
-        /**
514
-         * Filter the datepicker html by location.
515
-         *
516
-         * @param string $html The html to filter.
517
-         * @param array $cf The custom field array.
518
-         * @since 1.6.6
519
-         */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
-    }
522
-
523
-    // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
-        /**
526
-         * Filter the datepicker html by individual custom field.
527
-         *
528
-         * @param string $html The html to filter.
529
-         * @param string $location The location to output the html.
530
-         * @param array $cf The custom field array.
531
-         * @since 1.6.6
532
-         */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
-    }
535
-
536
-    // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
-        /**
539
-         * Filter the datepicker html by field type key.
540
-         *
541
-         * @param string $html The html to filter.
542
-         * @param string $location The location to output the html.
543
-         * @param array $cf The custom field array.
544
-         * @since 1.6.6
545
-         */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
-    }
548
-
549
-    // If not html then we run the standard output.
550
-    if(empty($html)){
551
-
552
-        if ($post->{$cf['htmlvar_name']}):
553
-
554
-            $date_format = geodir_default_date_format();
555
-            if ($cf['extra_fields'] != '') {
556
-                $date_format = stripslashes_deep(unserialize($cf['extra_fields']));
557
-                $date_format = $date_format['date_format'];
558
-            }
559
-            // check if we need to change the format or not
560
-            $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
562
-
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
565
-
566
-                $date_format = str_replace($search, $replace, $date_format);
567
-
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
570
-                $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
-            }
572
-
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
-                $date_format_from = $preview ? $date_format : 'Y-m-d';
575
-                $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576
-                //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577
-                //$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
-            }else{
579
-                return '';
580
-            }
581
-
582
-            $field_icon = geodir_field_icon_proccess($cf);
583
-
584
-            if (strpos($field_icon, 'http') !== false) {
585
-                $field_icon_af = '';
586
-            } elseif ($field_icon == '') {
587
-                $field_icon_af = '<i class="fas fa-calendar-alt"></i>';
588
-            } else {
589
-                $field_icon_af = $field_icon;
590
-                $field_icon = '';
591
-            }
592
-
593
-
594
-
595
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
-            $html .= '</span>' . $value . '</div>';
598
-
599
-        endif;
600
-
601
-    }
602
-
603
-    return $html;
499
+	global $preview;
500
+	// check we have the post value
501
+	if(is_int($p)){$post = geodir_get_post_info($p);}
502
+	else{ global $post;}
503
+
504
+	if(!is_array($cf) && $cf!=''){
505
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
+		if(!$cf){return NULL;}
507
+	}
508
+
509
+	$html_var = $cf['htmlvar_name'];
510
+
511
+	// Check if there is a location specific filter.
512
+	if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
+		/**
514
+		 * Filter the datepicker html by location.
515
+		 *
516
+		 * @param string $html The html to filter.
517
+		 * @param array $cf The custom field array.
518
+		 * @since 1.6.6
519
+		 */
520
+		$html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
+	}
522
+
523
+	// Check if there is a custom field specific filter.
524
+	if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
+		/**
526
+		 * Filter the datepicker html by individual custom field.
527
+		 *
528
+		 * @param string $html The html to filter.
529
+		 * @param string $location The location to output the html.
530
+		 * @param array $cf The custom field array.
531
+		 * @since 1.6.6
532
+		 */
533
+		$html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
+	}
535
+
536
+	// Check if there is a custom field key specific filter.
537
+	if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
+		/**
539
+		 * Filter the datepicker html by field type key.
540
+		 *
541
+		 * @param string $html The html to filter.
542
+		 * @param string $location The location to output the html.
543
+		 * @param array $cf The custom field array.
544
+		 * @since 1.6.6
545
+		 */
546
+		$html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
+	}
548
+
549
+	// If not html then we run the standard output.
550
+	if(empty($html)){
551
+
552
+		if ($post->{$cf['htmlvar_name']}):
553
+
554
+			$date_format = geodir_default_date_format();
555
+			if ($cf['extra_fields'] != '') {
556
+				$date_format = stripslashes_deep(unserialize($cf['extra_fields']));
557
+				$date_format = $date_format['date_format'];
558
+			}
559
+			// check if we need to change the format or not
560
+			$date_format_len = strlen(str_replace(' ', '', $date_format));
561
+			if($date_format_len>5){// if greater then 4 then it's the old style format.
562
+
563
+				$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
+				$replace = array('d','j','l','m','n','F','Y');//PHP date format
565
+
566
+				$date_format = str_replace($search, $replace, $date_format);
567
+
568
+				$post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+			}else{
570
+				$post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
+			}
572
+
573
+			if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
+				$date_format_from = $preview ? $date_format : 'Y-m-d';
575
+				$value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576
+				//$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577
+				//$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
+			}else{
579
+				return '';
580
+			}
581
+
582
+			$field_icon = geodir_field_icon_proccess($cf);
583
+
584
+			if (strpos($field_icon, 'http') !== false) {
585
+				$field_icon_af = '';
586
+			} elseif ($field_icon == '') {
587
+				$field_icon_af = '<i class="fas fa-calendar-alt"></i>';
588
+			} else {
589
+				$field_icon_af = $field_icon;
590
+				$field_icon = '';
591
+			}
592
+
593
+
594
+
595
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
+			$html .= '</span>' . $value . '</div>';
598
+
599
+		endif;
600
+
601
+	}
602
+
603
+	return $html;
604 604
 }
605 605
 add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
606 606
 
@@ -617,97 +617,97 @@  discard block
 block discarded – undo
617 617
  */
618 618
 function geodir_cf_text($html,$location,$cf,$p=''){
619 619
 
620
-    // check we have the post value
621
-    if(is_int($p)){$post = geodir_get_post_info($p);}
622
-    else{ global $post;}
623
-
624
-    if(!is_array($cf) && $cf!=''){
625
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
-        if(!$cf){return NULL;}
627
-    }
628
-
629
-    $html_var = $cf['htmlvar_name'];
630
-
631
-    // Check if there is a location specific filter.
632
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
633
-        /**
634
-         * Filter the text html by location.
635
-         *
636
-         * @param string $html The html to filter.
637
-         * @param array $cf The custom field array.
638
-         * @since 1.6.6
639
-         */
640
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
641
-    }
642
-
643
-    // Check if there is a custom field specific filter.
644
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
645
-        /**
646
-         * Filter the text html by individual custom field.
647
-         *
648
-         * @param string $html The html to filter.
649
-         * @param string $location The location to output the html.
650
-         * @param array $cf The custom field array.
651
-         * @since 1.6.6
652
-         */
653
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
654
-    }
655
-
656
-    // Check if there is a custom field key specific filter.
657
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
658
-        /**
659
-         * Filter the text html by field type key.
660
-         *
661
-         * @param string $html The html to filter.
662
-         * @param string $location The location to output the html.
663
-         * @param array $cf The custom field array.
664
-         * @since 1.6.6
665
-         */
666
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
667
-    }
620
+	// check we have the post value
621
+	if(is_int($p)){$post = geodir_get_post_info($p);}
622
+	else{ global $post;}
623
+
624
+	if(!is_array($cf) && $cf!=''){
625
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
+		if(!$cf){return NULL;}
627
+	}
628
+
629
+	$html_var = $cf['htmlvar_name'];
630
+
631
+	// Check if there is a location specific filter.
632
+	if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
633
+		/**
634
+		 * Filter the text html by location.
635
+		 *
636
+		 * @param string $html The html to filter.
637
+		 * @param array $cf The custom field array.
638
+		 * @since 1.6.6
639
+		 */
640
+		$html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
641
+	}
642
+
643
+	// Check if there is a custom field specific filter.
644
+	if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
645
+		/**
646
+		 * Filter the text html by individual custom field.
647
+		 *
648
+		 * @param string $html The html to filter.
649
+		 * @param string $location The location to output the html.
650
+		 * @param array $cf The custom field array.
651
+		 * @since 1.6.6
652
+		 */
653
+		$html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
654
+	}
655
+
656
+	// Check if there is a custom field key specific filter.
657
+	if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
658
+		/**
659
+		 * Filter the text html by field type key.
660
+		 *
661
+		 * @param string $html The html to filter.
662
+		 * @param string $location The location to output the html.
663
+		 * @param array $cf The custom field array.
664
+		 * @since 1.6.6
665
+		 */
666
+		$html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
667
+	}
668 668
 
669 669
     
670 670
 
671
-    // If not html then we run the standard output.
672
-    if(empty($html)){
671
+	// If not html then we run the standard output.
672
+	if(empty($html)){
673 673
 
674
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
674
+		if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
675 675
 
676
-            $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
676
+			$class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
677 677
 
678
-            $field_icon = geodir_field_icon_proccess($cf);
679
-            if (strpos($field_icon, 'http') !== false) {
680
-                $field_icon_af = '';
681
-            } elseif ($field_icon == '') {
682
-                $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="far fa-clock"></i>' : "";
683
-            } else {
684
-                $field_icon_af = $field_icon;
685
-                $field_icon = '';
686
-            }
678
+			$field_icon = geodir_field_icon_proccess($cf);
679
+			if (strpos($field_icon, 'http') !== false) {
680
+				$field_icon_af = '';
681
+			} elseif ($field_icon == '') {
682
+				$field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="far fa-clock"></i>' : "";
683
+			} else {
684
+				$field_icon_af = $field_icon;
685
+				$field_icon = '';
686
+			}
687 687
 
688 688
 
689
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
691
-            $html .= '</span>';
689
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
691
+			$html .= '</span>';
692 692
 
693
-            $value = $post->{$cf['htmlvar_name']};
694
-            if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){
695
-                $extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields']));
696
-                if(isset($extra_fields['is_price']) && $extra_fields['is_price']){
697
-                    if(!ceil($value) > 0){return '';}// dont output blank prices
698
-                    $value = geodir_currency_format_number($value,$cf);
699
-                }
700
-            }
693
+			$value = $post->{$cf['htmlvar_name']};
694
+			if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){
695
+				$extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields']));
696
+				if(isset($extra_fields['is_price']) && $extra_fields['is_price']){
697
+					if(!ceil($value) > 0){return '';}// dont output blank prices
698
+					$value = geodir_currency_format_number($value,$cf);
699
+				}
700
+			}
701 701
 
702 702
 
703
-            $html .= $value;
704
-            $html .= '</div>';
703
+			$html .= $value;
704
+			$html .= '</div>';
705 705
 
706
-        endif;
706
+		endif;
707 707
 
708
-    }
708
+	}
709 709
 
710
-    return $html;
710
+	return $html;
711 711
 }
712 712
 add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
713 713
 
@@ -724,98 +724,98 @@  discard block
 block discarded – undo
724 724
  */
725 725
 function geodir_cf_radio($html,$location,$cf,$p=''){
726 726
 
727
-    // check we have the post value
728
-    if(is_int($p)){$post = geodir_get_post_info($p);}
729
-    else{ global $post;}
730
-
731
-    if(!is_array($cf) && $cf!=''){
732
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
733
-        if(!$cf){return NULL;}
734
-    }
735
-
736
-    $html_var = $cf['htmlvar_name'];
737
-
738
-    // Check if there is a location specific filter.
739
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
740
-        /**
741
-         * Filter the radio html by location.
742
-         *
743
-         * @param string $html The html to filter.
744
-         * @param array $cf The custom field array.
745
-         * @since 1.6.6
746
-         */
747
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
748
-    }
749
-
750
-    // Check if there is a custom field specific filter.
751
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
752
-        /**
753
-         * Filter the radio html by individual custom field.
754
-         *
755
-         * @param string $html The html to filter.
756
-         * @param string $location The location to output the html.
757
-         * @param array $cf The custom field array.
758
-         * @since 1.6.6
759
-         */
760
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
761
-    }
762
-
763
-    // Check if there is a custom field key specific filter.
764
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
765
-        /**
766
-         * Filter the radio html by field type key.
767
-         *
768
-         * @param string $html The html to filter.
769
-         * @param string $location The location to output the html.
770
-         * @param array $cf The custom field array.
771
-         * @since 1.6.6
772
-         */
773
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
774
-    }
775
-
776
-    // If not html then we run the standard output.
777
-    if(empty($html)){
778
-
779
-        $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
780
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
781
-
782
-            if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
783
-                $html_val = __('No', 'geodirectory');
784
-            } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
785
-                $html_val = __('Yes', 'geodirectory');
786
-            } else {
787
-                if (!empty($cf['option_values'])) {
788
-                    $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
789
-
790
-                    if (!empty($cf_option_values)) {
791
-                        foreach ($cf_option_values as $cf_option_value) {
792
-                            if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
793
-                                $html_val = $cf_option_value['label'];
794
-                            }
795
-                        }
796
-                    }
797
-                }
798
-            }
799
-
800
-            $field_icon = geodir_field_icon_proccess($cf);
801
-            if (strpos($field_icon, 'http') !== false) {
802
-                $field_icon_af = '';
803
-            } elseif ($field_icon == '') {
804
-                $field_icon_af = '';
805
-            } else {
806
-                $field_icon_af = $field_icon;
807
-                $field_icon = '';
808
-            }
809
-
810
-
811
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
812
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
813
-            $html .= '</span>' . $html_val . '</div>';
814
-        endif;
815
-
816
-    }
817
-
818
-    return $html;
727
+	// check we have the post value
728
+	if(is_int($p)){$post = geodir_get_post_info($p);}
729
+	else{ global $post;}
730
+
731
+	if(!is_array($cf) && $cf!=''){
732
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
733
+		if(!$cf){return NULL;}
734
+	}
735
+
736
+	$html_var = $cf['htmlvar_name'];
737
+
738
+	// Check if there is a location specific filter.
739
+	if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
740
+		/**
741
+		 * Filter the radio html by location.
742
+		 *
743
+		 * @param string $html The html to filter.
744
+		 * @param array $cf The custom field array.
745
+		 * @since 1.6.6
746
+		 */
747
+		$html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
748
+	}
749
+
750
+	// Check if there is a custom field specific filter.
751
+	if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
752
+		/**
753
+		 * Filter the radio html by individual custom field.
754
+		 *
755
+		 * @param string $html The html to filter.
756
+		 * @param string $location The location to output the html.
757
+		 * @param array $cf The custom field array.
758
+		 * @since 1.6.6
759
+		 */
760
+		$html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
761
+	}
762
+
763
+	// Check if there is a custom field key specific filter.
764
+	if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
765
+		/**
766
+		 * Filter the radio html by field type key.
767
+		 *
768
+		 * @param string $html The html to filter.
769
+		 * @param string $location The location to output the html.
770
+		 * @param array $cf The custom field array.
771
+		 * @since 1.6.6
772
+		 */
773
+		$html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
774
+	}
775
+
776
+	// If not html then we run the standard output.
777
+	if(empty($html)){
778
+
779
+		$html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
780
+		if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
781
+
782
+			if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
783
+				$html_val = __('No', 'geodirectory');
784
+			} else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
785
+				$html_val = __('Yes', 'geodirectory');
786
+			} else {
787
+				if (!empty($cf['option_values'])) {
788
+					$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
789
+
790
+					if (!empty($cf_option_values)) {
791
+						foreach ($cf_option_values as $cf_option_value) {
792
+							if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
793
+								$html_val = $cf_option_value['label'];
794
+							}
795
+						}
796
+					}
797
+				}
798
+			}
799
+
800
+			$field_icon = geodir_field_icon_proccess($cf);
801
+			if (strpos($field_icon, 'http') !== false) {
802
+				$field_icon_af = '';
803
+			} elseif ($field_icon == '') {
804
+				$field_icon_af = '';
805
+			} else {
806
+				$field_icon_af = $field_icon;
807
+				$field_icon = '';
808
+			}
809
+
810
+
811
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
812
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
813
+			$html .= '</span>' . $html_val . '</div>';
814
+		endif;
815
+
816
+	}
817
+
818
+	return $html;
819 819
 }
820 820
 add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
821 821
 
@@ -833,92 +833,92 @@  discard block
 block discarded – undo
833 833
  */
834 834
 function geodir_cf_select($html,$location,$cf,$p=''){
835 835
 
836
-    // check we have the post value
837
-    if(is_int($p)){$post = geodir_get_post_info($p);}
838
-    else{ global $post;}
839
-
840
-    if(!is_array($cf) && $cf!=''){
841
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
842
-        if(!$cf){return NULL;}
843
-    }
844
-
845
-    $html_var = $cf['htmlvar_name'];
846
-
847
-    // Check if there is a location specific filter.
848
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
849
-        /**
850
-         * Filter the select html by location.
851
-         *
852
-         * @param string $html The html to filter.
853
-         * @param array $cf The custom field array.
854
-         * @since 1.6.6
855
-         */
856
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
857
-    }
858
-
859
-    // Check if there is a custom field specific filter.
860
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
861
-        /**
862
-         * Filter the select html by individual custom field.
863
-         *
864
-         * @param string $html The html to filter.
865
-         * @param string $location The location to output the html.
866
-         * @param array $cf The custom field array.
867
-         * @since 1.6.6
868
-         */
869
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
870
-    }
871
-
872
-    // Check if there is a custom field key specific filter.
873
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
874
-        /**
875
-         * Filter the select html by field type key.
876
-         *
877
-         * @param string $html The html to filter.
878
-         * @param string $location The location to output the html.
879
-         * @param array $cf The custom field array.
880
-         * @since 1.6.6
881
-         */
882
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
883
-    }
884
-
885
-    // If not html then we run the standard output.
886
-    if(empty($html)){
887
-
888
-        if ($post->{$cf['htmlvar_name']}):
889
-            $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
890
-
891
-            if (!empty($cf['option_values'])) {
892
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
893
-
894
-                if (!empty($cf_option_values)) {
895
-                    foreach ($cf_option_values as $cf_option_value) {
896
-                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
897
-                            $field_value = $cf_option_value['label']; // no longer needed here. Removed comment because it displays number instead of label if option vales set like "Good/1,Fair/2".
898
-                        }
899
-                    }
900
-                }
901
-            }
902
-
903
-            $field_icon = geodir_field_icon_proccess($cf);
904
-            if (strpos($field_icon, 'http') !== false) {
905
-                $field_icon_af = '';
906
-            } elseif ($field_icon == '') {
907
-                $field_icon_af = '';
908
-            } else {
909
-                $field_icon_af = $field_icon;
910
-                $field_icon = '';
911
-            }
912
-
913
-
914
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
915
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
916
-            $html .= '</span>' . $field_value . '</div>';
917
-        endif;
918
-
919
-    }
920
-
921
-    return $html;
836
+	// check we have the post value
837
+	if(is_int($p)){$post = geodir_get_post_info($p);}
838
+	else{ global $post;}
839
+
840
+	if(!is_array($cf) && $cf!=''){
841
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
842
+		if(!$cf){return NULL;}
843
+	}
844
+
845
+	$html_var = $cf['htmlvar_name'];
846
+
847
+	// Check if there is a location specific filter.
848
+	if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
849
+		/**
850
+		 * Filter the select html by location.
851
+		 *
852
+		 * @param string $html The html to filter.
853
+		 * @param array $cf The custom field array.
854
+		 * @since 1.6.6
855
+		 */
856
+		$html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
857
+	}
858
+
859
+	// Check if there is a custom field specific filter.
860
+	if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
861
+		/**
862
+		 * Filter the select html by individual custom field.
863
+		 *
864
+		 * @param string $html The html to filter.
865
+		 * @param string $location The location to output the html.
866
+		 * @param array $cf The custom field array.
867
+		 * @since 1.6.6
868
+		 */
869
+		$html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
870
+	}
871
+
872
+	// Check if there is a custom field key specific filter.
873
+	if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
874
+		/**
875
+		 * Filter the select html by field type key.
876
+		 *
877
+		 * @param string $html The html to filter.
878
+		 * @param string $location The location to output the html.
879
+		 * @param array $cf The custom field array.
880
+		 * @since 1.6.6
881
+		 */
882
+		$html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
883
+	}
884
+
885
+	// If not html then we run the standard output.
886
+	if(empty($html)){
887
+
888
+		if ($post->{$cf['htmlvar_name']}):
889
+			$field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
890
+
891
+			if (!empty($cf['option_values'])) {
892
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
893
+
894
+				if (!empty($cf_option_values)) {
895
+					foreach ($cf_option_values as $cf_option_value) {
896
+						if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
897
+							$field_value = $cf_option_value['label']; // no longer needed here. Removed comment because it displays number instead of label if option vales set like "Good/1,Fair/2".
898
+						}
899
+					}
900
+				}
901
+			}
902
+
903
+			$field_icon = geodir_field_icon_proccess($cf);
904
+			if (strpos($field_icon, 'http') !== false) {
905
+				$field_icon_af = '';
906
+			} elseif ($field_icon == '') {
907
+				$field_icon_af = '';
908
+			} else {
909
+				$field_icon_af = $field_icon;
910
+				$field_icon = '';
911
+			}
912
+
913
+
914
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
915
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
916
+			$html .= '</span>' . $field_value . '</div>';
917
+		endif;
918
+
919
+	}
920
+
921
+	return $html;
922 922
 }
923 923
 add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
924 924
 
@@ -935,117 +935,117 @@  discard block
 block discarded – undo
935 935
  */
936 936
 function geodir_cf_multiselect($html,$location,$cf,$p=''){
937 937
 
938
-    // check we have the post value
939
-    if(is_int($p)){$post = geodir_get_post_info($p);}
940
-    else{ global $post;}
941
-
942
-    if(!is_array($cf) && $cf!=''){
943
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
944
-        if(!$cf){return NULL;}
945
-    }
946
-
947
-    $html_var = $cf['htmlvar_name'];
948
-
949
-    // Check if there is a location specific filter.
950
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
951
-        /**
952
-         * Filter the multiselect html by location.
953
-         *
954
-         * @param string $html The html to filter.
955
-         * @param array $cf The custom field array.
956
-         * @since 1.6.6
957
-         */
958
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
959
-    }
960
-
961
-    // Check if there is a custom field specific filter.
962
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
963
-        /**
964
-         * Filter the multiselect html by individual custom field.
965
-         *
966
-         * @param string $html The html to filter.
967
-         * @param string $location The location to output the html.
968
-         * @param array $cf The custom field array.
969
-         * @since 1.6.6
970
-         */
971
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
972
-    }
973
-
974
-    // Check if there is a custom field key specific filter.
975
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
976
-        /**
977
-         * Filter the multiselect html by field type key.
978
-         *
979
-         * @param string $html The html to filter.
980
-         * @param string $location The location to output the html.
981
-         * @param array $cf The custom field array.
982
-         * @since 1.6.6
983
-         */
984
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
985
-    }
986
-
987
-    // If not html then we run the standard output.
988
-    if(empty($html)){
989
-
990
-
991
-        if (!empty($post->{$cf['htmlvar_name']})):
992
-
993
-            if (is_array($post->{$cf['htmlvar_name']})) {
994
-                $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
995
-            }
996
-
997
-            $field_icon = geodir_field_icon_proccess($cf);
998
-            if (strpos($field_icon, 'http') !== false) {
999
-                $field_icon_af = '';
1000
-            } elseif ($field_icon == '') {
1001
-                $field_icon_af = '';
1002
-            } else {
1003
-                $field_icon_af = $field_icon;
1004
-                $field_icon = '';
1005
-            }
1006
-
1007
-            $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
1008
-
1009
-            if(is_array($field_values)){
1010
-                $field_values = array_map('trim', $field_values);
1011
-            }
1012
-
1013
-            $option_values = array();
1014
-            if (!empty($cf['option_values'])) {
1015
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
1016
-
1017
-                if (!empty($cf_option_values)) {
1018
-                    foreach ($cf_option_values as $cf_option_value) {
1019
-                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
1020
-                            $option_values[] = $cf_option_value['label'];
1021
-                        }
1022
-                    }
1023
-                }
1024
-            }
1025
-
1026
-
1027
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1028
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1029
-            $html .= '</span>';
1030
-
1031
-            if (count($option_values) > 1) {
1032
-                $html .= '<ul>';
1033
-
1034
-                foreach ($option_values as $val) {
1035
-                    $html .= '<li>' . $val . '</li>';
1036
-                }
1037
-
1038
-                $html .= '</ul>';
1039
-            } else {
1040
-                $html .= __($post->{$cf['htmlvar_name']}, 'geodirectory');
1041
-            }
1042
-
1043
-            $html .= '</div>';
1044
-        endif;
1045
-
1046
-    }
1047
-
1048
-    return $html;
938
+	// check we have the post value
939
+	if(is_int($p)){$post = geodir_get_post_info($p);}
940
+	else{ global $post;}
941
+
942
+	if(!is_array($cf) && $cf!=''){
943
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
944
+		if(!$cf){return NULL;}
945
+	}
946
+
947
+	$html_var = $cf['htmlvar_name'];
948
+
949
+	// Check if there is a location specific filter.
950
+	if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
951
+		/**
952
+		 * Filter the multiselect html by location.
953
+		 *
954
+		 * @param string $html The html to filter.
955
+		 * @param array $cf The custom field array.
956
+		 * @since 1.6.6
957
+		 */
958
+		$html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
959
+	}
960
+
961
+	// Check if there is a custom field specific filter.
962
+	if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
963
+		/**
964
+		 * Filter the multiselect html by individual custom field.
965
+		 *
966
+		 * @param string $html The html to filter.
967
+		 * @param string $location The location to output the html.
968
+		 * @param array $cf The custom field array.
969
+		 * @since 1.6.6
970
+		 */
971
+		$html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
972
+	}
973
+
974
+	// Check if there is a custom field key specific filter.
975
+	if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
976
+		/**
977
+		 * Filter the multiselect html by field type key.
978
+		 *
979
+		 * @param string $html The html to filter.
980
+		 * @param string $location The location to output the html.
981
+		 * @param array $cf The custom field array.
982
+		 * @since 1.6.6
983
+		 */
984
+		$html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
985
+	}
986
+
987
+	// If not html then we run the standard output.
988
+	if(empty($html)){
989
+
990
+
991
+		if (!empty($post->{$cf['htmlvar_name']})):
992
+
993
+			if (is_array($post->{$cf['htmlvar_name']})) {
994
+				$post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
995
+			}
996
+
997
+			$field_icon = geodir_field_icon_proccess($cf);
998
+			if (strpos($field_icon, 'http') !== false) {
999
+				$field_icon_af = '';
1000
+			} elseif ($field_icon == '') {
1001
+				$field_icon_af = '';
1002
+			} else {
1003
+				$field_icon_af = $field_icon;
1004
+				$field_icon = '';
1005
+			}
1006
+
1007
+			$field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
1008
+
1009
+			if(is_array($field_values)){
1010
+				$field_values = array_map('trim', $field_values);
1011
+			}
1012
+
1013
+			$option_values = array();
1014
+			if (!empty($cf['option_values'])) {
1015
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
1016
+
1017
+				if (!empty($cf_option_values)) {
1018
+					foreach ($cf_option_values as $cf_option_value) {
1019
+						if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
1020
+							$option_values[] = $cf_option_value['label'];
1021
+						}
1022
+					}
1023
+				}
1024
+			}
1025
+
1026
+
1027
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1028
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1029
+			$html .= '</span>';
1030
+
1031
+			if (count($option_values) > 1) {
1032
+				$html .= '<ul>';
1033
+
1034
+				foreach ($option_values as $val) {
1035
+					$html .= '<li>' . $val . '</li>';
1036
+				}
1037
+
1038
+				$html .= '</ul>';
1039
+			} else {
1040
+				$html .= __($post->{$cf['htmlvar_name']}, 'geodirectory');
1041
+			}
1042
+
1043
+			$html .= '</div>';
1044
+		endif;
1045
+
1046
+	}
1047
+
1048
+	return $html;
1049 1049
 }
1050 1050
 add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1051 1051
 
@@ -1062,148 +1062,148 @@  discard block
 block discarded – undo
1062 1062
  */
1063 1063
 function geodir_cf_email($html,$location,$cf,$p=''){
1064 1064
 
1065
-    // check we have the post value
1066
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1067
-    else{ global $post;}
1068
-
1069
-    if(!is_array($cf) && $cf!=''){
1070
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1071
-        if(!$cf){return NULL;}
1072
-    }
1073
-
1074
-    $html_var = $cf['htmlvar_name'];
1075
-
1076
-    // Check if there is a location specific filter.
1077
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1078
-        /**
1079
-         * Filter the email html by location.
1080
-         *
1081
-         * @param string $html The html to filter.
1082
-         * @param array $cf The custom field array.
1083
-         * @since 1.6.6
1084
-         */
1085
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1086
-    }
1087
-
1088
-    // Check if there is a custom field specific filter.
1089
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1090
-        /**
1091
-         * Filter the email html by individual custom field.
1092
-         *
1093
-         * @param string $html The html to filter.
1094
-         * @param string $location The location to output the html.
1095
-         * @param array $cf The custom field array.
1096
-         * @since 1.6.6
1097
-         */
1098
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1099
-    }
1100
-
1101
-    // Check if there is a custom field key specific filter.
1102
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1103
-        /**
1104
-         * Filter the email html by field type key.
1105
-         *
1106
-         * @param string $html The html to filter.
1107
-         * @param string $location The location to output the html.
1108
-         * @param array $cf The custom field array.
1109
-         * @since 1.6.6
1110
-         */
1111
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1112
-    }
1113
-
1114
-    // If not html then we run the standard output.
1115
-    if(empty($html)){
1116
-
1117
-        global $preview;
1118
-        if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1119
-            return ''; // Remove Send Enquiry from listings page
1120
-        }
1121
-
1122
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1123
-
1124
-        if ($cf['htmlvar_name'] == 'geodir_email' && $post->{$cf['htmlvar_name']}) {
1125
-            $b_send_inquiry = '';
1126
-
1127
-            $html = '';
1128
-            if (!$preview) {
1129
-                $b_send_inquiry = 'b_send_inquiry';
1130
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1131
-            }
1132
-
1133
-            $field_icon = geodir_field_icon_proccess($cf);
1134
-            if (strpos($field_icon, 'http') !== false) {
1135
-                $field_icon_af = '';
1136
-            } elseif ($field_icon == '') {
1137
-                $field_icon_af = '<i class="fas fa-envelope"></i>';
1138
-            } else {
1139
-                $field_icon_af = $field_icon;
1140
-                $field_icon = '';
1141
-            }
1142
-
1143
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1144
-            $seperator = '';
1145
-            if ($post->{$cf['htmlvar_name']}) {
1146
-                $b_send_inquiry_url = apply_filters('b_send_inquiry_url', 'javascript:void(0);');
1147
-                $html .= '<a href="'.$b_send_inquiry_url.'" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1148
-            }
1149
-
1150
-            $html .= '</span></div>';
1151
-
1152
-
1153
-            if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1154
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1155
-            } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1156
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1157
-            }
1158
-
1159
-            /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1160
-
1161
-        } else {
1162
-
1163
-            if ($post->{$cf['htmlvar_name']}) {
1164
-
1165
-                $field_icon = geodir_field_icon_proccess($cf);
1166
-                if (strpos($field_icon, 'http') !== false) {
1167
-                    $field_icon_af = '';
1168
-                } elseif ($field_icon == '') {
1169
-                    $field_icon_af = '<i class="fas fa-envelope"></i>';
1170
-                } else {
1171
-                    $field_icon_af = $field_icon;
1172
-                    $field_icon = '';
1173
-                }
1174
-
1175
-
1176
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1177
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1178
-                $html .= '</span><span class="geodir-email-address-output">';
1179
-                $email = $post->{$cf['htmlvar_name']} ;
1180
-                if($e_split = explode('@',$email)){
1181
-                    /**
1182
-                     * Filter email custom field name output.
1183
-                     *
1184
-                     * @since 1.5.3
1185
-                     *
1186
-                     * @param string $email The email string being output.
1187
-                     * @param array $cf Custom field variables array.
1188
-                     */
1189
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1190
-                    if($location=='mapbubble'){
1191
-                        $html .=  "<a href=\"mailto:$email\">$email_name</a>";
1192
-                    }else{
1193
-                        $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1194
-                    }
1195
-
1196
-                }else{
1197
-                    $html .=  $email;
1198
-                }
1199
-                $html .= '</span></div>';
1200
-            }
1201
-
1202
-        }
1203
-
1204
-    }
1205
-
1206
-    return $html;
1065
+	// check we have the post value
1066
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1067
+	else{ global $post;}
1068
+
1069
+	if(!is_array($cf) && $cf!=''){
1070
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1071
+		if(!$cf){return NULL;}
1072
+	}
1073
+
1074
+	$html_var = $cf['htmlvar_name'];
1075
+
1076
+	// Check if there is a location specific filter.
1077
+	if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1078
+		/**
1079
+		 * Filter the email html by location.
1080
+		 *
1081
+		 * @param string $html The html to filter.
1082
+		 * @param array $cf The custom field array.
1083
+		 * @since 1.6.6
1084
+		 */
1085
+		$html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1086
+	}
1087
+
1088
+	// Check if there is a custom field specific filter.
1089
+	if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1090
+		/**
1091
+		 * Filter the email html by individual custom field.
1092
+		 *
1093
+		 * @param string $html The html to filter.
1094
+		 * @param string $location The location to output the html.
1095
+		 * @param array $cf The custom field array.
1096
+		 * @since 1.6.6
1097
+		 */
1098
+		$html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1099
+	}
1100
+
1101
+	// Check if there is a custom field key specific filter.
1102
+	if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1103
+		/**
1104
+		 * Filter the email html by field type key.
1105
+		 *
1106
+		 * @param string $html The html to filter.
1107
+		 * @param string $location The location to output the html.
1108
+		 * @param array $cf The custom field array.
1109
+		 * @since 1.6.6
1110
+		 */
1111
+		$html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1112
+	}
1113
+
1114
+	// If not html then we run the standard output.
1115
+	if(empty($html)){
1116
+
1117
+		global $preview;
1118
+		if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1119
+			return ''; // Remove Send Enquiry from listings page
1120
+		}
1121
+
1122
+		$package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1123
+
1124
+		if ($cf['htmlvar_name'] == 'geodir_email' && $post->{$cf['htmlvar_name']}) {
1125
+			$b_send_inquiry = '';
1126
+
1127
+			$html = '';
1128
+			if (!$preview) {
1129
+				$b_send_inquiry = 'b_send_inquiry';
1130
+				$html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1131
+			}
1132
+
1133
+			$field_icon = geodir_field_icon_proccess($cf);
1134
+			if (strpos($field_icon, 'http') !== false) {
1135
+				$field_icon_af = '';
1136
+			} elseif ($field_icon == '') {
1137
+				$field_icon_af = '<i class="fas fa-envelope"></i>';
1138
+			} else {
1139
+				$field_icon_af = $field_icon;
1140
+				$field_icon = '';
1141
+			}
1142
+
1143
+			$html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1144
+			$seperator = '';
1145
+			if ($post->{$cf['htmlvar_name']}) {
1146
+				$b_send_inquiry_url = apply_filters('b_send_inquiry_url', 'javascript:void(0);');
1147
+				$html .= '<a href="'.$b_send_inquiry_url.'" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1148
+			}
1149
+
1150
+			$html .= '</span></div>';
1151
+
1152
+
1153
+			if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1154
+				$html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1155
+			} elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1156
+				$html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1157
+			}
1158
+
1159
+			/*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1160
+
1161
+		} else {
1162
+
1163
+			if ($post->{$cf['htmlvar_name']}) {
1164
+
1165
+				$field_icon = geodir_field_icon_proccess($cf);
1166
+				if (strpos($field_icon, 'http') !== false) {
1167
+					$field_icon_af = '';
1168
+				} elseif ($field_icon == '') {
1169
+					$field_icon_af = '<i class="fas fa-envelope"></i>';
1170
+				} else {
1171
+					$field_icon_af = $field_icon;
1172
+					$field_icon = '';
1173
+				}
1174
+
1175
+
1176
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1177
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1178
+				$html .= '</span><span class="geodir-email-address-output">';
1179
+				$email = $post->{$cf['htmlvar_name']} ;
1180
+				if($e_split = explode('@',$email)){
1181
+					/**
1182
+					 * Filter email custom field name output.
1183
+					 *
1184
+					 * @since 1.5.3
1185
+					 *
1186
+					 * @param string $email The email string being output.
1187
+					 * @param array $cf Custom field variables array.
1188
+					 */
1189
+					$email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1190
+					if($location=='mapbubble'){
1191
+						$html .=  "<a href=\"mailto:$email\">$email_name</a>";
1192
+					}else{
1193
+						$html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1194
+					}
1195
+
1196
+				}else{
1197
+					$html .=  $email;
1198
+				}
1199
+				$html .= '</span></div>';
1200
+			}
1201
+
1202
+		}
1203
+
1204
+	}
1205
+
1206
+	return $html;
1207 1207
 }
1208 1208
 add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1209 1209
 
@@ -1220,136 +1220,136 @@  discard block
 block discarded – undo
1220 1220
  */
1221 1221
 function geodir_cf_file($html,$location,$cf,$p=''){
1222 1222
 
1223
-    // check we have the post value
1224
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1225
-    else{ global $post;}
1226
-
1227
-    if(!is_array($cf) && $cf!=''){
1228
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1229
-        if(!$cf){return NULL;}
1230
-    }
1231
-
1232
-    $html_var = $cf['htmlvar_name'];
1233
-
1234
-    // Check if there is a location specific filter.
1235
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1236
-        /**
1237
-         * Filter the file html by location.
1238
-         *
1239
-         * @param string $html The html to filter.
1240
-         * @param array $cf The custom field array.
1241
-         * @since 1.6.6
1242
-         */
1243
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1244
-    }
1245
-
1246
-    // Check if there is a custom field specific filter.
1247
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1248
-        /**
1249
-         * Filter the file html by individual custom field.
1250
-         *
1251
-         * @param string $html The html to filter.
1252
-         * @param string $location The location to output the html.
1253
-         * @param array $cf The custom field array.
1254
-         * @since 1.6.6
1255
-         */
1256
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1257
-    }
1258
-
1259
-    // Check if there is a custom field key specific filter.
1260
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1261
-        /**
1262
-         * Filter the file html by field type key.
1263
-         *
1264
-         * @param string $html The html to filter.
1265
-         * @param string $location The location to output the html.
1266
-         * @param array $cf The custom field array.
1267
-         * @since 1.6.6
1268
-         */
1269
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1270
-    }
1271
-
1272
-    // If not html then we run the standard output.
1273
-    if(empty($html)){
1274
-
1275
-        if (!empty($post->{$cf['htmlvar_name']})):
1276
-
1277
-            $files = explode(",", $post->{$cf['htmlvar_name']});
1278
-            if (!empty($files)):
1279
-
1280
-                $extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL;
1281
-                $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1282
-
1283
-                $file_paths = '';
1284
-                foreach ($files as $file) {
1285
-                    if (!empty($file)) {
1286
-
1287
-                        // $filetype = wp_check_filetype($file);
1288
-
1289
-                        $image_name_arr = explode('/', $file);
1290
-                        $curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1291
-                        $filename = end($image_name_arr);
1292
-                        $img_name_arr = explode('.', $filename);
1293
-
1294
-                        $arr_file_type = wp_check_filetype($filename);
1295
-                        if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1296
-                            continue;
1297
-                        }
1298
-
1299
-                        $uploaded_file_type = $arr_file_type['type'];
1300
-                        $uploaded_file_ext = $arr_file_type['ext'];
1301
-
1302
-                        if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1303
-                            continue; // Invalid file type.
1304
-                        }
1305
-
1306
-                        //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1307
-                        $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1308
-                        $audio_file_types = array('audio/mpeg', 'audio/ogg', 'audio/mp4', 'audio/vnd.wav', 'audio/basic', 'audio/mid');
1309
-
1310
-                        // If the uploaded file is image
1311
-                        if (in_array($uploaded_file_type, $image_file_types)) {
1312
-                            $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1313
-                            $file_paths .= '<a href="'.$file.'">';
1314
-                            $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1315
-                            $file_paths .= '</a>';
1316
-                            //$file_paths .= '<img src="'.$file.'"  />';	
1317
-                            $file_paths .= '</div>';
1318
-                        }elseif (in_array($uploaded_file_type, $audio_file_types)) {// if audio
1319
-                            $ext_path = '_' . $html_var . '_';
1320
-                            $filename = explode($ext_path, $filename);
1321
-                            $file_paths .= '<span class="gd-audio-name">'.$filename[count($filename) - 1].'</span>';
1322
-                            $file_paths .= do_shortcode('[audio src="'.$file.'" ]');
1323
-                        } else {
1324
-                            $ext_path = '_' . $html_var . '_';
1325
-                            $filename = explode($ext_path, $filename);
1326
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1327
-                        }
1328
-                    }
1329
-                }
1330
-
1331
-                $field_icon = geodir_field_icon_proccess($cf);
1332
-                if (strpos($field_icon, 'http') !== false) {
1333
-                    $field_icon_af = '';
1334
-                } elseif ($field_icon == '') {
1335
-                    $field_icon_af = '';
1336
-                } else {
1337
-                    $field_icon_af = $field_icon;
1338
-                    $field_icon = '';
1339
-                }
1340
-
1341
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1342
-                $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1343
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1344
-                $html .= '</span>';
1345
-                $html .= $file_paths . '</div></div>';
1346
-
1347
-            endif;
1348
-        endif;
1349
-
1350
-    }
1351
-
1352
-    return $html;
1223
+	// check we have the post value
1224
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1225
+	else{ global $post;}
1226
+
1227
+	if(!is_array($cf) && $cf!=''){
1228
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1229
+		if(!$cf){return NULL;}
1230
+	}
1231
+
1232
+	$html_var = $cf['htmlvar_name'];
1233
+
1234
+	// Check if there is a location specific filter.
1235
+	if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1236
+		/**
1237
+		 * Filter the file html by location.
1238
+		 *
1239
+		 * @param string $html The html to filter.
1240
+		 * @param array $cf The custom field array.
1241
+		 * @since 1.6.6
1242
+		 */
1243
+		$html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1244
+	}
1245
+
1246
+	// Check if there is a custom field specific filter.
1247
+	if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1248
+		/**
1249
+		 * Filter the file html by individual custom field.
1250
+		 *
1251
+		 * @param string $html The html to filter.
1252
+		 * @param string $location The location to output the html.
1253
+		 * @param array $cf The custom field array.
1254
+		 * @since 1.6.6
1255
+		 */
1256
+		$html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1257
+	}
1258
+
1259
+	// Check if there is a custom field key specific filter.
1260
+	if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1261
+		/**
1262
+		 * Filter the file html by field type key.
1263
+		 *
1264
+		 * @param string $html The html to filter.
1265
+		 * @param string $location The location to output the html.
1266
+		 * @param array $cf The custom field array.
1267
+		 * @since 1.6.6
1268
+		 */
1269
+		$html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1270
+	}
1271
+
1272
+	// If not html then we run the standard output.
1273
+	if(empty($html)){
1274
+
1275
+		if (!empty($post->{$cf['htmlvar_name']})):
1276
+
1277
+			$files = explode(",", $post->{$cf['htmlvar_name']});
1278
+			if (!empty($files)):
1279
+
1280
+				$extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL;
1281
+				$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1282
+
1283
+				$file_paths = '';
1284
+				foreach ($files as $file) {
1285
+					if (!empty($file)) {
1286
+
1287
+						// $filetype = wp_check_filetype($file);
1288
+
1289
+						$image_name_arr = explode('/', $file);
1290
+						$curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1291
+						$filename = end($image_name_arr);
1292
+						$img_name_arr = explode('.', $filename);
1293
+
1294
+						$arr_file_type = wp_check_filetype($filename);
1295
+						if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1296
+							continue;
1297
+						}
1298
+
1299
+						$uploaded_file_type = $arr_file_type['type'];
1300
+						$uploaded_file_ext = $arr_file_type['ext'];
1301
+
1302
+						if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1303
+							continue; // Invalid file type.
1304
+						}
1305
+
1306
+						//$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1307
+						$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1308
+						$audio_file_types = array('audio/mpeg', 'audio/ogg', 'audio/mp4', 'audio/vnd.wav', 'audio/basic', 'audio/mid');
1309
+
1310
+						// If the uploaded file is image
1311
+						if (in_array($uploaded_file_type, $image_file_types)) {
1312
+							$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1313
+							$file_paths .= '<a href="'.$file.'">';
1314
+							$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1315
+							$file_paths .= '</a>';
1316
+							//$file_paths .= '<img src="'.$file.'"  />';	
1317
+							$file_paths .= '</div>';
1318
+						}elseif (in_array($uploaded_file_type, $audio_file_types)) {// if audio
1319
+							$ext_path = '_' . $html_var . '_';
1320
+							$filename = explode($ext_path, $filename);
1321
+							$file_paths .= '<span class="gd-audio-name">'.$filename[count($filename) - 1].'</span>';
1322
+							$file_paths .= do_shortcode('[audio src="'.$file.'" ]');
1323
+						} else {
1324
+							$ext_path = '_' . $html_var . '_';
1325
+							$filename = explode($ext_path, $filename);
1326
+							$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1327
+						}
1328
+					}
1329
+				}
1330
+
1331
+				$field_icon = geodir_field_icon_proccess($cf);
1332
+				if (strpos($field_icon, 'http') !== false) {
1333
+					$field_icon_af = '';
1334
+				} elseif ($field_icon == '') {
1335
+					$field_icon_af = '';
1336
+				} else {
1337
+					$field_icon_af = $field_icon;
1338
+					$field_icon = '';
1339
+				}
1340
+
1341
+				$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1342
+				$html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1343
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1344
+				$html .= '</span>';
1345
+				$html .= $file_paths . '</div></div>';
1346
+
1347
+			endif;
1348
+		endif;
1349
+
1350
+	}
1351
+
1352
+	return $html;
1353 1353
 }
1354 1354
 add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1355 1355
 
@@ -1367,80 +1367,80 @@  discard block
 block discarded – undo
1367 1367
  */
1368 1368
 function geodir_cf_textarea($html,$location,$cf,$p=''){
1369 1369
 
1370
-    // check we have the post value
1371
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1372
-    else{ global $post;}
1373
-
1374
-    if(!is_array($cf) && $cf!=''){
1375
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1376
-        if(!$cf){return NULL;}
1377
-    }
1378
-
1379
-    $html_var = $cf['htmlvar_name'];
1380
-
1381
-    // Check if there is a location specific filter.
1382
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1383
-        /**
1384
-         * Filter the textarea html by location.
1385
-         *
1386
-         * @param string $html The html to filter.
1387
-         * @param array $cf The custom field array.
1388
-         * @since 1.6.6
1389
-         */
1390
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1391
-    }
1392
-
1393
-    // Check if there is a custom field specific filter.
1394
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1395
-        /**
1396
-         * Filter the textarea html by individual custom field.
1397
-         *
1398
-         * @param string $html The html to filter.
1399
-         * @param string $location The location to output the html.
1400
-         * @param array $cf The custom field array.
1401
-         * @since 1.6.6
1402
-         */
1403
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1404
-    }
1405
-
1406
-    // Check if there is a custom field key specific filter.
1407
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1408
-        /**
1409
-         * Filter the textarea html by field type key.
1410
-         *
1411
-         * @param string $html The html to filter.
1412
-         * @param string $location The location to output the html.
1413
-         * @param array $cf The custom field array.
1414
-         * @since 1.6.6
1415
-         */
1416
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1417
-    }
1418
-
1419
-    // If not html then we run the standard output.
1420
-    if(empty($html)){
1421
-
1422
-        if (!empty($post->{$cf['htmlvar_name']})) {
1423
-
1424
-            $field_icon = geodir_field_icon_proccess($cf);
1425
-            if (strpos($field_icon, 'http') !== false) {
1426
-                $field_icon_af = '';
1427
-            } elseif ($field_icon == '') {
1428
-                $field_icon_af = '';
1429
-            } else {
1430
-                $field_icon_af = $field_icon;
1431
-                $field_icon = '';
1432
-            }
1433
-
1434
-
1435
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1436
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1437
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1438
-
1439
-        }
1440
-
1441
-    }
1442
-
1443
-    return $html;
1370
+	// check we have the post value
1371
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1372
+	else{ global $post;}
1373
+
1374
+	if(!is_array($cf) && $cf!=''){
1375
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1376
+		if(!$cf){return NULL;}
1377
+	}
1378
+
1379
+	$html_var = $cf['htmlvar_name'];
1380
+
1381
+	// Check if there is a location specific filter.
1382
+	if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1383
+		/**
1384
+		 * Filter the textarea html by location.
1385
+		 *
1386
+		 * @param string $html The html to filter.
1387
+		 * @param array $cf The custom field array.
1388
+		 * @since 1.6.6
1389
+		 */
1390
+		$html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1391
+	}
1392
+
1393
+	// Check if there is a custom field specific filter.
1394
+	if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1395
+		/**
1396
+		 * Filter the textarea html by individual custom field.
1397
+		 *
1398
+		 * @param string $html The html to filter.
1399
+		 * @param string $location The location to output the html.
1400
+		 * @param array $cf The custom field array.
1401
+		 * @since 1.6.6
1402
+		 */
1403
+		$html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1404
+	}
1405
+
1406
+	// Check if there is a custom field key specific filter.
1407
+	if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1408
+		/**
1409
+		 * Filter the textarea html by field type key.
1410
+		 *
1411
+		 * @param string $html The html to filter.
1412
+		 * @param string $location The location to output the html.
1413
+		 * @param array $cf The custom field array.
1414
+		 * @since 1.6.6
1415
+		 */
1416
+		$html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1417
+	}
1418
+
1419
+	// If not html then we run the standard output.
1420
+	if(empty($html)){
1421
+
1422
+		if (!empty($post->{$cf['htmlvar_name']})) {
1423
+
1424
+			$field_icon = geodir_field_icon_proccess($cf);
1425
+			if (strpos($field_icon, 'http') !== false) {
1426
+				$field_icon_af = '';
1427
+			} elseif ($field_icon == '') {
1428
+				$field_icon_af = '';
1429
+			} else {
1430
+				$field_icon_af = $field_icon;
1431
+				$field_icon = '';
1432
+			}
1433
+
1434
+
1435
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1436
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1437
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1438
+
1439
+		}
1440
+
1441
+	}
1442
+
1443
+	return $html;
1444 1444
 }
1445 1445
 add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1446 1446
 
@@ -1458,79 +1458,79 @@  discard block
 block discarded – undo
1458 1458
  */
1459 1459
 function geodir_cf_html($html,$location,$cf,$p=''){
1460 1460
 
1461
-    // check we have the post value
1462
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1463
-    else{ global $post;}
1464
-
1465
-    if(!is_array($cf) && $cf!=''){
1466
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1467
-        if(!$cf){return NULL;}
1468
-    }
1469
-
1470
-    $html_var = $cf['htmlvar_name'];
1471
-
1472
-    // Check if there is a location specific filter.
1473
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1474
-        /**
1475
-         * Filter the html html by location.
1476
-         *
1477
-         * @param string $html The html to filter.
1478
-         * @param array $cf The custom field array.
1479
-         * @since 1.6.6
1480
-         */
1481
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1482
-    }
1483
-
1484
-    // Check if there is a custom field specific filter.
1485
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1486
-        /**
1487
-         * Filter the html html by individual custom field.
1488
-         *
1489
-         * @param string $html The html to filter.
1490
-         * @param string $location The location to output the html.
1491
-         * @param array $cf The custom field array.
1492
-         * @since 1.6.6
1493
-         */
1494
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1495
-    }
1496
-
1497
-    // Check if there is a custom field key specific filter.
1498
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1499
-        /**
1500
-         * Filter the html html by field type key.
1501
-         *
1502
-         * @param string $html The html to filter.
1503
-         * @param string $location The location to output the html.
1504
-         * @param array $cf The custom field array.
1505
-         * @since 1.6.6
1506
-         */
1507
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1508
-    }
1509
-
1510
-    // If not html then we run the standard output.
1511
-    if(empty($html)){
1512
-
1513
-        if (!empty($post->{$cf['htmlvar_name']})) {
1514
-
1515
-            $field_icon = geodir_field_icon_proccess($cf);
1516
-            if (strpos($field_icon, 'http') !== false) {
1517
-                $field_icon_af = '';
1518
-            } elseif ($field_icon == '') {
1519
-                $field_icon_af = '';
1520
-            } else {
1521
-                $field_icon_af = $field_icon;
1522
-                $field_icon = '';
1523
-            }
1524
-
1525
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1526
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1527
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1528
-
1529
-        }
1530
-
1531
-    }
1532
-
1533
-    return $html;
1461
+	// check we have the post value
1462
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1463
+	else{ global $post;}
1464
+
1465
+	if(!is_array($cf) && $cf!=''){
1466
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1467
+		if(!$cf){return NULL;}
1468
+	}
1469
+
1470
+	$html_var = $cf['htmlvar_name'];
1471
+
1472
+	// Check if there is a location specific filter.
1473
+	if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1474
+		/**
1475
+		 * Filter the html html by location.
1476
+		 *
1477
+		 * @param string $html The html to filter.
1478
+		 * @param array $cf The custom field array.
1479
+		 * @since 1.6.6
1480
+		 */
1481
+		$html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1482
+	}
1483
+
1484
+	// Check if there is a custom field specific filter.
1485
+	if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1486
+		/**
1487
+		 * Filter the html html by individual custom field.
1488
+		 *
1489
+		 * @param string $html The html to filter.
1490
+		 * @param string $location The location to output the html.
1491
+		 * @param array $cf The custom field array.
1492
+		 * @since 1.6.6
1493
+		 */
1494
+		$html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1495
+	}
1496
+
1497
+	// Check if there is a custom field key specific filter.
1498
+	if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1499
+		/**
1500
+		 * Filter the html html by field type key.
1501
+		 *
1502
+		 * @param string $html The html to filter.
1503
+		 * @param string $location The location to output the html.
1504
+		 * @param array $cf The custom field array.
1505
+		 * @since 1.6.6
1506
+		 */
1507
+		$html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1508
+	}
1509
+
1510
+	// If not html then we run the standard output.
1511
+	if(empty($html)){
1512
+
1513
+		if (!empty($post->{$cf['htmlvar_name']})) {
1514
+
1515
+			$field_icon = geodir_field_icon_proccess($cf);
1516
+			if (strpos($field_icon, 'http') !== false) {
1517
+				$field_icon_af = '';
1518
+			} elseif ($field_icon == '') {
1519
+				$field_icon_af = '';
1520
+			} else {
1521
+				$field_icon_af = $field_icon;
1522
+				$field_icon = '';
1523
+			}
1524
+
1525
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1526
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1527
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1528
+
1529
+		}
1530
+
1531
+	}
1532
+
1533
+	return $html;
1534 1534
 }
1535 1535
 add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1536 1536
 
@@ -1548,117 +1548,117 @@  discard block
 block discarded – undo
1548 1548
  */
1549 1549
 function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1550 1550
 
1551
-    // check we have the post value
1552
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1553
-    else{ global $post;}
1554
-
1555
-    if(!is_array($cf) && $cf!=''){
1556
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1557
-        if(!$cf){return NULL;}
1558
-    }
1559
-
1560
-    $html_var = $cf['htmlvar_name'];
1561
-
1562
-    // Check if there is a location specific filter.
1563
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1564
-        /**
1565
-         * Filter the taxonomy html by location.
1566
-         *
1567
-         * @param string $html The html to filter.
1568
-         * @param array $cf The custom field array.
1569
-         * @since 1.6.6
1570
-         */
1571
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1572
-    }
1573
-
1574
-    // Check if there is a custom field specific filter.
1575
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1576
-        /**
1577
-         * Filter the taxonomy html by individual custom field.
1578
-         *
1579
-         * @param string $html The html to filter.
1580
-         * @param string $location The location to output the html.
1581
-         * @param array $cf The custom field array.
1582
-         * @since 1.6.6
1583
-         */
1584
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1585
-    }
1586
-
1587
-    // Check if there is a custom field key specific filter.
1588
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1589
-        /**
1590
-         * Filter the taxonomy html by field type key.
1591
-         *
1592
-         * @param string $html The html to filter.
1593
-         * @param string $location The location to output the html.
1594
-         * @param array $cf The custom field array.
1595
-         * @since 1.6.6
1596
-         */
1597
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1598
-    }
1599
-
1600
-    // If not html then we run the standard output.
1601
-    if(empty($html)){
1602
-
1603
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1604
-            $post_taxonomy = $post->post_type . 'category';
1605
-            $field_value = $post->{$html_var};
1606
-            $links = array();
1607
-            $terms = array();
1608
-            $termsOrdered = array();
1609
-            if (!is_array($field_value)) {
1610
-                $field_value = explode(",", trim($field_value, ","));
1611
-            }
1612
-
1613
-            $field_value = array_unique($field_value);
1614
-
1615
-            if (!empty($field_value)) {
1616
-                foreach ($field_value as $term) {
1617
-                    $term = trim($term);
1618
-
1619
-                    if ($term != '') {
1620
-                        $term = get_term_by('id', $term, $html_var);
1621
-                        if (is_object($term)) {
1622
-                            $links[$term->slug] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1623
-                            $terms[$term->slug] = $term;
1624
-                        }
1625
-                    }
1626
-                }
1627
-                if (!empty($links)) {
1628
-                    // order alphabetically
1629
-                    ksort($links,SORT_STRING);
1551
+	// check we have the post value
1552
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1553
+	else{ global $post;}
1554
+
1555
+	if(!is_array($cf) && $cf!=''){
1556
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1557
+		if(!$cf){return NULL;}
1558
+	}
1559
+
1560
+	$html_var = $cf['htmlvar_name'];
1561
+
1562
+	// Check if there is a location specific filter.
1563
+	if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1564
+		/**
1565
+		 * Filter the taxonomy html by location.
1566
+		 *
1567
+		 * @param string $html The html to filter.
1568
+		 * @param array $cf The custom field array.
1569
+		 * @since 1.6.6
1570
+		 */
1571
+		$html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1572
+	}
1573
+
1574
+	// Check if there is a custom field specific filter.
1575
+	if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1576
+		/**
1577
+		 * Filter the taxonomy html by individual custom field.
1578
+		 *
1579
+		 * @param string $html The html to filter.
1580
+		 * @param string $location The location to output the html.
1581
+		 * @param array $cf The custom field array.
1582
+		 * @since 1.6.6
1583
+		 */
1584
+		$html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1585
+	}
1586
+
1587
+	// Check if there is a custom field key specific filter.
1588
+	if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1589
+		/**
1590
+		 * Filter the taxonomy html by field type key.
1591
+		 *
1592
+		 * @param string $html The html to filter.
1593
+		 * @param string $location The location to output the html.
1594
+		 * @param array $cf The custom field array.
1595
+		 * @since 1.6.6
1596
+		 */
1597
+		$html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1598
+	}
1599
+
1600
+	// If not html then we run the standard output.
1601
+	if(empty($html)){
1602
+
1603
+		if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1604
+			$post_taxonomy = $post->post_type . 'category';
1605
+			$field_value = $post->{$html_var};
1606
+			$links = array();
1607
+			$terms = array();
1608
+			$termsOrdered = array();
1609
+			if (!is_array($field_value)) {
1610
+				$field_value = explode(",", trim($field_value, ","));
1611
+			}
1612
+
1613
+			$field_value = array_unique($field_value);
1614
+
1615
+			if (!empty($field_value)) {
1616
+				foreach ($field_value as $term) {
1617
+					$term = trim($term);
1618
+
1619
+					if ($term != '') {
1620
+						$term = get_term_by('id', $term, $html_var);
1621
+						if (is_object($term)) {
1622
+							$links[$term->slug] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1623
+							$terms[$term->slug] = $term;
1624
+						}
1625
+					}
1626
+				}
1627
+				if (!empty($links)) {
1628
+					// order alphabetically
1629
+					ksort($links,SORT_STRING);
1630 1630
 //                    print_r($links);
1631
-                    foreach (array_keys($links) as $key) {
1632
-                        $termsOrdered[$key] = $terms[$key];
1633
-                    }
1634
-                    $terms = $termsOrdered;
1635
-                }
1636
-            }
1631
+					foreach (array_keys($links) as $key) {
1632
+						$termsOrdered[$key] = $terms[$key];
1633
+					}
1634
+					$terms = $termsOrdered;
1635
+				}
1636
+			}
1637 1637
 
1638 1638
 //            print_r($terms);
1639 1639
 
1640
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1640
+			$html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1641 1641
 
1642
-            if ($html_value != '') {
1643
-                $field_icon = geodir_field_icon_proccess($cf);
1644
-                if (strpos($field_icon, 'http') !== false) {
1645
-                    $field_icon_af = '';
1646
-                } else if ($field_icon == '') {
1647
-                    $field_icon_af = '';
1648
-                } else {
1649
-                    $field_icon_af = $field_icon;
1650
-                    $field_icon = '';
1651
-                }
1642
+			if ($html_value != '') {
1643
+				$field_icon = geodir_field_icon_proccess($cf);
1644
+				if (strpos($field_icon, 'http') !== false) {
1645
+					$field_icon_af = '';
1646
+				} else if ($field_icon == '') {
1647
+					$field_icon_af = '';
1648
+				} else {
1649
+					$field_icon_af = $field_icon;
1650
+					$field_icon = '';
1651
+				}
1652 1652
 
1653
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1654
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1655
-                $html .= '</span> ' . $html_value . '</div>';
1656
-            }
1657
-        }
1653
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1654
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1655
+				$html .= '</span> ' . $html_value . '</div>';
1656
+			}
1657
+		}
1658 1658
 
1659
-    }
1659
+	}
1660 1660
 
1661
-    return $html;
1661
+	return $html;
1662 1662
 }
1663 1663
 add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1664 1664
 
@@ -1676,176 +1676,176 @@  discard block
 block discarded – undo
1676 1676
  */
1677 1677
 function geodir_cf_address($html,$location,$cf,$p=''){
1678 1678
 
1679
-    // check we have the post value
1680
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1681
-    else{ global $post;}
1682
-
1683
-    if(!is_array($cf) && $cf!=''){
1684
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1685
-        if(!$cf){return NULL;}
1686
-    }
1687
-
1688
-    $html_var = $cf['htmlvar_name'];
1689
-
1690
-    // Check if there is a location specific filter.
1691
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1692
-        /**
1693
-         * Filter the address html by location.
1694
-         *
1695
-         * @param string $html The html to filter.
1696
-         * @param array $cf The custom field array.
1697
-         * @since 1.6.6
1698
-         */
1699
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1700
-    }
1701
-
1702
-    // Check if there is a custom field specific filter.
1703
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1704
-        /**
1705
-         * Filter the address html by individual custom field.
1706
-         *
1707
-         * @param string $html The html to filter.
1708
-         * @param string $location The location to output the html.
1709
-         * @param array $cf The custom field array.
1710
-         * @since 1.6.6
1711
-         */
1712
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1713
-    }
1714
-
1715
-    // Check if there is a custom field key specific filter.
1716
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1717
-        /**
1718
-         * Filter the address html by field type key.
1719
-         *
1720
-         * @param string $html The html to filter.
1721
-         * @param string $location The location to output the html.
1722
-         * @param array $cf The custom field array.
1723
-         * @since 1.6.6
1724
-         */
1725
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1726
-    }
1727
-
1728
-    // If not html then we run the standard output.
1729
-    if(empty($html)){
1730
-
1731
-        global $preview;
1732
-        $html_var = $cf['htmlvar_name'] . '_address';
1733
-
1734
-        if ($cf['extra_fields']) {
1735
-
1736
-            $extra_fields = stripslashes_deep(unserialize($cf['extra_fields']));
1737
-
1738
-            $addition_fields = '';
1739
-
1740
-            if (!empty($extra_fields)) {
1741
-
1742
-                $show_city_in_address = false;
1743
-                if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1744
-                    $show_city_in_address = true;
1745
-                }
1746
-                /**
1747
-                 * Filter "show city in address" value.
1748
-                 *
1749
-                 * @since 1.0.0
1750
-                 */
1751
-                $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1752
-
1753
-
1754
-                $show_region_in_address = false;
1755
-                if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1756
-                    $show_region_in_address = true;
1757
-                }
1758
-                /**
1759
-                 * Filter "show region in address" value.
1760
-                 *
1761
-                 * @since 1.6.6
1762
-                 */
1763
-                $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1764
-
1765
-                $show_country_in_address = false;
1766
-                if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1767
-                    $show_country_in_address = true;
1768
-                }
1769
-                /**
1770
-                 * Filter "show country in address" value.
1771
-                 *
1772
-                 * @since 1.6.6
1773
-                 */
1774
-                $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1775
-
1776
-                $show_zip_in_address = false;
1777
-                if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1778
-                    $show_zip_in_address = true;
1779
-                }
1780
-                /**
1781
-                 * Filter "show zip in address" value.
1782
-                 *
1783
-                 * @since 1.6.6
1784
-                 */
1785
-                $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1786
-
1787
-
1788
-            }
1789
-
1790
-        }
1791
-
1792
-
1793
-        if ($post->{$html_var}) {
1794
-
1795
-            $field_icon = geodir_field_icon_proccess( $cf );
1796
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1797
-                $field_icon_af = '';
1798
-            } elseif ( $field_icon == '' ) {
1799
-                $field_icon_af = '<i class="fas fa-home"></i>';
1800
-            } else {
1801
-                $field_icon_af = $field_icon;
1802
-                $field_icon    = '';
1803
-            }
1679
+	// check we have the post value
1680
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1681
+	else{ global $post;}
1682
+
1683
+	if(!is_array($cf) && $cf!=''){
1684
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1685
+		if(!$cf){return NULL;}
1686
+	}
1687
+
1688
+	$html_var = $cf['htmlvar_name'];
1689
+
1690
+	// Check if there is a location specific filter.
1691
+	if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1692
+		/**
1693
+		 * Filter the address html by location.
1694
+		 *
1695
+		 * @param string $html The html to filter.
1696
+		 * @param array $cf The custom field array.
1697
+		 * @since 1.6.6
1698
+		 */
1699
+		$html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1700
+	}
1701
+
1702
+	// Check if there is a custom field specific filter.
1703
+	if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1704
+		/**
1705
+		 * Filter the address html by individual custom field.
1706
+		 *
1707
+		 * @param string $html The html to filter.
1708
+		 * @param string $location The location to output the html.
1709
+		 * @param array $cf The custom field array.
1710
+		 * @since 1.6.6
1711
+		 */
1712
+		$html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1713
+	}
1714
+
1715
+	// Check if there is a custom field key specific filter.
1716
+	if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1717
+		/**
1718
+		 * Filter the address html by field type key.
1719
+		 *
1720
+		 * @param string $html The html to filter.
1721
+		 * @param string $location The location to output the html.
1722
+		 * @param array $cf The custom field array.
1723
+		 * @since 1.6.6
1724
+		 */
1725
+		$html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1726
+	}
1727
+
1728
+	// If not html then we run the standard output.
1729
+	if(empty($html)){
1730
+
1731
+		global $preview;
1732
+		$html_var = $cf['htmlvar_name'] . '_address';
1733
+
1734
+		if ($cf['extra_fields']) {
1735
+
1736
+			$extra_fields = stripslashes_deep(unserialize($cf['extra_fields']));
1737
+
1738
+			$addition_fields = '';
1739
+
1740
+			if (!empty($extra_fields)) {
1741
+
1742
+				$show_city_in_address = false;
1743
+				if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1744
+					$show_city_in_address = true;
1745
+				}
1746
+				/**
1747
+				 * Filter "show city in address" value.
1748
+				 *
1749
+				 * @since 1.0.0
1750
+				 */
1751
+				$show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1752
+
1753
+
1754
+				$show_region_in_address = false;
1755
+				if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1756
+					$show_region_in_address = true;
1757
+				}
1758
+				/**
1759
+				 * Filter "show region in address" value.
1760
+				 *
1761
+				 * @since 1.6.6
1762
+				 */
1763
+				$show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1764
+
1765
+				$show_country_in_address = false;
1766
+				if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1767
+					$show_country_in_address = true;
1768
+				}
1769
+				/**
1770
+				 * Filter "show country in address" value.
1771
+				 *
1772
+				 * @since 1.6.6
1773
+				 */
1774
+				$show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1775
+
1776
+				$show_zip_in_address = false;
1777
+				if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1778
+					$show_zip_in_address = true;
1779
+				}
1780
+				/**
1781
+				 * Filter "show zip in address" value.
1782
+				 *
1783
+				 * @since 1.6.6
1784
+				 */
1785
+				$show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1786
+
1787
+
1788
+			}
1789
+
1790
+		}
1791
+
1792
+
1793
+		if ($post->{$html_var}) {
1794
+
1795
+			$field_icon = geodir_field_icon_proccess( $cf );
1796
+			if ( strpos( $field_icon, 'http' ) !== false ) {
1797
+				$field_icon_af = '';
1798
+			} elseif ( $field_icon == '' ) {
1799
+				$field_icon_af = '<i class="fas fa-home"></i>';
1800
+			} else {
1801
+				$field_icon_af = $field_icon;
1802
+				$field_icon    = '';
1803
+			}
1804 1804
             
1805
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1806
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1807
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1808
-            $html .= '</span>';
1805
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1806
+			$html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1807
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1808
+			$html .= '</span>';
1809 1809
             
1810
-            $address_fields = array();
1811
-
1812
-            if ( isset($post->post_address) ) {
1813
-                $address_fields['post_address'] = '<span itemprop="streetAddress">' . $post->post_address . '</span>';
1814
-            }
1815
-            if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) {
1816
-                $address_fields['post_city'] = '<span itemprop="addressLocality">' . $post->post_city . '</span>';
1817
-            }
1818
-            if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) {
1819
-                $address_fields['post_region'] = '<span itemprop="addressRegion">' . $post->post_region . '</span>';
1820
-            }
1821
-            if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) {
1822
-                $address_fields['post_zip'] = '<span itemprop="postalCode">' . $post->post_zip . '</span>';
1823
-            }
1824
-            if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) {
1825
-                $address_fields['post_country'] = '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span>';
1826
-            }
1810
+			$address_fields = array();
1811
+
1812
+			if ( isset($post->post_address) ) {
1813
+				$address_fields['post_address'] = '<span itemprop="streetAddress">' . $post->post_address . '</span>';
1814
+			}
1815
+			if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) {
1816
+				$address_fields['post_city'] = '<span itemprop="addressLocality">' . $post->post_city . '</span>';
1817
+			}
1818
+			if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) {
1819
+				$address_fields['post_region'] = '<span itemprop="addressRegion">' . $post->post_region . '</span>';
1820
+			}
1821
+			if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) {
1822
+				$address_fields['post_zip'] = '<span itemprop="postalCode">' . $post->post_zip . '</span>';
1823
+			}
1824
+			if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) {
1825
+				$address_fields['post_country'] = '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span>';
1826
+			}
1827 1827
             
1828
-            /**
1829
-             * Filter the address fields array being displayed.
1830
-             *
1831
-             * @param array $address_fields The array of address fields.
1832
-             * @param object $post The current post object.
1833
-             * @param array $cf The custom field array details.
1834
-             * @param string $location The location to output the html.
1835
-             * 
1836
-             * @since 1.6.21
1837
-             */
1838
-            $address_fields = apply_filters('geodir_custom_field_output_address_fields', $address_fields, $post, $cf, $location);
1828
+			/**
1829
+			 * Filter the address fields array being displayed.
1830
+			 *
1831
+			 * @param array $address_fields The array of address fields.
1832
+			 * @param object $post The current post object.
1833
+			 * @param array $cf The custom field array details.
1834
+			 * @param string $location The location to output the html.
1835
+			 * 
1836
+			 * @since 1.6.21
1837
+			 */
1838
+			$address_fields = apply_filters('geodir_custom_field_output_address_fields', $address_fields, $post, $cf, $location);
1839 1839
             
1840
-            if (!empty($address_fields) && is_array($address_fields)) {
1841
-                $address_fields = array_values($address_fields);
1842
-                $html .= implode('<br>', $address_fields);
1843
-            }
1840
+			if (!empty($address_fields) && is_array($address_fields)) {
1841
+				$address_fields = array_values($address_fields);
1842
+				$html .= implode('<br>', $address_fields);
1843
+			}
1844 1844
             
1845
-            $html .= '</div>';
1846
-        }
1847
-    }
1845
+			$html .= '</div>';
1846
+		}
1847
+	}
1848 1848
 
1849
-    return $html;
1849
+	return $html;
1850 1850
 }
1851 1851
 add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1852 1852
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +305 added lines, -305 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return string The html to output for the custom field.
21 21
  */
22
-function geodir_cf_checkbox($html,$location,$cf,$p=''){
22
+function geodir_cf_checkbox($html, $location, $cf, $p = '') {
23 23
 
24 24
     // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
25
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
26
+    else { global $post; }
27 27
 
28
-    if(!is_array($cf) && $cf!=''){
28
+    if (!is_array($cf) && $cf != '') {
29 29
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
30
+        if (!$cf) {return NULL; }
31 31
     }
32 32
 
33 33
     $html_var = $cf['htmlvar_name'];
34 34
 
35 35
     // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
36
+    if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) {
37 37
         /**
38 38
          * Filter the checkbox html by location.
39 39
          *
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
          * @param array $cf The custom field array.
42 42
          * @since 1.6.6
43 43
          */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
44
+        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf);
45 45
     }
46 46
 
47 47
     // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
48
+    if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) {
49 49
         /**
50 50
          * Filter the checkbox html by individual custom field.
51 51
          *
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
          * @param array $cf The custom field array.
55 55
          * @since 1.6.6
56 56
          */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
57
+        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf);
58 58
     }
59 59
 
60 60
     // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
61
+    if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) {
62 62
         /**
63 63
          * Filter the checkbox html by field type key.
64 64
          *
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
          * @param array $cf The custom field array.
68 68
          * @since 1.6.6
69 69
          */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
70
+        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf);
71 71
     }
72 72
 
73 73
     // If not html then we run the standard output.
74
-    if(empty($html)){
74
+    if (empty($html)) {
75 75
 
76
-        if ( (int) $post->{$html_var} == 1 ):
76
+        if ((int) $post->{$html_var} == 1):
77 77
 
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
78
+            if ($post->{$html_var} == '1'):
79
+                $html_val = __('Yes', 'geodirectory');
80 80
             else:
81
-                $html_val = __( 'No', 'geodirectory' );
81
+                $html_val = __('No', 'geodirectory');
82 82
             endif;
83 83
 
84 84
             $field_icon = geodir_field_icon_proccess($cf);
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
                 $field_icon = '';
92 92
             }
93 93
 
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
94
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
95
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
96
+            $html .= '</span>'.$html_val.'</div>';
97 97
         endif;
98 98
 
99 99
     }
100 100
 
101 101
     return $html;
102 102
 }
103
-add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
103
+add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3);
104 104
 
105 105
 
106 106
 /**
@@ -113,21 +113,21 @@  discard block
 block discarded – undo
113 113
  *
114 114
  * @return string The html to output for the custom field.
115 115
  */
116
-function geodir_cf_fieldset($html,$location,$cf,$p=''){
116
+function geodir_cf_fieldset($html, $location, $cf, $p = '') {
117 117
 
118 118
     // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
119
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
120
+    else { global $post; }
121 121
 
122
-    if(!is_array($cf) && $cf!=''){
122
+    if (!is_array($cf) && $cf != '') {
123 123
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
124
+        if (!$cf) {return NULL; }
125 125
     }
126 126
 
127 127
     $html_var = $cf['htmlvar_name'];
128 128
 
129 129
     // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
130
+    if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) {
131 131
         /**
132 132
          * Filter the fieldset html by location.
133 133
          *
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
          * @param array $cf The custom field array.
136 136
          * @since 1.6.6
137 137
          */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
138
+        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf);
139 139
     }
140 140
 
141 141
     // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
142
+    if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) {
143 143
         /**
144 144
          * Filter the fieldset html by individual custom field.
145 145
          *
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
          * @param array $cf The custom field array.
149 149
          * @since 1.6.6
150 150
          */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
151
+        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf);
152 152
     }
153 153
 
154 154
     // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
155
+    if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) {
156 156
         /**
157 157
          * Filter the fieldset html by field type key.
158 158
          *
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
          * @param array $cf The custom field array.
162 162
          * @since 1.6.6
163 163
          */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
164
+        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf);
165 165
     }
166 166
 
167 167
     // If not html then we run the standard output.
168
-    if(empty($html)){
168
+    if (empty($html)) {
169 169
 
170 170
         global $field_set_start;
171 171
         $fieldset_class = 'fieldset-'.sanitize_html_class(sanitize_title_with_dashes($cf['site_title']));
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         if ($field_set_start == 1) {
174 174
             $html = '';
175 175
         } else {
176
-            $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
176
+            $html = '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>';
177 177
             //$field_set_start = 1;
178 178
         }
179 179
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
     return $html;
183 183
 }
184
-add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
184
+add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3);
185 185
 
186 186
 
187 187
 /**
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
  *
195 195
  * @return string The html to output for the custom field.
196 196
  */
197
-function geodir_cf_url($html,$location,$cf,$p=''){
197
+function geodir_cf_url($html, $location, $cf, $p = '') {
198 198
 
199 199
     // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
200
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
201
+    else { global $post; }
202 202
 
203
-    if(!is_array($cf) && $cf!=''){
203
+    if (!is_array($cf) && $cf != '') {
204 204
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
205
+        if (!$cf) {return NULL; }
206 206
     }
207 207
 
208 208
     $html_var = $cf['htmlvar_name'];
209 209
 
210 210
     // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
211
+    if (has_filter("geodir_custom_field_output_url_loc_{$location}")) {
212 212
         /**
213 213
          * Filter the url html by location.
214 214
          *
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
          * @param array $cf The custom field array.
217 217
          * @since 1.6.6
218 218
          */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
219
+        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf);
220 220
     }
221 221
 
222 222
     // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
223
+    if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) {
224 224
         /**
225 225
          * Filter the url html by individual custom field.
226 226
          *
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
          * @param array $cf The custom field array.
230 230
          * @since 1.6.6
231 231
          */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
232
+        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf);
233 233
     }
234 234
 
235 235
     // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
236
+    if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) {
237 237
         /**
238 238
          * Filter the url html by field type key.
239 239
          *
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
          * @param array $cf The custom field array.
243 243
          * @since 1.6.6
244 244
          */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
245
+        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf);
246 246
     }
247 247
 
248 248
     // If not html then we run the standard output.
249
-    if(empty($html)){
249
+    if (empty($html)) {
250 250
 
251 251
         if ($post->{$cf['htmlvar_name']}):
252 252
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
             $website = !empty($a_url['url']) ? $a_url['url'] : '';
275 275
             $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
276
+            if (!empty($cf['default_value'])) {$title = $cf['default_value']; }
277 277
             $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278 278
 
279 279
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
              * @param string $website Website URL.
290 290
              * @param int $post->ID Post ID.
291 291
              */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
292
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
293 293
 
294 294
         endif;
295 295
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
     return $html;
299 299
 }
300
-add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
300
+add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3);
301 301
 
302 302
 
303 303
 /**
@@ -310,21 +310,21 @@  discard block
 block discarded – undo
310 310
  *
311 311
  * @return string The html to output for the custom field.
312 312
  */
313
-function geodir_cf_phone($html,$location,$cf,$p=''){
313
+function geodir_cf_phone($html, $location, $cf, $p = '') {
314 314
 
315 315
     // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
316
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
317
+    else { global $post; }
318 318
 
319
-    if(!is_array($cf) && $cf!=''){
319
+    if (!is_array($cf) && $cf != '') {
320 320
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
321
+        if (!$cf) {return NULL; }
322 322
     }
323 323
 
324 324
     $html_var = $cf['htmlvar_name'];
325 325
 
326 326
     // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
327
+    if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) {
328 328
         /**
329 329
          * Filter the phone html by location.
330 330
          *
@@ -332,11 +332,11 @@  discard block
 block discarded – undo
332 332
          * @param array $cf The custom field array.
333 333
          * @since 1.6.6
334 334
          */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
335
+        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf);
336 336
     }
337 337
 
338 338
     // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
339
+    if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) {
340 340
         /**
341 341
          * Filter the phone html by individual custom field.
342 342
          *
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
          * @param array $cf The custom field array.
346 346
          * @since 1.6.6
347 347
          */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
348
+        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf);
349 349
     }
350 350
 
351 351
     // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
352
+    if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) {
353 353
         /**
354 354
          * Filter the phone html by field type key.
355 355
          *
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
          * @param array $cf The custom field array.
359 359
          * @since 1.6.6
360 360
          */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
361
+        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf);
362 362
     }
363 363
 
364 364
     // If not html then we run the standard output.
365
-    if(empty($html)){
365
+    if (empty($html)) {
366 366
 
367 367
         if ($post->{$cf['htmlvar_name']}):
368 368
 
@@ -377,9 +377,9 @@  discard block
 block discarded – undo
377 377
             }
378 378
 
379 379
 
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
380
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af.
381
+                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
382
+            $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>';
383 383
 
384 384
         endif;
385 385
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     return $html;
389 389
 }
390
-add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
390
+add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3);
391 391
 
392 392
 
393 393
 /**
@@ -400,21 +400,21 @@  discard block
 block discarded – undo
400 400
  *
401 401
  * @return string The html to output for the custom field.
402 402
  */
403
-function geodir_cf_time($html,$location,$cf,$p=''){
403
+function geodir_cf_time($html, $location, $cf, $p = '') {
404 404
 
405 405
     // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
406
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
407
+    else { global $post; }
408 408
 
409
-    if(!is_array($cf) && $cf!=''){
409
+    if (!is_array($cf) && $cf != '') {
410 410
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
411
+        if (!$cf) {return NULL; }
412 412
     }
413 413
 
414 414
     $html_var = $cf['htmlvar_name'];
415 415
 
416 416
     // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
417
+    if (has_filter("geodir_custom_field_output_time_loc_{$location}")) {
418 418
         /**
419 419
          * Filter the time html by location.
420 420
          *
@@ -422,11 +422,11 @@  discard block
 block discarded – undo
422 422
          * @param array $cf The custom field array.
423 423
          * @since 1.6.6
424 424
          */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
425
+        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf);
426 426
     }
427 427
 
428 428
     // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
429
+    if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) {
430 430
         /**
431 431
          * Filter the time html by individual custom field.
432 432
          *
@@ -435,11 +435,11 @@  discard block
 block discarded – undo
435 435
          * @param array $cf The custom field array.
436 436
          * @since 1.6.6
437 437
          */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
438
+        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf);
439 439
     }
440 440
 
441 441
     // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
442
+    if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) {
443 443
         /**
444 444
          * Filter the time html by field type key.
445 445
          *
@@ -448,11 +448,11 @@  discard block
 block discarded – undo
448 448
          * @param array $cf The custom field array.
449 449
          * @since 1.6.6
450 450
          */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
451
+        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf);
452 452
     }
453 453
 
454 454
     // If not html then we run the standard output.
455
-    if(empty($html)){
455
+    if (empty($html)) {
456 456
 
457 457
         if ($post->{$cf['htmlvar_name']}):
458 458
 
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
             }
473 473
 
474 474
 
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
475
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
476
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
477
+            $html .= '</span>'.$value.'</div>';
478 478
 
479 479
         endif;
480 480
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 
483 483
     return $html;
484 484
 }
485
-add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
485
+add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3);
486 486
 
487 487
 
488 488
 /**
@@ -495,21 +495,21 @@  discard block
 block discarded – undo
495 495
  *
496 496
  * @return string The html to output for the custom field.
497 497
  */
498
-function geodir_cf_datepicker($html,$location,$cf,$p=''){
498
+function geodir_cf_datepicker($html, $location, $cf, $p = '') {
499 499
     global $preview;
500 500
     // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
501
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
502
+    else { global $post; }
503 503
 
504
-    if(!is_array($cf) && $cf!=''){
504
+    if (!is_array($cf) && $cf != '') {
505 505
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
506
+        if (!$cf) {return NULL; }
507 507
     }
508 508
 
509 509
     $html_var = $cf['htmlvar_name'];
510 510
 
511 511
     // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
512
+    if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) {
513 513
         /**
514 514
          * Filter the datepicker html by location.
515 515
          *
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
          * @param array $cf The custom field array.
518 518
          * @since 1.6.6
519 519
          */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
520
+        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf);
521 521
     }
522 522
 
523 523
     // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
524
+    if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) {
525 525
         /**
526 526
          * Filter the datepicker html by individual custom field.
527 527
          *
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
          * @param array $cf The custom field array.
531 531
          * @since 1.6.6
532 532
          */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
533
+        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf);
534 534
     }
535 535
 
536 536
     // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
537
+    if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) {
538 538
         /**
539 539
          * Filter the datepicker html by field type key.
540 540
          *
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
          * @param array $cf The custom field array.
544 544
          * @since 1.6.6
545 545
          */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
546
+        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf);
547 547
     }
548 548
 
549 549
     // If not html then we run the standard output.
550
-    if(empty($html)){
550
+    if (empty($html)) {
551 551
 
552 552
         if ($post->{$cf['htmlvar_name']}):
553 553
 
@@ -558,24 +558,24 @@  discard block
 block discarded – undo
558 558
             }
559 559
             // check if we need to change the format or not
560 560
             $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
561
+            if ($date_format_len > 5) {// if greater then 4 then it's the old style format.
562 562
 
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
563
+                $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
564
+                $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
565 565
 
566 566
                 $date_format = str_replace($search, $replace, $date_format);
567 567
 
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
568
+                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y') ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+            } else {
570 570
                 $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571 571
             }
572 572
 
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
573
+            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") {
574 574
                 $date_format_from = $preview ? $date_format : 'Y-m-d';
575 575
                 $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576 576
                 //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577 577
                 //$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
-            }else{
578
+            } else {
579 579
                 return '';
580 580
             }
581 581
 
@@ -592,9 +592,9 @@  discard block
 block discarded – undo
592 592
 
593 593
 
594 594
 
595
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
-            $html .= '</span>' . $value . '</div>';
595
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
596
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
597
+            $html .= '</span>'.$value.'</div>';
598 598
 
599 599
         endif;
600 600
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 
603 603
     return $html;
604 604
 }
605
-add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
605
+add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3);
606 606
 
607 607
 
608 608
 /**
@@ -615,21 +615,21 @@  discard block
 block discarded – undo
615 615
  *
616 616
  * @return string The html to output for the custom field.
617 617
  */
618
-function geodir_cf_text($html,$location,$cf,$p=''){
618
+function geodir_cf_text($html, $location, $cf, $p = '') {
619 619
 
620 620
     // check we have the post value
621
-    if(is_int($p)){$post = geodir_get_post_info($p);}
622
-    else{ global $post;}
621
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
622
+    else { global $post; }
623 623
 
624
-    if(!is_array($cf) && $cf!=''){
624
+    if (!is_array($cf) && $cf != '') {
625 625
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
-        if(!$cf){return NULL;}
626
+        if (!$cf) {return NULL; }
627 627
     }
628 628
 
629 629
     $html_var = $cf['htmlvar_name'];
630 630
 
631 631
     // Check if there is a location specific filter.
632
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
632
+    if (has_filter("geodir_custom_field_output_text_loc_{$location}")) {
633 633
         /**
634 634
          * Filter the text html by location.
635 635
          *
@@ -637,11 +637,11 @@  discard block
 block discarded – undo
637 637
          * @param array $cf The custom field array.
638 638
          * @since 1.6.6
639 639
          */
640
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
640
+        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf);
641 641
     }
642 642
 
643 643
     // Check if there is a custom field specific filter.
644
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
644
+    if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) {
645 645
         /**
646 646
          * Filter the text html by individual custom field.
647 647
          *
@@ -650,11 +650,11 @@  discard block
 block discarded – undo
650 650
          * @param array $cf The custom field array.
651 651
          * @since 1.6.6
652 652
          */
653
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
653
+        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf);
654 654
     }
655 655
 
656 656
     // Check if there is a custom field key specific filter.
657
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
657
+    if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) {
658 658
         /**
659 659
          * Filter the text html by field type key.
660 660
          *
@@ -663,15 +663,15 @@  discard block
 block discarded – undo
663 663
          * @param array $cf The custom field array.
664 664
          * @since 1.6.6
665 665
          */
666
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
666
+        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf);
667 667
     }
668 668
 
669 669
     
670 670
 
671 671
     // If not html then we run the standard output.
672
-    if(empty($html)){
672
+    if (empty($html)) {
673 673
 
674
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
674
+        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
675 675
 
676 676
             $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
677 677
 
@@ -686,16 +686,16 @@  discard block
 block discarded – undo
686 686
             }
687 687
 
688 688
 
689
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
689
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af;
690
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
691 691
             $html .= '</span>';
692 692
 
693 693
             $value = $post->{$cf['htmlvar_name']};
694
-            if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){
694
+            if (isset($cf['data_type']) && ($cf['data_type'] == 'INT' || $cf['data_type'] == 'FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']) {
695 695
                 $extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields']));
696
-                if(isset($extra_fields['is_price']) && $extra_fields['is_price']){
697
-                    if(!ceil($value) > 0){return '';}// dont output blank prices
698
-                    $value = geodir_currency_format_number($value,$cf);
696
+                if (isset($extra_fields['is_price']) && $extra_fields['is_price']) {
697
+                    if (!ceil($value) > 0) {return ''; }// dont output blank prices
698
+                    $value = geodir_currency_format_number($value, $cf);
699 699
                 }
700 700
             }
701 701
 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 
710 710
     return $html;
711 711
 }
712
-add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
712
+add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3);
713 713
 
714 714
 
715 715
 /**
@@ -722,21 +722,21 @@  discard block
 block discarded – undo
722 722
  *
723 723
  * @return string The html to output for the custom field.
724 724
  */
725
-function geodir_cf_radio($html,$location,$cf,$p=''){
725
+function geodir_cf_radio($html, $location, $cf, $p = '') {
726 726
 
727 727
     // check we have the post value
728
-    if(is_int($p)){$post = geodir_get_post_info($p);}
729
-    else{ global $post;}
728
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
729
+    else { global $post; }
730 730
 
731
-    if(!is_array($cf) && $cf!=''){
731
+    if (!is_array($cf) && $cf != '') {
732 732
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
733
-        if(!$cf){return NULL;}
733
+        if (!$cf) {return NULL; }
734 734
     }
735 735
 
736 736
     $html_var = $cf['htmlvar_name'];
737 737
 
738 738
     // Check if there is a location specific filter.
739
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
739
+    if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) {
740 740
         /**
741 741
          * Filter the radio html by location.
742 742
          *
@@ -744,11 +744,11 @@  discard block
 block discarded – undo
744 744
          * @param array $cf The custom field array.
745 745
          * @since 1.6.6
746 746
          */
747
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
747
+        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf);
748 748
     }
749 749
 
750 750
     // Check if there is a custom field specific filter.
751
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
751
+    if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) {
752 752
         /**
753 753
          * Filter the radio html by individual custom field.
754 754
          *
@@ -757,11 +757,11 @@  discard block
 block discarded – undo
757 757
          * @param array $cf The custom field array.
758 758
          * @since 1.6.6
759 759
          */
760
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
760
+        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf);
761 761
     }
762 762
 
763 763
     // Check if there is a custom field key specific filter.
764
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
764
+    if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) {
765 765
         /**
766 766
          * Filter the radio html by field type key.
767 767
          *
@@ -770,11 +770,11 @@  discard block
 block discarded – undo
770 770
          * @param array $cf The custom field array.
771 771
          * @since 1.6.6
772 772
          */
773
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
773
+        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf);
774 774
     }
775 775
 
776 776
     // If not html then we run the standard output.
777
-    if(empty($html)){
777
+    if (empty($html)) {
778 778
 
779 779
         $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
780 780
         if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
@@ -808,16 +808,16 @@  discard block
 block discarded – undo
808 808
             }
809 809
 
810 810
 
811
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
812
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
813
-            $html .= '</span>' . $html_val . '</div>';
811
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
812
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
813
+            $html .= '</span>'.$html_val.'</div>';
814 814
         endif;
815 815
 
816 816
     }
817 817
 
818 818
     return $html;
819 819
 }
820
-add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
820
+add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3);
821 821
 
822 822
 
823 823
 /**
@@ -831,21 +831,21 @@  discard block
 block discarded – undo
831 831
  *
832 832
  * @return string The html to output for the custom field.
833 833
  */
834
-function geodir_cf_select($html,$location,$cf,$p=''){
834
+function geodir_cf_select($html, $location, $cf, $p = '') {
835 835
 
836 836
     // check we have the post value
837
-    if(is_int($p)){$post = geodir_get_post_info($p);}
838
-    else{ global $post;}
837
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
838
+    else { global $post; }
839 839
 
840
-    if(!is_array($cf) && $cf!=''){
840
+    if (!is_array($cf) && $cf != '') {
841 841
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
842
-        if(!$cf){return NULL;}
842
+        if (!$cf) {return NULL; }
843 843
     }
844 844
 
845 845
     $html_var = $cf['htmlvar_name'];
846 846
 
847 847
     // Check if there is a location specific filter.
848
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
848
+    if (has_filter("geodir_custom_field_output_select_loc_{$location}")) {
849 849
         /**
850 850
          * Filter the select html by location.
851 851
          *
@@ -853,11 +853,11 @@  discard block
 block discarded – undo
853 853
          * @param array $cf The custom field array.
854 854
          * @since 1.6.6
855 855
          */
856
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
856
+        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf);
857 857
     }
858 858
 
859 859
     // Check if there is a custom field specific filter.
860
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
860
+    if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) {
861 861
         /**
862 862
          * Filter the select html by individual custom field.
863 863
          *
@@ -866,11 +866,11 @@  discard block
 block discarded – undo
866 866
          * @param array $cf The custom field array.
867 867
          * @since 1.6.6
868 868
          */
869
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
869
+        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf);
870 870
     }
871 871
 
872 872
     // Check if there is a custom field key specific filter.
873
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
873
+    if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) {
874 874
         /**
875 875
          * Filter the select html by field type key.
876 876
          *
@@ -879,11 +879,11 @@  discard block
 block discarded – undo
879 879
          * @param array $cf The custom field array.
880 880
          * @since 1.6.6
881 881
          */
882
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
882
+        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf);
883 883
     }
884 884
 
885 885
     // If not html then we run the standard output.
886
-    if(empty($html)){
886
+    if (empty($html)) {
887 887
 
888 888
         if ($post->{$cf['htmlvar_name']}):
889 889
             $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
@@ -911,16 +911,16 @@  discard block
 block discarded – undo
911 911
             }
912 912
 
913 913
 
914
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
915
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
916
-            $html .= '</span>' . $field_value . '</div>';
914
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
915
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
916
+            $html .= '</span>'.$field_value.'</div>';
917 917
         endif;
918 918
 
919 919
     }
920 920
 
921 921
     return $html;
922 922
 }
923
-add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
923
+add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3);
924 924
 
925 925
 
926 926
 /**
@@ -933,21 +933,21 @@  discard block
 block discarded – undo
933 933
  *
934 934
  * @return string The html to output for the custom field.
935 935
  */
936
-function geodir_cf_multiselect($html,$location,$cf,$p=''){
936
+function geodir_cf_multiselect($html, $location, $cf, $p = '') {
937 937
 
938 938
     // check we have the post value
939
-    if(is_int($p)){$post = geodir_get_post_info($p);}
940
-    else{ global $post;}
939
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
940
+    else { global $post; }
941 941
 
942
-    if(!is_array($cf) && $cf!=''){
942
+    if (!is_array($cf) && $cf != '') {
943 943
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
944
-        if(!$cf){return NULL;}
944
+        if (!$cf) {return NULL; }
945 945
     }
946 946
 
947 947
     $html_var = $cf['htmlvar_name'];
948 948
 
949 949
     // Check if there is a location specific filter.
950
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
950
+    if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) {
951 951
         /**
952 952
          * Filter the multiselect html by location.
953 953
          *
@@ -955,11 +955,11 @@  discard block
 block discarded – undo
955 955
          * @param array $cf The custom field array.
956 956
          * @since 1.6.6
957 957
          */
958
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
958
+        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf);
959 959
     }
960 960
 
961 961
     // Check if there is a custom field specific filter.
962
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
962
+    if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) {
963 963
         /**
964 964
          * Filter the multiselect html by individual custom field.
965 965
          *
@@ -968,11 +968,11 @@  discard block
 block discarded – undo
968 968
          * @param array $cf The custom field array.
969 969
          * @since 1.6.6
970 970
          */
971
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
971
+        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf);
972 972
     }
973 973
 
974 974
     // Check if there is a custom field key specific filter.
975
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
975
+    if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) {
976 976
         /**
977 977
          * Filter the multiselect html by field type key.
978 978
          *
@@ -981,11 +981,11 @@  discard block
 block discarded – undo
981 981
          * @param array $cf The custom field array.
982 982
          * @since 1.6.6
983 983
          */
984
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
984
+        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf);
985 985
     }
986 986
 
987 987
     // If not html then we run the standard output.
988
-    if(empty($html)){
988
+    if (empty($html)) {
989 989
 
990 990
 
991 991
         if (!empty($post->{$cf['htmlvar_name']})):
@@ -1006,7 +1006,7 @@  discard block
 block discarded – undo
1006 1006
 
1007 1007
             $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
1008 1008
 
1009
-            if(is_array($field_values)){
1009
+            if (is_array($field_values)) {
1010 1010
                 $field_values = array_map('trim', $field_values);
1011 1011
             }
1012 1012
 
@@ -1024,15 +1024,15 @@  discard block
 block discarded – undo
1024 1024
             }
1025 1025
 
1026 1026
 
1027
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1028
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1027
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1028
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1029 1029
             $html .= '</span>';
1030 1030
 
1031 1031
             if (count($option_values) > 1) {
1032 1032
                 $html .= '<ul>';
1033 1033
 
1034 1034
                 foreach ($option_values as $val) {
1035
-                    $html .= '<li>' . $val . '</li>';
1035
+                    $html .= '<li>'.$val.'</li>';
1036 1036
                 }
1037 1037
 
1038 1038
                 $html .= '</ul>';
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
 
1048 1048
     return $html;
1049 1049
 }
1050
-add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1050
+add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3);
1051 1051
 
1052 1052
 
1053 1053
 /**
@@ -1060,21 +1060,21 @@  discard block
 block discarded – undo
1060 1060
  *
1061 1061
  * @return string The html to output for the custom field.
1062 1062
  */
1063
-function geodir_cf_email($html,$location,$cf,$p=''){
1063
+function geodir_cf_email($html, $location, $cf, $p = '') {
1064 1064
 
1065 1065
     // check we have the post value
1066
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1067
-    else{ global $post;}
1066
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1067
+    else { global $post; }
1068 1068
 
1069
-    if(!is_array($cf) && $cf!=''){
1069
+    if (!is_array($cf) && $cf != '') {
1070 1070
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1071
-        if(!$cf){return NULL;}
1071
+        if (!$cf) {return NULL; }
1072 1072
     }
1073 1073
 
1074 1074
     $html_var = $cf['htmlvar_name'];
1075 1075
 
1076 1076
     // Check if there is a location specific filter.
1077
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1077
+    if (has_filter("geodir_custom_field_output_email_loc_{$location}")) {
1078 1078
         /**
1079 1079
          * Filter the email html by location.
1080 1080
          *
@@ -1082,11 +1082,11 @@  discard block
 block discarded – undo
1082 1082
          * @param array $cf The custom field array.
1083 1083
          * @since 1.6.6
1084 1084
          */
1085
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1085
+        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf);
1086 1086
     }
1087 1087
 
1088 1088
     // Check if there is a custom field specific filter.
1089
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1089
+    if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) {
1090 1090
         /**
1091 1091
          * Filter the email html by individual custom field.
1092 1092
          *
@@ -1095,11 +1095,11 @@  discard block
 block discarded – undo
1095 1095
          * @param array $cf The custom field array.
1096 1096
          * @since 1.6.6
1097 1097
          */
1098
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1098
+        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf);
1099 1099
     }
1100 1100
 
1101 1101
     // Check if there is a custom field key specific filter.
1102
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1102
+    if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) {
1103 1103
         /**
1104 1104
          * Filter the email html by field type key.
1105 1105
          *
@@ -1108,18 +1108,18 @@  discard block
 block discarded – undo
1108 1108
          * @param array $cf The custom field array.
1109 1109
          * @since 1.6.6
1110 1110
          */
1111
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1111
+        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf);
1112 1112
     }
1113 1113
 
1114 1114
     // If not html then we run the standard output.
1115
-    if(empty($html)){
1115
+    if (empty($html)) {
1116 1116
 
1117 1117
         global $preview;
1118 1118
         if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1119 1119
             return ''; // Remove Send Enquiry from listings page
1120 1120
         }
1121 1121
 
1122
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1122
+        $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type);
1123 1123
 
1124 1124
         if ($cf['htmlvar_name'] == 'geodir_email' && $post->{$cf['htmlvar_name']}) {
1125 1125
             $b_send_inquiry = '';
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
             $html = '';
1128 1128
             if (!$preview) {
1129 1129
                 $b_send_inquiry = 'b_send_inquiry';
1130
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1130
+                $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>';
1131 1131
             }
1132 1132
 
1133 1133
             $field_icon = geodir_field_icon_proccess($cf);
@@ -1140,20 +1140,20 @@  discard block
 block discarded – undo
1140 1140
                 $field_icon = '';
1141 1141
             }
1142 1142
 
1143
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1143
+            $html .= '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1144 1144
             $seperator = '';
1145 1145
             if ($post->{$cf['htmlvar_name']}) {
1146 1146
                 $b_send_inquiry_url = apply_filters('b_send_inquiry_url', 'javascript:void(0);');
1147
-                $html .= '<a href="'.$b_send_inquiry_url.'" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1147
+                $html .= '<a href="'.$b_send_inquiry_url.'" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>';
1148 1148
             }
1149 1149
 
1150 1150
             $html .= '</span></div>';
1151 1151
 
1152 1152
 
1153 1153
             if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1154
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1154
+                $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>';
1155 1155
             } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1156
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1156
+                $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>';
1157 1157
             }
1158 1158
 
1159 1159
             /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
@@ -1173,11 +1173,11 @@  discard block
 block discarded – undo
1173 1173
                 }
1174 1174
 
1175 1175
 
1176
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1177
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1176
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1177
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1178 1178
                 $html .= '</span><span class="geodir-email-address-output">';
1179 1179
                 $email = $post->{$cf['htmlvar_name']} ;
1180
-                if($e_split = explode('@',$email)){
1180
+                if ($e_split = explode('@', $email)) {
1181 1181
                     /**
1182 1182
                      * Filter email custom field name output.
1183 1183
                      *
@@ -1186,15 +1186,15 @@  discard block
 block discarded – undo
1186 1186
                      * @param string $email The email string being output.
1187 1187
                      * @param array $cf Custom field variables array.
1188 1188
                      */
1189
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1190
-                    if($location=='mapbubble'){
1191
-                        $html .=  "<a href=\"mailto:$email\">$email_name</a>";
1192
-                    }else{
1193
-                        $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1189
+                    $email_name = apply_filters('geodir_email_field_name_output', $email, $cf);
1190
+                    if ($location == 'mapbubble') {
1191
+                        $html .= "<a href=\"mailto:$email\">$email_name</a>";
1192
+                    } else {
1193
+                        $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1194 1194
                     }
1195 1195
 
1196
-                }else{
1197
-                    $html .=  $email;
1196
+                } else {
1197
+                    $html .= $email;
1198 1198
                 }
1199 1199
                 $html .= '</span></div>';
1200 1200
             }
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
 
1206 1206
     return $html;
1207 1207
 }
1208
-add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1208
+add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3);
1209 1209
 
1210 1210
 
1211 1211
 /**
@@ -1218,21 +1218,21 @@  discard block
 block discarded – undo
1218 1218
  *
1219 1219
  * @return string The html to output for the custom field.
1220 1220
  */
1221
-function geodir_cf_file($html,$location,$cf,$p=''){
1221
+function geodir_cf_file($html, $location, $cf, $p = '') {
1222 1222
 
1223 1223
     // check we have the post value
1224
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1225
-    else{ global $post;}
1224
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1225
+    else { global $post; }
1226 1226
 
1227
-    if(!is_array($cf) && $cf!=''){
1227
+    if (!is_array($cf) && $cf != '') {
1228 1228
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1229
-        if(!$cf){return NULL;}
1229
+        if (!$cf) {return NULL; }
1230 1230
     }
1231 1231
 
1232 1232
     $html_var = $cf['htmlvar_name'];
1233 1233
 
1234 1234
     // Check if there is a location specific filter.
1235
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1235
+    if (has_filter("geodir_custom_field_output_file_loc_{$location}")) {
1236 1236
         /**
1237 1237
          * Filter the file html by location.
1238 1238
          *
@@ -1240,11 +1240,11 @@  discard block
 block discarded – undo
1240 1240
          * @param array $cf The custom field array.
1241 1241
          * @since 1.6.6
1242 1242
          */
1243
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1243
+        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf);
1244 1244
     }
1245 1245
 
1246 1246
     // Check if there is a custom field specific filter.
1247
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1247
+    if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) {
1248 1248
         /**
1249 1249
          * Filter the file html by individual custom field.
1250 1250
          *
@@ -1253,11 +1253,11 @@  discard block
 block discarded – undo
1253 1253
          * @param array $cf The custom field array.
1254 1254
          * @since 1.6.6
1255 1255
          */
1256
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1256
+        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf);
1257 1257
     }
1258 1258
 
1259 1259
     // Check if there is a custom field key specific filter.
1260
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1260
+    if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) {
1261 1261
         /**
1262 1262
          * Filter the file html by field type key.
1263 1263
          *
@@ -1266,11 +1266,11 @@  discard block
 block discarded – undo
1266 1266
          * @param array $cf The custom field array.
1267 1267
          * @since 1.6.6
1268 1268
          */
1269
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1269
+        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf);
1270 1270
     }
1271 1271
 
1272 1272
     // If not html then we run the standard output.
1273
-    if(empty($html)){
1273
+    if (empty($html)) {
1274 1274
 
1275 1275
         if (!empty($post->{$cf['htmlvar_name']})):
1276 1276
 
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
             if (!empty($files)):
1279 1279
 
1280 1280
                 $extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL;
1281
-                $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1281
+                $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
1282 1282
 
1283 1283
                 $file_paths = '';
1284 1284
                 foreach ($files as $file) {
@@ -1316,14 +1316,14 @@  discard block
 block discarded – undo
1316 1316
                             //$file_paths .= '<img src="'.$file.'"  />';	
1317 1317
                             $file_paths .= '</div>';
1318 1318
                         }elseif (in_array($uploaded_file_type, $audio_file_types)) {// if audio
1319
-                            $ext_path = '_' . $html_var . '_';
1319
+                            $ext_path = '_'.$html_var.'_';
1320 1320
                             $filename = explode($ext_path, $filename);
1321 1321
                             $file_paths .= '<span class="gd-audio-name">'.$filename[count($filename) - 1].'</span>';
1322 1322
                             $file_paths .= do_shortcode('[audio src="'.$file.'" ]');
1323 1323
                         } else {
1324
-                            $ext_path = '_' . $html_var . '_';
1324
+                            $ext_path = '_'.$html_var.'_';
1325 1325
                             $filename = explode($ext_path, $filename);
1326
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1326
+                            $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
1327 1327
                         }
1328 1328
                     }
1329 1329
                 }
@@ -1338,11 +1338,11 @@  discard block
 block discarded – undo
1338 1338
                     $field_icon = '';
1339 1339
                 }
1340 1340
 
1341
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1341
+                $html = '<div class="geodir_more_info  '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1342 1342
                 $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1343
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1343
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1344 1344
                 $html .= '</span>';
1345
-                $html .= $file_paths . '</div></div>';
1345
+                $html .= $file_paths.'</div></div>';
1346 1346
 
1347 1347
             endif;
1348 1348
         endif;
@@ -1351,7 +1351,7 @@  discard block
 block discarded – undo
1351 1351
 
1352 1352
     return $html;
1353 1353
 }
1354
-add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1354
+add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3);
1355 1355
 
1356 1356
 
1357 1357
 
@@ -1365,21 +1365,21 @@  discard block
 block discarded – undo
1365 1365
  *
1366 1366
  * @return string The html to output for the custom field.
1367 1367
  */
1368
-function geodir_cf_textarea($html,$location,$cf,$p=''){
1368
+function geodir_cf_textarea($html, $location, $cf, $p = '') {
1369 1369
 
1370 1370
     // check we have the post value
1371
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1372
-    else{ global $post;}
1371
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1372
+    else { global $post; }
1373 1373
 
1374
-    if(!is_array($cf) && $cf!=''){
1374
+    if (!is_array($cf) && $cf != '') {
1375 1375
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1376
-        if(!$cf){return NULL;}
1376
+        if (!$cf) {return NULL; }
1377 1377
     }
1378 1378
 
1379 1379
     $html_var = $cf['htmlvar_name'];
1380 1380
 
1381 1381
     // Check if there is a location specific filter.
1382
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1382
+    if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) {
1383 1383
         /**
1384 1384
          * Filter the textarea html by location.
1385 1385
          *
@@ -1387,11 +1387,11 @@  discard block
 block discarded – undo
1387 1387
          * @param array $cf The custom field array.
1388 1388
          * @since 1.6.6
1389 1389
          */
1390
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1390
+        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf);
1391 1391
     }
1392 1392
 
1393 1393
     // Check if there is a custom field specific filter.
1394
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1394
+    if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) {
1395 1395
         /**
1396 1396
          * Filter the textarea html by individual custom field.
1397 1397
          *
@@ -1400,11 +1400,11 @@  discard block
 block discarded – undo
1400 1400
          * @param array $cf The custom field array.
1401 1401
          * @since 1.6.6
1402 1402
          */
1403
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1403
+        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf);
1404 1404
     }
1405 1405
 
1406 1406
     // Check if there is a custom field key specific filter.
1407
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1407
+    if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) {
1408 1408
         /**
1409 1409
          * Filter the textarea html by field type key.
1410 1410
          *
@@ -1413,11 +1413,11 @@  discard block
 block discarded – undo
1413 1413
          * @param array $cf The custom field array.
1414 1414
          * @since 1.6.6
1415 1415
          */
1416
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1416
+        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf);
1417 1417
     }
1418 1418
 
1419 1419
     // If not html then we run the standard output.
1420
-    if(empty($html)){
1420
+    if (empty($html)) {
1421 1421
 
1422 1422
         if (!empty($post->{$cf['htmlvar_name']})) {
1423 1423
 
@@ -1432,9 +1432,9 @@  discard block
 block discarded – undo
1432 1432
             }
1433 1433
 
1434 1434
 
1435
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1436
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1437
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1435
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1436
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1437
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1438 1438
 
1439 1439
         }
1440 1440
 
@@ -1442,7 +1442,7 @@  discard block
 block discarded – undo
1442 1442
 
1443 1443
     return $html;
1444 1444
 }
1445
-add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1445
+add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3);
1446 1446
 
1447 1447
 
1448 1448
 
@@ -1456,21 +1456,21 @@  discard block
 block discarded – undo
1456 1456
  *
1457 1457
  * @return string The html to output for the custom field.
1458 1458
  */
1459
-function geodir_cf_html($html,$location,$cf,$p=''){
1459
+function geodir_cf_html($html, $location, $cf, $p = '') {
1460 1460
 
1461 1461
     // check we have the post value
1462
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1463
-    else{ global $post;}
1462
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1463
+    else { global $post; }
1464 1464
 
1465
-    if(!is_array($cf) && $cf!=''){
1465
+    if (!is_array($cf) && $cf != '') {
1466 1466
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1467
-        if(!$cf){return NULL;}
1467
+        if (!$cf) {return NULL; }
1468 1468
     }
1469 1469
 
1470 1470
     $html_var = $cf['htmlvar_name'];
1471 1471
 
1472 1472
     // Check if there is a location specific filter.
1473
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1473
+    if (has_filter("geodir_custom_field_output_html_loc_{$location}")) {
1474 1474
         /**
1475 1475
          * Filter the html html by location.
1476 1476
          *
@@ -1478,11 +1478,11 @@  discard block
 block discarded – undo
1478 1478
          * @param array $cf The custom field array.
1479 1479
          * @since 1.6.6
1480 1480
          */
1481
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1481
+        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf);
1482 1482
     }
1483 1483
 
1484 1484
     // Check if there is a custom field specific filter.
1485
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1485
+    if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) {
1486 1486
         /**
1487 1487
          * Filter the html html by individual custom field.
1488 1488
          *
@@ -1491,11 +1491,11 @@  discard block
 block discarded – undo
1491 1491
          * @param array $cf The custom field array.
1492 1492
          * @since 1.6.6
1493 1493
          */
1494
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1494
+        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf);
1495 1495
     }
1496 1496
 
1497 1497
     // Check if there is a custom field key specific filter.
1498
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1498
+    if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) {
1499 1499
         /**
1500 1500
          * Filter the html html by field type key.
1501 1501
          *
@@ -1504,11 +1504,11 @@  discard block
 block discarded – undo
1504 1504
          * @param array $cf The custom field array.
1505 1505
          * @since 1.6.6
1506 1506
          */
1507
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1507
+        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf);
1508 1508
     }
1509 1509
 
1510 1510
     // If not html then we run the standard output.
1511
-    if(empty($html)){
1511
+    if (empty($html)) {
1512 1512
 
1513 1513
         if (!empty($post->{$cf['htmlvar_name']})) {
1514 1514
 
@@ -1522,9 +1522,9 @@  discard block
 block discarded – undo
1522 1522
                 $field_icon = '';
1523 1523
             }
1524 1524
 
1525
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1526
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1527
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1525
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1526
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1527
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1528 1528
 
1529 1529
         }
1530 1530
 
@@ -1532,7 +1532,7 @@  discard block
 block discarded – undo
1532 1532
 
1533 1533
     return $html;
1534 1534
 }
1535
-add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1535
+add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3);
1536 1536
 
1537 1537
 
1538 1538
 
@@ -1546,21 +1546,21 @@  discard block
 block discarded – undo
1546 1546
  *
1547 1547
  * @return string The html to output for the custom field.
1548 1548
  */
1549
-function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1549
+function geodir_cf_taxonomy($html, $location, $cf, $p = '') {
1550 1550
 
1551 1551
     // check we have the post value
1552
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1553
-    else{ global $post;}
1552
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1553
+    else { global $post; }
1554 1554
 
1555
-    if(!is_array($cf) && $cf!=''){
1555
+    if (!is_array($cf) && $cf != '') {
1556 1556
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1557
-        if(!$cf){return NULL;}
1557
+        if (!$cf) {return NULL; }
1558 1558
     }
1559 1559
 
1560 1560
     $html_var = $cf['htmlvar_name'];
1561 1561
 
1562 1562
     // Check if there is a location specific filter.
1563
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1563
+    if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) {
1564 1564
         /**
1565 1565
          * Filter the taxonomy html by location.
1566 1566
          *
@@ -1568,11 +1568,11 @@  discard block
 block discarded – undo
1568 1568
          * @param array $cf The custom field array.
1569 1569
          * @since 1.6.6
1570 1570
          */
1571
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1571
+        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf);
1572 1572
     }
1573 1573
 
1574 1574
     // Check if there is a custom field specific filter.
1575
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1575
+    if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) {
1576 1576
         /**
1577 1577
          * Filter the taxonomy html by individual custom field.
1578 1578
          *
@@ -1581,11 +1581,11 @@  discard block
 block discarded – undo
1581 1581
          * @param array $cf The custom field array.
1582 1582
          * @since 1.6.6
1583 1583
          */
1584
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1584
+        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf);
1585 1585
     }
1586 1586
 
1587 1587
     // Check if there is a custom field key specific filter.
1588
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1588
+    if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) {
1589 1589
         /**
1590 1590
          * Filter the taxonomy html by field type key.
1591 1591
          *
@@ -1594,14 +1594,14 @@  discard block
 block discarded – undo
1594 1594
          * @param array $cf The custom field array.
1595 1595
          * @since 1.6.6
1596 1596
          */
1597
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1597
+        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf);
1598 1598
     }
1599 1599
 
1600 1600
     // If not html then we run the standard output.
1601
-    if(empty($html)){
1601
+    if (empty($html)) {
1602 1602
 
1603
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1604
-            $post_taxonomy = $post->post_type . 'category';
1603
+        if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) {
1604
+            $post_taxonomy = $post->post_type.'category';
1605 1605
             $field_value = $post->{$html_var};
1606 1606
             $links = array();
1607 1607
             $terms = array();
@@ -1619,14 +1619,14 @@  discard block
 block discarded – undo
1619 1619
                     if ($term != '') {
1620 1620
                         $term = get_term_by('id', $term, $html_var);
1621 1621
                         if (is_object($term)) {
1622
-                            $links[$term->slug] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1622
+                            $links[$term->slug] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>";
1623 1623
                             $terms[$term->slug] = $term;
1624 1624
                         }
1625 1625
                     }
1626 1626
                 }
1627 1627
                 if (!empty($links)) {
1628 1628
                     // order alphabetically
1629
-                    ksort($links,SORT_STRING);
1629
+                    ksort($links, SORT_STRING);
1630 1630
 //                    print_r($links);
1631 1631
                     foreach (array_keys($links) as $key) {
1632 1632
                         $termsOrdered[$key] = $terms[$key];
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 
1638 1638
 //            print_r($terms);
1639 1639
 
1640
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1640
+            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : '';
1641 1641
 
1642 1642
             if ($html_value != '') {
1643 1643
                 $field_icon = geodir_field_icon_proccess($cf);
@@ -1650,9 +1650,9 @@  discard block
 block discarded – undo
1650 1650
                     $field_icon = '';
1651 1651
                 }
1652 1652
 
1653
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1654
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1655
-                $html .= '</span> ' . $html_value . '</div>';
1653
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af;
1654
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1655
+                $html .= '</span> '.$html_value.'</div>';
1656 1656
             }
1657 1657
         }
1658 1658
 
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 
1661 1661
     return $html;
1662 1662
 }
1663
-add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1663
+add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3);
1664 1664
 
1665 1665
 
1666 1666
 /**
@@ -1674,21 +1674,21 @@  discard block
 block discarded – undo
1674 1674
  *
1675 1675
  * @return string The html to output for the custom field.
1676 1676
  */
1677
-function geodir_cf_address($html,$location,$cf,$p=''){
1677
+function geodir_cf_address($html, $location, $cf, $p = '') {
1678 1678
 
1679 1679
     // check we have the post value
1680
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1681
-    else{ global $post;}
1680
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1681
+    else { global $post; }
1682 1682
 
1683
-    if(!is_array($cf) && $cf!=''){
1683
+    if (!is_array($cf) && $cf != '') {
1684 1684
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1685
-        if(!$cf){return NULL;}
1685
+        if (!$cf) {return NULL; }
1686 1686
     }
1687 1687
 
1688 1688
     $html_var = $cf['htmlvar_name'];
1689 1689
 
1690 1690
     // Check if there is a location specific filter.
1691
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1691
+    if (has_filter("geodir_custom_field_output_address_loc_{$location}")) {
1692 1692
         /**
1693 1693
          * Filter the address html by location.
1694 1694
          *
@@ -1696,11 +1696,11 @@  discard block
 block discarded – undo
1696 1696
          * @param array $cf The custom field array.
1697 1697
          * @since 1.6.6
1698 1698
          */
1699
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1699
+        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf);
1700 1700
     }
1701 1701
 
1702 1702
     // Check if there is a custom field specific filter.
1703
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1703
+    if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) {
1704 1704
         /**
1705 1705
          * Filter the address html by individual custom field.
1706 1706
          *
@@ -1709,11 +1709,11 @@  discard block
 block discarded – undo
1709 1709
          * @param array $cf The custom field array.
1710 1710
          * @since 1.6.6
1711 1711
          */
1712
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1712
+        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf);
1713 1713
     }
1714 1714
 
1715 1715
     // Check if there is a custom field key specific filter.
1716
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1716
+    if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) {
1717 1717
         /**
1718 1718
          * Filter the address html by field type key.
1719 1719
          *
@@ -1722,14 +1722,14 @@  discard block
 block discarded – undo
1722 1722
          * @param array $cf The custom field array.
1723 1723
          * @since 1.6.6
1724 1724
          */
1725
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1725
+        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf);
1726 1726
     }
1727 1727
 
1728 1728
     // If not html then we run the standard output.
1729
-    if(empty($html)){
1729
+    if (empty($html)) {
1730 1730
 
1731 1731
         global $preview;
1732
-        $html_var = $cf['htmlvar_name'] . '_address';
1732
+        $html_var = $cf['htmlvar_name'].'_address';
1733 1733
 
1734 1734
         if ($cf['extra_fields']) {
1735 1735
 
@@ -1792,37 +1792,37 @@  discard block
 block discarded – undo
1792 1792
 
1793 1793
         if ($post->{$html_var}) {
1794 1794
 
1795
-            $field_icon = geodir_field_icon_proccess( $cf );
1796
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1795
+            $field_icon = geodir_field_icon_proccess($cf);
1796
+            if (strpos($field_icon, 'http') !== false) {
1797 1797
                 $field_icon_af = '';
1798
-            } elseif ( $field_icon == '' ) {
1798
+            } elseif ($field_icon == '') {
1799 1799
                 $field_icon_af = '<i class="fas fa-home"></i>';
1800 1800
             } else {
1801 1801
                 $field_icon_af = $field_icon;
1802 1802
                 $field_icon    = '';
1803 1803
             }
1804 1804
             
1805
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1806
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1807
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1805
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1806
+            $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af;
1807
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
1808 1808
             $html .= '</span>';
1809 1809
             
1810 1810
             $address_fields = array();
1811 1811
 
1812
-            if ( isset($post->post_address) ) {
1813
-                $address_fields['post_address'] = '<span itemprop="streetAddress">' . $post->post_address . '</span>';
1812
+            if (isset($post->post_address)) {
1813
+                $address_fields['post_address'] = '<span itemprop="streetAddress">'.$post->post_address.'</span>';
1814 1814
             }
1815
-            if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) {
1816
-                $address_fields['post_city'] = '<span itemprop="addressLocality">' . $post->post_city . '</span>';
1815
+            if ($show_city_in_address && isset($post->post_city) && $post->post_city) {
1816
+                $address_fields['post_city'] = '<span itemprop="addressLocality">'.$post->post_city.'</span>';
1817 1817
             }
1818
-            if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) {
1819
-                $address_fields['post_region'] = '<span itemprop="addressRegion">' . $post->post_region . '</span>';
1818
+            if ($show_region_in_address && isset($post->post_region) && $post->post_region) {
1819
+                $address_fields['post_region'] = '<span itemprop="addressRegion">'.$post->post_region.'</span>';
1820 1820
             }
1821
-            if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) {
1822
-                $address_fields['post_zip'] = '<span itemprop="postalCode">' . $post->post_zip . '</span>';
1821
+            if ($show_zip_in_address && isset($post->post_zip) && $post->post_zip) {
1822
+                $address_fields['post_zip'] = '<span itemprop="postalCode">'.$post->post_zip.'</span>';
1823 1823
             }
1824
-            if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) {
1825
-                $address_fields['post_country'] = '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span>';
1824
+            if ($show_country_in_address && isset($post->post_country) && $post->post_country) {
1825
+                $address_fields['post_country'] = '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span>';
1826 1826
             }
1827 1827
             
1828 1828
             /**
@@ -1848,4 +1848,4 @@  discard block
 block discarded – undo
1848 1848
 
1849 1849
     return $html;
1850 1850
 }
1851
-add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1852 1851
\ No newline at end of file
1852
+add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3);
1853 1853
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_actions.php 1 patch
Indentation   +1836 added lines, -1836 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
+		}
1027
+
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 1094
 
1095
-    if (!empty($post_images)) {
1096
-        ?>
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;
1266
-
1267
-        }
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;
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 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>';
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);
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);
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;
1543
-
1544
-    $gd_post_type = geodir_get_current_posttype();
1545
-    $post_type_info = get_post_type_object($gd_post_type);
1542
+	global $wp, $term;
1546 1543
 
1547
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1548
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1549
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1550
-    }
1544
+	$gd_post_type = geodir_get_current_posttype();
1545
+	$post_type_info = get_post_type_object($gd_post_type);
1551 1546
 
1552
-    $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1553
-    $single_name = $post_type_info->labels->singular_name;
1547
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1548
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1549
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1550
+	}
1554 1551
 
1555
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1552
+	$list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory');
1553
+	$single_name = $post_type_info->labels->singular_name;
1556 1554
 
1557
-    $gd_country = get_query_var('gd_country');
1558
-    $gd_region = get_query_var('gd_region');
1559
-    $gd_city = get_query_var('gd_city');
1555
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1560 1556
 
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
-            }
1557
+	$gd_country = get_query_var('gd_country');
1558
+	$gd_region = get_query_var('gd_region');
1559
+	$gd_city = get_query_var('gd_city');
1567 1560
 
1568
-            if ($gd_region != '') {
1569
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1570
-            }
1571
-
1572
-            if ($gd_city != '') {
1573
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1574
-            }
1575
-        }
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
+			}
1576 1567
 
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
-        }
1568
+			if ($gd_region != '') {
1569
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1570
+			}
1603 1571
 
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'] : '';
1572
+			if ($gd_city != '') {
1573
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1574
+			}
1575
+		}
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
+		}
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'] : '';
1608
+
1609
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
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
+		}
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
+			}
1608 1625
 
1609
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
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
+			}
1610 1635
 
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
-        }
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
+			}
1616 1645
 
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
-            }
1646
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1647
+		}
1648
+	}
1625 1649
 
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
-            }
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');
1635 1657
 
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 1658
 
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
-        }
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
+		}
1674 1674
 
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
-        }
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
+		}
1683 1683
 
1684
-    }
1684
+	}
1685 1685
 
1686 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);
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 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>';
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');
2120 2110
 
2121
-    }
2111
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2122 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
+
2121
+	}
2123 2122
 
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 2123
 
2133
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2134
-    echo $title;
2135
-    echo '</h1></header>';
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
+
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
-        }
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
-    }
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
+
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
-            }
2444
-
2445
-            $listing_type = $post->listing_type;
2440
+			if ($curImages != '') {
2441
+				$curImages_array = explode(',', $curImages);
2442
+				$totImg = count($curImages_array);
2443
+			}
2446 2444
 
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']);
2445
+			$listing_type = $post->listing_type;
2451 2446
 
2452
-        } else {
2453
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2454
-        }
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']);
2455 2451
 
2452
+		} else {
2453
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2454
+		}
2456 2455
 
2457
-        if (!empty($thumb_img_arr)) {
2458
-            foreach ($thumb_img_arr as $img) {
2459
-                //$curImages = $img->src.",";
2460
-            }
2461 2456
 
2462
-            $totImg = count((array)$thumb_img_arr);
2463
-        }
2457
+		if (!empty($thumb_img_arr)) {
2458
+			foreach ($thumb_img_arr as $img) {
2459
+				//$curImages = $img->src.",";
2460
+			}
2464 2461
 
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
-            ?>
2462
+			$totImg = count((array)$thumb_img_arr);
2463
+		}
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
+			?>
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;
2772
-
2773
-    $gd_post_type = geodir_get_current_posttype();
2774
-    $post_type_info = get_post_type_object($gd_post_type);
2771
+	global $term;
2775 2772
 
2776
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2777
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2778
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2779
-    }
2773
+	$gd_post_type = geodir_get_current_posttype();
2774
+	$post_type_info = get_post_type_object($gd_post_type);
2780 2775
 
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
-        }
3584
-
3585
-        if ( !empty( $post->region_slug ) ) {
3586
-            $post_locations .= " AND post_locations LIKE %s";
3587
-            $post_locations_var[] = "%,[" . $post->region_slug . "],%";
3588
-        }
3589
-
3590
-        if ( !empty( $post->city_slug ) ) {
3591
-            $post_locations .= " AND post_locations LIKE %s";
3592
-            $post_locations_var[] = "[" . $post->city_slug . "],%";
3593
-        }
3580
+		if ( !empty( $post->country_slug ) ) {
3581
+			$post_locations .= " AND post_locations LIKE %s";
3582
+			$post_locations_var[] = "%,[" . $post->country_slug . "]";
3583
+		}
3584
+
3585
+		if ( !empty( $post->region_slug ) ) {
3586
+			$post_locations .= " AND post_locations LIKE %s";
3587
+			$post_locations_var[] = "%,[" . $post->region_slug . "],%";
3588
+		}
3589
+
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 );
3602 3602
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_tags.php 2 patches
Indentation   +343 added lines, -343 removed lines patch added patch discarded remove patch
@@ -36,177 +36,177 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function geodir_templates_scripts()
38 38
 {
39
-    $is_detail_page = false;
40
-    $geodir_map_name = geodir_map_name();
39
+	$is_detail_page = false;
40
+	$geodir_map_name = geodir_map_name();
41 41
 
42
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
43
-        $is_detail_page = true;
44
-    }
42
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
43
+		$is_detail_page = true;
44
+	}
45 45
 
46
-    wp_enqueue_script('jquery');
46
+	wp_enqueue_script('jquery');
47 47
 
48
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
49
-    wp_enqueue_script('geodirectory-script');
48
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
49
+	wp_enqueue_script('geodirectory-script');
50 50
 
51
-    $geodir_vars_data = array(
52
-        'siteurl' => get_option('siteurl'),
53
-        'geodir_plugin_url' => geodir_plugin_url(),
54
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
55
-        'geodir_ajax_url' => geodir_get_ajax_url(),
56
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
57
-        'is_rtl' => is_rtl() ? 1 : 0, // fix rtl issue
51
+	$geodir_vars_data = array(
52
+		'siteurl' => get_option('siteurl'),
53
+		'geodir_plugin_url' => geodir_plugin_url(),
54
+		'geodir_lazy_load' => get_option('geodir_lazy_load',1),
55
+		'geodir_ajax_url' => geodir_get_ajax_url(),
56
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
57
+		'is_rtl' => is_rtl() ? 1 : 0, // fix rtl issue
58 58
 		'lightBox_txtImage' => addslashes(__('Image', 'geodirectory')),
59 59
 		'lightBox_txtOf' => addslashes(__('of', 'geodirectory')),
60
-    );
61
-
62
-    /**
63
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
64
-     *
65
-     * This is used by addons to add JS translatable variables.
66
-     *
67
-     * @since 1.4.4
68
-     * @param array $geodir_vars_data {
69
-     *    geodir var data used by addons to add JS translatable variables.
70
-     *
71
-     *    @type string $siteurl Site url.
72
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
73
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
74
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
75
-     *    @type int $is_rtl Checks if current locale is RTL.
76
-     *
77
-     * }
78
-     */
79
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
80
-
81
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
82
-
83
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
85
-
86
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
87
-    wp_enqueue_script('geodirectory-lightbox-jquery');
88
-
89
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
90
-    if ($is_detail_page) {
91
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
92
-    }
60
+	);
61
+
62
+	/**
63
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
64
+	 *
65
+	 * This is used by addons to add JS translatable variables.
66
+	 *
67
+	 * @since 1.4.4
68
+	 * @param array $geodir_vars_data {
69
+	 *    geodir var data used by addons to add JS translatable variables.
70
+	 *
71
+	 *    @type string $siteurl Site url.
72
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
73
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
74
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
75
+	 *    @type int $is_rtl Checks if current locale is RTL.
76
+	 *
77
+	 * }
78
+	 */
79
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
80
+
81
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
82
+
83
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
84
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
85
+
86
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
87
+	wp_enqueue_script('geodirectory-lightbox-jquery');
88
+
89
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
90
+	if ($is_detail_page) {
91
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
92
+	}
93 93
 
94
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
95
-        $map_lang = "&language=" . geodir_get_map_default_language();
96
-        $map_key = "&key=" . geodir_get_map_api_key();
97
-        /**
98
-         * Filter the variables that are added to the end of the google maps script call.
99
-         *
100
-         * This i used to change things like google maps language etc.
101
-         *
102
-         * @since 1.0.0
103
-         * @param string $var The string to filter, default is empty string.
104
-         */
105
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
106
-        wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
94
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
95
+		$map_lang = "&language=" . geodir_get_map_default_language();
96
+		$map_key = "&key=" . geodir_get_map_api_key();
97
+		/**
98
+		 * Filter the variables that are added to the end of the google maps script call.
99
+		 *
100
+		 * This i used to change things like google maps language etc.
101
+		 *
102
+		 * @since 1.0.0
103
+		 * @param string $var The string to filter, default is empty string.
104
+		 */
105
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
106
+		wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
107 107
         
108
-        // Overlapping Marker Spiderfier
109
-        wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
110
-        wp_enqueue_script('geodirectory-g-overlappingmarker-script');
111
-    }
108
+		// Overlapping Marker Spiderfier
109
+		wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
110
+		wp_enqueue_script('geodirectory-g-overlappingmarker-script');
111
+	}
112 112
     
113
-    if ($geodir_map_name == 'osm') {
114
-        // Leaflet OpenStreetMap
115
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
116
-        wp_enqueue_style('geodirectory-leaflet-style');
113
+	if ($geodir_map_name == 'osm') {
114
+		// Leaflet OpenStreetMap
115
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
116
+		wp_enqueue_style('geodirectory-leaflet-style');
117 117
             
118
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
119
-        wp_enqueue_script('geodirectory-leaflet-script');
118
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
119
+		wp_enqueue_script('geodirectory-leaflet-script');
120 120
         
121
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
122
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
121
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
122
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
123 123
         
124
-        if ($is_detail_page) {
125
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
126
-            wp_enqueue_style('geodirectory-leaflet-routing-style');
124
+		if ($is_detail_page) {
125
+			wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
126
+			wp_enqueue_style('geodirectory-leaflet-routing-style');
127 127
                 
128
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
129
-            wp_enqueue_script('geodirectory-leaflet-routing-script');
130
-        }
128
+			wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
129
+			wp_enqueue_script('geodirectory-leaflet-routing-script');
130
+		}
131 131
         
132
-        // Overlapping Marker Spiderfier Leaflet
133
-        wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
134
-        wp_enqueue_script('geodirectory-o-overlappingmarker-script');
135
-    }
136
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
132
+		// Overlapping Marker Spiderfier Leaflet
133
+		wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
134
+		wp_enqueue_script('geodirectory-o-overlappingmarker-script');
135
+	}
136
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
137 137
     
138
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
139
-    wp_enqueue_script('geodirectory-goMap-script');
140
-
141
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
142
-    wp_enqueue_script('chosen');
143
-
144
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
145
-    wp_enqueue_script('geodirectory-choose-ajax');
146
-
147
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
148
-
149
-    if (is_page() && geodir_is_page('add-listing')) {
150
-        // SCRIPT FOR UPLOAD
151
-        wp_enqueue_script('plupload-all');
152
-        wp_enqueue_script('jquery-ui-sortable');
153
-
154
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
155
-        wp_enqueue_script('geodirectory-plupload-script');
156
-        // SCRIPT FOR UPLOAD END
157
-
158
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
159
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
160
-            $ajax_url = admin_url('admin-ajax.php');
161
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
162
-            $ajax_url = admin_url('admin-ajax.php');
163
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
164
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
165
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
166
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
167
-        } else {
168
-            $ajax_url = admin_url('admin-ajax.php');
169
-        }
138
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
139
+	wp_enqueue_script('geodirectory-goMap-script');
140
+
141
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
142
+	wp_enqueue_script('chosen');
143
+
144
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
145
+	wp_enqueue_script('geodirectory-choose-ajax');
146
+
147
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
148
+
149
+	if (is_page() && geodir_is_page('add-listing')) {
150
+		// SCRIPT FOR UPLOAD
151
+		wp_enqueue_script('plupload-all');
152
+		wp_enqueue_script('jquery-ui-sortable');
153
+
154
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
155
+		wp_enqueue_script('geodirectory-plupload-script');
156
+		// SCRIPT FOR UPLOAD END
157
+
158
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
159
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
160
+			$ajax_url = admin_url('admin-ajax.php');
161
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
162
+			$ajax_url = admin_url('admin-ajax.php');
163
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
164
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
165
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
166
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
167
+		} else {
168
+			$ajax_url = admin_url('admin-ajax.php');
169
+		}
170 170
 
171
-        // place js config array for plupload
172
-        $plupload_init = array(
173
-            'runtimes' => 'html5,silverlight,browserplus,gears,html4',
174
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
175
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
176
-            'drop_element' => 'dropbox', // will be adjusted per uploader
177
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
178
-            'multiple_queues' => true,
179
-            'max_file_size' => geodir_max_upload_size(),
180
-            'url' => $ajax_url,
181
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
182
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
183
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
184
-            'multipart' => true,
185
-            'urlstream_upload' => true,
186
-            'multi_selection' => false, // will be added per uploader
187
-            // additional post data to send to our ajax hook
188
-            'multipart_params' => array(
189
-                '_ajax_nonce' => "", // will be added per uploader
190
-                'action' => 'plupload_action', // the ajax action name
191
-                'imgid' => 0 // will be added per uploader
192
-            )
193
-        );
194
-        $base_plupload_config = json_encode($plupload_init);
195
-
196
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
197
-            'upload_img_size' => geodir_max_upload_size());
198
-
199
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
200
-
201
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
202
-    } // End if for add place page
203
-
204
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
205
-    if ($is_detail_page) {
171
+		// place js config array for plupload
172
+		$plupload_init = array(
173
+			'runtimes' => 'html5,silverlight,browserplus,gears,html4',
174
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
175
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
176
+			'drop_element' => 'dropbox', // will be adjusted per uploader
177
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
178
+			'multiple_queues' => true,
179
+			'max_file_size' => geodir_max_upload_size(),
180
+			'url' => $ajax_url,
181
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
182
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
183
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
184
+			'multipart' => true,
185
+			'urlstream_upload' => true,
186
+			'multi_selection' => false, // will be added per uploader
187
+			// additional post data to send to our ajax hook
188
+			'multipart_params' => array(
189
+				'_ajax_nonce' => "", // will be added per uploader
190
+				'action' => 'plupload_action', // the ajax action name
191
+				'imgid' => 0 // will be added per uploader
192
+			)
193
+		);
194
+		$base_plupload_config = json_encode($plupload_init);
195
+
196
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
197
+			'upload_img_size' => geodir_max_upload_size());
198
+
199
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
200
+
201
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
202
+	} // End if for add place page
203
+
204
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
205
+	if ($is_detail_page) {
206 206
 		wp_enqueue_script('geodirectory-post-custom-js');
207 207
 	}
208 208
 
209
-    // font awesome rating script
209
+	// font awesome rating script
210 210
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
211 211
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
212 212
 		wp_enqueue_script('geodir-barrating-js');
@@ -215,11 +215,11 @@  discard block
 block discarded – undo
215 215
 		wp_enqueue_script('geodir-jRating-js');
216 216
 	}
217 217
 
218
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
219
-    wp_enqueue_script('geodir-on-document-load');
218
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
219
+	wp_enqueue_script('geodir-on-document-load');
220 220
 
221
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
222
-    wp_enqueue_script('google-geometa');
221
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
222
+	wp_enqueue_script('google-geometa');
223 223
 }
224 224
 
225 225
 /**
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
  */
234 234
 function geodir_header_scripts()
235 235
 {
236
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
237
-    echo stripslashes(get_option('geodir_header_scripts'));
236
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
237
+	echo stripslashes(get_option('geodir_header_scripts'));
238 238
 }
239 239
 
240 240
 /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_google_analytics_tracking_code()
249 249
 {
250
-    if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
250
+	if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
251 251
 
252 252
         <script>
253 253
             (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
         </script>
263 263
 
264 264
         <?php
265
-    }elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
266
-        echo stripslashes(get_option('geodir_ga_tracking_code'));
267
-    }
265
+	}elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
266
+		echo stripslashes(get_option('geodir_ga_tracking_code'));
267
+	}
268 268
 }
269 269
 
270 270
 /**
@@ -278,16 +278,16 @@  discard block
 block discarded – undo
278 278
 function geodir_footer_scripts()
279 279
 {
280 280
 
281
-    echo stripslashes(get_option('geodir_footer_scripts'));
281
+	echo stripslashes(get_option('geodir_footer_scripts'));
282 282
 
283
-    /*
283
+	/*
284 284
      * Apple suck and can't/won't fix bugs: https://bugs.webkit.org/show_bug.cgi?id=136041
285 285
      *
286 286
      * Flexbox wont wrap on ios for search form items
287 287
      */
288
-    if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
289
-        echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
290
-    }
288
+	if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
289
+		echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
290
+	}
291 291
 }
292 292
 
293 293
 
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
  */
302 302
 function geodir_add_async_forscript($url)
303 303
 {
304
-    if (strpos($url, '#asyncload')===false)
305
-        return $url;
306
-    else if (is_admin())
307
-        return str_replace('#asyncload', '', $url);
308
-    else
309
-        return str_replace('#asyncload', '', $url)."' async='async";
304
+	if (strpos($url, '#asyncload')===false)
305
+		return $url;
306
+	else if (is_admin())
307
+		return str_replace('#asyncload', '', $url);
308
+	else
309
+		return str_replace('#asyncload', '', $url)."' async='async";
310 310
 }
311 311
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
312 312
 
@@ -319,21 +319,21 @@  discard block
 block discarded – undo
319 319
 function geodir_templates_styles()
320 320
 {
321 321
 
322
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
323
-    wp_enqueue_style('geodir-core-scss');
324
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
322
+	wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
323
+	wp_enqueue_style('geodir-core-scss');
324
+	wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
325 325
 
326
-    if(is_rtl()){
327
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
328
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
329
-    }
326
+	if(is_rtl()){
327
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
328
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
329
+	}
330 330
 
331 331
 //    wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
332 332
 //    wp_enqueue_style('font-awesome');
333 333
 
334
-    wp_register_script('font-awesome', 'https://use.fontawesome.com/releases/v5.4.1/js/all.js', array('font-awesome-shim'), GEODIRECTORY_VERSION);
335
-    wp_register_script('font-awesome-shim', 'https://use.fontawesome.com/releases/v5.4.1/js/v4-shims.js', array(), GEODIRECTORY_VERSION);
336
-    wp_enqueue_script( 'font-awesome' );
334
+	wp_register_script('font-awesome', 'https://use.fontawesome.com/releases/v5.4.1/js/all.js', array('font-awesome-shim'), GEODIRECTORY_VERSION);
335
+	wp_register_script('font-awesome-shim', 'https://use.fontawesome.com/releases/v5.4.1/js/v4-shims.js', array(), GEODIRECTORY_VERSION);
336
+	wp_enqueue_script( 'font-awesome' );
337 337
 
338 338
 
339 339
 }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
  */
348 348
 function geodir_get_sidebar()
349 349
 {
350
-    get_sidebar('geodirectory');
350
+	get_sidebar('geodirectory');
351 351
 }
352 352
 
353 353
 /**
@@ -366,122 +366,122 @@  discard block
 block discarded – undo
366 366
  * @param bool $always_show Do you want to show the pagination always? Default: false.
367 367
  */
368 368
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
369
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
369
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
370 370
 
371
-    if (empty($prelabel)) {
372
-        $prelabel = '<strong>&lt;</strong>';
373
-    }
371
+	if (empty($prelabel)) {
372
+		$prelabel = '<strong>&lt;</strong>';
373
+	}
374 374
 
375
-    if (empty($nxtlabel)) {
376
-        $nxtlabel = '<strong>&gt;</strong>';
377
-    }
375
+	if (empty($nxtlabel)) {
376
+		$nxtlabel = '<strong>&gt;</strong>';
377
+	}
378 378
 
379
-    $half_pages_to_show = round($pages_to_show / 2);
379
+	$half_pages_to_show = round($pages_to_show / 2);
380 380
 
381
-    if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
382
-        return;
381
+	if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
382
+		return;
383 383
 
384
-    if (!is_single()) {
385
-        if (function_exists('geodir_location_geo_home_link')) {
386
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
387
-        }
388
-        $numposts = $wp_query->found_posts;
384
+	if (!is_single()) {
385
+		if (function_exists('geodir_location_geo_home_link')) {
386
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
387
+		}
388
+		$numposts = $wp_query->found_posts;
389 389
 
390
-        $max_page = ceil($numposts / $posts_per_page);
390
+		$max_page = ceil($numposts / $posts_per_page);
391 391
 
392
-        if (empty($paged)) {
393
-            $paged = 1;
394
-        }
392
+		if (empty($paged)) {
393
+			$paged = 1;
394
+		}
395 395
         
396
-        $post_type = geodir_get_current_posttype();
397
-        $listing_type_name = get_post_type_plural_label($post_type);
398
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
399
-            $term = array();
396
+		$post_type = geodir_get_current_posttype();
397
+		$listing_type_name = get_post_type_plural_label($post_type);
398
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
399
+			$term = array();
400 400
             
401
-            if (is_tax()) {
402
-                $term_id = get_queried_object_id();
403
-                $taxonomy = get_query_var('taxonomy');
401
+			if (is_tax()) {
402
+				$term_id = get_queried_object_id();
403
+				$taxonomy = get_query_var('taxonomy');
404 404
 
405
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
406
-                    $term = get_term($term_id, $post_type . 'category');
407
-                }
408
-            }
405
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
406
+					$term = get_term($term_id, $post_type . 'category');
407
+				}
408
+			}
409 409
             
410
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
411
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
410
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
411
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
412 412
                 
413
-                if (!is_array($taxonomy_search)) {
414
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
415
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
416
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
417
-                }
418
-            }
413
+				if (!is_array($taxonomy_search)) {
414
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
415
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
416
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
417
+				}
418
+			}
419 419
             
420
-            if (!empty($term) && !is_wp_error($term)) {
421
-                $listing_type_name = $term->name;
422
-            }
423
-        }
420
+			if (!empty($term) && !is_wp_error($term)) {
421
+				$listing_type_name = $term->name;
422
+			}
423
+		}
424 424
 
425
-        if ($max_page > 1 || $always_show) {            
426
-            // Extra pagination info
427
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
428
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
429
-            $end_no = min($paged * $posts_per_page, $numposts);
425
+		if ($max_page > 1 || $always_show) {            
426
+			// Extra pagination info
427
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
428
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
429
+			$end_no = min($paged * $posts_per_page, $numposts);
430 430
 
431
-            if ($geodir_pagination_more_info != '') {
432
-                if ($listing_type_name) {
433
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
434
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
435
-                } else {
436
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
437
-                }
438
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
439
-                /**
440
-                 * Adds an extra pagination info above/under pagination.
441
-                 *
442
-                 * @since 1.5.9
443
-                 *
444
-                 * @param string $pagination_info Extra pagination info content.
445
-                 * @param string $listing_type_name Listing results type.
446
-                 * @param string $start_no First result number.
447
-                 * @param string $end_no Last result number.
448
-                 * @param string $numposts Total number of listings.
449
-                 * @param string $post_type The post type.
450
-                 */
451
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
431
+			if ($geodir_pagination_more_info != '') {
432
+				if ($listing_type_name) {
433
+					$listing_type_name = __($listing_type_name, 'geodirectory');
434
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
435
+				} else {
436
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
437
+				}
438
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
439
+				/**
440
+				 * Adds an extra pagination info above/under pagination.
441
+				 *
442
+				 * @since 1.5.9
443
+				 *
444
+				 * @param string $pagination_info Extra pagination info content.
445
+				 * @param string $listing_type_name Listing results type.
446
+				 * @param string $start_no First result number.
447
+				 * @param string $end_no Last result number.
448
+				 * @param string $numposts Total number of listings.
449
+				 * @param string $post_type The post type.
450
+				 */
451
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
452 452
                 
453
-                if ($geodir_pagination_more_info == 'before') {
454
-                    $before = $before . $pagination_info;
455
-                } else if ($geodir_pagination_more_info == 'after') {
456
-                    $after = $pagination_info . $after;
457
-                }
458
-            }
453
+				if ($geodir_pagination_more_info == 'before') {
454
+					$before = $before . $pagination_info;
455
+				} else if ($geodir_pagination_more_info == 'after') {
456
+					$after = $pagination_info . $after;
457
+				}
458
+			}
459 459
             
460
-            echo "$before <div class='Navi gd-navi'>";
461
-            if ($paged >= ($pages_to_show - 1)) {
462
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
463
-            }
464
-            previous_posts_link($prelabel);
465
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
466
-                if ($i >= 1 && $i <= $max_page) {
467
-                    if ($i == $paged) {
468
-                        echo "<strong class='on'>$i</strong>";
469
-                    } else {
470
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
471
-                    }
472
-                }
473
-            }
474
-            next_posts_link($nxtlabel, $max_page);
475
-            if (($paged + $half_pages_to_show) < ($max_page)) {
476
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
477
-            }
478
-            echo "</div> $after";
479
-        }
460
+			echo "$before <div class='Navi gd-navi'>";
461
+			if ($paged >= ($pages_to_show - 1)) {
462
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
463
+			}
464
+			previous_posts_link($prelabel);
465
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
466
+				if ($i >= 1 && $i <= $max_page) {
467
+					if ($i == $paged) {
468
+						echo "<strong class='on'>$i</strong>";
469
+					} else {
470
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
471
+					}
472
+				}
473
+			}
474
+			next_posts_link($nxtlabel, $max_page);
475
+			if (($paged + $half_pages_to_show) < ($max_page)) {
476
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
477
+			}
478
+			echo "</div> $after";
479
+		}
480 480
         
481
-        if (function_exists('geodir_location_geo_home_link')) {
482
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
483
-        }
484
-    }
481
+		if (function_exists('geodir_location_geo_home_link')) {
482
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
483
+		}
484
+	}
485 485
 }
486 486
 
487 487
 /**
@@ -492,20 +492,20 @@  discard block
 block discarded – undo
492 492
  */
493 493
 function geodir_listingsearch_scripts()
494 494
 {
495
-    if (get_option('gd_search_dist') != '') {
496
-        $dist = get_option('gd_search_dist');
497
-    } else {
498
-        $dist = 500;
499
-    }
500
-    $dist_dif = 1000;
501
-
502
-    if ($dist <= 5000) $dist_dif = 500;
503
-    if ($dist <= 1000) $dist_dif = 100;
504
-    if ($dist <= 500) $dist_dif = 50;
505
-    if ($dist <= 100) $dist_dif = 10;
506
-    if ($dist <= 50) $dist_dif = 5;
507
-
508
-    ?>
495
+	if (get_option('gd_search_dist') != '') {
496
+		$dist = get_option('gd_search_dist');
497
+	} else {
498
+		$dist = 500;
499
+	}
500
+	$dist_dif = 1000;
501
+
502
+	if ($dist <= 5000) $dist_dif = 500;
503
+	if ($dist <= 1000) $dist_dif = 100;
504
+	if ($dist <= 500) $dist_dif = 50;
505
+	if ($dist <= 100) $dist_dif = 10;
506
+	if ($dist <= 50) $dist_dif = 5;
507
+
508
+	?>
509 509
     <script type="text/javascript">
510 510
 
511 511
         jQuery(function ($) {
@@ -563,20 +563,20 @@  discard block
 block discarded – undo
563 563
  * @package GeoDirectory
564 564
  */
565 565
 function geodir_add_sharelocation_scripts() {
566
-    $default_search_for_text = SEARCH_FOR_TEXT;
567
-    if (get_option('geodir_search_field_default_text'))
568
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
566
+	$default_search_for_text = SEARCH_FOR_TEXT;
567
+	if (get_option('geodir_search_field_default_text'))
568
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
569 569
 
570
-    $default_near_text = NEAR_TEXT;
571
-    if (get_option('geodir_near_field_default_text'))
572
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
570
+	$default_near_text = NEAR_TEXT;
571
+	if (get_option('geodir_near_field_default_text'))
572
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
573 573
     
574
-    $search_location = geodir_get_default_location();
574
+	$search_location = geodir_get_default_location();
575 575
     
576
-    $default_search_for_text = addslashes(stripslashes($default_search_for_text));
577
-    $default_near_text = addslashes(stripslashes($default_near_text));
578
-    $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
579
-    ?>
576
+	$default_search_for_text = addslashes(stripslashes($default_search_for_text));
577
+	$default_near_text = addslashes(stripslashes($default_near_text));
578
+	$city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
579
+	?>
580 580
     <script type="text/javascript">
581 581
         var default_location = '<?php echo $city ;?>';
582 582
         var latlng;
@@ -668,14 +668,14 @@  discard block
 block discarded – undo
668 668
                     initialise2();
669 669
                 } else {
670 670
                     <?php
671
-                    $near_add = get_option('geodir_search_near_addition');
672
-                    /**
673
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
674
-                     *
675
-                     * @since 1.0.0
676
-                     */
677
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
678
-                    ?>
671
+					$near_add = get_option('geodir_search_near_addition');
672
+					/**
673
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
674
+					 *
675
+					 * @since 1.0.0
676
+					 */
677
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
678
+					?>
679 679
                     if (window.gdMaps === 'google') {
680 680
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
681 681
                             function (results, status) {
@@ -789,32 +789,32 @@  discard block
 block discarded – undo
789 789
  */
790 790
 function geodir_show_badges_on_image($which, $post, $link)
791 791
 {
792
-    $return = '';
793
-    switch ($which) {
794
-        case 'featured':
795
-            /**
796
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
797
-             *
798
-             * @since 1.0.0
799
-             * @param object $post The post object.
800
-             * @param string $link The link to the post.
801
-             */
802
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
803
-            break;
804
-        case 'new' :
805
-            /**
806
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
807
-             *
808
-             * @since 1.0.0
809
-             * @param object $post The post object.
810
-             * @param string $link The link to the post.
811
-             */
812
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
813
-            break;
814
-
815
-    }
792
+	$return = '';
793
+	switch ($which) {
794
+		case 'featured':
795
+			/**
796
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
797
+			 *
798
+			 * @since 1.0.0
799
+			 * @param object $post The post object.
800
+			 * @param string $link The link to the post.
801
+			 */
802
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
803
+			break;
804
+		case 'new' :
805
+			/**
806
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
807
+			 *
808
+			 * @since 1.0.0
809
+			 * @param object $post The post object.
810
+			 * @param string $link The link to the post.
811
+			 */
812
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
813
+			break;
814
+
815
+	}
816 816
     
817
-    return $return;
817
+	return $return;
818 818
 }
819 819
 
820 820
 /**
@@ -823,8 +823,8 @@  discard block
 block discarded – undo
823 823
  * @since 1.6.22
824 824
  */
825 825
 function geodir_fix_script_conflict() {
826
-    if ( wp_script_is( 'flexslider', 'enqueued' ) && wp_script_is( 'geodirectory-jquery-flexslider-js', 'enqueued' ) ) {
827
-        wp_dequeue_script( 'flexslider' );
828
-    }
826
+	if ( wp_script_is( 'flexslider', 'enqueued' ) && wp_script_is( 'geodirectory-jquery-flexslider-js', 'enqueued' ) ) {
827
+		wp_dequeue_script( 'flexslider' );
828
+	}
829 829
 }
830 830
 add_action( 'wp_enqueue_scripts', 'geodir_fix_script_conflict', 100 );
831 831
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -39,21 +39,21 @@  discard block
 block discarded – undo
39 39
     $is_detail_page = false;
40 40
     $geodir_map_name = geodir_map_name();
41 41
 
42
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
43 43
         $is_detail_page = true;
44 44
     }
45 45
 
46 46
     wp_enqueue_script('jquery');
47 47
 
48
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
48
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
49 49
     wp_enqueue_script('geodirectory-script');
50 50
 
51 51
     $geodir_vars_data = array(
52 52
         'siteurl' => get_option('siteurl'),
53 53
         'geodir_plugin_url' => geodir_plugin_url(),
54
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
55 55
         'geodir_ajax_url' => geodir_get_ajax_url(),
56
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
57 57
         'is_rtl' => is_rtl() ? 1 : 0, // fix rtl issue
58 58
 		'lightBox_txtImage' => addslashes(__('Image', 'geodirectory')),
59 59
 		'lightBox_txtOf' => addslashes(__('of', 'geodirectory')),
@@ -76,24 +76,24 @@  discard block
 block discarded – undo
76 76
      *
77 77
      * }
78 78
      */
79
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
79
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
80 80
 
81 81
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
82 82
 
83
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
83
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
84
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
85 85
 
86
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     wp_enqueue_script('geodirectory-lightbox-jquery');
88 88
 
89
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
89
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
90 90
     if ($is_detail_page) {
91 91
         wp_enqueue_script('geodirectory-jquery-simplemodal');
92 92
     }
93 93
 
94 94
     if (in_array($geodir_map_name, array('auto', 'google'))) {
95
-        $map_lang = "&language=" . geodir_get_map_default_language();
96
-        $map_key = "&key=" . geodir_get_map_api_key();
95
+        $map_lang = "&language=".geodir_get_map_default_language();
96
+        $map_key = "&key=".geodir_get_map_api_key();
97 97
         /**
98 98
          * Filter the variables that are added to the end of the google maps script call.
99 99
          *
@@ -103,55 +103,55 @@  discard block
 block discarded – undo
103 103
          * @param string $var The string to filter, default is empty string.
104 104
          */
105 105
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
106
-        wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
106
+        wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
107 107
         
108 108
         // Overlapping Marker Spiderfier
109
-        wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
109
+        wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
110 110
         wp_enqueue_script('geodirectory-g-overlappingmarker-script');
111 111
     }
112 112
     
113 113
     if ($geodir_map_name == 'osm') {
114 114
         // Leaflet OpenStreetMap
115
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
115
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
116 116
         wp_enqueue_style('geodirectory-leaflet-style');
117 117
             
118
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
118
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
119 119
         wp_enqueue_script('geodirectory-leaflet-script');
120 120
         
121
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
121
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
122 122
         wp_enqueue_script('geodirectory-leaflet-geo-script');
123 123
         
124 124
         if ($is_detail_page) {
125
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
125
+            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
126 126
             wp_enqueue_style('geodirectory-leaflet-routing-style');
127 127
                 
128
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
128
+            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
129 129
             wp_enqueue_script('geodirectory-leaflet-routing-script');
130 130
         }
131 131
         
132 132
         // Overlapping Marker Spiderfier Leaflet
133
-        wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
133
+        wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
134 134
         wp_enqueue_script('geodirectory-o-overlappingmarker-script');
135 135
     }
136
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
136
+    wp_enqueue_script('jquery-ui-autocomplete');
137 137
     
138
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
138
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
139 139
     wp_enqueue_script('geodirectory-goMap-script');
140 140
 
141
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
141
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
142 142
     wp_enqueue_script('chosen');
143 143
 
144
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
144
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
145 145
     wp_enqueue_script('geodirectory-choose-ajax');
146 146
 
147
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
147
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
148 148
 
149 149
     if (is_page() && geodir_is_page('add-listing')) {
150 150
         // SCRIPT FOR UPLOAD
151 151
         wp_enqueue_script('plupload-all');
152 152
         wp_enqueue_script('jquery-ui-sortable');
153 153
 
154
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
154
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
155 155
         wp_enqueue_script('geodirectory-plupload-script');
156 156
         // SCRIPT FOR UPLOAD END
157 157
 
@@ -198,27 +198,27 @@  discard block
 block discarded – undo
198 198
 
199 199
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
200 200
 
201
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
201
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
202 202
     } // End if for add place page
203 203
 
204
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
204
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
205 205
     if ($is_detail_page) {
206 206
 		wp_enqueue_script('geodirectory-post-custom-js');
207 207
 	}
208 208
 
209 209
     // font awesome rating script
210 210
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
211
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
211
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
212 212
 		wp_enqueue_script('geodir-barrating-js');
213 213
 	} else { // default rating script
214
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
214
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
215 215
 		wp_enqueue_script('geodir-jRating-js');
216 216
 	}
217 217
 
218
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
218
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
219 219
     wp_enqueue_script('geodir-on-document-load');
220 220
 
221
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
221
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
222 222
     wp_enqueue_script('google-geometa');
223 223
 }
224 224
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
  */
234 234
 function geodir_header_scripts()
235 235
 {
236
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
236
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
237 237
     echo stripslashes(get_option('geodir_header_scripts'));
238 238
 }
239 239
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_google_analytics_tracking_code()
249 249
 {
250
-    if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
250
+    if (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')) {?>
251 251
 
252 252
         <script>
253 253
             (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
                 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
256 256
             })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
257 257
 
258
-            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
259
-            <?php if(get_option('geodir_ga_anonymize_ip')){echo "ga('set', 'anonymizeIP', true);";}?>
258
+            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
259
+            <?php if (get_option('geodir_ga_anonymize_ip')) {echo "ga('set', 'anonymizeIP', true);"; }?>
260 260
             ga('send', 'pageview');
261 261
 
262 262
         </script>
263 263
 
264 264
         <?php
265
-    }elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
265
+    }elseif (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
266 266
         echo stripslashes(get_option('geodir_ga_tracking_code'));
267 267
     }
268 268
 }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      *
286 286
      * Flexbox wont wrap on ios for search form items
287 287
      */
288
-    if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
288
+    if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
289 289
         echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
290 290
     }
291 291
 }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
  */
302 302
 function geodir_add_async_forscript($url)
303 303
 {
304
-    if (strpos($url, '#asyncload')===false)
304
+    if (strpos($url, '#asyncload') === false)
305 305
         return $url;
306 306
     else if (is_admin())
307 307
         return str_replace('#asyncload', '', $url);
@@ -319,12 +319,12 @@  discard block
 block discarded – undo
319 319
 function geodir_templates_styles()
320 320
 {
321 321
 
322
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
322
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
323 323
     wp_enqueue_style('geodir-core-scss');
324
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
324
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
325 325
 
326
-    if(is_rtl()){
327
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
326
+    if (is_rtl()) {
327
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
328 328
     wp_enqueue_style('geodirectory-frontend-rtl-style');
329 329
     }
330 330
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
     wp_register_script('font-awesome', 'https://use.fontawesome.com/releases/v5.4.1/js/all.js', array('font-awesome-shim'), GEODIRECTORY_VERSION);
335 335
     wp_register_script('font-awesome-shim', 'https://use.fontawesome.com/releases/v5.4.1/js/v4-shims.js', array(), GEODIRECTORY_VERSION);
336
-    wp_enqueue_script( 'font-awesome' );
336
+    wp_enqueue_script('font-awesome');
337 337
 
338 338
 
339 339
 }
@@ -402,18 +402,18 @@  discard block
 block discarded – undo
402 402
                 $term_id = get_queried_object_id();
403 403
                 $taxonomy = get_query_var('taxonomy');
404 404
 
405
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
406
-                    $term = get_term($term_id, $post_type . 'category');
405
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
406
+                    $term = get_term($term_id, $post_type.'category');
407 407
                 }
408 408
             }
409 409
             
410
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
411
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
410
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
411
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
412 412
                 
413 413
                 if (!is_array($taxonomy_search)) {
414
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
415
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
416
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
414
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
415
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
416
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
417 417
                 }
418 418
             }
419 419
             
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
         if ($max_page > 1 || $always_show) {            
426 426
             // Extra pagination info
427 427
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
428
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
428
+            $start_no = ($paged - 1) * $posts_per_page + 1;
429 429
             $end_no = min($paged * $posts_per_page, $numposts);
430 430
 
431 431
             if ($geodir_pagination_more_info != '') {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
                 } else {
436 436
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
437 437
                 }
438
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
438
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
439 439
                 /**
440 440
                  * Adds an extra pagination info above/under pagination.
441 441
                  *
@@ -451,15 +451,15 @@  discard block
 block discarded – undo
451 451
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
452 452
                 
453 453
                 if ($geodir_pagination_more_info == 'before') {
454
-                    $before = $before . $pagination_info;
454
+                    $before = $before.$pagination_info;
455 455
                 } else if ($geodir_pagination_more_info == 'after') {
456
-                    $after = $pagination_info . $after;
456
+                    $after = $pagination_info.$after;
457 457
                 }
458 458
             }
459 459
             
460 460
             echo "$before <div class='Navi gd-navi'>";
461 461
             if ($paged >= ($pages_to_show - 1)) {
462
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
462
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
463 463
             }
464 464
             previous_posts_link($prelabel);
465 465
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -467,13 +467,13 @@  discard block
 block discarded – undo
467 467
                     if ($i == $paged) {
468 468
                         echo "<strong class='on'>$i</strong>";
469 469
                     } else {
470
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
470
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
471 471
                     }
472 472
                 }
473 473
             }
474 474
             next_posts_link($nxtlabel, $max_page);
475 475
             if (($paged + $half_pages_to_show) < ($max_page)) {
476
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
476
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
477 477
             }
478 478
             echo "</div> $after";
479 479
         }
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
         jQuery(function ($) {
512 512
             $("#distance_slider").slider({
513 513
                 range: true,
514
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
514
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
515 515
                 min: 0,
516 516
                 max: <?php echo $dist; ?>,
517 517
                 step: <?php echo $dist_dif; ?>,
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
     $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
579 579
     ?>
580 580
     <script type="text/javascript">
581
-        var default_location = '<?php echo $city ;?>';
581
+        var default_location = '<?php echo $city; ?>';
582 582
         var latlng;
583 583
         var address;
584 584
         var dist = 0;
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 				var $form = jQuery(this).closest('form');
595 595
 
596 596
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
597
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
597
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
598 598
 				
599 599
 				// Disable location based search for disabled location post type.
600 600
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 					}
609 609
 				}
610 610
 				
611
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
611
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
612 612
 
613 613
                     // OSM can't handel post code with no space so we test for it and add one if needed
614 614
                     if(window.gdMaps === 'osm'){
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
         });
638 638
         
639 639
 		function geodir_setsearch($form) {
640
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
640
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
641 641
 			geocodeAddress($form);
642 642
 		}
643 643
 
@@ -656,15 +656,15 @@  discard block
 block discarded – undo
656 656
             // Call the geocode function
657 657
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
658 658
 
659
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
660
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
659
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
660
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
661 661
                     jQuery(".snear", $form).val('');
662 662
                 }
663 663
                 jQuery($form).submit();
664 664
             } else {
665 665
                 var address = jQuery(".snear", $form).val();
666 666
 
667
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
667
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
668 668
                     initialise2();
669 669
                 } else {
670 670
                     <?php
@@ -677,21 +677,21 @@  discard block
 block discarded – undo
677 677
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
678 678
                     ?>
679 679
                     if (window.gdMaps === 'google') {
680
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
680
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
681 681
                             function (results, status) {
682 682
                                 if (status == google.maps.GeocoderStatus.OK) {
683 683
                                     updateSearchPosition(results[0].geometry.location, $form);
684 684
                                 } else {
685
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
685
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
686 686
                                 }
687 687
                             });
688 688
                     } else if (window.gdMaps === 'osm') {
689
-                        geocodePositionOSM(false, address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>, false, false,
689
+                        geocodePositionOSM(false, address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>, false, false,
690 690
                             function(geo) {
691 691
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
692 692
                                     updateSearchPosition(geo, $form);
693 693
                                 } else {
694
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
694
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
695 695
                                 }
696 696
                             });
697 697
                     } else {
@@ -737,19 +737,19 @@  discard block
 block discarded – undo
737 737
             var msg;
738 738
             switch (err.code) {
739 739
                 case err.UNKNOWN_ERROR:
740
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
740
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
741 741
                     break;
742 742
                 case err.PERMISSION_DENINED:
743
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
743
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
744 744
                     break;
745 745
                 case err.POSITION_UNAVAILABLE:
746
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
746
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
747 747
                     break;
748 748
                 case err.BREAK:
749
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
749
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
750 750
                     break;
751 751
                 default:
752
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
752
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
753 753
             }
754 754
             jQuery('#info').html(msg);
755 755
         }
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
              * @param object $post The post object.
800 800
              * @param string $link The link to the post.
801 801
              */
802
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
802
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
803 803
             break;
804 804
         case 'new' :
805 805
             /**
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
              * @param object $post The post object.
810 810
              * @param string $link The link to the post.
811 811
              */
812
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
812
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
813 813
             break;
814 814
 
815 815
     }
@@ -823,8 +823,8 @@  discard block
 block discarded – undo
823 823
  * @since 1.6.22
824 824
  */
825 825
 function geodir_fix_script_conflict() {
826
-    if ( wp_script_is( 'flexslider', 'enqueued' ) && wp_script_is( 'geodirectory-jquery-flexslider-js', 'enqueued' ) ) {
827
-        wp_dequeue_script( 'flexslider' );
826
+    if (wp_script_is('flexslider', 'enqueued') && wp_script_is('geodirectory-jquery-flexslider-js', 'enqueued')) {
827
+        wp_dequeue_script('flexslider');
828 828
     }
829 829
 }
830
-add_action( 'wp_enqueue_scripts', 'geodir_fix_script_conflict', 100 );
831 830
\ No newline at end of file
831
+add_action('wp_enqueue_scripts', 'geodir_fix_script_conflict', 100);
832 832
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-admin/dummy-data/property_rent.php 1 patch
Indentation   +872 added lines, -872 removed lines patch added patch discarded remove patch
@@ -7,452 +7,452 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 function geodir_property_rent_custom_fields($post_type='gd_place',$package_id=''){
10
-    $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
12
-
13
-    // price
14
-    $fields[] = array('listing_type' => $post_type,
15
-                      'field_type'          =>  'text',
16
-                      'data_type'           =>  'FLOAT',
17
-                      'decimal_point'       =>  '2',
18
-                      'admin_title'         =>  __('Price', 'geodirectory'),
19
-                      'site_title'          =>  __('Price', 'geodirectory'),
20
-                      'admin_desc'          =>  __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'),
21
-                      'htmlvar_name'        =>  'price',
22
-                      'is_active'           =>  true,
23
-                      'for_admin_use'       =>  false,
24
-                      'default_value'       =>  '',
25
-                      'show_in' 	        =>  '[detail],[listing]',
26
-                      'is_required'         =>  false,
27
-                      'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
28
-                      'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
-                      'required_msg'        =>  '',
30
-                      'field_icon'          =>  'fas fa-dollar-sign',
31
-                      'css_class'           =>  '',
32
-                      'cat_sort'            =>  true,
33
-                      'cat_filter'	        =>  true,
34
-                      'extra'        =>  array(
35
-                          'is_price'                  =>  1,
36
-                          'thousand_separator'        =>  'comma',
37
-                          'decimal_separator'         =>  'period',
38
-                          'decimal_display'           =>  'if',
39
-                          'currency_symbol'           =>  '$',
40
-                          'currency_symbol_placement' =>  'left'
41
-                      )
42
-    );
43
-
44
-    // property status
45
-    $fields[] = array('listing_type' => $post_type,
46
-                      'data_type' => 'VARCHAR',
47
-                      'field_type' => 'select',
48
-                      'field_type_key' => 'property_status',
49
-                      'is_active' => 1,
50
-                      'for_admin_use' => 0,
51
-                      'is_default' => 0,
52
-                      'admin_title' => __('Property Status', 'geodirectory'),
53
-                      'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
-                      'site_title' => __('Property Status', 'geodirectory'),
55
-                      'htmlvar_name' => 'property_status',
56
-                      'default_value' => '',
57
-                      'is_required' => '1',
58
-                      'required_msg' => '',
59
-                      'show_in'   =>  '[detail],[listing]',
60
-                      'show_on_pkg' => $package,
61
-                      'option_values' => 'Select Status/,For Rent,Let,Under Offer',
62
-                      'field_icon' => 'fas fa-home',
63
-                      'css_class' => '',
64
-                      'cat_sort' => 1,
65
-                      'cat_filter' => 1,
66
-    );
67
-
68
-    // property furnishing
69
-    $fields[] = array('listing_type' => $post_type,
70
-                      'field_type'          =>  'select',
71
-                      'data_type'           =>  'VARCHAR',
72
-                      'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
-                      'site_title'          =>  __('Furnishing', 'geodirectory'),
74
-                      'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
-                      'htmlvar_name'        =>  'property_furnishing',
76
-                      'is_active'           =>  true,
77
-                      'for_admin_use'       =>  false,
78
-                      'default_value'       =>  '',
79
-                      'show_in' 	        =>  '[detail],[listing]',
80
-                      'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
-                      'validation_pattern'  =>  '',
83
-                      'validation_msg'      =>  '',
84
-                      'required_msg'        =>  '',
85
-                      'field_icon'          =>  'fas fa-th-large',
86
-                      'css_class'           =>  '',
87
-                      'cat_sort'            =>  true,
88
-                      'cat_filter'	        =>  true
89
-    );
90
-
91
-    // property type
92
-    $fields[] = array('listing_type' => $post_type,
93
-                      'field_type'          =>  'select',
94
-                      'data_type'           =>  'VARCHAR',
95
-                      'admin_title'         =>  __('Property Type', 'geodirectory'),
96
-                      'site_title'          =>  __('Property Type', 'geodirectory'),
97
-                      'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
-                      'htmlvar_name'        =>  'property_type',
99
-                      'is_active'           =>  true,
100
-                      'for_admin_use'       =>  false,
101
-                      'default_value'       =>  '',
102
-                      'show_in' 	        =>  '[detail],[listing]',
103
-                      'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
-                      'validation_pattern'  =>  '',
106
-                      'validation_msg'      =>  '',
107
-                      'required_msg'        =>  '',
108
-                      'field_icon'          =>  'fas fa-home',
109
-                      'css_class'           =>  '',
110
-                      'cat_sort'            =>  true,
111
-                      'cat_filter'	        =>  true
112
-    );
113
-
114
-    // property bedrooms
115
-    $fields[] = array('listing_type' => $post_type,
116
-                      'field_type'          =>  'select',
117
-                      'data_type'           =>  'VARCHAR',
118
-                      'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
-                      'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
-                      'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
-                      'htmlvar_name'        =>  'property_bedrooms',
122
-                      'is_active'           =>  true,
123
-                      'for_admin_use'       =>  false,
124
-                      'default_value'       =>  '',
125
-                      'show_in' 	        =>  '[detail],[listing]',
126
-                      'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
-                      'validation_pattern'  =>  '',
129
-                      'validation_msg'      =>  '',
130
-                      'required_msg'        =>  '',
131
-                      'field_icon'          =>  'fas fa-bed',
132
-                      'css_class'           =>  '',
133
-                      'cat_sort'            =>  true,
134
-                      'cat_filter'	        =>  true
135
-    );
136
-
137
-    // property bathrooms
138
-    $fields[] = array('listing_type' => $post_type,
139
-                      'field_type'          =>  'select',
140
-                      'data_type'           =>  'VARCHAR',
141
-                      'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
-                      'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
-                      'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
-                      'htmlvar_name'        =>  'property_bathrooms',
145
-                      'is_active'           =>  true,
146
-                      'for_admin_use'       =>  false,
147
-                      'default_value'       =>  '',
148
-                      'show_in' 	        =>  '[detail],[listing]',
149
-                      'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
-                      'validation_pattern'  =>  '',
152
-                      'validation_msg'      =>  '',
153
-                      'required_msg'        =>  '',
154
-                      'field_icon'          =>  'fas fa-bold',
155
-                      'css_class'           =>  '',
156
-                      'cat_sort'            =>  true,
157
-                      'cat_filter'	        =>  true
158
-    );
159
-
160
-    // property area
161
-    $fields[] = array('listing_type' => $post_type,
162
-                      'field_type'          =>  'text',
163
-                      'data_type'           =>  'INT',
164
-                      'admin_title'         =>  __('Property Area', 'geodirectory'),
165
-                      'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
-                      'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
-                      'htmlvar_name'        =>  'property_area',
168
-                      'is_active'           =>  true,
169
-                      'for_admin_use'       =>  false,
170
-                      'default_value'       =>  '',
171
-                      'show_in' 	        =>  '[detail],[listing]',
172
-                      'is_required'         =>  false,
173
-                      'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
174
-                      'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
-                      'required_msg'        =>  '',
176
-                      'field_icon'          =>  'fas fa-chart-area',
177
-                      'css_class'           =>  '',
178
-                      'cat_sort'            =>  true,
179
-                      'cat_filter'	        =>  true
180
-    );
181
-
182
-    // property features
183
-    $fields[] = array('listing_type' => $post_type,
184
-                      'field_type'          =>  'multiselect',
185
-                      'data_type'           =>  'VARCHAR',
186
-                      'admin_title'         =>  __('Property Features', 'geodirectory'),
187
-                      'site_title'          =>  __('Features', 'geodirectory'),
188
-                      'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
-                      'htmlvar_name'        =>  'property_features',
190
-                      'is_active'           =>  true,
191
-                      'for_admin_use'       =>  false,
192
-                      'default_value'       =>  '',
193
-                      'show_in' 	        =>  '[detail],[listing]',
194
-                      'is_required'         =>  false,
195
-                      'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
-                      'validation_pattern'  =>  '',
197
-                      'validation_msg'      =>  '',
198
-                      'required_msg'        =>  '',
199
-                      'field_icon'          =>  'fas fa-plus-square',
200
-                      'css_class'           =>  'gd-comma-list',
201
-                      'cat_sort'            =>  true,
202
-                      'cat_filter'	        =>  true
203
-    );
204
-
205
-
206
-
207
-    /**
208
-     * Filter the array of default custom fields DB table data.
209
-     *
210
-     * @since 1.6.6
211
-     * @param string $fields The default custom fields as an array.
212
-     */
213
-    $fields = apply_filters('geodir_property_rent_custom_fields', $fields);
214
-
215
-    return  $fields;
10
+	$fields = array();
11
+	$package = ($package_id=='') ? '' : array($package_id);
12
+
13
+	// price
14
+	$fields[] = array('listing_type' => $post_type,
15
+					  'field_type'          =>  'text',
16
+					  'data_type'           =>  'FLOAT',
17
+					  'decimal_point'       =>  '2',
18
+					  'admin_title'         =>  __('Price', 'geodirectory'),
19
+					  'site_title'          =>  __('Price', 'geodirectory'),
20
+					  'admin_desc'          =>  __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'),
21
+					  'htmlvar_name'        =>  'price',
22
+					  'is_active'           =>  true,
23
+					  'for_admin_use'       =>  false,
24
+					  'default_value'       =>  '',
25
+					  'show_in' 	        =>  '[detail],[listing]',
26
+					  'is_required'         =>  false,
27
+					  'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
28
+					  'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
+					  'required_msg'        =>  '',
30
+					  'field_icon'          =>  'fas fa-dollar-sign',
31
+					  'css_class'           =>  '',
32
+					  'cat_sort'            =>  true,
33
+					  'cat_filter'	        =>  true,
34
+					  'extra'        =>  array(
35
+						  'is_price'                  =>  1,
36
+						  'thousand_separator'        =>  'comma',
37
+						  'decimal_separator'         =>  'period',
38
+						  'decimal_display'           =>  'if',
39
+						  'currency_symbol'           =>  '$',
40
+						  'currency_symbol_placement' =>  'left'
41
+					  )
42
+	);
43
+
44
+	// property status
45
+	$fields[] = array('listing_type' => $post_type,
46
+					  'data_type' => 'VARCHAR',
47
+					  'field_type' => 'select',
48
+					  'field_type_key' => 'property_status',
49
+					  'is_active' => 1,
50
+					  'for_admin_use' => 0,
51
+					  'is_default' => 0,
52
+					  'admin_title' => __('Property Status', 'geodirectory'),
53
+					  'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
+					  'site_title' => __('Property Status', 'geodirectory'),
55
+					  'htmlvar_name' => 'property_status',
56
+					  'default_value' => '',
57
+					  'is_required' => '1',
58
+					  'required_msg' => '',
59
+					  'show_in'   =>  '[detail],[listing]',
60
+					  'show_on_pkg' => $package,
61
+					  'option_values' => 'Select Status/,For Rent,Let,Under Offer',
62
+					  'field_icon' => 'fas fa-home',
63
+					  'css_class' => '',
64
+					  'cat_sort' => 1,
65
+					  'cat_filter' => 1,
66
+	);
67
+
68
+	// property furnishing
69
+	$fields[] = array('listing_type' => $post_type,
70
+					  'field_type'          =>  'select',
71
+					  'data_type'           =>  'VARCHAR',
72
+					  'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
+					  'site_title'          =>  __('Furnishing', 'geodirectory'),
74
+					  'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
+					  'htmlvar_name'        =>  'property_furnishing',
76
+					  'is_active'           =>  true,
77
+					  'for_admin_use'       =>  false,
78
+					  'default_value'       =>  '',
79
+					  'show_in' 	        =>  '[detail],[listing]',
80
+					  'is_required'         =>  true,
81
+					  'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
+					  'validation_pattern'  =>  '',
83
+					  'validation_msg'      =>  '',
84
+					  'required_msg'        =>  '',
85
+					  'field_icon'          =>  'fas fa-th-large',
86
+					  'css_class'           =>  '',
87
+					  'cat_sort'            =>  true,
88
+					  'cat_filter'	        =>  true
89
+	);
90
+
91
+	// property type
92
+	$fields[] = array('listing_type' => $post_type,
93
+					  'field_type'          =>  'select',
94
+					  'data_type'           =>  'VARCHAR',
95
+					  'admin_title'         =>  __('Property Type', 'geodirectory'),
96
+					  'site_title'          =>  __('Property Type', 'geodirectory'),
97
+					  'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
+					  'htmlvar_name'        =>  'property_type',
99
+					  'is_active'           =>  true,
100
+					  'for_admin_use'       =>  false,
101
+					  'default_value'       =>  '',
102
+					  'show_in' 	        =>  '[detail],[listing]',
103
+					  'is_required'         =>  true,
104
+					  'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
+					  'validation_pattern'  =>  '',
106
+					  'validation_msg'      =>  '',
107
+					  'required_msg'        =>  '',
108
+					  'field_icon'          =>  'fas fa-home',
109
+					  'css_class'           =>  '',
110
+					  'cat_sort'            =>  true,
111
+					  'cat_filter'	        =>  true
112
+	);
113
+
114
+	// property bedrooms
115
+	$fields[] = array('listing_type' => $post_type,
116
+					  'field_type'          =>  'select',
117
+					  'data_type'           =>  'VARCHAR',
118
+					  'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
+					  'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
+					  'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
+					  'htmlvar_name'        =>  'property_bedrooms',
122
+					  'is_active'           =>  true,
123
+					  'for_admin_use'       =>  false,
124
+					  'default_value'       =>  '',
125
+					  'show_in' 	        =>  '[detail],[listing]',
126
+					  'is_required'         =>  true,
127
+					  'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
+					  'validation_pattern'  =>  '',
129
+					  'validation_msg'      =>  '',
130
+					  'required_msg'        =>  '',
131
+					  'field_icon'          =>  'fas fa-bed',
132
+					  'css_class'           =>  '',
133
+					  'cat_sort'            =>  true,
134
+					  'cat_filter'	        =>  true
135
+	);
136
+
137
+	// property bathrooms
138
+	$fields[] = array('listing_type' => $post_type,
139
+					  'field_type'          =>  'select',
140
+					  'data_type'           =>  'VARCHAR',
141
+					  'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
+					  'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
+					  'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
+					  'htmlvar_name'        =>  'property_bathrooms',
145
+					  'is_active'           =>  true,
146
+					  'for_admin_use'       =>  false,
147
+					  'default_value'       =>  '',
148
+					  'show_in' 	        =>  '[detail],[listing]',
149
+					  'is_required'         =>  true,
150
+					  'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
+					  'validation_pattern'  =>  '',
152
+					  'validation_msg'      =>  '',
153
+					  'required_msg'        =>  '',
154
+					  'field_icon'          =>  'fas fa-bold',
155
+					  'css_class'           =>  '',
156
+					  'cat_sort'            =>  true,
157
+					  'cat_filter'	        =>  true
158
+	);
159
+
160
+	// property area
161
+	$fields[] = array('listing_type' => $post_type,
162
+					  'field_type'          =>  'text',
163
+					  'data_type'           =>  'INT',
164
+					  'admin_title'         =>  __('Property Area', 'geodirectory'),
165
+					  'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
+					  'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
+					  'htmlvar_name'        =>  'property_area',
168
+					  'is_active'           =>  true,
169
+					  'for_admin_use'       =>  false,
170
+					  'default_value'       =>  '',
171
+					  'show_in' 	        =>  '[detail],[listing]',
172
+					  'is_required'         =>  false,
173
+					  'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
174
+					  'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
+					  'required_msg'        =>  '',
176
+					  'field_icon'          =>  'fas fa-chart-area',
177
+					  'css_class'           =>  '',
178
+					  'cat_sort'            =>  true,
179
+					  'cat_filter'	        =>  true
180
+	);
181
+
182
+	// property features
183
+	$fields[] = array('listing_type' => $post_type,
184
+					  'field_type'          =>  'multiselect',
185
+					  'data_type'           =>  'VARCHAR',
186
+					  'admin_title'         =>  __('Property Features', 'geodirectory'),
187
+					  'site_title'          =>  __('Features', 'geodirectory'),
188
+					  'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
+					  'htmlvar_name'        =>  'property_features',
190
+					  'is_active'           =>  true,
191
+					  'for_admin_use'       =>  false,
192
+					  'default_value'       =>  '',
193
+					  'show_in' 	        =>  '[detail],[listing]',
194
+					  'is_required'         =>  false,
195
+					  'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
+					  'validation_pattern'  =>  '',
197
+					  'validation_msg'      =>  '',
198
+					  'required_msg'        =>  '',
199
+					  'field_icon'          =>  'fas fa-plus-square',
200
+					  'css_class'           =>  'gd-comma-list',
201
+					  'cat_sort'            =>  true,
202
+					  'cat_filter'	        =>  true
203
+	);
204
+
205
+
206
+
207
+	/**
208
+	 * Filter the array of default custom fields DB table data.
209
+	 *
210
+	 * @since 1.6.6
211
+	 * @param string $fields The default custom fields as an array.
212
+	 */
213
+	$fields = apply_filters('geodir_property_rent_custom_fields', $fields);
214
+
215
+	return  $fields;
216 216
 }
217 217
 
218 218
 function geodir_property_rent_custom_fields_sort($post_type='gd_place') {
219 219
 
220 220
 
221
-    $fields = array();
222
-
223
-    // price sort
224
-    $fields[] = array(
225
-        'create_field'            => true,
226
-        'listing_type'            => $post_type,
227
-        'field_type'              => 'text',
228
-        'data_type'               => '',
229
-        'htmlvar_name'            => 'geodir_price',
230
-        'site_title'              => __('Price','geodirectory'),
231
-        'asc'                     => 1,
232
-        'asc_title'               => __('Price (lowest first)','geodirectory'),
233
-        'desc'                    => 1,
234
-        'desc_title'              => __('Price (highest first)','geodirectory'),
235
-        'is_active'               => 1
236
-    );
237
-
238
-    // area sort
239
-    $fields[] = array(
240
-        'create_field'            => true,
241
-        'listing_type'            => $post_type,
242
-        'field_type'              => 'text',
243
-        'data_type'               => '',
244
-        'htmlvar_name'            => 'geodir_property_area',
245
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
246
-        'asc'                     => 1,
247
-        'asc_title'               => __('Area (smallest first)','geodirectory'),
248
-        'desc'                    => 1,
249
-        'desc_title'              => __('Area (largest first)','geodirectory'),
250
-        'is_active'               => 1
251
-    );
252
-
253
-    // bedrooms sort
254
-    $fields[] = array(
255
-        'create_field'            => true,
256
-        'listing_type'            => $post_type,
257
-        'field_type'              => 'select',
258
-        'data_type'               => '',
259
-        'htmlvar_name'            => 'geodir_property_bedrooms',
260
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
261
-        'asc'                     => 1,
262
-        'asc_title'               => __('Bedrooms (least)','geodirectory'),
263
-        'desc'                    => 1,
264
-        'desc_title'              => __('Bedrooms (most)','geodirectory'),
265
-        'is_active'               => 1
266
-    );
267
-
268
-    /**
269
-     * Filter the array of advanced search fields DB table data.
270
-     *
271
-     * @since 1.6.6
272
-     * @param string $fields The default custom fields as an array.
273
-     */
274
-    $fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields);
275
-
276
-    return $fields;
221
+	$fields = array();
222
+
223
+	// price sort
224
+	$fields[] = array(
225
+		'create_field'            => true,
226
+		'listing_type'            => $post_type,
227
+		'field_type'              => 'text',
228
+		'data_type'               => '',
229
+		'htmlvar_name'            => 'geodir_price',
230
+		'site_title'              => __('Price','geodirectory'),
231
+		'asc'                     => 1,
232
+		'asc_title'               => __('Price (lowest first)','geodirectory'),
233
+		'desc'                    => 1,
234
+		'desc_title'              => __('Price (highest first)','geodirectory'),
235
+		'is_active'               => 1
236
+	);
237
+
238
+	// area sort
239
+	$fields[] = array(
240
+		'create_field'            => true,
241
+		'listing_type'            => $post_type,
242
+		'field_type'              => 'text',
243
+		'data_type'               => '',
244
+		'htmlvar_name'            => 'geodir_property_area',
245
+		'site_title'              => __('Area (Sq Ft)','geodirectory'),
246
+		'asc'                     => 1,
247
+		'asc_title'               => __('Area (smallest first)','geodirectory'),
248
+		'desc'                    => 1,
249
+		'desc_title'              => __('Area (largest first)','geodirectory'),
250
+		'is_active'               => 1
251
+	);
252
+
253
+	// bedrooms sort
254
+	$fields[] = array(
255
+		'create_field'            => true,
256
+		'listing_type'            => $post_type,
257
+		'field_type'              => 'select',
258
+		'data_type'               => '',
259
+		'htmlvar_name'            => 'geodir_property_bedrooms',
260
+		'site_title'              => __('Area (Sq Ft)','geodirectory'),
261
+		'asc'                     => 1,
262
+		'asc_title'               => __('Bedrooms (least)','geodirectory'),
263
+		'desc'                    => 1,
264
+		'desc_title'              => __('Bedrooms (most)','geodirectory'),
265
+		'is_active'               => 1
266
+	);
267
+
268
+	/**
269
+	 * Filter the array of advanced search fields DB table data.
270
+	 *
271
+	 * @since 1.6.6
272
+	 * @param string $fields The default custom fields as an array.
273
+	 */
274
+	$fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields);
275
+
276
+	return $fields;
277 277
 
278 278
 }
279 279
 
280 280
 function geodir_property_rent_custom_fields_advanced_search($post_type='gd_place') {
281 281
 
282 282
 
283
-    $fields = array();
284
-
285
-    // Price range
286
-    $fields[] = array(
287
-        'create_field'            => true,
288
-        'listing_type'            => $post_type,
289
-        'field_type'              => 'text',
290
-        'data_type'               => 'RANGE',
291
-        'is_active'               => 1,
292
-        'site_field_title'        => 'Price',
293
-        'field_data_type'         => 'FLOAT',
294
-        'main_search'             => 1,
295
-        'main_search_priority'    => 15,
296
-        'data_type_change'        => 'SELECT',
297
-        'search_condition_select' => 'SINGLE',
298
-        'search_min_value'        => '1000',
299
-        'search_max_value'        => '10000',
300
-        'search_diff_value'       => '1000',
301
-        'first_search_value'      => '0',
302
-        'first_search_text'       => '',
303
-        'last_search_text'        => '',
304
-        'search_condition'        => 'SELECT',
305
-        'site_htmlvar_name'       => 'geodir_price',
306
-        'htmlvar_name'            => 'geodir_price',
307
-        'field_title'             => 'geodir_price',
308
-        'expand_custom_value'     => '',
309
-        'front_search_title'      => 'Price Range pm',
310
-        'field_desc'              => ''
311
-    );
312
-
313
-    // bedrooms
314
-    $fields[] = array(
315
-        'create_field'            => true,
316
-        'listing_type'            => $post_type,
317
-        'field_type'              => 'select',
318
-        'data_type'               => 'CHECK',
319
-        'is_active'               => 1,
320
-        'site_field_title'        => 'Bedrooms',
321
-        'field_data_type'         => 'VARCHAR',
322
-        'main_search'             => 1,
323
-        'main_search_priority'    => 16,
324
-        'search_condition'        => 'SINGLE',
325
-        'site_htmlvar_name'       => 'geodir_property_bedrooms',
326
-        'htmlvar_name'            => 'geodir_property_bedrooms',
327
-        'field_title'             => 'geodir_property_bedrooms',
328
-        'front_search_title'      => 'Bedrooms',
329
-        'field_desc'              => '',
330
-        'expand_custom_value'     => 5,
331
-        'expand_search'           => 1,
332
-        'search_operator'         => 'OR'
333
-    );
334
-
335
-    // Property type
336
-    $fields[] = array(
337
-        'create_field'            => true,
338
-        'listing_type'            => $post_type,
339
-        'field_type'              => 'select',
340
-        'data_type'               => 'CHECK',
341
-        'is_active'               => 1,
342
-        'site_field_title'        => 'Property Type',
343
-        'field_data_type'         => 'VARCHAR',
344
-        'main_search'             => 0,
345
-        //'main_search_priority'    => 16,
346
-        'search_condition'        => 'SINGLE',
347
-        'site_htmlvar_name'       => 'geodir_property_type',
348
-        'htmlvar_name'            => 'geodir_property_type',
349
-        'field_title'             => 'geodir_property_type',
350
-        'front_search_title'      => 'Property Type',
351
-        'field_desc'              => '',
352
-        'expand_custom_value'     => 5,
353
-        'expand_search'           => 1,
354
-        'search_operator'         => 'OR'
355
-    );
356
-
357
-    // Property Features
358
-    $fields[] = array(
359
-        'create_field'            => true,
360
-        'listing_type'            => $post_type,
361
-        'field_type'              => 'multiselect',
362
-        'data_type'               => 'CHECK',
363
-        'is_active'               => 1,
364
-        'site_field_title'        => 'Features',
365
-        'field_data_type'         => 'VARCHAR',
366
-        'main_search'             => 0,
367
-        //'main_search_priority'    => 16,
368
-        'search_condition'        => 'SINGLE',
369
-        'site_htmlvar_name'       => 'geodir_property_features',
370
-        'htmlvar_name'            => 'geodir_property_features',
371
-        'field_title'             => 'geodir_property_features',
372
-        'front_search_title'      => 'Property Features',
373
-        'field_desc'              => '',
374
-        'expand_custom_value'     => 5,
375
-        'expand_search'           => 1,
376
-        'search_operator'         => 'AND'
377
-    );
378
-
379
-    // Property Bathrooms
380
-    $fields[] = array(
381
-        'create_field'            => true,
382
-        'listing_type'            => $post_type,
383
-        'field_type'              => 'select',
384
-        'data_type'               => 'CHECK',
385
-        'is_active'               => 1,
386
-        'site_field_title'        => 'Bathrooms',
387
-        'field_data_type'         => 'VARCHAR',
388
-        'main_search'             => 0,
389
-        //'main_search_priority'    => 16,
390
-        'search_condition'        => 'SINGLE',
391
-        'site_htmlvar_name'       => 'geodir_property_bathrooms',
392
-        'htmlvar_name'            => 'geodir_property_bathrooms',
393
-        'field_title'             => 'geodir_property_bathrooms',
394
-        'front_search_title'      => 'Bathrooms',
395
-        'field_desc'              => '',
396
-        'expand_custom_value'     => 5,
397
-        'expand_search'           => 1,
398
-        'search_operator'         => 'OR'
399
-    );
400
-
401
-    // Property Furnishing
402
-    $fields[] = array(
403
-        'create_field'            => true,
404
-        'listing_type'            => $post_type,
405
-        'field_type'              => 'select',
406
-        'data_type'               => 'CHECK',
407
-        'is_active'               => 1,
408
-        'site_field_title'        => 'Furnishing',
409
-        'field_data_type'         => 'VARCHAR',
410
-        'main_search'             => 0,
411
-        //'main_search_priority'    => 16,
412
-        'search_condition'        => 'SINGLE',
413
-        'site_htmlvar_name'       => 'geodir_property_furnishing',
414
-        'htmlvar_name'            => 'geodir_property_furnishing',
415
-        'field_title'             => 'geodir_property_furnishing',
416
-        'front_search_title'      => 'Furnishing',
417
-        'field_desc'              => '',
418
-        'expand_custom_value'     => 5,
419
-        'expand_search'           => 1,
420
-        'search_operator'         => 'OR'
421
-    );
422
-
423
-    // Property Status
424
-    $fields[] = array(
425
-        'create_field'            => true,
426
-        'listing_type'            => $post_type,
427
-        'field_type'              => 'select',
428
-        'data_type'               => 'CHECK',
429
-        'is_active'               => 1,
430
-        'site_field_title'        => 'Property Status',
431
-        'field_data_type'         => 'VARCHAR',
432
-        'main_search'             => 0,
433
-        //'main_search_priority'    => 16,
434
-        'search_condition'        => 'SINGLE',
435
-        'site_htmlvar_name'       => 'geodir_property_status',
436
-        'htmlvar_name'            => 'geodir_property_status',
437
-        'field_title'             => 'geodir_property_status',
438
-        'front_search_title'      => 'Property Status',
439
-        'field_desc'              => '',
440
-        'expand_custom_value'     => 5,
441
-        'expand_search'           => 1,
442
-        'search_operator'         => 'OR'
443
-    );
444
-
445
-
446
-
447
-    /**
448
-     * Filter the array of advanced search fields DB table data.
449
-     *
450
-     * @since 1.6.6
451
-     * @param string $fields The default custom fields as an array.
452
-     */
453
-    $fields = apply_filters('geodir_property_rent_custom_fields_advanced_search', $fields);
454
-
455
-    return $fields;
283
+	$fields = array();
284
+
285
+	// Price range
286
+	$fields[] = array(
287
+		'create_field'            => true,
288
+		'listing_type'            => $post_type,
289
+		'field_type'              => 'text',
290
+		'data_type'               => 'RANGE',
291
+		'is_active'               => 1,
292
+		'site_field_title'        => 'Price',
293
+		'field_data_type'         => 'FLOAT',
294
+		'main_search'             => 1,
295
+		'main_search_priority'    => 15,
296
+		'data_type_change'        => 'SELECT',
297
+		'search_condition_select' => 'SINGLE',
298
+		'search_min_value'        => '1000',
299
+		'search_max_value'        => '10000',
300
+		'search_diff_value'       => '1000',
301
+		'first_search_value'      => '0',
302
+		'first_search_text'       => '',
303
+		'last_search_text'        => '',
304
+		'search_condition'        => 'SELECT',
305
+		'site_htmlvar_name'       => 'geodir_price',
306
+		'htmlvar_name'            => 'geodir_price',
307
+		'field_title'             => 'geodir_price',
308
+		'expand_custom_value'     => '',
309
+		'front_search_title'      => 'Price Range pm',
310
+		'field_desc'              => ''
311
+	);
312
+
313
+	// bedrooms
314
+	$fields[] = array(
315
+		'create_field'            => true,
316
+		'listing_type'            => $post_type,
317
+		'field_type'              => 'select',
318
+		'data_type'               => 'CHECK',
319
+		'is_active'               => 1,
320
+		'site_field_title'        => 'Bedrooms',
321
+		'field_data_type'         => 'VARCHAR',
322
+		'main_search'             => 1,
323
+		'main_search_priority'    => 16,
324
+		'search_condition'        => 'SINGLE',
325
+		'site_htmlvar_name'       => 'geodir_property_bedrooms',
326
+		'htmlvar_name'            => 'geodir_property_bedrooms',
327
+		'field_title'             => 'geodir_property_bedrooms',
328
+		'front_search_title'      => 'Bedrooms',
329
+		'field_desc'              => '',
330
+		'expand_custom_value'     => 5,
331
+		'expand_search'           => 1,
332
+		'search_operator'         => 'OR'
333
+	);
334
+
335
+	// Property type
336
+	$fields[] = array(
337
+		'create_field'            => true,
338
+		'listing_type'            => $post_type,
339
+		'field_type'              => 'select',
340
+		'data_type'               => 'CHECK',
341
+		'is_active'               => 1,
342
+		'site_field_title'        => 'Property Type',
343
+		'field_data_type'         => 'VARCHAR',
344
+		'main_search'             => 0,
345
+		//'main_search_priority'    => 16,
346
+		'search_condition'        => 'SINGLE',
347
+		'site_htmlvar_name'       => 'geodir_property_type',
348
+		'htmlvar_name'            => 'geodir_property_type',
349
+		'field_title'             => 'geodir_property_type',
350
+		'front_search_title'      => 'Property Type',
351
+		'field_desc'              => '',
352
+		'expand_custom_value'     => 5,
353
+		'expand_search'           => 1,
354
+		'search_operator'         => 'OR'
355
+	);
356
+
357
+	// Property Features
358
+	$fields[] = array(
359
+		'create_field'            => true,
360
+		'listing_type'            => $post_type,
361
+		'field_type'              => 'multiselect',
362
+		'data_type'               => 'CHECK',
363
+		'is_active'               => 1,
364
+		'site_field_title'        => 'Features',
365
+		'field_data_type'         => 'VARCHAR',
366
+		'main_search'             => 0,
367
+		//'main_search_priority'    => 16,
368
+		'search_condition'        => 'SINGLE',
369
+		'site_htmlvar_name'       => 'geodir_property_features',
370
+		'htmlvar_name'            => 'geodir_property_features',
371
+		'field_title'             => 'geodir_property_features',
372
+		'front_search_title'      => 'Property Features',
373
+		'field_desc'              => '',
374
+		'expand_custom_value'     => 5,
375
+		'expand_search'           => 1,
376
+		'search_operator'         => 'AND'
377
+	);
378
+
379
+	// Property Bathrooms
380
+	$fields[] = array(
381
+		'create_field'            => true,
382
+		'listing_type'            => $post_type,
383
+		'field_type'              => 'select',
384
+		'data_type'               => 'CHECK',
385
+		'is_active'               => 1,
386
+		'site_field_title'        => 'Bathrooms',
387
+		'field_data_type'         => 'VARCHAR',
388
+		'main_search'             => 0,
389
+		//'main_search_priority'    => 16,
390
+		'search_condition'        => 'SINGLE',
391
+		'site_htmlvar_name'       => 'geodir_property_bathrooms',
392
+		'htmlvar_name'            => 'geodir_property_bathrooms',
393
+		'field_title'             => 'geodir_property_bathrooms',
394
+		'front_search_title'      => 'Bathrooms',
395
+		'field_desc'              => '',
396
+		'expand_custom_value'     => 5,
397
+		'expand_search'           => 1,
398
+		'search_operator'         => 'OR'
399
+	);
400
+
401
+	// Property Furnishing
402
+	$fields[] = array(
403
+		'create_field'            => true,
404
+		'listing_type'            => $post_type,
405
+		'field_type'              => 'select',
406
+		'data_type'               => 'CHECK',
407
+		'is_active'               => 1,
408
+		'site_field_title'        => 'Furnishing',
409
+		'field_data_type'         => 'VARCHAR',
410
+		'main_search'             => 0,
411
+		//'main_search_priority'    => 16,
412
+		'search_condition'        => 'SINGLE',
413
+		'site_htmlvar_name'       => 'geodir_property_furnishing',
414
+		'htmlvar_name'            => 'geodir_property_furnishing',
415
+		'field_title'             => 'geodir_property_furnishing',
416
+		'front_search_title'      => 'Furnishing',
417
+		'field_desc'              => '',
418
+		'expand_custom_value'     => 5,
419
+		'expand_search'           => 1,
420
+		'search_operator'         => 'OR'
421
+	);
422
+
423
+	// Property Status
424
+	$fields[] = array(
425
+		'create_field'            => true,
426
+		'listing_type'            => $post_type,
427
+		'field_type'              => 'select',
428
+		'data_type'               => 'CHECK',
429
+		'is_active'               => 1,
430
+		'site_field_title'        => 'Property Status',
431
+		'field_data_type'         => 'VARCHAR',
432
+		'main_search'             => 0,
433
+		//'main_search_priority'    => 16,
434
+		'search_condition'        => 'SINGLE',
435
+		'site_htmlvar_name'       => 'geodir_property_status',
436
+		'htmlvar_name'            => 'geodir_property_status',
437
+		'field_title'             => 'geodir_property_status',
438
+		'front_search_title'      => 'Property Status',
439
+		'field_desc'              => '',
440
+		'expand_custom_value'     => 5,
441
+		'expand_search'           => 1,
442
+		'search_operator'         => 'OR'
443
+	);
444
+
445
+
446
+
447
+	/**
448
+	 * Filter the array of advanced search fields DB table data.
449
+	 *
450
+	 * @since 1.6.6
451
+	 * @param string $fields The default custom fields as an array.
452
+	 */
453
+	$fields = apply_filters('geodir_property_rent_custom_fields_advanced_search', $fields);
454
+
455
+	return $fields;
456 456
 }
457 457
 
458 458
 global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
@@ -462,52 +462,52 @@  discard block
 block discarded – undo
462 462
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
463 463
 
464 464
 if($dummy_post_index==1){
465
-    // add the dummy categories
466
-    geodir_dummy_data_taxonomies($post_type,$category_array );
467
-
468
-    // add the dummy custom fields
469
-    $fields = geodir_property_rent_custom_fields($post_type);
470
-    geodir_create_dummy_fields($fields);
471
-
472
-    // add sort order items
473
-    $sort_fields = geodir_property_rent_custom_fields_sort($post_type);
474
-    foreach($sort_fields as $sort){
475
-        geodir_custom_sort_field_save($sort);
476
-    }
477
-
478
-    // update the type currently installed
479
-    update_option($post_type.'_dummy_data_type','property_rent');
480
-
481
-    // add the advanced search fields
482
-    if (defined('GEODIRADVANCESEARCH_VERSION')){
483
-        $search_fields = geodir_property_rent_custom_fields_advanced_search($post_type);
484
-        foreach($search_fields as $sfield){
485
-            geodir_custom_advance_search_field_save( $sfield );
486
-        }
487
-    }
465
+	// add the dummy categories
466
+	geodir_dummy_data_taxonomies($post_type,$category_array );
467
+
468
+	// add the dummy custom fields
469
+	$fields = geodir_property_rent_custom_fields($post_type);
470
+	geodir_create_dummy_fields($fields);
471
+
472
+	// add sort order items
473
+	$sort_fields = geodir_property_rent_custom_fields_sort($post_type);
474
+	foreach($sort_fields as $sort){
475
+		geodir_custom_sort_field_save($sort);
476
+	}
477
+
478
+	// update the type currently installed
479
+	update_option($post_type.'_dummy_data_type','property_rent');
480
+
481
+	// add the advanced search fields
482
+	if (defined('GEODIRADVANCESEARCH_VERSION')){
483
+		$search_fields = geodir_property_rent_custom_fields_advanced_search($post_type);
484
+		foreach($search_fields as $sfield){
485
+			geodir_custom_advance_search_field_save( $sfield );
486
+		}
487
+	}
488 488
 }
489 489
 
490 490
 if (geodir_dummy_folder_exists())
491
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
491
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
492 492
 else
493
-    $dummy_image_url = 'https://wpgeodirectory.com/dummy';
493
+	$dummy_image_url = 'https://wpgeodirectory.com/dummy';
494 494
 
495 495
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
496 496
 
497 497
 switch ($dummy_post_index) {
498 498
 
499
-    case(1):
500
-        $image_array[] = "$dummy_image_url/ps/psf1.jpg";
501
-        $image_array[] = "$dummy_image_url/ps/psl1.jpg";
502
-        $image_array[] = "$dummy_image_url/ps/psb1.jpg";
503
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
504
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
499
+	case(1):
500
+		$image_array[] = "$dummy_image_url/ps/psf1.jpg";
501
+		$image_array[] = "$dummy_image_url/ps/psl1.jpg";
502
+		$image_array[] = "$dummy_image_url/ps/psb1.jpg";
503
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
504
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
505 505
 
506 506
 
507
-        $post_info[] = array(
508
-            "listing_type" => $post_type,
509
-            "post_title" => 'Eastern Lodge',
510
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
507
+		$post_info[] = array(
508
+			"listing_type" => $post_type,
509
+			"post_title" => 'Eastern Lodge',
510
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
511 511
 
512 512
 Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien.
513 513
 
@@ -516,42 +516,42 @@  discard block
 block discarded – undo
516 516
 Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat.
517 517
 
518 518
 Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.',
519
-            "post_images" => $image_array,
520
-            "post_category" => array($post_type.'category' => array($category_array[1])),
521
-            "post_tags" => array('Tags', 'Sample Tags'),
522
-            "geodir_video" => '',
523
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
524
-            "geodir_contact" => '(111) 677-4444',
525
-            "geodir_email" => '[email protected]',
526
-            "geodir_website" => 'http://example.com/',
527
-            "geodir_twitter" => 'http://example.com/',
528
-            "geodir_facebook" => 'http://example.com/',
529
-            "geodir_price" => '1750',
530
-            "geodir_property_status" => 'For Rent',
531
-            'geodir_property_furnishing' => 'Furnished',
532
-            'geodir_property_type' => 'Detached house',
533
-            'geodir_property_bedrooms' => '3',
534
-            'geodir_property_bathrooms' => '2',
535
-            'geodir_property_area' => '1850',
536
-            'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
537
-            "post_dummy" => '1'
538
-        );
539
-
540
-
541
-        break;
542
-    case 2:
543
-        $image_array = array();
544
-        $post_meta = array();
545
-        $image_array[] = "$dummy_image_url/ps/psf2.jpg";
546
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
547
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
548
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
549
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
550
-
551
-        $post_info[] = array(
552
-            "listing_type" => $post_type,
553
-            "post_title" => 'Daisy Street',
554
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
519
+			"post_images" => $image_array,
520
+			"post_category" => array($post_type.'category' => array($category_array[1])),
521
+			"post_tags" => array('Tags', 'Sample Tags'),
522
+			"geodir_video" => '',
523
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
524
+			"geodir_contact" => '(111) 677-4444',
525
+			"geodir_email" => '[email protected]',
526
+			"geodir_website" => 'http://example.com/',
527
+			"geodir_twitter" => 'http://example.com/',
528
+			"geodir_facebook" => 'http://example.com/',
529
+			"geodir_price" => '1750',
530
+			"geodir_property_status" => 'For Rent',
531
+			'geodir_property_furnishing' => 'Furnished',
532
+			'geodir_property_type' => 'Detached house',
533
+			'geodir_property_bedrooms' => '3',
534
+			'geodir_property_bathrooms' => '2',
535
+			'geodir_property_area' => '1850',
536
+			'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
537
+			"post_dummy" => '1'
538
+		);
539
+
540
+
541
+		break;
542
+	case 2:
543
+		$image_array = array();
544
+		$post_meta = array();
545
+		$image_array[] = "$dummy_image_url/ps/psf2.jpg";
546
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
547
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
548
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
549
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
550
+
551
+		$post_info[] = array(
552
+			"listing_type" => $post_type,
553
+			"post_title" => 'Daisy Street',
554
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
555 555
 
556 556
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
557 557
 
@@ -561,42 +561,42 @@  discard block
 block discarded – undo
561 561
 
562 562
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
563 563
 
564
-            "post_images" => $image_array,
565
-            "post_category" => array($post_type.'category' => array($category_array[1])),
566
-            "post_tags" => array('Garage'),
567
-            "geodir_video" => '',
568
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
569
-            "geodir_contact" => '(222) 777-1111',
570
-            "geodir_email" => '[email protected]',
571
-            "geodir_website" => 'http://example.com/',
572
-            "geodir_twitter" => 'http://example.com/',
573
-            "geodir_facebook" => 'http://example.com/',
574
-            "geodir_price" => '1150',
575
-            "geodir_property_status" => 'Let',
576
-            'geodir_property_furnishing' => 'Unfurnished',
577
-            'geodir_property_type' => 'Detached house',
578
-            'geodir_property_bedrooms' => '5',
579
-            'geodir_property_bathrooms' => '3',
580
-            'geodir_property_area' => '2650',
581
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
582
-            "post_dummy" => '1'
583
-        );
584
-
585
-        break;
586
-
587
-    case 3:
588
-        $image_array = array();
589
-        $post_meta = array();
590
-        $image_array[] = "$dummy_image_url/ps/psf3.jpg";
591
-        $image_array[] = "$dummy_image_url/ps/psl3.jpg";
592
-        $image_array[] = "$dummy_image_url/ps/psb3.jpg";
593
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
594
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
595
-
596
-        $post_info[] = array(
597
-            "listing_type" => $post_type,
598
-            "post_title" => 'Northbay House',
599
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
564
+			"post_images" => $image_array,
565
+			"post_category" => array($post_type.'category' => array($category_array[1])),
566
+			"post_tags" => array('Garage'),
567
+			"geodir_video" => '',
568
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
569
+			"geodir_contact" => '(222) 777-1111',
570
+			"geodir_email" => '[email protected]',
571
+			"geodir_website" => 'http://example.com/',
572
+			"geodir_twitter" => 'http://example.com/',
573
+			"geodir_facebook" => 'http://example.com/',
574
+			"geodir_price" => '1150',
575
+			"geodir_property_status" => 'Let',
576
+			'geodir_property_furnishing' => 'Unfurnished',
577
+			'geodir_property_type' => 'Detached house',
578
+			'geodir_property_bedrooms' => '5',
579
+			'geodir_property_bathrooms' => '3',
580
+			'geodir_property_area' => '2650',
581
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
582
+			"post_dummy" => '1'
583
+		);
584
+
585
+		break;
586
+
587
+	case 3:
588
+		$image_array = array();
589
+		$post_meta = array();
590
+		$image_array[] = "$dummy_image_url/ps/psf3.jpg";
591
+		$image_array[] = "$dummy_image_url/ps/psl3.jpg";
592
+		$image_array[] = "$dummy_image_url/ps/psb3.jpg";
593
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
594
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
595
+
596
+		$post_info[] = array(
597
+			"listing_type" => $post_type,
598
+			"post_title" => 'Northbay House',
599
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
600 600
 
601 601
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
602 602
 
@@ -606,43 +606,43 @@  discard block
 block discarded – undo
606 606
 
607 607
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
608 608
 
609
-            "post_images" => $image_array,
610
-            "post_category" => array($post_type.'category' => array($category_array[1])),
611
-            "post_tags" => array('Tags', 'Sample Tags'),
612
-            "geodir_video" => '',
613
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
614
-            "geodir_contact" => '(222) 777-1111',
615
-            "geodir_email" => '[email protected]',
616
-            "geodir_website" => 'http://example.com/',
617
-            "geodir_twitter" => 'http://example.com/',
618
-            "geodir_facebook" => 'http://example.com/',
619
-            "geodir_price" => '1300',
620
-            "geodir_property_status" => 'Under Offer',
621
-            'geodir_property_furnishing' => 'Unfurnished',
622
-            'geodir_property_type' => 'Detached house',
623
-            'geodir_property_bedrooms' => '6',
624
-            'geodir_property_bathrooms' => '6',
625
-            'geodir_property_area' => '1650',
626
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
627
-            "post_dummy" => '1'
628
-        );
629
-
630
-        break;
631
-
632
-
633
-    case 4:
634
-        $image_array = array();
635
-        $post_meta = array();
636
-        $image_array[] = "$dummy_image_url/ps/psf4.jpg";
637
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
638
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
639
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
640
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
641
-
642
-        $post_info[] = array(
643
-            "listing_type" => $post_type,
644
-            "post_title" => 'Jesmond Mansion',
645
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
609
+			"post_images" => $image_array,
610
+			"post_category" => array($post_type.'category' => array($category_array[1])),
611
+			"post_tags" => array('Tags', 'Sample Tags'),
612
+			"geodir_video" => '',
613
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
614
+			"geodir_contact" => '(222) 777-1111',
615
+			"geodir_email" => '[email protected]',
616
+			"geodir_website" => 'http://example.com/',
617
+			"geodir_twitter" => 'http://example.com/',
618
+			"geodir_facebook" => 'http://example.com/',
619
+			"geodir_price" => '1300',
620
+			"geodir_property_status" => 'Under Offer',
621
+			'geodir_property_furnishing' => 'Unfurnished',
622
+			'geodir_property_type' => 'Detached house',
623
+			'geodir_property_bedrooms' => '6',
624
+			'geodir_property_bathrooms' => '6',
625
+			'geodir_property_area' => '1650',
626
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
627
+			"post_dummy" => '1'
628
+		);
629
+
630
+		break;
631
+
632
+
633
+	case 4:
634
+		$image_array = array();
635
+		$post_meta = array();
636
+		$image_array[] = "$dummy_image_url/ps/psf4.jpg";
637
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
638
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
639
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
640
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
641
+
642
+		$post_info[] = array(
643
+			"listing_type" => $post_type,
644
+			"post_title" => 'Jesmond Mansion',
645
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
646 646
 
647 647
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
648 648
 
@@ -652,42 +652,42 @@  discard block
 block discarded – undo
652 652
 
653 653
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
654 654
 
655
-            "post_images" => $image_array,
656
-            "post_category" => array($post_type.'category' => array($category_array[1])),
657
-            "post_tags" => array('Tags', 'Sample Tags'),
658
-            "geodir_video" => '',
659
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
660
-            "geodir_contact" => '(222) 777-1111',
661
-            "geodir_email" => '[email protected]',
662
-            "geodir_website" => 'http://example.com/',
663
-            "geodir_twitter" => 'http://example.com/',
664
-            "geodir_facebook" => 'http://example.com/',
665
-            "geodir_price" => '13000',
666
-            "geodir_property_status" => 'Under Offer',
667
-            'geodir_property_furnishing' => 'Partially furnished',
668
-            'geodir_property_type' => 'Detached house',
669
-            'geodir_property_bedrooms' => '10',
670
-            'geodir_property_bathrooms' => '7',
671
-            'geodir_property_area' => '6600',
672
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
673
-            "post_dummy" => '1'
674
-        );
675
-
676
-        break;
677
-
678
-    case 5:
679
-        $image_array = array();
680
-        $post_meta = array();
681
-        $image_array[] = "$dummy_image_url/ps/psf5.jpg";
682
-        $image_array[] = "$dummy_image_url/ps/psl5.jpg";
683
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
684
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
685
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
686
-
687
-        $post_info[] = array(
688
-            "listing_type" => $post_type,
689
-            "post_title" => 'Springfield Lodge',
690
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
655
+			"post_images" => $image_array,
656
+			"post_category" => array($post_type.'category' => array($category_array[1])),
657
+			"post_tags" => array('Tags', 'Sample Tags'),
658
+			"geodir_video" => '',
659
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
660
+			"geodir_contact" => '(222) 777-1111',
661
+			"geodir_email" => '[email protected]',
662
+			"geodir_website" => 'http://example.com/',
663
+			"geodir_twitter" => 'http://example.com/',
664
+			"geodir_facebook" => 'http://example.com/',
665
+			"geodir_price" => '13000',
666
+			"geodir_property_status" => 'Under Offer',
667
+			'geodir_property_furnishing' => 'Partially furnished',
668
+			'geodir_property_type' => 'Detached house',
669
+			'geodir_property_bedrooms' => '10',
670
+			'geodir_property_bathrooms' => '7',
671
+			'geodir_property_area' => '6600',
672
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
673
+			"post_dummy" => '1'
674
+		);
675
+
676
+		break;
677
+
678
+	case 5:
679
+		$image_array = array();
680
+		$post_meta = array();
681
+		$image_array[] = "$dummy_image_url/ps/psf5.jpg";
682
+		$image_array[] = "$dummy_image_url/ps/psl5.jpg";
683
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
684
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
685
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
686
+
687
+		$post_info[] = array(
688
+			"listing_type" => $post_type,
689
+			"post_title" => 'Springfield Lodge',
690
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
691 691
 
692 692
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
693 693
 
@@ -697,42 +697,42 @@  discard block
 block discarded – undo
697 697
 
698 698
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
699 699
 
700
-            "post_images" => $image_array,
701
-            "post_category" => array($post_type.'category' => array($category_array[1])),
702
-            "post_tags" => array('Tags', 'Sample Tags'),
703
-            "geodir_video" => '',
704
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
705
-            "geodir_contact" => '(222) 777-1111',
706
-            "geodir_email" => '[email protected]',
707
-            "geodir_website" => 'http://example.com/',
708
-            "geodir_twitter" => 'http://example.com/',
709
-            "geodir_facebook" => 'http://example.com/',
710
-            "geodir_price" => '1800',
711
-            "geodir_property_status" => 'For Rent',
712
-            'geodir_property_furnishing' => 'Optional',
713
-            'geodir_property_type' => 'Detached house',
714
-            'geodir_property_bedrooms' => '4',
715
-            'geodir_property_bathrooms' => '3',
716
-            'geodir_property_area' => '3700',
717
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
718
-            "post_dummy" => '1'
719
-        );
720
-
721
-        break;
722
-
723
-    case 6:
724
-        $image_array = array();
725
-        $post_meta = array();
726
-        $image_array[] = "$dummy_image_url/ps/psf6.jpg";
727
-        $image_array[] = "$dummy_image_url/ps/psl6.jpg";
728
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
729
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
730
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
731
-
732
-        $post_info[] = array(
733
-            "listing_type" => $post_type,
734
-            "post_title" => 'Forrest Park',
735
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
700
+			"post_images" => $image_array,
701
+			"post_category" => array($post_type.'category' => array($category_array[1])),
702
+			"post_tags" => array('Tags', 'Sample Tags'),
703
+			"geodir_video" => '',
704
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
705
+			"geodir_contact" => '(222) 777-1111',
706
+			"geodir_email" => '[email protected]',
707
+			"geodir_website" => 'http://example.com/',
708
+			"geodir_twitter" => 'http://example.com/',
709
+			"geodir_facebook" => 'http://example.com/',
710
+			"geodir_price" => '1800',
711
+			"geodir_property_status" => 'For Rent',
712
+			'geodir_property_furnishing' => 'Optional',
713
+			'geodir_property_type' => 'Detached house',
714
+			'geodir_property_bedrooms' => '4',
715
+			'geodir_property_bathrooms' => '3',
716
+			'geodir_property_area' => '3700',
717
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
718
+			"post_dummy" => '1'
719
+		);
720
+
721
+		break;
722
+
723
+	case 6:
724
+		$image_array = array();
725
+		$post_meta = array();
726
+		$image_array[] = "$dummy_image_url/ps/psf6.jpg";
727
+		$image_array[] = "$dummy_image_url/ps/psl6.jpg";
728
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
729
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
730
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
731
+
732
+		$post_info[] = array(
733
+			"listing_type" => $post_type,
734
+			"post_title" => 'Forrest Park',
735
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
736 736
 
737 737
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
738 738
 
@@ -742,42 +742,42 @@  discard block
 block discarded – undo
742 742
 
743 743
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
744 744
 
745
-            "post_images" => $image_array,
746
-            "post_category" => array($post_type.'category' => array($category_array[1])),
747
-            "post_tags" => array('Tags', 'Sample Tags'),
748
-            "geodir_video" => '',
749
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
750
-            "geodir_contact" => '(222) 777-1111',
751
-            "geodir_email" => '[email protected]',
752
-            "geodir_website" => 'http://example.com/',
753
-            "geodir_twitter" => 'http://example.com/',
754
-            "geodir_facebook" => 'http://example.com/',
755
-            "geodir_price" => '2700',
756
-            "geodir_property_status" => 'For Rent',
757
-            'geodir_property_furnishing' => 'Unfurnished',
758
-            'geodir_property_type' => 'Detached house',
759
-            'geodir_property_bedrooms' => '5',
760
-            'geodir_property_bathrooms' => '4',
761
-            'geodir_property_area' => '2250',
762
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
763
-            "post_dummy" => '1'
764
-        );
765
-
766
-        break;
767
-
768
-    case 7:
769
-        $image_array = array();
770
-        $post_meta = array();
771
-        $image_array[] = "$dummy_image_url/ps/psf7.jpg";
772
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
773
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
774
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
775
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
776
-
777
-        $post_info[] = array(
778
-            "listing_type" => $post_type,
779
-            "post_title" => 'Fraser Suites',
780
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
745
+			"post_images" => $image_array,
746
+			"post_category" => array($post_type.'category' => array($category_array[1])),
747
+			"post_tags" => array('Tags', 'Sample Tags'),
748
+			"geodir_video" => '',
749
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
750
+			"geodir_contact" => '(222) 777-1111',
751
+			"geodir_email" => '[email protected]',
752
+			"geodir_website" => 'http://example.com/',
753
+			"geodir_twitter" => 'http://example.com/',
754
+			"geodir_facebook" => 'http://example.com/',
755
+			"geodir_price" => '2700',
756
+			"geodir_property_status" => 'For Rent',
757
+			'geodir_property_furnishing' => 'Unfurnished',
758
+			'geodir_property_type' => 'Detached house',
759
+			'geodir_property_bedrooms' => '5',
760
+			'geodir_property_bathrooms' => '4',
761
+			'geodir_property_area' => '2250',
762
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
763
+			"post_dummy" => '1'
764
+		);
765
+
766
+		break;
767
+
768
+	case 7:
769
+		$image_array = array();
770
+		$post_meta = array();
771
+		$image_array[] = "$dummy_image_url/ps/psf7.jpg";
772
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
773
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
774
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
775
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
776
+
777
+		$post_info[] = array(
778
+			"listing_type" => $post_type,
779
+			"post_title" => 'Fraser Suites',
780
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
781 781
 
782 782
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
783 783
 
@@ -787,42 +787,42 @@  discard block
 block discarded – undo
787 787
 
788 788
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
789 789
 
790
-            "post_images" => $image_array,
791
-            "post_category" => array($post_type.'category' => array($category_array[0])),
792
-            "post_tags" => array('Tags', 'Sample Tags'),
793
-            "geodir_video" => '',
794
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
795
-            "geodir_contact" => '(222) 777-1111',
796
-            "geodir_email" => '[email protected]',
797
-            "geodir_website" => 'http://example.com/',
798
-            "geodir_twitter" => 'http://example.com/',
799
-            "geodir_facebook" => 'http://example.com/',
800
-            "geodir_price" => '1450',
801
-            "geodir_property_status" => 'For Rent',
802
-            'geodir_property_furnishing' => 'Unfurnished',
803
-            'geodir_property_type' => 'Apartment',
804
-            'geodir_property_bedrooms' => '3',
805
-            'geodir_property_bathrooms' => '2',
806
-            'geodir_property_area' => '1250',
807
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
808
-            "post_dummy" => '1'
809
-        );
810
-
811
-        break;
812
-
813
-    case 8:
814
-        $image_array = array();
815
-        $post_meta = array();
816
-        $image_array[] = "$dummy_image_url/ps/psf8.jpg";
817
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
818
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
819
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
820
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
821
-
822
-        $post_info[] = array(
823
-            "listing_type" => $post_type,
824
-            "post_title" => 'Richmore Apartments',
825
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
790
+			"post_images" => $image_array,
791
+			"post_category" => array($post_type.'category' => array($category_array[0])),
792
+			"post_tags" => array('Tags', 'Sample Tags'),
793
+			"geodir_video" => '',
794
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
795
+			"geodir_contact" => '(222) 777-1111',
796
+			"geodir_email" => '[email protected]',
797
+			"geodir_website" => 'http://example.com/',
798
+			"geodir_twitter" => 'http://example.com/',
799
+			"geodir_facebook" => 'http://example.com/',
800
+			"geodir_price" => '1450',
801
+			"geodir_property_status" => 'For Rent',
802
+			'geodir_property_furnishing' => 'Unfurnished',
803
+			'geodir_property_type' => 'Apartment',
804
+			'geodir_property_bedrooms' => '3',
805
+			'geodir_property_bathrooms' => '2',
806
+			'geodir_property_area' => '1250',
807
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
808
+			"post_dummy" => '1'
809
+		);
810
+
811
+		break;
812
+
813
+	case 8:
814
+		$image_array = array();
815
+		$post_meta = array();
816
+		$image_array[] = "$dummy_image_url/ps/psf8.jpg";
817
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
818
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
819
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
820
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
821
+
822
+		$post_info[] = array(
823
+			"listing_type" => $post_type,
824
+			"post_title" => 'Richmore Apartments',
825
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
826 826
 
827 827
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
828 828
 
@@ -832,43 +832,43 @@  discard block
 block discarded – undo
832 832
 
833 833
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
834 834
 
835
-            "post_images" => $image_array,
836
-            "post_category" => array($post_type.'category' => array($category_array[0])),
837
-            "post_tags" => array('Tags', 'Sample Tags'),
838
-            "geodir_video" => '',
839
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
840
-            "geodir_contact" => '(222) 777-1111',
841
-            "geodir_email" => '[email protected]',
842
-            "geodir_website" => 'http://example.com/',
843
-            "geodir_twitter" => 'http://example.com/',
844
-            "geodir_facebook" => 'http://example.com/',
845
-            "geodir_price" => '2000',
846
-            "geodir_property_status" => 'For Rent',
847
-            'geodir_property_furnishing' => 'Unfurnished',
848
-            'geodir_property_type' => 'Apartment',
849
-            'geodir_property_bedrooms' => '2',
850
-            'geodir_property_bathrooms' => '2',
851
-            'geodir_property_area' => '1750',
852
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
853
-            "post_dummy" => '1'
854
-        );
855
-
856
-        break;
857
-
858
-
859
-    case 9:
860
-        $image_array = array();
861
-        $post_meta = array();
862
-        $image_array[] = "$dummy_image_url/ps/psf9.jpg";
863
-        $image_array[] = "$dummy_image_url/ps/psc9.jpg";
864
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
865
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
866
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
867
-
868
-        $post_info[] = array(
869
-            "listing_type" => $post_type,
870
-            "post_title" => 'Hotel Alpina',
871
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
835
+			"post_images" => $image_array,
836
+			"post_category" => array($post_type.'category' => array($category_array[0])),
837
+			"post_tags" => array('Tags', 'Sample Tags'),
838
+			"geodir_video" => '',
839
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
840
+			"geodir_contact" => '(222) 777-1111',
841
+			"geodir_email" => '[email protected]',
842
+			"geodir_website" => 'http://example.com/',
843
+			"geodir_twitter" => 'http://example.com/',
844
+			"geodir_facebook" => 'http://example.com/',
845
+			"geodir_price" => '2000',
846
+			"geodir_property_status" => 'For Rent',
847
+			'geodir_property_furnishing' => 'Unfurnished',
848
+			'geodir_property_type' => 'Apartment',
849
+			'geodir_property_bedrooms' => '2',
850
+			'geodir_property_bathrooms' => '2',
851
+			'geodir_property_area' => '1750',
852
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
853
+			"post_dummy" => '1'
854
+		);
855
+
856
+		break;
857
+
858
+
859
+	case 9:
860
+		$image_array = array();
861
+		$post_meta = array();
862
+		$image_array[] = "$dummy_image_url/ps/psf9.jpg";
863
+		$image_array[] = "$dummy_image_url/ps/psc9.jpg";
864
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
865
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
866
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
867
+
868
+		$post_info[] = array(
869
+			"listing_type" => $post_type,
870
+			"post_title" => 'Hotel Alpina',
871
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
872 872
 
873 873
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
874 874
 
@@ -878,39 +878,39 @@  discard block
 block discarded – undo
878 878
 
879 879
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
880 880
 
881
-            "post_images" => $image_array,
882
-            "post_category" => array($post_type.'category' => array($category_array[2])),
883
-            "post_tags" => array('Tags', 'Sample Tags'),
884
-            "geodir_video" => '',
885
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
886
-            "geodir_contact" => '(222) 777-1111',
887
-            "geodir_email" => '[email protected]',
888
-            "geodir_website" => 'http://example.com/',
889
-            "geodir_twitter" => 'http://example.com/',
890
-            "geodir_facebook" => 'http://example.com/',
891
-            "geodir_price" => '60000',
892
-            "geodir_property_status" => 'For Rent',
893
-            'geodir_property_furnishing' => 'Furnished',
894
-            'geodir_property_type' => 'Hotel',
895
-            'geodir_property_bedrooms' => '120',
896
-            'geodir_property_bathrooms' => '133',
897
-            'geodir_property_area' => '35000',
898
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
899
-            "post_dummy" => '1'
900
-        );
901
-
902
-        break;
903
-
904
-    case 10:
905
-        $image_array = array();
906
-        $post_meta = array();
907
-        $image_array[] = "$dummy_image_url/ps/psf10.jpg";
908
-        $image_array[] = "$dummy_image_url/ps/psf102.jpg";
909
-
910
-        $post_info[] = array(
911
-            "listing_type" => $post_type,
912
-            "post_title" => 'Development Land',
913
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
881
+			"post_images" => $image_array,
882
+			"post_category" => array($post_type.'category' => array($category_array[2])),
883
+			"post_tags" => array('Tags', 'Sample Tags'),
884
+			"geodir_video" => '',
885
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
886
+			"geodir_contact" => '(222) 777-1111',
887
+			"geodir_email" => '[email protected]',
888
+			"geodir_website" => 'http://example.com/',
889
+			"geodir_twitter" => 'http://example.com/',
890
+			"geodir_facebook" => 'http://example.com/',
891
+			"geodir_price" => '60000',
892
+			"geodir_property_status" => 'For Rent',
893
+			'geodir_property_furnishing' => 'Furnished',
894
+			'geodir_property_type' => 'Hotel',
895
+			'geodir_property_bedrooms' => '120',
896
+			'geodir_property_bathrooms' => '133',
897
+			'geodir_property_area' => '35000',
898
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
899
+			"post_dummy" => '1'
900
+		);
901
+
902
+		break;
903
+
904
+	case 10:
905
+		$image_array = array();
906
+		$post_meta = array();
907
+		$image_array[] = "$dummy_image_url/ps/psf10.jpg";
908
+		$image_array[] = "$dummy_image_url/ps/psf102.jpg";
909
+
910
+		$post_info[] = array(
911
+			"listing_type" => $post_type,
912
+			"post_title" => 'Development Land',
913
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
914 914
 
915 915
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
916 916
 
@@ -920,93 +920,93 @@  discard block
 block discarded – undo
920 920
 
921 921
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
922 922
 
923
-            "post_images" => $image_array,
924
-            "post_category" => array($post_type.'category' => array($category_array[3])),
925
-            "post_tags" => array('Tags', 'Sample Tags'),
926
-            "geodir_video" => '',
927
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
928
-            "geodir_contact" => '(222) 777-1111',
929
-            "geodir_email" => '[email protected]',
930
-            "geodir_website" => 'http://example.com/',
931
-            "geodir_twitter" => 'http://example.com/',
932
-            "geodir_facebook" => 'http://example.com/',
933
-            "geodir_price" => '800',
934
-            "geodir_property_status" => 'For Rent',
935
-            'geodir_property_furnishing' => '',
936
-            'geodir_property_type' => 'Land',
937
-            'geodir_property_bedrooms' => '',
938
-            'geodir_property_bathrooms' => '',
939
-            'geodir_property_area' => '250000',
940
-            'geodir_property_features' => '',
941
-            "post_dummy" => '1'
942
-        );
943
-
944
-        break;
923
+			"post_images" => $image_array,
924
+			"post_category" => array($post_type.'category' => array($category_array[3])),
925
+			"post_tags" => array('Tags', 'Sample Tags'),
926
+			"geodir_video" => '',
927
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
928
+			"geodir_contact" => '(222) 777-1111',
929
+			"geodir_email" => '[email protected]',
930
+			"geodir_website" => 'http://example.com/',
931
+			"geodir_twitter" => 'http://example.com/',
932
+			"geodir_facebook" => 'http://example.com/',
933
+			"geodir_price" => '800',
934
+			"geodir_property_status" => 'For Rent',
935
+			'geodir_property_furnishing' => '',
936
+			'geodir_property_type' => 'Land',
937
+			'geodir_property_bedrooms' => '',
938
+			'geodir_property_bathrooms' => '',
939
+			'geodir_property_area' => '250000',
940
+			'geodir_property_features' => '',
941
+			"post_dummy" => '1'
942
+		);
943
+
944
+		break;
945 945
 
946 946
 } // end of switch
947 947
 
948 948
 foreach ($post_info as $post_info) {
949
-    $default_location = geodir_get_default_location();
950
-    if ($city_bound_lat1 > $city_bound_lat2)
951
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
952
-    else
953
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
949
+	$default_location = geodir_get_default_location();
950
+	if ($city_bound_lat1 > $city_bound_lat2)
951
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
952
+	else
953
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
954 954
 
955 955
 
956
-    if ($city_bound_lng1 > $city_bound_lng2)
957
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
958
-    else
959
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
956
+	if ($city_bound_lng1 > $city_bound_lng2)
957
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
958
+	else
959
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
960 960
 
961
-    $load_map = get_option('geodir_load_map');
961
+	$load_map = get_option('geodir_load_map');
962 962
     
963
-    if ($load_map == 'osm') {
964
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
965
-    } else {
966
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
967
-    }
968
-
969
-    $postal_code = '';
970
-    if (!empty($post_address)) {
971
-        if ($load_map == 'osm') {
972
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
973
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
974
-        } else {
975
-            $addresses = array();
976
-            $addresses_default = array();
963
+	if ($load_map == 'osm') {
964
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
965
+	} else {
966
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
967
+	}
968
+
969
+	$postal_code = '';
970
+	if (!empty($post_address)) {
971
+		if ($load_map == 'osm') {
972
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
973
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
974
+		} else {
975
+			$addresses = array();
976
+			$addresses_default = array();
977 977
             
978
-            foreach ($post_address as $add_key => $add_value) {
979
-                if ($add_key < 2 && !empty($add_value->long_name)) {
980
-                    $addresses_default[] = $add_value->long_name;
981
-                }
982
-                if ($add_value->types[0] == 'postal_code') {
983
-                    $postal_code = $add_value->long_name;
984
-                }
985
-                if ($add_value->types[0] == 'street_number') {
986
-                    $addresses[] = $add_value->long_name;
987
-                }
988
-                if ($add_value->types[0] == 'route') {
989
-                    $addresses[] = $add_value->long_name;
990
-                }
991
-                if ($add_value->types[0] == 'neighborhood') {
992
-                    $addresses[] = $add_value->long_name;
993
-                }
994
-                if ($add_value->types[0] == 'sublocality') {
995
-                    $addresses[] = $add_value->long_name;
996
-                }
997
-            }
998
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
999
-        }
1000
-
1001
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1002
-        $post_info['post_city'] = $default_location->city;
1003
-        $post_info['post_region'] = $default_location->region;
1004
-        $post_info['post_country'] = $default_location->country;
1005
-        $post_info['post_zip'] = $postal_code;
1006
-        $post_info['post_latitude'] = $dummy_post_latitude;
1007
-        $post_info['post_longitude'] = $dummy_post_longitude;
1008
-    }
978
+			foreach ($post_address as $add_key => $add_value) {
979
+				if ($add_key < 2 && !empty($add_value->long_name)) {
980
+					$addresses_default[] = $add_value->long_name;
981
+				}
982
+				if ($add_value->types[0] == 'postal_code') {
983
+					$postal_code = $add_value->long_name;
984
+				}
985
+				if ($add_value->types[0] == 'street_number') {
986
+					$addresses[] = $add_value->long_name;
987
+				}
988
+				if ($add_value->types[0] == 'route') {
989
+					$addresses[] = $add_value->long_name;
990
+				}
991
+				if ($add_value->types[0] == 'neighborhood') {
992
+					$addresses[] = $add_value->long_name;
993
+				}
994
+				if ($add_value->types[0] == 'sublocality') {
995
+					$addresses[] = $add_value->long_name;
996
+				}
997
+			}
998
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
999
+		}
1000
+
1001
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1002
+		$post_info['post_city'] = $default_location->city;
1003
+		$post_info['post_region'] = $default_location->region;
1004
+		$post_info['post_country'] = $default_location->country;
1005
+		$post_info['post_zip'] = $postal_code;
1006
+		$post_info['post_latitude'] = $dummy_post_latitude;
1007
+		$post_info['post_longitude'] = $dummy_post_longitude;
1008
+	}
1009 1009
     
1010
-    geodir_save_listing($post_info, true);
1011
-    echo 1;
1010
+	geodir_save_listing($post_info, true);
1011
+	echo 1;
1012 1012
 }
Please login to merge, or discard this patch.
geodirectory-admin/dummy-data/property_sale.php 1 patch
Indentation   +873 added lines, -873 removed lines patch added patch discarded remove patch
@@ -7,453 +7,453 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
10
-    $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
12
-
13
-    // price
14
-    $fields[] = array('listing_type' => $post_type,
15
-                      'field_type'          =>  'text',
16
-                      'data_type'           =>  'FLOAT',
17
-                      'decimal_point'       =>  '2',
18
-                      'admin_title'         =>  __('Price', 'geodirectory'),
19
-                      'site_title'          =>  __('Price', 'geodirectory'),
20
-                      'admin_desc'          =>  __('Enter the price in $ (no currency symbol)', 'geodirectory'),
21
-                      'htmlvar_name'        =>  'price',
22
-                      'is_active'           =>  true,
23
-                      'for_admin_use'       =>  false,
24
-                      'default_value'       =>  '',
25
-                      'show_in' 	        =>  '[detail],[listing]',
26
-                      'is_required'         =>  false,
27
-                      'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
28
-                      'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
-                      'required_msg'        =>  '',
30
-                      'field_icon'          =>  'fas fa-dollar-sign',
31
-                      'css_class'           =>  '',
32
-                      'cat_sort'            =>  true,
33
-                      'cat_filter'	        =>  true,
34
-                      'extra'        =>  array(
35
-                          'is_price'                  =>  1,
36
-                          'thousand_separator'        =>  'comma',
37
-                          'decimal_separator'         =>  'period',
38
-                          'decimal_display'           =>  'if',
39
-                          'currency_symbol'           =>  '$',
40
-                          'currency_symbol_placement' =>  'left'
41
-                      )
42
-    );
43
-
44
-    // property status
45
-    $fields[] = array('listing_type' => $post_type,
46
-                      'data_type' => 'VARCHAR',
47
-                      'field_type' => 'select',
48
-                      'field_type_key' => 'property_status',
49
-                      'is_active' => 1,
50
-                      'for_admin_use' => 0,
51
-                      'is_default' => 0,
52
-                      'admin_title' => __('Property Status', 'geodirectory'),
53
-                      'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
-                      'site_title' => __('Property Status', 'geodirectory'),
55
-                      'htmlvar_name' => 'property_status',
56
-                      'default_value' => '',
57
-                      'is_required' => '1',
58
-                      'required_msg' => '',
59
-                      'show_in'   =>  '[detail],[listing]',
60
-                      'show_on_pkg' => $package,
61
-                      'option_values' => 'Select Status/,For Sale,Sold,Under Offer',
62
-                      'field_icon' => 'fas fa-home',
63
-                      'css_class' => '',
64
-                      'cat_sort' => 1,
65
-                      'cat_filter' => 1,
66
-    );
67
-
68
-    // property furnishing
69
-    $fields[] = array('listing_type' => $post_type,
70
-                      'field_type'          =>  'select',
71
-                      'data_type'           =>  'VARCHAR',
72
-                      'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
-                      'site_title'          =>  __('Furnishing', 'geodirectory'),
74
-                      'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
-                      'htmlvar_name'        =>  'property_furnishing',
76
-                      'is_active'           =>  true,
77
-                      'for_admin_use'       =>  false,
78
-                      'default_value'       =>  '',
79
-                      'show_in' 	        =>  '[detail],[listing]',
80
-                      'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
-                      'validation_pattern'  =>  '',
83
-                      'validation_msg'      =>  '',
84
-                      'required_msg'        =>  '',
85
-                      'field_icon'          =>  'fas fa-th-large',
86
-                      'css_class'           =>  '',
87
-                      'cat_sort'            =>  true,
88
-                      'cat_filter'	        =>  true
89
-    );
90
-
91
-    // property type
92
-    $fields[] = array('listing_type' => $post_type,
93
-                      'field_type'          =>  'select',
94
-                      'data_type'           =>  'VARCHAR',
95
-                      'admin_title'         =>  __('Property Type', 'geodirectory'),
96
-                      'site_title'          =>  __('Property Type', 'geodirectory'),
97
-                      'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
-                      'htmlvar_name'        =>  'property_type',
99
-                      'is_active'           =>  true,
100
-                      'for_admin_use'       =>  false,
101
-                      'default_value'       =>  '',
102
-                      'show_in' 	        =>  '[detail],[listing]',
103
-                      'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
-                      'validation_pattern'  =>  '',
106
-                      'validation_msg'      =>  '',
107
-                      'required_msg'        =>  '',
108
-                      'field_icon'          =>  'fas fa-home',
109
-                      'css_class'           =>  '',
110
-                      'cat_sort'            =>  true,
111
-                      'cat_filter'	        =>  true
112
-    );
113
-
114
-    // property bedrooms
115
-    $fields[] = array('listing_type' => $post_type,
116
-                      'field_type'          =>  'select',
117
-                      'data_type'           =>  'VARCHAR',
118
-                      'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
-                      'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
-                      'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
-                      'htmlvar_name'        =>  'property_bedrooms',
122
-                      'is_active'           =>  true,
123
-                      'for_admin_use'       =>  false,
124
-                      'default_value'       =>  '',
125
-                      'show_in' 	        =>  '[detail],[listing]',
126
-                      'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
-                      'validation_pattern'  =>  '',
129
-                      'validation_msg'      =>  '',
130
-                      'required_msg'        =>  '',
131
-                      'field_icon'          =>  'fas fa-bed',
132
-                      'css_class'           =>  '',
133
-                      'cat_sort'            =>  true,
134
-                      'cat_filter'	        =>  true
135
-    );
136
-
137
-    // property bathrooms
138
-    $fields[] = array('listing_type' => $post_type,
139
-                      'field_type'          =>  'select',
140
-                      'data_type'           =>  'VARCHAR',
141
-                      'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
-                      'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
-                      'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
-                      'htmlvar_name'        =>  'property_bathrooms',
145
-                      'is_active'           =>  true,
146
-                      'for_admin_use'       =>  false,
147
-                      'default_value'       =>  '',
148
-                      'show_in' 	        =>  '[detail],[listing]',
149
-                      'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
-                      'validation_pattern'  =>  '',
152
-                      'validation_msg'      =>  '',
153
-                      'required_msg'        =>  '',
154
-                      'field_icon'          =>  'fas fa-bold',
155
-                      'css_class'           =>  '',
156
-                      'cat_sort'            =>  true,
157
-                      'cat_filter'	        =>  true
158
-    );
159
-
160
-    // property area
161
-    $fields[] = array('listing_type' => $post_type,
162
-                      'field_type'          =>  'text',
163
-                      'data_type'           =>  'INT',
164
-                      'admin_title'         =>  __('Property Area', 'geodirectory'),
165
-                      'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
-                      'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
-                      'htmlvar_name'        =>  'property_area',
168
-                      'is_active'           =>  true,
169
-                      'for_admin_use'       =>  false,
170
-                      'default_value'       =>  '',
171
-                      'show_in' 	        =>  '[detail],[listing]',
172
-                      'is_required'         =>  false,
173
-                      'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
174
-                      'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
-                      'required_msg'        =>  '',
176
-                      'field_icon'          =>  'fas fa-chart-area',
177
-                      'css_class'           =>  '',
178
-                      'cat_sort'            =>  true,
179
-                      'cat_filter'	        =>  true
180
-    );
181
-
182
-    // property features
183
-    $fields[] = array('listing_type' => $post_type,
184
-                      'field_type'          =>  'multiselect',
185
-                      'data_type'           =>  'VARCHAR',
186
-                      'admin_title'         =>  __('Property Features', 'geodirectory'),
187
-                      'site_title'          =>  __('Features', 'geodirectory'),
188
-                      'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
-                      'htmlvar_name'        =>  'property_features',
190
-                      'is_active'           =>  true,
191
-                      'for_admin_use'       =>  false,
192
-                      'default_value'       =>  '',
193
-                      'show_in' 	        =>  '[detail],[listing]',
194
-                      'is_required'         =>  false,
195
-                      'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
-                      'validation_pattern'  =>  '',
197
-                      'validation_msg'      =>  '',
198
-                      'required_msg'        =>  '',
199
-                      'field_icon'          =>  'fas fa-plus-square',
200
-                      'css_class'           =>  'gd-comma-list',
201
-                      'cat_sort'            =>  true,
202
-                      'cat_filter'	        =>  true
203
-    );
204
-
205
-
206
-
207
-    /**
208
-     * Filter the array of default custom fields DB table data.
209
-     *
210
-     * @since 1.6.6
211
-     * @param string $fields The default custom fields as an array.
212
-     */
213
-    $fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
-
215
-    return  $fields;
10
+	$fields = array();
11
+	$package = ($package_id=='') ? '' : array($package_id);
12
+
13
+	// price
14
+	$fields[] = array('listing_type' => $post_type,
15
+					  'field_type'          =>  'text',
16
+					  'data_type'           =>  'FLOAT',
17
+					  'decimal_point'       =>  '2',
18
+					  'admin_title'         =>  __('Price', 'geodirectory'),
19
+					  'site_title'          =>  __('Price', 'geodirectory'),
20
+					  'admin_desc'          =>  __('Enter the price in $ (no currency symbol)', 'geodirectory'),
21
+					  'htmlvar_name'        =>  'price',
22
+					  'is_active'           =>  true,
23
+					  'for_admin_use'       =>  false,
24
+					  'default_value'       =>  '',
25
+					  'show_in' 	        =>  '[detail],[listing]',
26
+					  'is_required'         =>  false,
27
+					  'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
28
+					  'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
+					  'required_msg'        =>  '',
30
+					  'field_icon'          =>  'fas fa-dollar-sign',
31
+					  'css_class'           =>  '',
32
+					  'cat_sort'            =>  true,
33
+					  'cat_filter'	        =>  true,
34
+					  'extra'        =>  array(
35
+						  'is_price'                  =>  1,
36
+						  'thousand_separator'        =>  'comma',
37
+						  'decimal_separator'         =>  'period',
38
+						  'decimal_display'           =>  'if',
39
+						  'currency_symbol'           =>  '$',
40
+						  'currency_symbol_placement' =>  'left'
41
+					  )
42
+	);
43
+
44
+	// property status
45
+	$fields[] = array('listing_type' => $post_type,
46
+					  'data_type' => 'VARCHAR',
47
+					  'field_type' => 'select',
48
+					  'field_type_key' => 'property_status',
49
+					  'is_active' => 1,
50
+					  'for_admin_use' => 0,
51
+					  'is_default' => 0,
52
+					  'admin_title' => __('Property Status', 'geodirectory'),
53
+					  'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
+					  'site_title' => __('Property Status', 'geodirectory'),
55
+					  'htmlvar_name' => 'property_status',
56
+					  'default_value' => '',
57
+					  'is_required' => '1',
58
+					  'required_msg' => '',
59
+					  'show_in'   =>  '[detail],[listing]',
60
+					  'show_on_pkg' => $package,
61
+					  'option_values' => 'Select Status/,For Sale,Sold,Under Offer',
62
+					  'field_icon' => 'fas fa-home',
63
+					  'css_class' => '',
64
+					  'cat_sort' => 1,
65
+					  'cat_filter' => 1,
66
+	);
67
+
68
+	// property furnishing
69
+	$fields[] = array('listing_type' => $post_type,
70
+					  'field_type'          =>  'select',
71
+					  'data_type'           =>  'VARCHAR',
72
+					  'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
+					  'site_title'          =>  __('Furnishing', 'geodirectory'),
74
+					  'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
+					  'htmlvar_name'        =>  'property_furnishing',
76
+					  'is_active'           =>  true,
77
+					  'for_admin_use'       =>  false,
78
+					  'default_value'       =>  '',
79
+					  'show_in' 	        =>  '[detail],[listing]',
80
+					  'is_required'         =>  true,
81
+					  'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
+					  'validation_pattern'  =>  '',
83
+					  'validation_msg'      =>  '',
84
+					  'required_msg'        =>  '',
85
+					  'field_icon'          =>  'fas fa-th-large',
86
+					  'css_class'           =>  '',
87
+					  'cat_sort'            =>  true,
88
+					  'cat_filter'	        =>  true
89
+	);
90
+
91
+	// property type
92
+	$fields[] = array('listing_type' => $post_type,
93
+					  'field_type'          =>  'select',
94
+					  'data_type'           =>  'VARCHAR',
95
+					  'admin_title'         =>  __('Property Type', 'geodirectory'),
96
+					  'site_title'          =>  __('Property Type', 'geodirectory'),
97
+					  'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
+					  'htmlvar_name'        =>  'property_type',
99
+					  'is_active'           =>  true,
100
+					  'for_admin_use'       =>  false,
101
+					  'default_value'       =>  '',
102
+					  'show_in' 	        =>  '[detail],[listing]',
103
+					  'is_required'         =>  true,
104
+					  'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
+					  'validation_pattern'  =>  '',
106
+					  'validation_msg'      =>  '',
107
+					  'required_msg'        =>  '',
108
+					  'field_icon'          =>  'fas fa-home',
109
+					  'css_class'           =>  '',
110
+					  'cat_sort'            =>  true,
111
+					  'cat_filter'	        =>  true
112
+	);
113
+
114
+	// property bedrooms
115
+	$fields[] = array('listing_type' => $post_type,
116
+					  'field_type'          =>  'select',
117
+					  'data_type'           =>  'VARCHAR',
118
+					  'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
+					  'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
+					  'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
+					  'htmlvar_name'        =>  'property_bedrooms',
122
+					  'is_active'           =>  true,
123
+					  'for_admin_use'       =>  false,
124
+					  'default_value'       =>  '',
125
+					  'show_in' 	        =>  '[detail],[listing]',
126
+					  'is_required'         =>  true,
127
+					  'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
+					  'validation_pattern'  =>  '',
129
+					  'validation_msg'      =>  '',
130
+					  'required_msg'        =>  '',
131
+					  'field_icon'          =>  'fas fa-bed',
132
+					  'css_class'           =>  '',
133
+					  'cat_sort'            =>  true,
134
+					  'cat_filter'	        =>  true
135
+	);
136
+
137
+	// property bathrooms
138
+	$fields[] = array('listing_type' => $post_type,
139
+					  'field_type'          =>  'select',
140
+					  'data_type'           =>  'VARCHAR',
141
+					  'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
+					  'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
+					  'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
+					  'htmlvar_name'        =>  'property_bathrooms',
145
+					  'is_active'           =>  true,
146
+					  'for_admin_use'       =>  false,
147
+					  'default_value'       =>  '',
148
+					  'show_in' 	        =>  '[detail],[listing]',
149
+					  'is_required'         =>  true,
150
+					  'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
+					  'validation_pattern'  =>  '',
152
+					  'validation_msg'      =>  '',
153
+					  'required_msg'        =>  '',
154
+					  'field_icon'          =>  'fas fa-bold',
155
+					  'css_class'           =>  '',
156
+					  'cat_sort'            =>  true,
157
+					  'cat_filter'	        =>  true
158
+	);
159
+
160
+	// property area
161
+	$fields[] = array('listing_type' => $post_type,
162
+					  'field_type'          =>  'text',
163
+					  'data_type'           =>  'INT',
164
+					  'admin_title'         =>  __('Property Area', 'geodirectory'),
165
+					  'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
+					  'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
+					  'htmlvar_name'        =>  'property_area',
168
+					  'is_active'           =>  true,
169
+					  'for_admin_use'       =>  false,
170
+					  'default_value'       =>  '',
171
+					  'show_in' 	        =>  '[detail],[listing]',
172
+					  'is_required'         =>  false,
173
+					  'validation_pattern'  =>  addslashes_gpc('\d+(\.\d{2})?'), // add slashes required
174
+					  'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
+					  'required_msg'        =>  '',
176
+					  'field_icon'          =>  'fas fa-chart-area',
177
+					  'css_class'           =>  '',
178
+					  'cat_sort'            =>  true,
179
+					  'cat_filter'	        =>  true
180
+	);
181
+
182
+	// property features
183
+	$fields[] = array('listing_type' => $post_type,
184
+					  'field_type'          =>  'multiselect',
185
+					  'data_type'           =>  'VARCHAR',
186
+					  'admin_title'         =>  __('Property Features', 'geodirectory'),
187
+					  'site_title'          =>  __('Features', 'geodirectory'),
188
+					  'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
+					  'htmlvar_name'        =>  'property_features',
190
+					  'is_active'           =>  true,
191
+					  'for_admin_use'       =>  false,
192
+					  'default_value'       =>  '',
193
+					  'show_in' 	        =>  '[detail],[listing]',
194
+					  'is_required'         =>  false,
195
+					  'option_values'       =>  __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
+					  'validation_pattern'  =>  '',
197
+					  'validation_msg'      =>  '',
198
+					  'required_msg'        =>  '',
199
+					  'field_icon'          =>  'fas fa-plus-square',
200
+					  'css_class'           =>  'gd-comma-list',
201
+					  'cat_sort'            =>  true,
202
+					  'cat_filter'	        =>  true
203
+	);
204
+
205
+
206
+
207
+	/**
208
+	 * Filter the array of default custom fields DB table data.
209
+	 *
210
+	 * @since 1.6.6
211
+	 * @param string $fields The default custom fields as an array.
212
+	 */
213
+	$fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
+
215
+	return  $fields;
216 216
 }
217 217
 
218 218
 function geodir_property_sale_custom_fields_sort($post_type='gd_place') {
219 219
 
220 220
 
221
-    $fields = array();
222
-
223
-    // price sort
224
-    $fields[] = array(
225
-        'create_field'            => true,
226
-        'listing_type'            => $post_type,
227
-        'field_type'              => 'text',
228
-        'data_type'               => '',
229
-        'htmlvar_name'            => 'geodir_price',
230
-        'site_title'              => __('Price','geodirectory'),
231
-        'asc'                     => 1,
232
-        'asc_title'               => __('Price (lowest first)','geodirectory'),
233
-        'desc'                    => 1,
234
-        'desc_title'              => __('Price (highest first)','geodirectory'),
235
-        'is_active'               => 1
236
-    );
237
-
238
-    // area sort
239
-    $fields[] = array(
240
-        'create_field'            => true,
241
-        'listing_type'            => $post_type,
242
-        'field_type'              => 'text',
243
-        'data_type'               => '',
244
-        'htmlvar_name'            => 'geodir_property_area',
245
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
246
-        'asc'                     => 1,
247
-        'asc_title'               => __('Area (smallest first)','geodirectory'),
248
-        'desc'                    => 1,
249
-        'desc_title'              => __('Area (largest first)','geodirectory'),
250
-        'is_active'               => 1
251
-    );
252
-
253
-    // bedrooms sort
254
-    $fields[] = array(
255
-        'create_field'            => true,
256
-        'listing_type'            => $post_type,
257
-        'field_type'              => 'select',
258
-        'data_type'               => '',
259
-        'htmlvar_name'            => 'geodir_property_bedrooms',
260
-        'site_title'              => __('Area (Sq Ft)','geodirectory'),
261
-        'asc'                     => 1,
262
-        'asc_title'               => __('Bedrooms (least)','geodirectory'),
263
-        'desc'                    => 1,
264
-        'desc_title'              => __('Bedrooms (most)','geodirectory'),
265
-        'is_active'               => 1
266
-    );
267
-
268
-
269
-    /**
270
-     * Filter the array of advanced search fields DB table data.
271
-     *
272
-     * @since 1.6.6
273
-     * @param string $fields The default custom fields as an array.
274
-     */
275
-    $fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields);
276
-
277
-    return $fields;
221
+	$fields = array();
222
+
223
+	// price sort
224
+	$fields[] = array(
225
+		'create_field'            => true,
226
+		'listing_type'            => $post_type,
227
+		'field_type'              => 'text',
228
+		'data_type'               => '',
229
+		'htmlvar_name'            => 'geodir_price',
230
+		'site_title'              => __('Price','geodirectory'),
231
+		'asc'                     => 1,
232
+		'asc_title'               => __('Price (lowest first)','geodirectory'),
233
+		'desc'                    => 1,
234
+		'desc_title'              => __('Price (highest first)','geodirectory'),
235
+		'is_active'               => 1
236
+	);
237
+
238
+	// area sort
239
+	$fields[] = array(
240
+		'create_field'            => true,
241
+		'listing_type'            => $post_type,
242
+		'field_type'              => 'text',
243
+		'data_type'               => '',
244
+		'htmlvar_name'            => 'geodir_property_area',
245
+		'site_title'              => __('Area (Sq Ft)','geodirectory'),
246
+		'asc'                     => 1,
247
+		'asc_title'               => __('Area (smallest first)','geodirectory'),
248
+		'desc'                    => 1,
249
+		'desc_title'              => __('Area (largest first)','geodirectory'),
250
+		'is_active'               => 1
251
+	);
252
+
253
+	// bedrooms sort
254
+	$fields[] = array(
255
+		'create_field'            => true,
256
+		'listing_type'            => $post_type,
257
+		'field_type'              => 'select',
258
+		'data_type'               => '',
259
+		'htmlvar_name'            => 'geodir_property_bedrooms',
260
+		'site_title'              => __('Area (Sq Ft)','geodirectory'),
261
+		'asc'                     => 1,
262
+		'asc_title'               => __('Bedrooms (least)','geodirectory'),
263
+		'desc'                    => 1,
264
+		'desc_title'              => __('Bedrooms (most)','geodirectory'),
265
+		'is_active'               => 1
266
+	);
267
+
268
+
269
+	/**
270
+	 * Filter the array of advanced search fields DB table data.
271
+	 *
272
+	 * @since 1.6.6
273
+	 * @param string $fields The default custom fields as an array.
274
+	 */
275
+	$fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields);
276
+
277
+	return $fields;
278 278
 
279 279
 }
280 280
 
281 281
 function geodir_property_sale_custom_fields_advanced_search($post_type='gd_place') {
282 282
 
283 283
 
284
-    $fields = array();
285
-
286
-    // price range
287
-    $fields[] = array(
288
-        'create_field'            => true,
289
-        'listing_type'            => $post_type,
290
-        'field_type'              => 'text',
291
-        'data_type'               => 'RANGE',
292
-        'is_active'               => 1,
293
-        'site_field_title'        => 'Price',
294
-        'field_data_type'         => 'FLOAT',
295
-        'main_search'             => 1,
296
-        'main_search_priority'    => 15,
297
-        'data_type_change'        => 'SELECT',
298
-        'search_condition_select' => 'SINGLE',
299
-        'search_min_value'        => '50000',
300
-        'search_max_value'        => '1000000',
301
-        'search_diff_value'       => '100000',
302
-        'first_search_value'      => '0',
303
-        'first_search_text'       => '',
304
-        'last_search_text'        => '',
305
-        'search_condition'        => 'SELECT',
306
-        'site_htmlvar_name'       => 'geodir_price',
307
-        'htmlvar_name'            => 'geodir_price',
308
-        'field_title'             => 'geodir_price',
309
-        'expand_custom_value'     => '',
310
-        'front_search_title'      => 'Price Range',
311
-        'field_desc'              => ''
312
-    );
313
-
314
-    // bedrooms
315
-    $fields[] = array(
316
-        'create_field'            => true,
317
-        'listing_type'            => $post_type,
318
-        'field_type'              => 'select',
319
-        'data_type'               => 'CHECK',
320
-        'is_active'               => 1,
321
-        'site_field_title'        => 'Bedrooms',
322
-        'field_data_type'         => 'VARCHAR',
323
-        'main_search'             => 1,
324
-        'main_search_priority'    => 16,
325
-        'search_condition'        => 'SINGLE',
326
-        'site_htmlvar_name'       => 'geodir_property_bedrooms',
327
-        'htmlvar_name'            => 'geodir_property_bedrooms',
328
-        'field_title'             => 'geodir_property_bedrooms',
329
-        'front_search_title'      => 'Bedrooms',
330
-        'field_desc'              => '',
331
-        'expand_custom_value'     => 5,
332
-        'expand_search'           => 1,
333
-        'search_operator'         => 'OR'
334
-    );
335
-
336
-    // Property type
337
-    $fields[] = array(
338
-        'create_field'            => true,
339
-        'listing_type'            => $post_type,
340
-        'field_type'              => 'select',
341
-        'data_type'               => 'CHECK',
342
-        'is_active'               => 1,
343
-        'site_field_title'        => 'Property Type',
344
-        'field_data_type'         => 'VARCHAR',
345
-        'main_search'             => 0,
346
-        //'main_search_priority'    => 16,
347
-        'search_condition'        => 'SINGLE',
348
-        'site_htmlvar_name'       => 'geodir_property_type',
349
-        'htmlvar_name'            => 'geodir_property_type',
350
-        'field_title'             => 'geodir_property_type',
351
-        'front_search_title'      => 'Property Type',
352
-        'field_desc'              => '',
353
-        'expand_custom_value'     => 5,
354
-        'expand_search'           => 1,
355
-        'search_operator'         => 'OR'
356
-    );
357
-
358
-    // Property Features
359
-    $fields[] = array(
360
-        'create_field'            => true,
361
-        'listing_type'            => $post_type,
362
-        'field_type'              => 'multiselect',
363
-        'data_type'               => 'CHECK',
364
-        'is_active'               => 1,
365
-        'site_field_title'        => 'Features',
366
-        'field_data_type'         => 'VARCHAR',
367
-        'main_search'             => 0,
368
-        //'main_search_priority'    => 16,
369
-        'search_condition'        => 'SINGLE',
370
-        'site_htmlvar_name'       => 'geodir_property_features',
371
-        'htmlvar_name'            => 'geodir_property_features',
372
-        'field_title'             => 'geodir_property_features',
373
-        'front_search_title'      => 'Property Features',
374
-        'field_desc'              => '',
375
-        'expand_custom_value'     => 5,
376
-        'expand_search'           => 1,
377
-        'search_operator'         => 'AND'
378
-    );
379
-
380
-    // Property Bathrooms
381
-    $fields[] = array(
382
-        'create_field'            => true,
383
-        'listing_type'            => $post_type,
384
-        'field_type'              => 'select',
385
-        'data_type'               => 'CHECK',
386
-        'is_active'               => 1,
387
-        'site_field_title'        => 'Bathrooms',
388
-        'field_data_type'         => 'VARCHAR',
389
-        'main_search'             => 0,
390
-        //'main_search_priority'    => 16,
391
-        'search_condition'        => 'SINGLE',
392
-        'site_htmlvar_name'       => 'geodir_property_bathrooms',
393
-        'htmlvar_name'            => 'geodir_property_bathrooms',
394
-        'field_title'             => 'geodir_property_bathrooms',
395
-        'front_search_title'      => 'Bathrooms',
396
-        'field_desc'              => '',
397
-        'expand_custom_value'     => 5,
398
-        'expand_search'           => 1,
399
-        'search_operator'         => 'OR'
400
-    );
401
-
402
-    // Property Furnishing
403
-    $fields[] = array(
404
-        'create_field'            => true,
405
-        'listing_type'            => $post_type,
406
-        'field_type'              => 'select',
407
-        'data_type'               => 'CHECK',
408
-        'is_active'               => 1,
409
-        'site_field_title'        => 'Furnishing',
410
-        'field_data_type'         => 'VARCHAR',
411
-        'main_search'             => 0,
412
-        //'main_search_priority'    => 16,
413
-        'search_condition'        => 'SINGLE',
414
-        'site_htmlvar_name'       => 'geodir_property_furnishing',
415
-        'htmlvar_name'            => 'geodir_property_furnishing',
416
-        'field_title'             => 'geodir_property_furnishing',
417
-        'front_search_title'      => 'Furnishing',
418
-        'field_desc'              => '',
419
-        'expand_custom_value'     => 5,
420
-        'expand_search'           => 1,
421
-        'search_operator'         => 'OR'
422
-    );
423
-
424
-    // Property Status
425
-    $fields[] = array(
426
-        'create_field'            => true,
427
-        'listing_type'            => $post_type,
428
-        'field_type'              => 'select',
429
-        'data_type'               => 'CHECK',
430
-        'is_active'               => 1,
431
-        'site_field_title'        => 'Property Status',
432
-        'field_data_type'         => 'VARCHAR',
433
-        'main_search'             => 0,
434
-        //'main_search_priority'    => 16,
435
-        'search_condition'        => 'SINGLE',
436
-        'site_htmlvar_name'       => 'geodir_property_status',
437
-        'htmlvar_name'            => 'geodir_property_status',
438
-        'field_title'             => 'geodir_property_status',
439
-        'front_search_title'      => 'Property Status',
440
-        'field_desc'              => '',
441
-        'expand_custom_value'     => 5,
442
-        'expand_search'           => 1,
443
-        'search_operator'         => 'OR'
444
-    );
445
-
446
-
447
-
448
-    /**
449
-     * Filter the array of advanced search fields DB table data.
450
-     *
451
-     * @since 1.6.6
452
-     * @param string $fields The default custom fields as an array.
453
-     */
454
-    $fields = apply_filters('geodir_property_sale_custom_fields_advanced_search', $fields);
455
-
456
-    return $fields;
284
+	$fields = array();
285
+
286
+	// price range
287
+	$fields[] = array(
288
+		'create_field'            => true,
289
+		'listing_type'            => $post_type,
290
+		'field_type'              => 'text',
291
+		'data_type'               => 'RANGE',
292
+		'is_active'               => 1,
293
+		'site_field_title'        => 'Price',
294
+		'field_data_type'         => 'FLOAT',
295
+		'main_search'             => 1,
296
+		'main_search_priority'    => 15,
297
+		'data_type_change'        => 'SELECT',
298
+		'search_condition_select' => 'SINGLE',
299
+		'search_min_value'        => '50000',
300
+		'search_max_value'        => '1000000',
301
+		'search_diff_value'       => '100000',
302
+		'first_search_value'      => '0',
303
+		'first_search_text'       => '',
304
+		'last_search_text'        => '',
305
+		'search_condition'        => 'SELECT',
306
+		'site_htmlvar_name'       => 'geodir_price',
307
+		'htmlvar_name'            => 'geodir_price',
308
+		'field_title'             => 'geodir_price',
309
+		'expand_custom_value'     => '',
310
+		'front_search_title'      => 'Price Range',
311
+		'field_desc'              => ''
312
+	);
313
+
314
+	// bedrooms
315
+	$fields[] = array(
316
+		'create_field'            => true,
317
+		'listing_type'            => $post_type,
318
+		'field_type'              => 'select',
319
+		'data_type'               => 'CHECK',
320
+		'is_active'               => 1,
321
+		'site_field_title'        => 'Bedrooms',
322
+		'field_data_type'         => 'VARCHAR',
323
+		'main_search'             => 1,
324
+		'main_search_priority'    => 16,
325
+		'search_condition'        => 'SINGLE',
326
+		'site_htmlvar_name'       => 'geodir_property_bedrooms',
327
+		'htmlvar_name'            => 'geodir_property_bedrooms',
328
+		'field_title'             => 'geodir_property_bedrooms',
329
+		'front_search_title'      => 'Bedrooms',
330
+		'field_desc'              => '',
331
+		'expand_custom_value'     => 5,
332
+		'expand_search'           => 1,
333
+		'search_operator'         => 'OR'
334
+	);
335
+
336
+	// Property type
337
+	$fields[] = array(
338
+		'create_field'            => true,
339
+		'listing_type'            => $post_type,
340
+		'field_type'              => 'select',
341
+		'data_type'               => 'CHECK',
342
+		'is_active'               => 1,
343
+		'site_field_title'        => 'Property Type',
344
+		'field_data_type'         => 'VARCHAR',
345
+		'main_search'             => 0,
346
+		//'main_search_priority'    => 16,
347
+		'search_condition'        => 'SINGLE',
348
+		'site_htmlvar_name'       => 'geodir_property_type',
349
+		'htmlvar_name'            => 'geodir_property_type',
350
+		'field_title'             => 'geodir_property_type',
351
+		'front_search_title'      => 'Property Type',
352
+		'field_desc'              => '',
353
+		'expand_custom_value'     => 5,
354
+		'expand_search'           => 1,
355
+		'search_operator'         => 'OR'
356
+	);
357
+
358
+	// Property Features
359
+	$fields[] = array(
360
+		'create_field'            => true,
361
+		'listing_type'            => $post_type,
362
+		'field_type'              => 'multiselect',
363
+		'data_type'               => 'CHECK',
364
+		'is_active'               => 1,
365
+		'site_field_title'        => 'Features',
366
+		'field_data_type'         => 'VARCHAR',
367
+		'main_search'             => 0,
368
+		//'main_search_priority'    => 16,
369
+		'search_condition'        => 'SINGLE',
370
+		'site_htmlvar_name'       => 'geodir_property_features',
371
+		'htmlvar_name'            => 'geodir_property_features',
372
+		'field_title'             => 'geodir_property_features',
373
+		'front_search_title'      => 'Property Features',
374
+		'field_desc'              => '',
375
+		'expand_custom_value'     => 5,
376
+		'expand_search'           => 1,
377
+		'search_operator'         => 'AND'
378
+	);
379
+
380
+	// Property Bathrooms
381
+	$fields[] = array(
382
+		'create_field'            => true,
383
+		'listing_type'            => $post_type,
384
+		'field_type'              => 'select',
385
+		'data_type'               => 'CHECK',
386
+		'is_active'               => 1,
387
+		'site_field_title'        => 'Bathrooms',
388
+		'field_data_type'         => 'VARCHAR',
389
+		'main_search'             => 0,
390
+		//'main_search_priority'    => 16,
391
+		'search_condition'        => 'SINGLE',
392
+		'site_htmlvar_name'       => 'geodir_property_bathrooms',
393
+		'htmlvar_name'            => 'geodir_property_bathrooms',
394
+		'field_title'             => 'geodir_property_bathrooms',
395
+		'front_search_title'      => 'Bathrooms',
396
+		'field_desc'              => '',
397
+		'expand_custom_value'     => 5,
398
+		'expand_search'           => 1,
399
+		'search_operator'         => 'OR'
400
+	);
401
+
402
+	// Property Furnishing
403
+	$fields[] = array(
404
+		'create_field'            => true,
405
+		'listing_type'            => $post_type,
406
+		'field_type'              => 'select',
407
+		'data_type'               => 'CHECK',
408
+		'is_active'               => 1,
409
+		'site_field_title'        => 'Furnishing',
410
+		'field_data_type'         => 'VARCHAR',
411
+		'main_search'             => 0,
412
+		//'main_search_priority'    => 16,
413
+		'search_condition'        => 'SINGLE',
414
+		'site_htmlvar_name'       => 'geodir_property_furnishing',
415
+		'htmlvar_name'            => 'geodir_property_furnishing',
416
+		'field_title'             => 'geodir_property_furnishing',
417
+		'front_search_title'      => 'Furnishing',
418
+		'field_desc'              => '',
419
+		'expand_custom_value'     => 5,
420
+		'expand_search'           => 1,
421
+		'search_operator'         => 'OR'
422
+	);
423
+
424
+	// Property Status
425
+	$fields[] = array(
426
+		'create_field'            => true,
427
+		'listing_type'            => $post_type,
428
+		'field_type'              => 'select',
429
+		'data_type'               => 'CHECK',
430
+		'is_active'               => 1,
431
+		'site_field_title'        => 'Property Status',
432
+		'field_data_type'         => 'VARCHAR',
433
+		'main_search'             => 0,
434
+		//'main_search_priority'    => 16,
435
+		'search_condition'        => 'SINGLE',
436
+		'site_htmlvar_name'       => 'geodir_property_status',
437
+		'htmlvar_name'            => 'geodir_property_status',
438
+		'field_title'             => 'geodir_property_status',
439
+		'front_search_title'      => 'Property Status',
440
+		'field_desc'              => '',
441
+		'expand_custom_value'     => 5,
442
+		'expand_search'           => 1,
443
+		'search_operator'         => 'OR'
444
+	);
445
+
446
+
447
+
448
+	/**
449
+	 * Filter the array of advanced search fields DB table data.
450
+	 *
451
+	 * @since 1.6.6
452
+	 * @param string $fields The default custom fields as an array.
453
+	 */
454
+	$fields = apply_filters('geodir_property_sale_custom_fields_advanced_search', $fields);
455
+
456
+	return $fields;
457 457
 }
458 458
 
459 459
 global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
@@ -463,52 +463,52 @@  discard block
 block discarded – undo
463 463
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
464 464
 
465 465
 if($dummy_post_index==1){
466
-    // add the dummy categories
467
-    geodir_dummy_data_taxonomies($post_type,$category_array );
468
-
469
-    // add the dummy custom fields
470
-    $fields = geodir_property_sale_custom_fields($post_type);
471
-    geodir_create_dummy_fields($fields);
472
-
473
-    // add sort order items
474
-    $sort_fields = geodir_property_sale_custom_fields_sort($post_type);
475
-    foreach($sort_fields as $sort){
476
-        geodir_custom_sort_field_save($sort);
477
-    }
478
-
479
-    // update the type currently installed
480
-    update_option($post_type.'_dummy_data_type','property_sale');
481
-
482
-    // add the advanced search fields
483
-    if (defined('GEODIRADVANCESEARCH_VERSION')){
484
-        $search_fields = geodir_property_sale_custom_fields_advanced_search($post_type);
485
-        foreach($search_fields as $sfield){
486
-            geodir_custom_advance_search_field_save( $sfield );
487
-        }
488
-    }
466
+	// add the dummy categories
467
+	geodir_dummy_data_taxonomies($post_type,$category_array );
468
+
469
+	// add the dummy custom fields
470
+	$fields = geodir_property_sale_custom_fields($post_type);
471
+	geodir_create_dummy_fields($fields);
472
+
473
+	// add sort order items
474
+	$sort_fields = geodir_property_sale_custom_fields_sort($post_type);
475
+	foreach($sort_fields as $sort){
476
+		geodir_custom_sort_field_save($sort);
477
+	}
478
+
479
+	// update the type currently installed
480
+	update_option($post_type.'_dummy_data_type','property_sale');
481
+
482
+	// add the advanced search fields
483
+	if (defined('GEODIRADVANCESEARCH_VERSION')){
484
+		$search_fields = geodir_property_sale_custom_fields_advanced_search($post_type);
485
+		foreach($search_fields as $sfield){
486
+			geodir_custom_advance_search_field_save( $sfield );
487
+		}
488
+	}
489 489
 }
490 490
 
491 491
 if (geodir_dummy_folder_exists())
492
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
492
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
493 493
 else
494
-    $dummy_image_url = 'https://wpgeodirectory.com/dummy';
494
+	$dummy_image_url = 'https://wpgeodirectory.com/dummy';
495 495
 
496 496
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
497 497
 
498 498
 switch ($dummy_post_index) {
499 499
 
500
-    case(1):
501
-        $image_array[] = "$dummy_image_url/ps/psf1.jpg";
502
-        $image_array[] = "$dummy_image_url/ps/psl1.jpg";
503
-        $image_array[] = "$dummy_image_url/ps/psb1.jpg";
504
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
505
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
500
+	case(1):
501
+		$image_array[] = "$dummy_image_url/ps/psf1.jpg";
502
+		$image_array[] = "$dummy_image_url/ps/psl1.jpg";
503
+		$image_array[] = "$dummy_image_url/ps/psb1.jpg";
504
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
505
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
506 506
 
507 507
 
508
-        $post_info[] = array(
509
-            "listing_type" => $post_type,
510
-            "post_title" => 'Eastern Lodge',
511
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
508
+		$post_info[] = array(
509
+			"listing_type" => $post_type,
510
+			"post_title" => 'Eastern Lodge',
511
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
512 512
 
513 513
 Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien.
514 514
 
@@ -517,42 +517,42 @@  discard block
 block discarded – undo
517 517
 Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat.
518 518
 
519 519
 Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.',
520
-            "post_images" => $image_array,
521
-            "post_category" => array($post_type.'category' => array($category_array[1])),
522
-            "post_tags" => array('Tags', 'Sample Tags'),
523
-            "geodir_video" => '',
524
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
525
-            "geodir_contact" => '(111) 677-4444',
526
-            "geodir_email" => '[email protected]',
527
-            "geodir_website" => 'http://example.com/',
528
-            "geodir_twitter" => 'http://example.com/',
529
-            "geodir_facebook" => 'http://example.com/',
530
-            "geodir_price" => '350000',
531
-            "geodir_property_status" => 'For Sale',
532
-            'geodir_property_furnishing' => 'Furnished',
533
-            'geodir_property_type' => 'Detached house',
534
-            'geodir_property_bedrooms' => '3',
535
-            'geodir_property_bathrooms' => '2',
536
-            'geodir_property_area' => '1850',
537
-            'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
538
-            "post_dummy" => '1'
539
-        );
540
-
541
-
542
-        break;
543
-    case 2:
544
-        $image_array = array();
545
-        $post_meta = array();
546
-        $image_array[] = "$dummy_image_url/ps/psf2.jpg";
547
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
548
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
549
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
550
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
551
-
552
-        $post_info[] = array(
553
-            "listing_type" => $post_type,
554
-            "post_title" => 'Daisy Street',
555
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
520
+			"post_images" => $image_array,
521
+			"post_category" => array($post_type.'category' => array($category_array[1])),
522
+			"post_tags" => array('Tags', 'Sample Tags'),
523
+			"geodir_video" => '',
524
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
525
+			"geodir_contact" => '(111) 677-4444',
526
+			"geodir_email" => '[email protected]',
527
+			"geodir_website" => 'http://example.com/',
528
+			"geodir_twitter" => 'http://example.com/',
529
+			"geodir_facebook" => 'http://example.com/',
530
+			"geodir_price" => '350000',
531
+			"geodir_property_status" => 'For Sale',
532
+			'geodir_property_furnishing' => 'Furnished',
533
+			'geodir_property_type' => 'Detached house',
534
+			'geodir_property_bedrooms' => '3',
535
+			'geodir_property_bathrooms' => '2',
536
+			'geodir_property_area' => '1850',
537
+			'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
538
+			"post_dummy" => '1'
539
+		);
540
+
541
+
542
+		break;
543
+	case 2:
544
+		$image_array = array();
545
+		$post_meta = array();
546
+		$image_array[] = "$dummy_image_url/ps/psf2.jpg";
547
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
548
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
549
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
550
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
551
+
552
+		$post_info[] = array(
553
+			"listing_type" => $post_type,
554
+			"post_title" => 'Daisy Street',
555
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
556 556
 
557 557
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
558 558
 
@@ -562,42 +562,42 @@  discard block
 block discarded – undo
562 562
 
563 563
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
564 564
 
565
-            "post_images" => $image_array,
566
-            "post_category" => array($post_type.'category' => array($category_array[1])),
567
-            "post_tags" => array('Garage'),
568
-            "geodir_video" => '',
569
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
570
-            "geodir_contact" => '(222) 777-1111',
571
-            "geodir_email" => '[email protected]',
572
-            "geodir_website" => 'http://example.com/',
573
-            "geodir_twitter" => 'http://example.com/',
574
-            "geodir_facebook" => 'http://example.com/',
575
-            "geodir_price" => '230000',
576
-            "geodir_property_status" => 'Sold',
577
-            'geodir_property_furnishing' => 'Unfurnished',
578
-            'geodir_property_type' => 'Detached house',
579
-            'geodir_property_bedrooms' => '5',
580
-            'geodir_property_bathrooms' => '3',
581
-            'geodir_property_area' => '2650',
582
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
583
-            "post_dummy" => '1'
584
-        );
585
-
586
-        break;
587
-
588
-    case 3:
589
-        $image_array = array();
590
-        $post_meta = array();
591
-        $image_array[] = "$dummy_image_url/ps/psf3.jpg";
592
-        $image_array[] = "$dummy_image_url/ps/psl3.jpg";
593
-        $image_array[] = "$dummy_image_url/ps/psb3.jpg";
594
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
595
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
596
-
597
-        $post_info[] = array(
598
-            "listing_type" => $post_type,
599
-            "post_title" => 'Northbay House',
600
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
565
+			"post_images" => $image_array,
566
+			"post_category" => array($post_type.'category' => array($category_array[1])),
567
+			"post_tags" => array('Garage'),
568
+			"geodir_video" => '',
569
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
570
+			"geodir_contact" => '(222) 777-1111',
571
+			"geodir_email" => '[email protected]',
572
+			"geodir_website" => 'http://example.com/',
573
+			"geodir_twitter" => 'http://example.com/',
574
+			"geodir_facebook" => 'http://example.com/',
575
+			"geodir_price" => '230000',
576
+			"geodir_property_status" => 'Sold',
577
+			'geodir_property_furnishing' => 'Unfurnished',
578
+			'geodir_property_type' => 'Detached house',
579
+			'geodir_property_bedrooms' => '5',
580
+			'geodir_property_bathrooms' => '3',
581
+			'geodir_property_area' => '2650',
582
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
583
+			"post_dummy" => '1'
584
+		);
585
+
586
+		break;
587
+
588
+	case 3:
589
+		$image_array = array();
590
+		$post_meta = array();
591
+		$image_array[] = "$dummy_image_url/ps/psf3.jpg";
592
+		$image_array[] = "$dummy_image_url/ps/psl3.jpg";
593
+		$image_array[] = "$dummy_image_url/ps/psb3.jpg";
594
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
595
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
596
+
597
+		$post_info[] = array(
598
+			"listing_type" => $post_type,
599
+			"post_title" => 'Northbay House',
600
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
601 601
 
602 602
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
603 603
 
@@ -607,43 +607,43 @@  discard block
 block discarded – undo
607 607
 
608 608
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
609 609
 
610
-            "post_images" => $image_array,
611
-            "post_category" => array($post_type.'category' => array($category_array[1])),
612
-            "post_tags" => array('Tags', 'Sample Tags'),
613
-            "geodir_video" => '',
614
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
615
-            "geodir_contact" => '(222) 777-1111',
616
-            "geodir_email" => '[email protected]',
617
-            "geodir_website" => 'http://example.com/',
618
-            "geodir_twitter" => 'http://example.com/',
619
-            "geodir_facebook" => 'http://example.com/',
620
-            "geodir_price" => '260000',
621
-            "geodir_property_status" => 'Under Offer',
622
-            'geodir_property_furnishing' => 'Unfurnished',
623
-            'geodir_property_type' => 'Detached house',
624
-            'geodir_property_bedrooms' => '6',
625
-            'geodir_property_bathrooms' => '6',
626
-            'geodir_property_area' => '1650',
627
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
628
-            "post_dummy" => '1'
629
-        );
630
-
631
-        break;
632
-
633
-
634
-    case 4:
635
-        $image_array = array();
636
-        $post_meta = array();
637
-        $image_array[] = "$dummy_image_url/ps/psf4.jpg";
638
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
639
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
640
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
641
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
642
-
643
-        $post_info[] = array(
644
-            "listing_type" => $post_type,
645
-            "post_title" => 'Jesmond Mansion',
646
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
610
+			"post_images" => $image_array,
611
+			"post_category" => array($post_type.'category' => array($category_array[1])),
612
+			"post_tags" => array('Tags', 'Sample Tags'),
613
+			"geodir_video" => '',
614
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
615
+			"geodir_contact" => '(222) 777-1111',
616
+			"geodir_email" => '[email protected]',
617
+			"geodir_website" => 'http://example.com/',
618
+			"geodir_twitter" => 'http://example.com/',
619
+			"geodir_facebook" => 'http://example.com/',
620
+			"geodir_price" => '260000',
621
+			"geodir_property_status" => 'Under Offer',
622
+			'geodir_property_furnishing' => 'Unfurnished',
623
+			'geodir_property_type' => 'Detached house',
624
+			'geodir_property_bedrooms' => '6',
625
+			'geodir_property_bathrooms' => '6',
626
+			'geodir_property_area' => '1650',
627
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
628
+			"post_dummy" => '1'
629
+		);
630
+
631
+		break;
632
+
633
+
634
+	case 4:
635
+		$image_array = array();
636
+		$post_meta = array();
637
+		$image_array[] = "$dummy_image_url/ps/psf4.jpg";
638
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
639
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
640
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
641
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
642
+
643
+		$post_info[] = array(
644
+			"listing_type" => $post_type,
645
+			"post_title" => 'Jesmond Mansion',
646
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
647 647
 
648 648
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
649 649
 
@@ -653,42 +653,42 @@  discard block
 block discarded – undo
653 653
 
654 654
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
655 655
 
656
-            "post_images" => $image_array,
657
-            "post_category" => array($post_type.'category' => array($category_array[1])),
658
-            "post_tags" => array('Tags', 'Sample Tags'),
659
-            "geodir_video" => '',
660
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
661
-            "geodir_contact" => '(222) 777-1111',
662
-            "geodir_email" => '[email protected]',
663
-            "geodir_website" => 'http://example.com/',
664
-            "geodir_twitter" => 'http://example.com/',
665
-            "geodir_facebook" => 'http://example.com/',
666
-            "geodir_price" => '2300000',
667
-            "geodir_property_status" => 'Under Offer',
668
-            'geodir_property_furnishing' => 'Partially furnished',
669
-            'geodir_property_type' => 'Detached house',
670
-            'geodir_property_bedrooms' => '10',
671
-            'geodir_property_bathrooms' => '7',
672
-            'geodir_property_area' => '6600',
673
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
674
-            "post_dummy" => '1'
675
-        );
676
-
677
-        break;
678
-
679
-    case 5:
680
-        $image_array = array();
681
-        $post_meta = array();
682
-        $image_array[] = "$dummy_image_url/ps/psf5.jpg";
683
-        $image_array[] = "$dummy_image_url/ps/psl5.jpg";
684
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
685
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
686
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
687
-
688
-        $post_info[] = array(
689
-            "listing_type" => $post_type,
690
-            "post_title" => 'Springfield Lodge',
691
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
656
+			"post_images" => $image_array,
657
+			"post_category" => array($post_type.'category' => array($category_array[1])),
658
+			"post_tags" => array('Tags', 'Sample Tags'),
659
+			"geodir_video" => '',
660
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
661
+			"geodir_contact" => '(222) 777-1111',
662
+			"geodir_email" => '[email protected]',
663
+			"geodir_website" => 'http://example.com/',
664
+			"geodir_twitter" => 'http://example.com/',
665
+			"geodir_facebook" => 'http://example.com/',
666
+			"geodir_price" => '2300000',
667
+			"geodir_property_status" => 'Under Offer',
668
+			'geodir_property_furnishing' => 'Partially furnished',
669
+			'geodir_property_type' => 'Detached house',
670
+			'geodir_property_bedrooms' => '10',
671
+			'geodir_property_bathrooms' => '7',
672
+			'geodir_property_area' => '6600',
673
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
674
+			"post_dummy" => '1'
675
+		);
676
+
677
+		break;
678
+
679
+	case 5:
680
+		$image_array = array();
681
+		$post_meta = array();
682
+		$image_array[] = "$dummy_image_url/ps/psf5.jpg";
683
+		$image_array[] = "$dummy_image_url/ps/psl5.jpg";
684
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
685
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
686
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
687
+
688
+		$post_info[] = array(
689
+			"listing_type" => $post_type,
690
+			"post_title" => 'Springfield Lodge',
691
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
692 692
 
693 693
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
694 694
 
@@ -698,42 +698,42 @@  discard block
 block discarded – undo
698 698
 
699 699
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
700 700
 
701
-            "post_images" => $image_array,
702
-            "post_category" => array($post_type.'category' => array($category_array[1])),
703
-            "post_tags" => array('Tags', 'Sample Tags'),
704
-            "geodir_video" => '',
705
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
706
-            "geodir_contact" => '(222) 777-1111',
707
-            "geodir_email" => '[email protected]',
708
-            "geodir_website" => 'http://example.com/',
709
-            "geodir_twitter" => 'http://example.com/',
710
-            "geodir_facebook" => 'http://example.com/',
711
-            "geodir_price" => '330000',
712
-            "geodir_property_status" => 'For Sale',
713
-            'geodir_property_furnishing' => 'Optional',
714
-            'geodir_property_type' => 'Detached house',
715
-            'geodir_property_bedrooms' => '4',
716
-            'geodir_property_bathrooms' => '3',
717
-            'geodir_property_area' => '3700',
718
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
719
-            "post_dummy" => '1'
720
-        );
721
-
722
-        break;
723
-
724
-    case 6:
725
-        $image_array = array();
726
-        $post_meta = array();
727
-        $image_array[] = "$dummy_image_url/ps/psf6.jpg";
728
-        $image_array[] = "$dummy_image_url/ps/psl6.jpg";
729
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
730
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
731
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
732
-
733
-        $post_info[] = array(
734
-            "listing_type" => $post_type,
735
-            "post_title" => 'Forrest Park',
736
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
701
+			"post_images" => $image_array,
702
+			"post_category" => array($post_type.'category' => array($category_array[1])),
703
+			"post_tags" => array('Tags', 'Sample Tags'),
704
+			"geodir_video" => '',
705
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
706
+			"geodir_contact" => '(222) 777-1111',
707
+			"geodir_email" => '[email protected]',
708
+			"geodir_website" => 'http://example.com/',
709
+			"geodir_twitter" => 'http://example.com/',
710
+			"geodir_facebook" => 'http://example.com/',
711
+			"geodir_price" => '330000',
712
+			"geodir_property_status" => 'For Sale',
713
+			'geodir_property_furnishing' => 'Optional',
714
+			'geodir_property_type' => 'Detached house',
715
+			'geodir_property_bedrooms' => '4',
716
+			'geodir_property_bathrooms' => '3',
717
+			'geodir_property_area' => '3700',
718
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
719
+			"post_dummy" => '1'
720
+		);
721
+
722
+		break;
723
+
724
+	case 6:
725
+		$image_array = array();
726
+		$post_meta = array();
727
+		$image_array[] = "$dummy_image_url/ps/psf6.jpg";
728
+		$image_array[] = "$dummy_image_url/ps/psl6.jpg";
729
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
730
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
731
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
732
+
733
+		$post_info[] = array(
734
+			"listing_type" => $post_type,
735
+			"post_title" => 'Forrest Park',
736
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
737 737
 
738 738
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
739 739
 
@@ -743,42 +743,42 @@  discard block
 block discarded – undo
743 743
 
744 744
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
745 745
 
746
-            "post_images" => $image_array,
747
-            "post_category" => array($post_type.'category' => array($category_array[1])),
748
-            "post_tags" => array('Tags', 'Sample Tags'),
749
-            "geodir_video" => '',
750
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
751
-            "geodir_contact" => '(222) 777-1111',
752
-            "geodir_email" => '[email protected]',
753
-            "geodir_website" => 'http://example.com/',
754
-            "geodir_twitter" => 'http://example.com/',
755
-            "geodir_facebook" => 'http://example.com/',
756
-            "geodir_price" => '530000',
757
-            "geodir_property_status" => 'For Sale',
758
-            'geodir_property_furnishing' => 'Unfurnished',
759
-            'geodir_property_type' => 'Detached house',
760
-            'geodir_property_bedrooms' => '5',
761
-            'geodir_property_bathrooms' => '4',
762
-            'geodir_property_area' => '2250',
763
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
764
-            "post_dummy" => '1'
765
-        );
766
-
767
-        break;
768
-
769
-    case 7:
770
-        $image_array = array();
771
-        $post_meta = array();
772
-        $image_array[] = "$dummy_image_url/ps/psf7.jpg";
773
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
774
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
775
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
776
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
777
-
778
-        $post_info[] = array(
779
-            "listing_type" => $post_type,
780
-            "post_title" => 'Fraser Suites',
781
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
746
+			"post_images" => $image_array,
747
+			"post_category" => array($post_type.'category' => array($category_array[1])),
748
+			"post_tags" => array('Tags', 'Sample Tags'),
749
+			"geodir_video" => '',
750
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
751
+			"geodir_contact" => '(222) 777-1111',
752
+			"geodir_email" => '[email protected]',
753
+			"geodir_website" => 'http://example.com/',
754
+			"geodir_twitter" => 'http://example.com/',
755
+			"geodir_facebook" => 'http://example.com/',
756
+			"geodir_price" => '530000',
757
+			"geodir_property_status" => 'For Sale',
758
+			'geodir_property_furnishing' => 'Unfurnished',
759
+			'geodir_property_type' => 'Detached house',
760
+			'geodir_property_bedrooms' => '5',
761
+			'geodir_property_bathrooms' => '4',
762
+			'geodir_property_area' => '2250',
763
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
764
+			"post_dummy" => '1'
765
+		);
766
+
767
+		break;
768
+
769
+	case 7:
770
+		$image_array = array();
771
+		$post_meta = array();
772
+		$image_array[] = "$dummy_image_url/ps/psf7.jpg";
773
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
774
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
775
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
776
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
777
+
778
+		$post_info[] = array(
779
+			"listing_type" => $post_type,
780
+			"post_title" => 'Fraser Suites',
781
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
782 782
 
783 783
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
784 784
 
@@ -788,42 +788,42 @@  discard block
 block discarded – undo
788 788
 
789 789
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
790 790
 
791
-            "post_images" => $image_array,
792
-            "post_category" => array($post_type.'category' => array($category_array[0])),
793
-            "post_tags" => array('Tags', 'Sample Tags'),
794
-            "geodir_video" => '',
795
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
796
-            "geodir_contact" => '(222) 777-1111',
797
-            "geodir_email" => '[email protected]',
798
-            "geodir_website" => 'http://example.com/',
799
-            "geodir_twitter" => 'http://example.com/',
800
-            "geodir_facebook" => 'http://example.com/',
801
-            "geodir_price" => '245000',
802
-            "geodir_property_status" => 'For Sale',
803
-            'geodir_property_furnishing' => 'Unfurnished',
804
-            'geodir_property_type' => 'Apartment',
805
-            'geodir_property_bedrooms' => '3',
806
-            'geodir_property_bathrooms' => '2',
807
-            'geodir_property_area' => '1250',
808
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
809
-            "post_dummy" => '1'
810
-        );
811
-
812
-        break;
813
-
814
-    case 8:
815
-        $image_array = array();
816
-        $post_meta = array();
817
-        $image_array[] = "$dummy_image_url/ps/psf8.jpg";
818
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
819
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
820
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
821
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
822
-
823
-        $post_info[] = array(
824
-            "listing_type" => $post_type,
825
-            "post_title" => 'Richmore Apartments',
826
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
791
+			"post_images" => $image_array,
792
+			"post_category" => array($post_type.'category' => array($category_array[0])),
793
+			"post_tags" => array('Tags', 'Sample Tags'),
794
+			"geodir_video" => '',
795
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
796
+			"geodir_contact" => '(222) 777-1111',
797
+			"geodir_email" => '[email protected]',
798
+			"geodir_website" => 'http://example.com/',
799
+			"geodir_twitter" => 'http://example.com/',
800
+			"geodir_facebook" => 'http://example.com/',
801
+			"geodir_price" => '245000',
802
+			"geodir_property_status" => 'For Sale',
803
+			'geodir_property_furnishing' => 'Unfurnished',
804
+			'geodir_property_type' => 'Apartment',
805
+			'geodir_property_bedrooms' => '3',
806
+			'geodir_property_bathrooms' => '2',
807
+			'geodir_property_area' => '1250',
808
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
809
+			"post_dummy" => '1'
810
+		);
811
+
812
+		break;
813
+
814
+	case 8:
815
+		$image_array = array();
816
+		$post_meta = array();
817
+		$image_array[] = "$dummy_image_url/ps/psf8.jpg";
818
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
819
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
820
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
821
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
822
+
823
+		$post_info[] = array(
824
+			"listing_type" => $post_type,
825
+			"post_title" => 'Richmore Apartments',
826
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
827 827
 
828 828
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
829 829
 
@@ -833,43 +833,43 @@  discard block
 block discarded – undo
833 833
 
834 834
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
835 835
 
836
-            "post_images" => $image_array,
837
-            "post_category" => array($post_type.'category' => array($category_array[0])),
838
-            "post_tags" => array('Tags', 'Sample Tags'),
839
-            "geodir_video" => '',
840
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
841
-            "geodir_contact" => '(222) 777-1111',
842
-            "geodir_email" => '[email protected]',
843
-            "geodir_website" => 'http://example.com/',
844
-            "geodir_twitter" => 'http://example.com/',
845
-            "geodir_facebook" => 'http://example.com/',
846
-            "geodir_price" => '395000',
847
-            "geodir_property_status" => 'For Sale',
848
-            'geodir_property_furnishing' => 'Unfurnished',
849
-            'geodir_property_type' => 'Apartment',
850
-            'geodir_property_bedrooms' => '2',
851
-            'geodir_property_bathrooms' => '2',
852
-            'geodir_property_area' => '1750',
853
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
854
-            "post_dummy" => '1'
855
-        );
856
-
857
-        break;
858
-
859
-
860
-    case 9:
861
-        $image_array = array();
862
-        $post_meta = array();
863
-        $image_array[] = "$dummy_image_url/ps/psf9.jpg";
864
-        $image_array[] = "$dummy_image_url/ps/psc9.jpg";
865
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
866
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
867
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
868
-
869
-        $post_info[] = array(
870
-            "listing_type" => $post_type,
871
-            "post_title" => 'Hotel Alpina',
872
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
836
+			"post_images" => $image_array,
837
+			"post_category" => array($post_type.'category' => array($category_array[0])),
838
+			"post_tags" => array('Tags', 'Sample Tags'),
839
+			"geodir_video" => '',
840
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
841
+			"geodir_contact" => '(222) 777-1111',
842
+			"geodir_email" => '[email protected]',
843
+			"geodir_website" => 'http://example.com/',
844
+			"geodir_twitter" => 'http://example.com/',
845
+			"geodir_facebook" => 'http://example.com/',
846
+			"geodir_price" => '395000',
847
+			"geodir_property_status" => 'For Sale',
848
+			'geodir_property_furnishing' => 'Unfurnished',
849
+			'geodir_property_type' => 'Apartment',
850
+			'geodir_property_bedrooms' => '2',
851
+			'geodir_property_bathrooms' => '2',
852
+			'geodir_property_area' => '1750',
853
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
854
+			"post_dummy" => '1'
855
+		);
856
+
857
+		break;
858
+
859
+
860
+	case 9:
861
+		$image_array = array();
862
+		$post_meta = array();
863
+		$image_array[] = "$dummy_image_url/ps/psf9.jpg";
864
+		$image_array[] = "$dummy_image_url/ps/psc9.jpg";
865
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
866
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
867
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
868
+
869
+		$post_info[] = array(
870
+			"listing_type" => $post_type,
871
+			"post_title" => 'Hotel Alpina',
872
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
873 873
 
874 874
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
875 875
 
@@ -879,39 +879,39 @@  discard block
 block discarded – undo
879 879
 
880 880
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
881 881
 
882
-            "post_images" => $image_array,
883
-            "post_category" => array($post_type.'category' => array($category_array[2])),
884
-            "post_tags" => array('Tags', 'Sample Tags'),
885
-            "geodir_video" => '',
886
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
887
-            "geodir_contact" => '(222) 777-1111',
888
-            "geodir_email" => '[email protected]',
889
-            "geodir_website" => 'http://example.com/',
890
-            "geodir_twitter" => 'http://example.com/',
891
-            "geodir_facebook" => 'http://example.com/',
892
-            "geodir_price" => '12500000',
893
-            "geodir_property_status" => 'For Sale',
894
-            'geodir_property_furnishing' => 'Furnished',
895
-            'geodir_property_type' => 'Hotel',
896
-            'geodir_property_bedrooms' => '120',
897
-            'geodir_property_bathrooms' => '133',
898
-            'geodir_property_area' => '35000',
899
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
900
-            "post_dummy" => '1'
901
-        );
902
-
903
-        break;
904
-
905
-    case 10:
906
-        $image_array = array();
907
-        $post_meta = array();
908
-        $image_array[] = "$dummy_image_url/ps/psf10.jpg";
909
-        $image_array[] = "$dummy_image_url/ps/psf102.jpg";
910
-
911
-        $post_info[] = array(
912
-            "listing_type" => $post_type,
913
-            "post_title" => 'Development Land',
914
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
882
+			"post_images" => $image_array,
883
+			"post_category" => array($post_type.'category' => array($category_array[2])),
884
+			"post_tags" => array('Tags', 'Sample Tags'),
885
+			"geodir_video" => '',
886
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
887
+			"geodir_contact" => '(222) 777-1111',
888
+			"geodir_email" => '[email protected]',
889
+			"geodir_website" => 'http://example.com/',
890
+			"geodir_twitter" => 'http://example.com/',
891
+			"geodir_facebook" => 'http://example.com/',
892
+			"geodir_price" => '12500000',
893
+			"geodir_property_status" => 'For Sale',
894
+			'geodir_property_furnishing' => 'Furnished',
895
+			'geodir_property_type' => 'Hotel',
896
+			'geodir_property_bedrooms' => '120',
897
+			'geodir_property_bathrooms' => '133',
898
+			'geodir_property_area' => '35000',
899
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
900
+			"post_dummy" => '1'
901
+		);
902
+
903
+		break;
904
+
905
+	case 10:
906
+		$image_array = array();
907
+		$post_meta = array();
908
+		$image_array[] = "$dummy_image_url/ps/psf10.jpg";
909
+		$image_array[] = "$dummy_image_url/ps/psf102.jpg";
910
+
911
+		$post_info[] = array(
912
+			"listing_type" => $post_type,
913
+			"post_title" => 'Development Land',
914
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
915 915
 
916 916
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
917 917
 
@@ -921,93 +921,93 @@  discard block
 block discarded – undo
921 921
 
922 922
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
923 923
 
924
-            "post_images" => $image_array,
925
-            "post_category" => array($post_type.'category' => array($category_array[3])),
926
-            "post_tags" => array('Tags', 'Sample Tags'),
927
-            "geodir_video" => '',
928
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
929
-            "geodir_contact" => '(222) 777-1111',
930
-            "geodir_email" => '[email protected]',
931
-            "geodir_website" => 'http://example.com/',
932
-            "geodir_twitter" => 'http://example.com/',
933
-            "geodir_facebook" => 'http://example.com/',
934
-            "geodir_price" => '80000',
935
-            "geodir_property_status" => 'For Sale',
936
-            'geodir_property_furnishing' => '',
937
-            'geodir_property_type' => 'Land',
938
-            'geodir_property_bedrooms' => '',
939
-            'geodir_property_bathrooms' => '',
940
-            'geodir_property_area' => '250000',
941
-            'geodir_property_features' => '',
942
-            "post_dummy" => '1'
943
-        );
944
-
945
-        break;
924
+			"post_images" => $image_array,
925
+			"post_category" => array($post_type.'category' => array($category_array[3])),
926
+			"post_tags" => array('Tags', 'Sample Tags'),
927
+			"geodir_video" => '',
928
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
929
+			"geodir_contact" => '(222) 777-1111',
930
+			"geodir_email" => '[email protected]',
931
+			"geodir_website" => 'http://example.com/',
932
+			"geodir_twitter" => 'http://example.com/',
933
+			"geodir_facebook" => 'http://example.com/',
934
+			"geodir_price" => '80000',
935
+			"geodir_property_status" => 'For Sale',
936
+			'geodir_property_furnishing' => '',
937
+			'geodir_property_type' => 'Land',
938
+			'geodir_property_bedrooms' => '',
939
+			'geodir_property_bathrooms' => '',
940
+			'geodir_property_area' => '250000',
941
+			'geodir_property_features' => '',
942
+			"post_dummy" => '1'
943
+		);
944
+
945
+		break;
946 946
 
947 947
 } // end of switch
948 948
 
949 949
 foreach ($post_info as $post_info) {
950
-    $default_location = geodir_get_default_location();
951
-    if ($city_bound_lat1 > $city_bound_lat2)
952
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
953
-    else
954
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
950
+	$default_location = geodir_get_default_location();
951
+	if ($city_bound_lat1 > $city_bound_lat2)
952
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
953
+	else
954
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
955 955
 
956 956
 
957
-    if ($city_bound_lng1 > $city_bound_lng2)
958
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
959
-    else
960
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
957
+	if ($city_bound_lng1 > $city_bound_lng2)
958
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
959
+	else
960
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
961 961
 
962
-    $load_map = get_option('geodir_load_map');
962
+	$load_map = get_option('geodir_load_map');
963 963
     
964
-    if ($load_map == 'osm') {
965
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
966
-    } else {
967
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
968
-    }
969
-
970
-    $postal_code = '';
971
-    if (!empty($post_address)) {
972
-        if ($load_map == 'osm') {
973
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
974
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
975
-        } else {
976
-            $addresses = array();
977
-            $addresses_default = array();
964
+	if ($load_map == 'osm') {
965
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
966
+	} else {
967
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
968
+	}
969
+
970
+	$postal_code = '';
971
+	if (!empty($post_address)) {
972
+		if ($load_map == 'osm') {
973
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
974
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
975
+		} else {
976
+			$addresses = array();
977
+			$addresses_default = array();
978 978
             
979
-            foreach ($post_address as $add_key => $add_value) {
980
-                if ($add_key < 2 && !empty($add_value->long_name)) {
981
-                    $addresses_default[] = $add_value->long_name;
982
-                }
983
-                if ($add_value->types[0] == 'postal_code') {
984
-                    $postal_code = $add_value->long_name;
985
-                }
986
-                if ($add_value->types[0] == 'street_number') {
987
-                    $addresses[] = $add_value->long_name;
988
-                }
989
-                if ($add_value->types[0] == 'route') {
990
-                    $addresses[] = $add_value->long_name;
991
-                }
992
-                if ($add_value->types[0] == 'neighborhood') {
993
-                    $addresses[] = $add_value->long_name;
994
-                }
995
-                if ($add_value->types[0] == 'sublocality') {
996
-                    $addresses[] = $add_value->long_name;
997
-                }
998
-            }
999
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1000
-        }
1001
-
1002
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1003
-        $post_info['post_city'] = $default_location->city;
1004
-        $post_info['post_region'] = $default_location->region;
1005
-        $post_info['post_country'] = $default_location->country;
1006
-        $post_info['post_zip'] = $postal_code;
1007
-        $post_info['post_latitude'] = $dummy_post_latitude;
1008
-        $post_info['post_longitude'] = $dummy_post_longitude;
1009
-    }
979
+			foreach ($post_address as $add_key => $add_value) {
980
+				if ($add_key < 2 && !empty($add_value->long_name)) {
981
+					$addresses_default[] = $add_value->long_name;
982
+				}
983
+				if ($add_value->types[0] == 'postal_code') {
984
+					$postal_code = $add_value->long_name;
985
+				}
986
+				if ($add_value->types[0] == 'street_number') {
987
+					$addresses[] = $add_value->long_name;
988
+				}
989
+				if ($add_value->types[0] == 'route') {
990
+					$addresses[] = $add_value->long_name;
991
+				}
992
+				if ($add_value->types[0] == 'neighborhood') {
993
+					$addresses[] = $add_value->long_name;
994
+				}
995
+				if ($add_value->types[0] == 'sublocality') {
996
+					$addresses[] = $add_value->long_name;
997
+				}
998
+			}
999
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1000
+		}
1001
+
1002
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1003
+		$post_info['post_city'] = $default_location->city;
1004
+		$post_info['post_region'] = $default_location->region;
1005
+		$post_info['post_country'] = $default_location->country;
1006
+		$post_info['post_zip'] = $postal_code;
1007
+		$post_info['post_latitude'] = $dummy_post_latitude;
1008
+		$post_info['post_longitude'] = $dummy_post_longitude;
1009
+	}
1010 1010
     
1011
-    geodir_save_listing($post_info, true);
1012
-    echo 1;
1011
+	geodir_save_listing($post_info, true);
1012
+	echo 1;
1013 1013
 }
Please login to merge, or discard this patch.
geodirectory-admin/dummy-data/recruitment_jobs.php 1 patch
Indentation   +646 added lines, -646 removed lines patch added patch discarded remove patch
@@ -7,232 +7,232 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
10
-    $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
12
-
13
-    // Salary
14
-    $fields[] = array('listing_type' => $post_type,
15
-                      'field_type'          =>  'text',
16
-                      'data_type'           =>  'FLOAT',
17
-                      'decimal_point'       =>  '2',
18
-                      'admin_title'         =>  __('Salary', 'geodirectory'),
19
-                      'site_title'          =>  __('Salary', 'geodirectory'),
20
-                      'admin_desc'          =>  __('Enter the Salary in $ (no currency symbol) ie: 25000', 'geodirectory'),
21
-                      'htmlvar_name'        =>  'salary',
22
-                      'is_active'           =>  true,
23
-                      'for_admin_use'       =>  false,
24
-                      'default_value'       =>  '',
25
-                      'show_in' 	        =>  '[detail],[listing]',
26
-                      'is_required'         =>  false,
27
-                      'validation_pattern'  =>  '\d+(\.\d{2})?',
28
-                      'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
-                      'required_msg'        =>  '',
30
-                      'field_icon'          =>  'fas fa-dollar-sign',
31
-                      'css_class'           =>  '',
32
-                      'cat_sort'            =>  true,
33
-                      'cat_filter'	        =>  true,
34
-                      'extra'        =>  array(
35
-                          'is_price'                  =>  1,
36
-                          'thousand_separator'        =>  'comma',
37
-                          'decimal_separator'         =>  'period',
38
-                          'decimal_display'           =>  'if',
39
-                          'currency_symbol'           =>  '$',
40
-                          'currency_symbol_placement' =>  'left'
41
-                      )
42
-    );
43
-
44
-
45
-
46
-    // Job Type
47
-    $fields[] = array('listing_type' => $post_type,
48
-                      'field_type'          =>  'select',
49
-                      'data_type'           =>  'VARCHAR',
50
-                      'admin_title'         =>  __('Job Type', 'geodirectory'),
51
-                      'site_title'          =>  __('Job Type','geodirectory'),
52
-                      'admin_desc'          =>  __('Select the type of job.','geodirectory'),
53
-                      'htmlvar_name'        =>  'job_type',
54
-                      'is_active'           =>  true,
55
-                      'for_admin_use'       =>  false,
56
-                      'default_value'       =>  '',
57
-                      'show_in' 	        =>  '[detail],[listing]',
58
-                      'is_required'         =>  true,
59
-                      'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'),
60
-                      'validation_pattern'  =>  '',
61
-                      'validation_msg'      =>  '',
62
-                      'required_msg'        =>  '',
63
-                      'field_icon'          =>  'fas fa-briefcase',
64
-                      'css_class'           =>  '',
65
-                      'cat_sort'            =>  true,
66
-                      'cat_filter'	        =>  true
67
-    );
68
-
69
-    // Job Sector
70
-    $fields[] = array('listing_type' => $post_type,
71
-                      'field_type'          =>  'select',
72
-                      'data_type'           =>  'VARCHAR',
73
-                      'admin_title'         =>  __('Job Sector','geodirectory'),
74
-                      'site_title'          =>  __('Job Sector','geodirectory'),
75
-                      'admin_desc'          =>  __('Select the job sector.','geodirectory'),
76
-                      'htmlvar_name'        =>  'job_sector',
77
-                      'is_active'           =>  true,
78
-                      'for_admin_use'       =>  false,
79
-                      'default_value'       =>  '',
80
-                      'show_in' 	          =>  '[detail]',
81
-                      'is_required'         =>  true,
82
-                      'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'),
83
-                      'validation_pattern'  =>  '',
84
-                      'validation_msg'      =>  '',
85
-                      'required_msg'        =>  '',
86
-                      'field_icon'          =>  'fas fa-briefcase',
87
-                      'css_class'           =>  '',
88
-                      'cat_sort'            =>  true,
89
-                      'cat_filter'	      =>  true
90
-    );
91
-
92
-    // Required Experience
93
-    $fields[] = array('listing_type' => $post_type,
94
-                      'field_type'          =>  'select',
95
-                      'data_type'           =>  'VARCHAR',
96
-                      'admin_title'         =>  __('Required Experience', 'geodirectory'),
97
-                      'site_title'          =>  __('Required Experience', 'geodirectory'),
98
-                      'admin_desc'          =>  __('Select the number of years required experience', 'geodirectory'),
99
-                      'htmlvar_name'        =>  'job_experience',
100
-                      'is_active'           =>  true,
101
-                      'for_admin_use'       =>  false,
102
-                      'default_value'       =>  '',
103
-                      'show_in' 	        =>  '[detail],[listing]',
104
-                      'is_required'         =>  true,
105
-                      'option_values'       =>  __('Select Experience/,No Experience Required,1 Year,2 Years,3 Years,4 Years,5 Years,6 Years,7 Years,8 Years,9 Years,10+ Years','geodirectory'),
106
-                      'validation_pattern'  =>  '',
107
-                      'validation_msg'      =>  '',
108
-                      'required_msg'        =>  '',
109
-                      'field_icon'          =>  'far fa-life-ring',
110
-                      'css_class'           =>  '',
111
-                      'cat_sort'            =>  true,
112
-                      'cat_filter'	        =>  true
113
-    );
114
-
115
-    // Required Skills
116
-    $fields[] = array('listing_type' => $post_type,
117
-                      'field_type'          =>  'textarea',
118
-                      'data_type'           =>  'TEXT',
119
-                      'admin_title'         =>  __('Required Skills', 'geodirectory'),
120
-                      'site_title'          =>  __('Required Skills', 'geodirectory'),
121
-                      'admin_desc'          =>  __('Enter the required skills for the job', 'geodirectory'),
122
-                      'htmlvar_name'        =>  'property_area',
123
-                      'is_active'           =>  true,
124
-                      'for_admin_use'       =>  false,
125
-                      'default_value'       =>  '',
126
-                      'show_in' 	        =>  '[detail],[listing]',
127
-                      'is_required'         =>  false,
128
-                      'validation_pattern'  =>  '',
129
-                      'validation_msg'      =>  '',
130
-                      'required_msg'        =>  '',
131
-                      'field_icon'          =>  'fas fa-chart-area',
132
-                      'css_class'           =>  '',
133
-                      'cat_sort'            =>  true,
134
-                      'cat_filter'	        =>  true
135
-    );
136
-
137
-
138
-
139
-    // Company details fieldset
140
-    $fields[] = array('listing_type' => $post_type,
141
-                      'field_type'          =>  'fieldset',
142
-                      'data_type'           =>  '',
143
-                      'admin_title'         =>  __('Company Details', 'geodirectory'),
144
-                      'site_title'          =>  __('Company Details', 'geodirectory'),
145
-                      'admin_desc'          =>  __('Enter your company details here', 'geodirectory'),
146
-                      'htmlvar_name'        =>  'job_company_details',
147
-                      'is_active'           =>  true,
148
-                      'for_admin_use'       =>  false,
149
-                      'show_in' 	        =>  '[owntab]'
150
-
151
-    );
152
-
153
-    // Company Name
154
-    $fields[] = array('listing_type' => $post_type,
155
-                      'field_type'          =>  'text',
156
-                      'data_type'           =>  'VARCHAR',
157
-                      'admin_title'         =>  __('Company Name', 'geodirectory'),
158
-                      'site_title'          =>  __('Company Name', 'geodirectory'),
159
-                      'admin_desc'          =>  __('Enter your company name', 'geodirectory'),
160
-                      'htmlvar_name'        =>  'job_company_name',
161
-                      'is_active'           =>  true,
162
-                      'for_admin_use'       =>  false,
163
-                      'default_value'       =>  '',
164
-                      'show_in' 	        =>  '[owntab]',
165
-                      'is_required'         =>  false,
166
-                      'validation_pattern'  =>  '',
167
-                      'validation_msg'      =>  '',
168
-                      'required_msg'        =>  '',
169
-                      'field_icon'          =>  'fas fa-arrow-circle-right',
170
-                      'css_class'           =>  '',
171
-                      'cat_sort'            =>  false,
172
-                      'cat_filter'	        =>  false
173
-    );
174
-
175
-    // Company Logo
176
-    $fields[] = array('listing_type' => $post_type,
177
-                      'field_type'          =>  'file',
178
-                      'data_type'           =>  '',
179
-                      'admin_title'         =>  __('Company Logo', 'geodirectory'),
180
-                      'site_title'          =>  __('Company Logo', 'geodirectory'),
181
-                      'admin_desc'          =>  __('Enter your company Logo', 'geodirectory'),
182
-                      'htmlvar_name'        =>  'job_company_logo',
183
-                      'is_active'           =>  true,
184
-                      'for_admin_use'       =>  false,
185
-                      'default_value'       =>  '',
186
-                      'show_in' 	        =>  '[owntab]',
187
-                      'is_required'         =>  false,
188
-                      'validation_pattern'  =>  '',
189
-                      'validation_msg'      =>  '',
190
-                      'required_msg'        =>  '',
191
-                      'field_icon'          =>  'fas fa-arrow-circle-right',
192
-                      'css_class'           =>  '',
193
-                      'cat_sort'            =>  false,
194
-                      'cat_filter'	        =>  false,
195
-                      'extra'               =>  array(
196
-                          'gd_file_types'   =>  'jpg',
197
-                          'gd_file_types'   =>  'jpeg',
198
-                          'gd_file_types'   =>  'gif',
199
-                          'gd_file_types'   =>  'png',
200
-                      )
201
-    );
202
-
203
-    // Company Url
204
-    $fields[] = array('listing_type' => $post_type,
205
-                      'field_type'          =>  'url',
206
-                      'data_type'           =>  'VARCHAR',
207
-                      'admin_title'         =>  __('Company Url', 'geodirectory'),
208
-                      'site_title'          =>  __('Company Url', 'geodirectory'),
209
-                      'admin_desc'          =>  __('Enter your company Url', 'geodirectory'),
210
-                      'htmlvar_name'        =>  'job_company_url',
211
-                      'is_active'           =>  true,
212
-                      'for_admin_use'       =>  false,
213
-                      'default_value'       =>  '',
214
-                      'show_in' 	        =>  '[owntab]',
215
-                      'is_required'         =>  false,
216
-                      'validation_pattern'  =>  '',
217
-                      'validation_msg'      =>  '',
218
-                      'required_msg'        =>  '',
219
-                      'field_icon'          =>  'fas fa-arrow-circle-right',
220
-                      'css_class'           =>  '',
221
-                      'cat_sort'            =>  false,
222
-                      'cat_filter'	        =>  false
223
-    );
224
-
225
-
226
-
227
-    /**
228
-     * Filter the array of default custom fields DB table data.
229
-     *
230
-     * @since 1.6.6
231
-     * @param string $fields The default custom fields as an array.
232
-     */
233
-    $fields = apply_filters('geodir_property_sale_custom_fields', $fields);
234
-
235
-    return  $fields;
10
+	$fields = array();
11
+	$package = ($package_id=='') ? '' : array($package_id);
12
+
13
+	// Salary
14
+	$fields[] = array('listing_type' => $post_type,
15
+					  'field_type'          =>  'text',
16
+					  'data_type'           =>  'FLOAT',
17
+					  'decimal_point'       =>  '2',
18
+					  'admin_title'         =>  __('Salary', 'geodirectory'),
19
+					  'site_title'          =>  __('Salary', 'geodirectory'),
20
+					  'admin_desc'          =>  __('Enter the Salary in $ (no currency symbol) ie: 25000', 'geodirectory'),
21
+					  'htmlvar_name'        =>  'salary',
22
+					  'is_active'           =>  true,
23
+					  'for_admin_use'       =>  false,
24
+					  'default_value'       =>  '',
25
+					  'show_in' 	        =>  '[detail],[listing]',
26
+					  'is_required'         =>  false,
27
+					  'validation_pattern'  =>  '\d+(\.\d{2})?',
28
+					  'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
+					  'required_msg'        =>  '',
30
+					  'field_icon'          =>  'fas fa-dollar-sign',
31
+					  'css_class'           =>  '',
32
+					  'cat_sort'            =>  true,
33
+					  'cat_filter'	        =>  true,
34
+					  'extra'        =>  array(
35
+						  'is_price'                  =>  1,
36
+						  'thousand_separator'        =>  'comma',
37
+						  'decimal_separator'         =>  'period',
38
+						  'decimal_display'           =>  'if',
39
+						  'currency_symbol'           =>  '$',
40
+						  'currency_symbol_placement' =>  'left'
41
+					  )
42
+	);
43
+
44
+
45
+
46
+	// Job Type
47
+	$fields[] = array('listing_type' => $post_type,
48
+					  'field_type'          =>  'select',
49
+					  'data_type'           =>  'VARCHAR',
50
+					  'admin_title'         =>  __('Job Type', 'geodirectory'),
51
+					  'site_title'          =>  __('Job Type','geodirectory'),
52
+					  'admin_desc'          =>  __('Select the type of job.','geodirectory'),
53
+					  'htmlvar_name'        =>  'job_type',
54
+					  'is_active'           =>  true,
55
+					  'for_admin_use'       =>  false,
56
+					  'default_value'       =>  '',
57
+					  'show_in' 	        =>  '[detail],[listing]',
58
+					  'is_required'         =>  true,
59
+					  'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'),
60
+					  'validation_pattern'  =>  '',
61
+					  'validation_msg'      =>  '',
62
+					  'required_msg'        =>  '',
63
+					  'field_icon'          =>  'fas fa-briefcase',
64
+					  'css_class'           =>  '',
65
+					  'cat_sort'            =>  true,
66
+					  'cat_filter'	        =>  true
67
+	);
68
+
69
+	// Job Sector
70
+	$fields[] = array('listing_type' => $post_type,
71
+					  'field_type'          =>  'select',
72
+					  'data_type'           =>  'VARCHAR',
73
+					  'admin_title'         =>  __('Job Sector','geodirectory'),
74
+					  'site_title'          =>  __('Job Sector','geodirectory'),
75
+					  'admin_desc'          =>  __('Select the job sector.','geodirectory'),
76
+					  'htmlvar_name'        =>  'job_sector',
77
+					  'is_active'           =>  true,
78
+					  'for_admin_use'       =>  false,
79
+					  'default_value'       =>  '',
80
+					  'show_in' 	          =>  '[detail]',
81
+					  'is_required'         =>  true,
82
+					  'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'),
83
+					  'validation_pattern'  =>  '',
84
+					  'validation_msg'      =>  '',
85
+					  'required_msg'        =>  '',
86
+					  'field_icon'          =>  'fas fa-briefcase',
87
+					  'css_class'           =>  '',
88
+					  'cat_sort'            =>  true,
89
+					  'cat_filter'	      =>  true
90
+	);
91
+
92
+	// Required Experience
93
+	$fields[] = array('listing_type' => $post_type,
94
+					  'field_type'          =>  'select',
95
+					  'data_type'           =>  'VARCHAR',
96
+					  'admin_title'         =>  __('Required Experience', 'geodirectory'),
97
+					  'site_title'          =>  __('Required Experience', 'geodirectory'),
98
+					  'admin_desc'          =>  __('Select the number of years required experience', 'geodirectory'),
99
+					  'htmlvar_name'        =>  'job_experience',
100
+					  'is_active'           =>  true,
101
+					  'for_admin_use'       =>  false,
102
+					  'default_value'       =>  '',
103
+					  'show_in' 	        =>  '[detail],[listing]',
104
+					  'is_required'         =>  true,
105
+					  'option_values'       =>  __('Select Experience/,No Experience Required,1 Year,2 Years,3 Years,4 Years,5 Years,6 Years,7 Years,8 Years,9 Years,10+ Years','geodirectory'),
106
+					  'validation_pattern'  =>  '',
107
+					  'validation_msg'      =>  '',
108
+					  'required_msg'        =>  '',
109
+					  'field_icon'          =>  'far fa-life-ring',
110
+					  'css_class'           =>  '',
111
+					  'cat_sort'            =>  true,
112
+					  'cat_filter'	        =>  true
113
+	);
114
+
115
+	// Required Skills
116
+	$fields[] = array('listing_type' => $post_type,
117
+					  'field_type'          =>  'textarea',
118
+					  'data_type'           =>  'TEXT',
119
+					  'admin_title'         =>  __('Required Skills', 'geodirectory'),
120
+					  'site_title'          =>  __('Required Skills', 'geodirectory'),
121
+					  'admin_desc'          =>  __('Enter the required skills for the job', 'geodirectory'),
122
+					  'htmlvar_name'        =>  'property_area',
123
+					  'is_active'           =>  true,
124
+					  'for_admin_use'       =>  false,
125
+					  'default_value'       =>  '',
126
+					  'show_in' 	        =>  '[detail],[listing]',
127
+					  'is_required'         =>  false,
128
+					  'validation_pattern'  =>  '',
129
+					  'validation_msg'      =>  '',
130
+					  'required_msg'        =>  '',
131
+					  'field_icon'          =>  'fas fa-chart-area',
132
+					  'css_class'           =>  '',
133
+					  'cat_sort'            =>  true,
134
+					  'cat_filter'	        =>  true
135
+	);
136
+
137
+
138
+
139
+	// Company details fieldset
140
+	$fields[] = array('listing_type' => $post_type,
141
+					  'field_type'          =>  'fieldset',
142
+					  'data_type'           =>  '',
143
+					  'admin_title'         =>  __('Company Details', 'geodirectory'),
144
+					  'site_title'          =>  __('Company Details', 'geodirectory'),
145
+					  'admin_desc'          =>  __('Enter your company details here', 'geodirectory'),
146
+					  'htmlvar_name'        =>  'job_company_details',
147
+					  'is_active'           =>  true,
148
+					  'for_admin_use'       =>  false,
149
+					  'show_in' 	        =>  '[owntab]'
150
+
151
+	);
152
+
153
+	// Company Name
154
+	$fields[] = array('listing_type' => $post_type,
155
+					  'field_type'          =>  'text',
156
+					  'data_type'           =>  'VARCHAR',
157
+					  'admin_title'         =>  __('Company Name', 'geodirectory'),
158
+					  'site_title'          =>  __('Company Name', 'geodirectory'),
159
+					  'admin_desc'          =>  __('Enter your company name', 'geodirectory'),
160
+					  'htmlvar_name'        =>  'job_company_name',
161
+					  'is_active'           =>  true,
162
+					  'for_admin_use'       =>  false,
163
+					  'default_value'       =>  '',
164
+					  'show_in' 	        =>  '[owntab]',
165
+					  'is_required'         =>  false,
166
+					  'validation_pattern'  =>  '',
167
+					  'validation_msg'      =>  '',
168
+					  'required_msg'        =>  '',
169
+					  'field_icon'          =>  'fas fa-arrow-circle-right',
170
+					  'css_class'           =>  '',
171
+					  'cat_sort'            =>  false,
172
+					  'cat_filter'	        =>  false
173
+	);
174
+
175
+	// Company Logo
176
+	$fields[] = array('listing_type' => $post_type,
177
+					  'field_type'          =>  'file',
178
+					  'data_type'           =>  '',
179
+					  'admin_title'         =>  __('Company Logo', 'geodirectory'),
180
+					  'site_title'          =>  __('Company Logo', 'geodirectory'),
181
+					  'admin_desc'          =>  __('Enter your company Logo', 'geodirectory'),
182
+					  'htmlvar_name'        =>  'job_company_logo',
183
+					  'is_active'           =>  true,
184
+					  'for_admin_use'       =>  false,
185
+					  'default_value'       =>  '',
186
+					  'show_in' 	        =>  '[owntab]',
187
+					  'is_required'         =>  false,
188
+					  'validation_pattern'  =>  '',
189
+					  'validation_msg'      =>  '',
190
+					  'required_msg'        =>  '',
191
+					  'field_icon'          =>  'fas fa-arrow-circle-right',
192
+					  'css_class'           =>  '',
193
+					  'cat_sort'            =>  false,
194
+					  'cat_filter'	        =>  false,
195
+					  'extra'               =>  array(
196
+						  'gd_file_types'   =>  'jpg',
197
+						  'gd_file_types'   =>  'jpeg',
198
+						  'gd_file_types'   =>  'gif',
199
+						  'gd_file_types'   =>  'png',
200
+					  )
201
+	);
202
+
203
+	// Company Url
204
+	$fields[] = array('listing_type' => $post_type,
205
+					  'field_type'          =>  'url',
206
+					  'data_type'           =>  'VARCHAR',
207
+					  'admin_title'         =>  __('Company Url', 'geodirectory'),
208
+					  'site_title'          =>  __('Company Url', 'geodirectory'),
209
+					  'admin_desc'          =>  __('Enter your company Url', 'geodirectory'),
210
+					  'htmlvar_name'        =>  'job_company_url',
211
+					  'is_active'           =>  true,
212
+					  'for_admin_use'       =>  false,
213
+					  'default_value'       =>  '',
214
+					  'show_in' 	        =>  '[owntab]',
215
+					  'is_required'         =>  false,
216
+					  'validation_pattern'  =>  '',
217
+					  'validation_msg'      =>  '',
218
+					  'required_msg'        =>  '',
219
+					  'field_icon'          =>  'fas fa-arrow-circle-right',
220
+					  'css_class'           =>  '',
221
+					  'cat_sort'            =>  false,
222
+					  'cat_filter'	        =>  false
223
+	);
224
+
225
+
226
+
227
+	/**
228
+	 * Filter the array of default custom fields DB table data.
229
+	 *
230
+	 * @since 1.6.6
231
+	 * @param string $fields The default custom fields as an array.
232
+	 */
233
+	$fields = apply_filters('geodir_property_sale_custom_fields', $fields);
234
+
235
+	return  $fields;
236 236
 }
237 237
 
238 238
 global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
@@ -242,36 +242,36 @@  discard block
 block discarded – undo
242 242
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
243 243
 
244 244
 if($dummy_post_index==1){
245
-    // add the dummy categories
246
-    geodir_dummy_data_taxonomies($post_type,$category_array );
245
+	// add the dummy categories
246
+	geodir_dummy_data_taxonomies($post_type,$category_array );
247 247
 
248
-    // add the dummy custom fields
249
-    $fields = geodir_property_sale_custom_fields($post_type);
250
-    geodir_create_dummy_fields($fields);
251
-    update_option($post_type.'_dummy_data_type','property_sale');
248
+	// add the dummy custom fields
249
+	$fields = geodir_property_sale_custom_fields($post_type);
250
+	geodir_create_dummy_fields($fields);
251
+	update_option($post_type.'_dummy_data_type','property_sale');
252 252
 }
253 253
 
254 254
 if (geodir_dummy_folder_exists())
255
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
255
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
256 256
 else
257
-    $dummy_image_url = 'http://wpgeodirectory.com/dummy';
257
+	$dummy_image_url = 'http://wpgeodirectory.com/dummy';
258 258
 
259 259
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
260 260
 
261 261
 switch ($dummy_post_index) {
262 262
 
263
-    case(1):
264
-        $image_array[] = "$dummy_image_url/ps/psf1.jpg";
265
-        $image_array[] = "$dummy_image_url/ps/psl1.jpg";
266
-        $image_array[] = "$dummy_image_url/ps/psb1.jpg";
267
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
268
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
263
+	case(1):
264
+		$image_array[] = "$dummy_image_url/ps/psf1.jpg";
265
+		$image_array[] = "$dummy_image_url/ps/psl1.jpg";
266
+		$image_array[] = "$dummy_image_url/ps/psb1.jpg";
267
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
268
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
269 269
 
270 270
 
271
-        $post_info[] = array(
272
-            "listing_type" => $post_type,
273
-            "post_title" => 'Eastern Lodge',
274
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
271
+		$post_info[] = array(
272
+			"listing_type" => $post_type,
273
+			"post_title" => 'Eastern Lodge',
274
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
275 275
 
276 276
 Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien.
277 277
 
@@ -280,42 +280,42 @@  discard block
 block discarded – undo
280 280
 Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat.
281 281
 
282 282
 Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.',
283
-            "post_images" => $image_array,
284
-            "post_category" => array($post_type.'category' => array($category_array[1])),
285
-            "post_tags" => array('Tags', 'Sample Tags'),
286
-            "geodir_video" => '',
287
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
288
-            "geodir_contact" => '(111) 677-4444',
289
-            "geodir_email" => '[email protected]',
290
-            "geodir_website" => 'http://example.com/',
291
-            "geodir_twitter" => 'http://example.com/',
292
-            "geodir_facebook" => 'http://example.com/',
293
-            "geodir_price" => '350000',
294
-            "geodir_property_status" => 'For Sale',
295
-            'geodir_property_furnishing' => 'Furnished',
296
-            'geodir_property_type' => 'Detached house',
297
-            'geodir_property_bedrooms' => '3',
298
-            'geodir_property_bathrooms' => '2',
299
-            'geodir_property_area' => '1850',
300
-            'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
301
-            "post_dummy" => '1'
302
-        );
303
-
304
-
305
-        break;
306
-    case 2:
307
-        $image_array = array();
308
-        $post_meta = array();
309
-        $image_array[] = "$dummy_image_url/ps/psf2.jpg";
310
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
311
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
312
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
313
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
314
-
315
-        $post_info[] = array(
316
-            "listing_type" => $post_type,
317
-            "post_title" => 'Daisy Street',
318
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
283
+			"post_images" => $image_array,
284
+			"post_category" => array($post_type.'category' => array($category_array[1])),
285
+			"post_tags" => array('Tags', 'Sample Tags'),
286
+			"geodir_video" => '',
287
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
288
+			"geodir_contact" => '(111) 677-4444',
289
+			"geodir_email" => '[email protected]',
290
+			"geodir_website" => 'http://example.com/',
291
+			"geodir_twitter" => 'http://example.com/',
292
+			"geodir_facebook" => 'http://example.com/',
293
+			"geodir_price" => '350000',
294
+			"geodir_property_status" => 'For Sale',
295
+			'geodir_property_furnishing' => 'Furnished',
296
+			'geodir_property_type' => 'Detached house',
297
+			'geodir_property_bedrooms' => '3',
298
+			'geodir_property_bathrooms' => '2',
299
+			'geodir_property_area' => '1850',
300
+			'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
301
+			"post_dummy" => '1'
302
+		);
303
+
304
+
305
+		break;
306
+	case 2:
307
+		$image_array = array();
308
+		$post_meta = array();
309
+		$image_array[] = "$dummy_image_url/ps/psf2.jpg";
310
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
311
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
312
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
313
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
314
+
315
+		$post_info[] = array(
316
+			"listing_type" => $post_type,
317
+			"post_title" => 'Daisy Street',
318
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
319 319
 
320 320
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
321 321
 
@@ -325,42 +325,42 @@  discard block
 block discarded – undo
325 325
 
326 326
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
327 327
 
328
-            "post_images" => $image_array,
329
-            "post_category" => array($post_type.'category' => array($category_array[1])),
330
-            "post_tags" => array('Garage'),
331
-            "geodir_video" => '',
332
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
333
-            "geodir_contact" => '(222) 777-1111',
334
-            "geodir_email" => '[email protected]',
335
-            "geodir_website" => 'http://example.com/',
336
-            "geodir_twitter" => 'http://example.com/',
337
-            "geodir_facebook" => 'http://example.com/',
338
-            "geodir_price" => '230000',
339
-            "geodir_property_status" => 'Sold',
340
-            'geodir_property_furnishing' => 'Unfurnished',
341
-            'geodir_property_type' => 'Detached house',
342
-            'geodir_property_bedrooms' => '5',
343
-            'geodir_property_bathrooms' => '3',
344
-            'geodir_property_area' => '2650',
345
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
346
-            "post_dummy" => '1'
347
-        );
348
-
349
-        break;
350
-
351
-    case 3:
352
-        $image_array = array();
353
-        $post_meta = array();
354
-        $image_array[] = "$dummy_image_url/ps/psf3.jpg";
355
-        $image_array[] = "$dummy_image_url/ps/psl3.jpg";
356
-        $image_array[] = "$dummy_image_url/ps/psb3.jpg";
357
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
358
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
359
-
360
-        $post_info[] = array(
361
-            "listing_type" => $post_type,
362
-            "post_title" => 'Northbay House',
363
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
328
+			"post_images" => $image_array,
329
+			"post_category" => array($post_type.'category' => array($category_array[1])),
330
+			"post_tags" => array('Garage'),
331
+			"geodir_video" => '',
332
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
333
+			"geodir_contact" => '(222) 777-1111',
334
+			"geodir_email" => '[email protected]',
335
+			"geodir_website" => 'http://example.com/',
336
+			"geodir_twitter" => 'http://example.com/',
337
+			"geodir_facebook" => 'http://example.com/',
338
+			"geodir_price" => '230000',
339
+			"geodir_property_status" => 'Sold',
340
+			'geodir_property_furnishing' => 'Unfurnished',
341
+			'geodir_property_type' => 'Detached house',
342
+			'geodir_property_bedrooms' => '5',
343
+			'geodir_property_bathrooms' => '3',
344
+			'geodir_property_area' => '2650',
345
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
346
+			"post_dummy" => '1'
347
+		);
348
+
349
+		break;
350
+
351
+	case 3:
352
+		$image_array = array();
353
+		$post_meta = array();
354
+		$image_array[] = "$dummy_image_url/ps/psf3.jpg";
355
+		$image_array[] = "$dummy_image_url/ps/psl3.jpg";
356
+		$image_array[] = "$dummy_image_url/ps/psb3.jpg";
357
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
358
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
359
+
360
+		$post_info[] = array(
361
+			"listing_type" => $post_type,
362
+			"post_title" => 'Northbay House',
363
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
364 364
 
365 365
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
366 366
 
@@ -370,43 +370,43 @@  discard block
 block discarded – undo
370 370
 
371 371
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
372 372
 
373
-            "post_images" => $image_array,
374
-            "post_category" => array($post_type.'category' => array($category_array[1])),
375
-            "post_tags" => array('Tags', 'Sample Tags'),
376
-            "geodir_video" => '',
377
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
378
-            "geodir_contact" => '(222) 777-1111',
379
-            "geodir_email" => '[email protected]',
380
-            "geodir_website" => 'http://example.com/',
381
-            "geodir_twitter" => 'http://example.com/',
382
-            "geodir_facebook" => 'http://example.com/',
383
-            "geodir_price" => '260000',
384
-            "geodir_property_status" => 'Under Offer',
385
-            'geodir_property_furnishing' => 'Unfurnished',
386
-            'geodir_property_type' => 'Detached house',
387
-            'geodir_property_bedrooms' => '6',
388
-            'geodir_property_bathrooms' => '6',
389
-            'geodir_property_area' => '1650',
390
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
391
-            "post_dummy" => '1'
392
-        );
393
-
394
-        break;
395
-
396
-
397
-    case 4:
398
-        $image_array = array();
399
-        $post_meta = array();
400
-        $image_array[] = "$dummy_image_url/ps/psf4.jpg";
401
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
402
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
403
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
404
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
405
-
406
-        $post_info[] = array(
407
-            "listing_type" => $post_type,
408
-            "post_title" => 'Jesmond Mansion',
409
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
373
+			"post_images" => $image_array,
374
+			"post_category" => array($post_type.'category' => array($category_array[1])),
375
+			"post_tags" => array('Tags', 'Sample Tags'),
376
+			"geodir_video" => '',
377
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
378
+			"geodir_contact" => '(222) 777-1111',
379
+			"geodir_email" => '[email protected]',
380
+			"geodir_website" => 'http://example.com/',
381
+			"geodir_twitter" => 'http://example.com/',
382
+			"geodir_facebook" => 'http://example.com/',
383
+			"geodir_price" => '260000',
384
+			"geodir_property_status" => 'Under Offer',
385
+			'geodir_property_furnishing' => 'Unfurnished',
386
+			'geodir_property_type' => 'Detached house',
387
+			'geodir_property_bedrooms' => '6',
388
+			'geodir_property_bathrooms' => '6',
389
+			'geodir_property_area' => '1650',
390
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
391
+			"post_dummy" => '1'
392
+		);
393
+
394
+		break;
395
+
396
+
397
+	case 4:
398
+		$image_array = array();
399
+		$post_meta = array();
400
+		$image_array[] = "$dummy_image_url/ps/psf4.jpg";
401
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
402
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
403
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
404
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
405
+
406
+		$post_info[] = array(
407
+			"listing_type" => $post_type,
408
+			"post_title" => 'Jesmond Mansion',
409
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
410 410
 
411 411
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
412 412
 
@@ -416,42 +416,42 @@  discard block
 block discarded – undo
416 416
 
417 417
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
418 418
 
419
-            "post_images" => $image_array,
420
-            "post_category" => array($post_type.'category' => array($category_array[1])),
421
-            "post_tags" => array('Tags', 'Sample Tags'),
422
-            "geodir_video" => '',
423
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
424
-            "geodir_contact" => '(222) 777-1111',
425
-            "geodir_email" => '[email protected]',
426
-            "geodir_website" => 'http://example.com/',
427
-            "geodir_twitter" => 'http://example.com/',
428
-            "geodir_facebook" => 'http://example.com/',
429
-            "geodir_price" => '2300000',
430
-            "geodir_property_status" => 'Under Offer',
431
-            'geodir_property_furnishing' => 'Partially furnished',
432
-            'geodir_property_type' => 'Detached house',
433
-            'geodir_property_bedrooms' => '10',
434
-            'geodir_property_bathrooms' => '7',
435
-            'geodir_property_area' => '6600',
436
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
437
-            "post_dummy" => '1'
438
-        );
439
-
440
-        break;
441
-
442
-    case 5:
443
-        $image_array = array();
444
-        $post_meta = array();
445
-        $image_array[] = "$dummy_image_url/ps/psf5.jpg";
446
-        $image_array[] = "$dummy_image_url/ps/psl5.jpg";
447
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
448
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
449
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
450
-
451
-        $post_info[] = array(
452
-            "listing_type" => $post_type,
453
-            "post_title" => 'Springfield Lodge',
454
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
419
+			"post_images" => $image_array,
420
+			"post_category" => array($post_type.'category' => array($category_array[1])),
421
+			"post_tags" => array('Tags', 'Sample Tags'),
422
+			"geodir_video" => '',
423
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
424
+			"geodir_contact" => '(222) 777-1111',
425
+			"geodir_email" => '[email protected]',
426
+			"geodir_website" => 'http://example.com/',
427
+			"geodir_twitter" => 'http://example.com/',
428
+			"geodir_facebook" => 'http://example.com/',
429
+			"geodir_price" => '2300000',
430
+			"geodir_property_status" => 'Under Offer',
431
+			'geodir_property_furnishing' => 'Partially furnished',
432
+			'geodir_property_type' => 'Detached house',
433
+			'geodir_property_bedrooms' => '10',
434
+			'geodir_property_bathrooms' => '7',
435
+			'geodir_property_area' => '6600',
436
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
437
+			"post_dummy" => '1'
438
+		);
439
+
440
+		break;
441
+
442
+	case 5:
443
+		$image_array = array();
444
+		$post_meta = array();
445
+		$image_array[] = "$dummy_image_url/ps/psf5.jpg";
446
+		$image_array[] = "$dummy_image_url/ps/psl5.jpg";
447
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
448
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
449
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
450
+
451
+		$post_info[] = array(
452
+			"listing_type" => $post_type,
453
+			"post_title" => 'Springfield Lodge',
454
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
455 455
 
456 456
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
457 457
 
@@ -461,42 +461,42 @@  discard block
 block discarded – undo
461 461
 
462 462
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
463 463
 
464
-            "post_images" => $image_array,
465
-            "post_category" => array($post_type.'category' => array($category_array[1])),
466
-            "post_tags" => array('Tags', 'Sample Tags'),
467
-            "geodir_video" => '',
468
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
469
-            "geodir_contact" => '(222) 777-1111',
470
-            "geodir_email" => '[email protected]',
471
-            "geodir_website" => 'http://example.com/',
472
-            "geodir_twitter" => 'http://example.com/',
473
-            "geodir_facebook" => 'http://example.com/',
474
-            "geodir_price" => '330000',
475
-            "geodir_property_status" => 'For Sale',
476
-            'geodir_property_furnishing' => 'Optional',
477
-            'geodir_property_type' => 'Detached house',
478
-            'geodir_property_bedrooms' => '4',
479
-            'geodir_property_bathrooms' => '3',
480
-            'geodir_property_area' => '3700',
481
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
482
-            "post_dummy" => '1'
483
-        );
484
-
485
-        break;
486
-
487
-    case 6:
488
-        $image_array = array();
489
-        $post_meta = array();
490
-        $image_array[] = "$dummy_image_url/ps/psf6.jpg";
491
-        $image_array[] = "$dummy_image_url/ps/psl6.jpg";
492
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
493
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
494
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
495
-
496
-        $post_info[] = array(
497
-            "listing_type" => $post_type,
498
-            "post_title" => 'Forrest Park',
499
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
464
+			"post_images" => $image_array,
465
+			"post_category" => array($post_type.'category' => array($category_array[1])),
466
+			"post_tags" => array('Tags', 'Sample Tags'),
467
+			"geodir_video" => '',
468
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
469
+			"geodir_contact" => '(222) 777-1111',
470
+			"geodir_email" => '[email protected]',
471
+			"geodir_website" => 'http://example.com/',
472
+			"geodir_twitter" => 'http://example.com/',
473
+			"geodir_facebook" => 'http://example.com/',
474
+			"geodir_price" => '330000',
475
+			"geodir_property_status" => 'For Sale',
476
+			'geodir_property_furnishing' => 'Optional',
477
+			'geodir_property_type' => 'Detached house',
478
+			'geodir_property_bedrooms' => '4',
479
+			'geodir_property_bathrooms' => '3',
480
+			'geodir_property_area' => '3700',
481
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
482
+			"post_dummy" => '1'
483
+		);
484
+
485
+		break;
486
+
487
+	case 6:
488
+		$image_array = array();
489
+		$post_meta = array();
490
+		$image_array[] = "$dummy_image_url/ps/psf6.jpg";
491
+		$image_array[] = "$dummy_image_url/ps/psl6.jpg";
492
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
493
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
494
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
495
+
496
+		$post_info[] = array(
497
+			"listing_type" => $post_type,
498
+			"post_title" => 'Forrest Park',
499
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
500 500
 
501 501
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
502 502
 
@@ -506,42 +506,42 @@  discard block
 block discarded – undo
506 506
 
507 507
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
508 508
 
509
-            "post_images" => $image_array,
510
-            "post_category" => array($post_type.'category' => array($category_array[1])),
511
-            "post_tags" => array('Tags', 'Sample Tags'),
512
-            "geodir_video" => '',
513
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
514
-            "geodir_contact" => '(222) 777-1111',
515
-            "geodir_email" => '[email protected]',
516
-            "geodir_website" => 'http://example.com/',
517
-            "geodir_twitter" => 'http://example.com/',
518
-            "geodir_facebook" => 'http://example.com/',
519
-            "geodir_price" => '530000',
520
-            "geodir_property_status" => 'For Sale',
521
-            'geodir_property_furnishing' => 'Unfurnished',
522
-            'geodir_property_type' => 'Detached house',
523
-            'geodir_property_bedrooms' => '5',
524
-            'geodir_property_bathrooms' => '4',
525
-            'geodir_property_area' => '2250',
526
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
527
-            "post_dummy" => '1'
528
-        );
529
-
530
-        break;
531
-
532
-    case 7:
533
-        $image_array = array();
534
-        $post_meta = array();
535
-        $image_array[] = "$dummy_image_url/ps/psf7.jpg";
536
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
537
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
538
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
539
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
540
-
541
-        $post_info[] = array(
542
-            "listing_type" => $post_type,
543
-            "post_title" => 'Fraser Suites',
544
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
509
+			"post_images" => $image_array,
510
+			"post_category" => array($post_type.'category' => array($category_array[1])),
511
+			"post_tags" => array('Tags', 'Sample Tags'),
512
+			"geodir_video" => '',
513
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
514
+			"geodir_contact" => '(222) 777-1111',
515
+			"geodir_email" => '[email protected]',
516
+			"geodir_website" => 'http://example.com/',
517
+			"geodir_twitter" => 'http://example.com/',
518
+			"geodir_facebook" => 'http://example.com/',
519
+			"geodir_price" => '530000',
520
+			"geodir_property_status" => 'For Sale',
521
+			'geodir_property_furnishing' => 'Unfurnished',
522
+			'geodir_property_type' => 'Detached house',
523
+			'geodir_property_bedrooms' => '5',
524
+			'geodir_property_bathrooms' => '4',
525
+			'geodir_property_area' => '2250',
526
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
527
+			"post_dummy" => '1'
528
+		);
529
+
530
+		break;
531
+
532
+	case 7:
533
+		$image_array = array();
534
+		$post_meta = array();
535
+		$image_array[] = "$dummy_image_url/ps/psf7.jpg";
536
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
537
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
538
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
539
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
540
+
541
+		$post_info[] = array(
542
+			"listing_type" => $post_type,
543
+			"post_title" => 'Fraser Suites',
544
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
545 545
 
546 546
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
547 547
 
@@ -551,42 +551,42 @@  discard block
 block discarded – undo
551 551
 
552 552
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
553 553
 
554
-            "post_images" => $image_array,
555
-            "post_category" => array($post_type.'category' => array($category_array[0])),
556
-            "post_tags" => array('Tags', 'Sample Tags'),
557
-            "geodir_video" => '',
558
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
559
-            "geodir_contact" => '(222) 777-1111',
560
-            "geodir_email" => '[email protected]',
561
-            "geodir_website" => 'http://example.com/',
562
-            "geodir_twitter" => 'http://example.com/',
563
-            "geodir_facebook" => 'http://example.com/',
564
-            "geodir_price" => '245000',
565
-            "geodir_property_status" => 'For Sale',
566
-            'geodir_property_furnishing' => 'Unfurnished',
567
-            'geodir_property_type' => 'Apartment',
568
-            'geodir_property_bedrooms' => '3',
569
-            'geodir_property_bathrooms' => '2',
570
-            'geodir_property_area' => '1250',
571
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
572
-            "post_dummy" => '1'
573
-        );
574
-
575
-        break;
576
-
577
-    case 8:
578
-        $image_array = array();
579
-        $post_meta = array();
580
-        $image_array[] = "$dummy_image_url/ps/psf8.jpg";
581
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
582
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
583
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
584
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
585
-
586
-        $post_info[] = array(
587
-            "listing_type" => $post_type,
588
-            "post_title" => 'Richmore Apartments',
589
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
554
+			"post_images" => $image_array,
555
+			"post_category" => array($post_type.'category' => array($category_array[0])),
556
+			"post_tags" => array('Tags', 'Sample Tags'),
557
+			"geodir_video" => '',
558
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
559
+			"geodir_contact" => '(222) 777-1111',
560
+			"geodir_email" => '[email protected]',
561
+			"geodir_website" => 'http://example.com/',
562
+			"geodir_twitter" => 'http://example.com/',
563
+			"geodir_facebook" => 'http://example.com/',
564
+			"geodir_price" => '245000',
565
+			"geodir_property_status" => 'For Sale',
566
+			'geodir_property_furnishing' => 'Unfurnished',
567
+			'geodir_property_type' => 'Apartment',
568
+			'geodir_property_bedrooms' => '3',
569
+			'geodir_property_bathrooms' => '2',
570
+			'geodir_property_area' => '1250',
571
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
572
+			"post_dummy" => '1'
573
+		);
574
+
575
+		break;
576
+
577
+	case 8:
578
+		$image_array = array();
579
+		$post_meta = array();
580
+		$image_array[] = "$dummy_image_url/ps/psf8.jpg";
581
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
582
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
583
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
584
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
585
+
586
+		$post_info[] = array(
587
+			"listing_type" => $post_type,
588
+			"post_title" => 'Richmore Apartments',
589
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
590 590
 
591 591
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
592 592
 
@@ -596,43 +596,43 @@  discard block
 block discarded – undo
596 596
 
597 597
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
598 598
 
599
-            "post_images" => $image_array,
600
-            "post_category" => array($post_type.'category' => array($category_array[0])),
601
-            "post_tags" => array('Tags', 'Sample Tags'),
602
-            "geodir_video" => '',
603
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
604
-            "geodir_contact" => '(222) 777-1111',
605
-            "geodir_email" => '[email protected]',
606
-            "geodir_website" => 'http://example.com/',
607
-            "geodir_twitter" => 'http://example.com/',
608
-            "geodir_facebook" => 'http://example.com/',
609
-            "geodir_price" => '395000',
610
-            "geodir_property_status" => 'For Sale',
611
-            'geodir_property_furnishing' => 'Unfurnished',
612
-            'geodir_property_type' => 'Apartment',
613
-            'geodir_property_bedrooms' => '2',
614
-            'geodir_property_bathrooms' => '2',
615
-            'geodir_property_area' => '1750',
616
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
617
-            "post_dummy" => '1'
618
-        );
619
-
620
-        break;
621
-
622
-
623
-    case 9:
624
-        $image_array = array();
625
-        $post_meta = array();
626
-        $image_array[] = "$dummy_image_url/ps/psf9.jpg";
627
-        $image_array[] = "$dummy_image_url/ps/psc9.jpg";
628
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
629
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
630
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
631
-
632
-        $post_info[] = array(
633
-            "listing_type" => $post_type,
634
-            "post_title" => 'Hotel Alpina',
635
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
599
+			"post_images" => $image_array,
600
+			"post_category" => array($post_type.'category' => array($category_array[0])),
601
+			"post_tags" => array('Tags', 'Sample Tags'),
602
+			"geodir_video" => '',
603
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
604
+			"geodir_contact" => '(222) 777-1111',
605
+			"geodir_email" => '[email protected]',
606
+			"geodir_website" => 'http://example.com/',
607
+			"geodir_twitter" => 'http://example.com/',
608
+			"geodir_facebook" => 'http://example.com/',
609
+			"geodir_price" => '395000',
610
+			"geodir_property_status" => 'For Sale',
611
+			'geodir_property_furnishing' => 'Unfurnished',
612
+			'geodir_property_type' => 'Apartment',
613
+			'geodir_property_bedrooms' => '2',
614
+			'geodir_property_bathrooms' => '2',
615
+			'geodir_property_area' => '1750',
616
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
617
+			"post_dummy" => '1'
618
+		);
619
+
620
+		break;
621
+
622
+
623
+	case 9:
624
+		$image_array = array();
625
+		$post_meta = array();
626
+		$image_array[] = "$dummy_image_url/ps/psf9.jpg";
627
+		$image_array[] = "$dummy_image_url/ps/psc9.jpg";
628
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
629
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
630
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
631
+
632
+		$post_info[] = array(
633
+			"listing_type" => $post_type,
634
+			"post_title" => 'Hotel Alpina',
635
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
636 636
 
637 637
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
638 638
 
@@ -642,39 +642,39 @@  discard block
 block discarded – undo
642 642
 
643 643
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
644 644
 
645
-            "post_images" => $image_array,
646
-            "post_category" => array($post_type.'category' => array($category_array[2])),
647
-            "post_tags" => array('Tags', 'Sample Tags'),
648
-            "geodir_video" => '',
649
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
650
-            "geodir_contact" => '(222) 777-1111',
651
-            "geodir_email" => '[email protected]',
652
-            "geodir_website" => 'http://example.com/',
653
-            "geodir_twitter" => 'http://example.com/',
654
-            "geodir_facebook" => 'http://example.com/',
655
-            "geodir_price" => '12500000',
656
-            "geodir_property_status" => 'For Sale',
657
-            'geodir_property_furnishing' => 'Furnished',
658
-            'geodir_property_type' => 'Hotel',
659
-            'geodir_property_bedrooms' => '120',
660
-            'geodir_property_bathrooms' => '133',
661
-            'geodir_property_area' => '35000',
662
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
663
-            "post_dummy" => '1'
664
-        );
665
-
666
-        break;
667
-
668
-    case 10:
669
-        $image_array = array();
670
-        $post_meta = array();
671
-        $image_array[] = "$dummy_image_url/ps/psf10.jpg";
672
-        $image_array[] = "$dummy_image_url/ps/psf102.jpg";
673
-
674
-        $post_info[] = array(
675
-            "listing_type" => $post_type,
676
-            "post_title" => 'Development Land',
677
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
645
+			"post_images" => $image_array,
646
+			"post_category" => array($post_type.'category' => array($category_array[2])),
647
+			"post_tags" => array('Tags', 'Sample Tags'),
648
+			"geodir_video" => '',
649
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
650
+			"geodir_contact" => '(222) 777-1111',
651
+			"geodir_email" => '[email protected]',
652
+			"geodir_website" => 'http://example.com/',
653
+			"geodir_twitter" => 'http://example.com/',
654
+			"geodir_facebook" => 'http://example.com/',
655
+			"geodir_price" => '12500000',
656
+			"geodir_property_status" => 'For Sale',
657
+			'geodir_property_furnishing' => 'Furnished',
658
+			'geodir_property_type' => 'Hotel',
659
+			'geodir_property_bedrooms' => '120',
660
+			'geodir_property_bathrooms' => '133',
661
+			'geodir_property_area' => '35000',
662
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
663
+			"post_dummy" => '1'
664
+		);
665
+
666
+		break;
667
+
668
+	case 10:
669
+		$image_array = array();
670
+		$post_meta = array();
671
+		$image_array[] = "$dummy_image_url/ps/psf10.jpg";
672
+		$image_array[] = "$dummy_image_url/ps/psf102.jpg";
673
+
674
+		$post_info[] = array(
675
+			"listing_type" => $post_type,
676
+			"post_title" => 'Development Land',
677
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
678 678
 
679 679
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
680 680
 
@@ -684,93 +684,93 @@  discard block
 block discarded – undo
684 684
 
685 685
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
686 686
 
687
-            "post_images" => $image_array,
688
-            "post_category" => array($post_type.'category' => array($category_array[3])),
689
-            "post_tags" => array('Tags', 'Sample Tags'),
690
-            "geodir_video" => '',
691
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
692
-            "geodir_contact" => '(222) 777-1111',
693
-            "geodir_email" => '[email protected]',
694
-            "geodir_website" => 'http://example.com/',
695
-            "geodir_twitter" => 'http://example.com/',
696
-            "geodir_facebook" => 'http://example.com/',
697
-            "geodir_price" => '80000',
698
-            "geodir_property_status" => 'For Sale',
699
-            'geodir_property_furnishing' => '',
700
-            'geodir_property_type' => 'Land',
701
-            'geodir_property_bedrooms' => '',
702
-            'geodir_property_bathrooms' => '',
703
-            'geodir_property_area' => '250000',
704
-            'geodir_property_features' => '',
705
-            "post_dummy" => '1'
706
-        );
707
-
708
-        break;
687
+			"post_images" => $image_array,
688
+			"post_category" => array($post_type.'category' => array($category_array[3])),
689
+			"post_tags" => array('Tags', 'Sample Tags'),
690
+			"geodir_video" => '',
691
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
692
+			"geodir_contact" => '(222) 777-1111',
693
+			"geodir_email" => '[email protected]',
694
+			"geodir_website" => 'http://example.com/',
695
+			"geodir_twitter" => 'http://example.com/',
696
+			"geodir_facebook" => 'http://example.com/',
697
+			"geodir_price" => '80000',
698
+			"geodir_property_status" => 'For Sale',
699
+			'geodir_property_furnishing' => '',
700
+			'geodir_property_type' => 'Land',
701
+			'geodir_property_bedrooms' => '',
702
+			'geodir_property_bathrooms' => '',
703
+			'geodir_property_area' => '250000',
704
+			'geodir_property_features' => '',
705
+			"post_dummy" => '1'
706
+		);
707
+
708
+		break;
709 709
 
710 710
 } // end of switch
711 711
 
712 712
 foreach ($post_info as $post_info) {
713
-    $default_location = geodir_get_default_location();
714
-    if ($city_bound_lat1 > $city_bound_lat2)
715
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
716
-    else
717
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
713
+	$default_location = geodir_get_default_location();
714
+	if ($city_bound_lat1 > $city_bound_lat2)
715
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
716
+	else
717
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
718 718
 
719 719
 
720
-    if ($city_bound_lng1 > $city_bound_lng2)
721
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
722
-    else
723
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
720
+	if ($city_bound_lng1 > $city_bound_lng2)
721
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
722
+	else
723
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
724 724
 
725
-    $load_map = get_option('geodir_load_map');
725
+	$load_map = get_option('geodir_load_map');
726 726
     
727
-    if ($load_map == 'osm') {
728
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
729
-    } else {
730
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
731
-    }
732
-
733
-    $postal_code = '';
734
-    if (!empty($post_address)) {
735
-        if ($load_map == 'osm') {
736
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
737
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
738
-        } else {
739
-            $addresses = array();
740
-            $addresses_default = array();
727
+	if ($load_map == 'osm') {
728
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
729
+	} else {
730
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
731
+	}
732
+
733
+	$postal_code = '';
734
+	if (!empty($post_address)) {
735
+		if ($load_map == 'osm') {
736
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
737
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
738
+		} else {
739
+			$addresses = array();
740
+			$addresses_default = array();
741 741
             
742
-            foreach ($post_address as $add_key => $add_value) {
743
-                if ($add_key < 2 && !empty($add_value->long_name)) {
744
-                    $addresses_default[] = $add_value->long_name;
745
-                }
746
-                if ($add_value->types[0] == 'postal_code') {
747
-                    $postal_code = $add_value->long_name;
748
-                }
749
-                if ($add_value->types[0] == 'street_number') {
750
-                    $addresses[] = $add_value->long_name;
751
-                }
752
-                if ($add_value->types[0] == 'route') {
753
-                    $addresses[] = $add_value->long_name;
754
-                }
755
-                if ($add_value->types[0] == 'neighborhood') {
756
-                    $addresses[] = $add_value->long_name;
757
-                }
758
-                if ($add_value->types[0] == 'sublocality') {
759
-                    $addresses[] = $add_value->long_name;
760
-                }
761
-            }
762
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
763
-        }
764
-
765
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
766
-        $post_info['post_city'] = $default_location->city;
767
-        $post_info['post_region'] = $default_location->region;
768
-        $post_info['post_country'] = $default_location->country;
769
-        $post_info['post_zip'] = $postal_code;
770
-        $post_info['post_latitude'] = $dummy_post_latitude;
771
-        $post_info['post_longitude'] = $dummy_post_longitude;
772
-    }
742
+			foreach ($post_address as $add_key => $add_value) {
743
+				if ($add_key < 2 && !empty($add_value->long_name)) {
744
+					$addresses_default[] = $add_value->long_name;
745
+				}
746
+				if ($add_value->types[0] == 'postal_code') {
747
+					$postal_code = $add_value->long_name;
748
+				}
749
+				if ($add_value->types[0] == 'street_number') {
750
+					$addresses[] = $add_value->long_name;
751
+				}
752
+				if ($add_value->types[0] == 'route') {
753
+					$addresses[] = $add_value->long_name;
754
+				}
755
+				if ($add_value->types[0] == 'neighborhood') {
756
+					$addresses[] = $add_value->long_name;
757
+				}
758
+				if ($add_value->types[0] == 'sublocality') {
759
+					$addresses[] = $add_value->long_name;
760
+				}
761
+			}
762
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
763
+		}
764
+
765
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
766
+		$post_info['post_city'] = $default_location->city;
767
+		$post_info['post_region'] = $default_location->region;
768
+		$post_info['post_country'] = $default_location->country;
769
+		$post_info['post_zip'] = $postal_code;
770
+		$post_info['post_latitude'] = $dummy_post_latitude;
771
+		$post_info['post_longitude'] = $dummy_post_longitude;
772
+	}
773 773
     
774
-    geodir_save_listing($post_info, true);
775
-    echo 1;
774
+	geodir_save_listing($post_info, true);
775
+	echo 1;
776 776
 }
Please login to merge, or discard this patch.