Test Failed
Push — master ( 7975e0...d13900 )
by Stiofan
18:02
created
geodirectory-functions/custom_field_html.php 2 patches
Indentation   +333 added lines, -333 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,17 +68,17 @@  discard block
 block discarded – undo
68 68
 //print_r($field_info);
69 69
 
70 70
 if (isset($cf['icon']) && strpos($cf['icon'], 'fa 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 style="background-image: url("'.$cf['icon'].'")"></b>';
73
+	$field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
74 74
 }else{
75
-    $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
75
+	$field_icon = '<i class="fa 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
 ?>
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
89 89
         <?php
90 90
 
91
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
92
-        ?>
91
+		$nonce = wp_create_nonce('custom_fields_' . $result_str);
92
+		?>
93 93
 
94 94
         <?php if ($default): ?>
95 95
             <div title="<?php _e('Default field, should not be removed.', 'geodirectory'); ?>" class="handlediv move gd-default-remove"><i class="fa fa-times" aria-hidden="true"></i></div>
@@ -98,37 +98,37 @@  discard block
 block discarded – undo
98 98
                  onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
99 99
                  class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div>
100 100
         <?php endif;
101
-        if ($field_type == 'fieldset') {
102
-            ?>
101
+		if ($field_type == 'fieldset') {
102
+			?>
103 103
             <i class="fa fa-long-arrow-left " aria-hidden="true"></i>
104 104
             <i class="fa fa-long-arrow-right " aria-hidden="true"></i>
105 105
             <b style="cursor:pointer;"
106 106
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
107 107
         <?php
108
-        } else {echo $field_icon;
109
-            ?>
108
+		} else {echo $field_icon;
109
+			?>
110 110
             <b style="cursor:pointer;"
111 111
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b>
112 112
         <?php
113
-        }
114
-        ?>
113
+		}
114
+		?>
115 115
     </div>
116 116
 
117 117
     <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
118 118
     <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
119 119
          style="display:<?php if ($field_ins_upd == 'submit') {
120
-             echo 'block;';
121
-         } else {
122
-             echo 'none;';
123
-         } ?>">
120
+			 echo 'block;';
121
+		 } else {
122
+			 echo 'none;';
123
+		 } ?>">
124 124
         <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/>
125 125
         <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
126 126
         <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
127 127
         <input type="hidden" name="field_type_key" id="field_type_key" value="<?php echo $field_type_key; ?>"/>
128 128
         <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/>
129 129
         <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
130
-            echo $field_info->data_type;
131
-        } ?>"/>
130
+			echo $field_info->data_type;
131
+		} ?>"/>
132 132
         <input type="hidden" name="is_active" id="is_active" value="1"/>
133 133
 
134 134
         <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?>
@@ -140,37 +140,37 @@  discard block
 block discarded – undo
140 140
 
141 141
             <?php
142 142
 
143
-            // data_type
144
-            if(has_filter("geodir_cfa_data_type_{$field_type}")){
143
+			// data_type
144
+			if(has_filter("geodir_cfa_data_type_{$field_type}")){
145 145
 
146
-                echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
146
+				echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
147 147
 
148
-            }else{
149
-                $value = '';
150
-                if (isset($field_info->data_type)) {
151
-                    $value = esc_attr($field_info->data_type);
152
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
153
-                    $value = $cf['defaults']['data_type'];
154
-                }
155
-                ?>
148
+			}else{
149
+				$value = '';
150
+				if (isset($field_info->data_type)) {
151
+					$value = esc_attr($field_info->data_type);
152
+				}elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
153
+					$value = $cf['defaults']['data_type'];
154
+				}
155
+				?>
156 156
                 <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/>
157 157
             <?php
158
-            }
158
+			}
159 159
 
160 160
 
161
-            // admin_title
162
-            if(has_filter("geodir_cfa_admin_title_{$field_type}")){
161
+			// admin_title
162
+			if(has_filter("geodir_cfa_admin_title_{$field_type}")){
163 163
 
164
-                echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
164
+				echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
165 165
 
166
-            }else{
167
-                $value = '';
168
-                if (isset($field_info->admin_title)) {
169
-                    $value = esc_attr($field_info->admin_title);
170
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
171
-                    $value = $cf['defaults']['admin_title'];
172
-                }
173
-                ?>
166
+			}else{
167
+				$value = '';
168
+				if (isset($field_info->admin_title)) {
169
+					$value = esc_attr($field_info->admin_title);
170
+				}elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
171
+					$value = $cf['defaults']['admin_title'];
172
+				}
173
+				?>
174 174
                 <li>
175 175
                     <label for="admin_title" class="gd-cf-tooltip-wrap">
176 176
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Admin title :', 'geodirectory'); ?>
@@ -184,22 +184,22 @@  discard block
 block discarded – undo
184 184
                     </div>
185 185
                 </li>
186 186
                 <?php
187
-            }
187
+			}
188 188
 
189 189
 
190
-            // site_title
191
-            if(has_filter("geodir_cfa_site_title_{$field_type}")){
190
+			// site_title
191
+			if(has_filter("geodir_cfa_site_title_{$field_type}")){
192 192
 
193
-                echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
193
+				echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
194 194
 
195
-            }else{
196
-                $value = '';
197
-                if (isset($field_info->site_title)) {
198
-                    $value = esc_attr($field_info->site_title);
199
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
200
-                    $value = $cf['defaults']['site_title'];
201
-                }
202
-                ?>
195
+			}else{
196
+				$value = '';
197
+				if (isset($field_info->site_title)) {
198
+					$value = esc_attr($field_info->site_title);
199
+				}elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
200
+					$value = $cf['defaults']['site_title'];
201
+				}
202
+				?>
203 203
                 <li>
204 204
                     <label for="site_title" class="gd-cf-tooltip-wrap"> <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend title :', 'geodirectory'); ?>
205 205
                         <div class="gdcf-tooltip">
@@ -212,22 +212,22 @@  discard block
 block discarded – undo
212 212
                     </div>
213 213
                 </li>
214 214
                 <?php
215
-            }
215
+			}
216 216
 
217 217
 
218
-            // admin_desc
219
-            if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
218
+			// admin_desc
219
+			if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
220 220
 
221
-                echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
221
+				echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
222 222
 
223
-            }else{
224
-                $value = '';
225
-                if (isset($field_info->admin_desc)) {
226
-                    $value = esc_attr($field_info->admin_desc);
227
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
228
-                    $value = $cf['defaults']['admin_desc'];
229
-                }
230
-                ?>
223
+			}else{
224
+				$value = '';
225
+				if (isset($field_info->admin_desc)) {
226
+					$value = esc_attr($field_info->admin_desc);
227
+				}elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
228
+					$value = $cf['defaults']['admin_desc'];
229
+				}
230
+				?>
231 231
                 <li>
232 232
                     <label for="admin_desc" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend description :', 'geodirectory'); ?>
233 233
                         <div class="gdcf-tooltip">
@@ -239,23 +239,23 @@  discard block
 block discarded – undo
239 239
                     </div>
240 240
                 </li>
241 241
                 <?php
242
-            }
242
+			}
243 243
 
244 244
 
245 245
 
246
-            // htmlvar_name
247
-            if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
246
+			// htmlvar_name
247
+			if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
248 248
 
249
-                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
249
+				echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
250 250
 
251
-            }else{
252
-                $value = '';
253
-                if (isset($field_info->htmlvar_name)) {
254
-                    $value = esc_attr($field_info->htmlvar_name);
255
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
256
-                    $value = $cf['defaults']['htmlvar_name'];
257
-                }
258
-                ?>
251
+			}else{
252
+				$value = '';
253
+				if (isset($field_info->htmlvar_name)) {
254
+					$value = esc_attr($field_info->htmlvar_name);
255
+				}elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
256
+					$value = $cf['defaults']['htmlvar_name'];
257
+				}
258
+				?>
259 259
                 <li>
260 260
                     <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
261 261
                         <div class="gdcf-tooltip">
@@ -265,29 +265,29 @@  discard block
 block discarded – undo
265 265
                     <div class="gd-cf-input-wrap">
266 266
                         <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');?>"
267 267
                                value="<?php if ($value) {
268
-                                   echo preg_replace('/geodir_/', '', $value, 1);
269
-                               }?>" <?php if ($default) {
270
-                            echo 'readonly="readonly"';
271
-                        }?> />
268
+								   echo preg_replace('/geodir_/', '', $value, 1);
269
+							   }?>" <?php if ($default) {
270
+							echo 'readonly="readonly"';
271
+						}?> />
272 272
                     </div>
273 273
                 </li>
274 274
                 <?php
275
-            }
275
+			}
276 276
 
277 277
 
278
-            // is_active
279
-            if(has_filter("geodir_cfa_is_active_{$field_type}")){
278
+			// is_active
279
+			if(has_filter("geodir_cfa_is_active_{$field_type}")){
280 280
 
281
-                echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
281
+				echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
282 282
 
283
-            }else{
284
-                $value = '';
285
-                if (isset($field_info->is_active)) {
286
-                    $value = esc_attr($field_info->is_active);
287
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
288
-                    $value = $cf['defaults']['is_active'];
289
-                }
290
-                ?>
283
+			}else{
284
+				$value = '';
285
+				if (isset($field_info->is_active)) {
286
+					$value = esc_attr($field_info->is_active);
287
+				}elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
288
+					$value = $cf['defaults']['is_active'];
289
+				}
290
+				?>
291 291
                 <li <?php echo $field_display; ?>>
292 292
                     <label for="is_active" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active :', 'geodirectory'); ?>
293 293
                         <div class="gdcf-tooltip">
@@ -298,35 +298,35 @@  discard block
 block discarded – undo
298 298
 
299 299
                         <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
300 300
                             <?php if ($value == '1') {
301
-                                echo 'checked';
302
-                            } ?>/>
301
+								echo 'checked';
302
+							} ?>/>
303 303
                         <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
304 304
 
305 305
                         <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
306 306
                             <?php if ($value == '0' || !$value) {
307
-                                echo 'checked';
308
-                            } ?>/>
307
+								echo 'checked';
308
+							} ?>/>
309 309
                         <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
310 310
 
311 311
                     </div>
312 312
                 </li>
313 313
                 <?php
314
-            }
314
+			}
315 315
 
316 316
 
317
-            // for_admin_use
318
-            if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
317
+			// for_admin_use
318
+			if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
319 319
 
320
-                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
320
+				echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
321 321
 
322
-            }else{
323
-                $value = '';
324
-                if (isset($field_info->for_admin_use)) {
325
-                    $value = esc_attr($field_info->for_admin_use);
326
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
327
-                    $value = $cf['defaults']['for_admin_use'];
328
-                }
329
-                ?>
322
+			}else{
323
+				$value = '';
324
+				if (isset($field_info->for_admin_use)) {
325
+					$value = esc_attr($field_info->for_admin_use);
326
+				}elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
327
+					$value = $cf['defaults']['for_admin_use'];
328
+				}
329
+				?>
330 330
                 <li>
331 331
                     <label for="for_admin_use" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('For admin use only? :', 'geodirectory'); ?>
332 332
                         <div class="gdcf-tooltip">
@@ -337,47 +337,47 @@  discard block
 block discarded – undo
337 337
 
338 338
                         <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled"  value="1"
339 339
                             <?php if ($value == '1') {
340
-                                echo 'checked';
341
-                            } ?>/>
340
+								echo 'checked';
341
+							} ?>/>
342 342
                         <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
343 343
 
344 344
                         <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0"
345 345
                             <?php if ($value == '0' || !$value) {
346
-                                echo 'checked';
347
-                            } ?>/>
346
+								echo 'checked';
347
+							} ?>/>
348 348
                         <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
349 349
 
350 350
                     </div>
351 351
                 </li>
352 352
                 <?php
353
-            }
353
+			}
354 354
 
355 355
 
356
-            // default_value
357
-            if(has_filter("geodir_cfa_default_value_{$field_type}")){
356
+			// default_value
357
+			if(has_filter("geodir_cfa_default_value_{$field_type}")){
358 358
 
359
-                echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
359
+				echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
360 360
 
361
-            }else{
362
-                $value = '';
363
-                if (isset($field_info->default_value)) {
364
-                    $value = esc_attr($field_info->default_value);
365
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
366
-                    $value = $cf['defaults']['default_value'];
367
-                }
368
-                ?>
361
+			}else{
362
+				$value = '';
363
+				if (isset($field_info->default_value)) {
364
+					$value = esc_attr($field_info->default_value);
365
+				}elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
366
+					$value = $cf['defaults']['default_value'];
367
+				}
368
+				?>
369 369
                 <li>
370 370
                     <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
371 371
                         <div class="gdcf-tooltip">
372 372
                             <?php
373
-                            if ($field_type == 'checkbox') {
374
-                                _e('Should the checkbox be checked by default?', 'geodirectory');
375
-                            } else if ($field_type == 'email') {
376
-                                _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
377
-                            } else {
378
-                                _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
379
-                            }
380
-                            ?>
373
+							if ($field_type == 'checkbox') {
374
+								_e('Should the checkbox be checked by default?', 'geodirectory');
375
+							} else if ($field_type == 'email') {
376
+								_e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
377
+							} else {
378
+								_e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
379
+							}
380
+							?>
381 381
                         </div>
382 382
                     </label>
383 383
                     <div class="gd-cf-input-wrap">
@@ -394,22 +394,22 @@  discard block
 block discarded – undo
394 394
                     </div>
395 395
                 </li>
396 396
                 <?php
397
-            }
397
+			}
398 398
 
399 399
 
400
-            // show_in
401
-            if(has_filter("geodir_cfa_show_in_{$field_type}")){
400
+			// show_in
401
+			if(has_filter("geodir_cfa_show_in_{$field_type}")){
402 402
 
403
-                echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
403
+				echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
404 404
 
405
-            }else{
406
-                $value = '';
407
-                if (isset($field_info->show_in)) {
408
-                    $value = esc_attr($field_info->show_in);
409
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
410
-                    $value = esc_attr($cf['defaults']['show_in']);
411
-                }
412
-                ?>
405
+			}else{
406
+				$value = '';
407
+				if (isset($field_info->show_in)) {
408
+					$value = esc_attr($field_info->show_in);
409
+				}elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
410
+					$value = esc_attr($cf['defaults']['show_in']);
411
+				}
412
+				?>
413 413
                 <li>
414 414
                     <label for="show_in" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show in what locations?:', 'geodirectory'); ?>
415 415
                         <div class="gdcf-tooltip">
@@ -420,41 +420,41 @@  discard block
 block discarded – undo
420 420
 
421 421
                         <?php
422 422
 
423
-                        /*
423
+						/*
424 424
 						 * We wrap the key values in [] so we can search the DB easier with a LIKE query.
425 425
 						 */
426
-                        $show_in_locations = array(
427
-                            "[detail]" => __("Details page sidebar", 'geodirectory'),
428
-                            "[moreinfo]" => __("More info tab", 'geodirectory'),
429
-                            "[listing]" => __("Listings page", 'geodirectory'),
430
-                            "[owntab]" => __("Details page own tab", 'geodirectory'),
431
-                            "[mapbubble]" => __("Map bubble", 'geodirectory'),
432
-                        );
433
-
434
-                        /**
435
-                         * Filter the locations array for where to display custom fields.
436
-                         *
437
-                         * @since 1.6.6
438
-                         * @param array $show_in_locations The array of locations and descriptions.
439
-                         * @param object $field_info The field being displayed info.
440
-                         * @param string $field_info The type of field.
441
-                         */
442
-                        $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
443
-
444
-
445
-                        // remove some locations for some field types
446
-
447
-                        // don't show new tab option for some types
448
-                        if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
449
-                        }else{
450
-                            unset($show_in_locations['[owntab]']);
451
-                        }
452
-
453
-                        if(!$display_on_listing){
454
-                            unset($show_in_locations['[listings]']);
455
-                        }
456
-
457
-                        ?>
426
+						$show_in_locations = array(
427
+							"[detail]" => __("Details page sidebar", 'geodirectory'),
428
+							"[moreinfo]" => __("More info tab", 'geodirectory'),
429
+							"[listing]" => __("Listings page", 'geodirectory'),
430
+							"[owntab]" => __("Details page own tab", 'geodirectory'),
431
+							"[mapbubble]" => __("Map bubble", 'geodirectory'),
432
+						);
433
+
434
+						/**
435
+						 * Filter the locations array for where to display custom fields.
436
+						 *
437
+						 * @since 1.6.6
438
+						 * @param array $show_in_locations The array of locations and descriptions.
439
+						 * @param object $field_info The field being displayed info.
440
+						 * @param string $field_info The type of field.
441
+						 */
442
+						$show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
443
+
444
+
445
+						// remove some locations for some field types
446
+
447
+						// don't show new tab option for some types
448
+						if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
449
+						}else{
450
+							unset($show_in_locations['[owntab]']);
451
+						}
452
+
453
+						if(!$display_on_listing){
454
+							unset($show_in_locations['[listings]']);
455
+						}
456
+
457
+						?>
458 458
 
459 459
                         <select multiple="multiple" name="show_in[]"
460 460
                                 id="show_in"
@@ -464,38 +464,38 @@  discard block
 block discarded – undo
464 464
                                 option-ajaxchosen="false">
465 465
                             <?php
466 466
 
467
-                            $show_in_values = explode(',',$value);
467
+							$show_in_values = explode(',',$value);
468 468
 
469
-                            foreach( $show_in_locations as $key => $val){
470
-                                $selected = '';
469
+							foreach( $show_in_locations as $key => $val){
470
+								$selected = '';
471 471
 
472
-                                if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
473
-                                    $selected = 'selected';
474
-                                }
472
+								if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
473
+									$selected = 'selected';
474
+								}
475 475
 
476
-                                ?>
476
+								?>
477 477
                                 <option  value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option>
478 478
                                 <?php
479
-                            }
480
-                            ?>
479
+							}
480
+							?>
481 481
                         </select>
482 482
                     </div>
483 483
                 </li>
484 484
                 <?php
485
-            }
485
+			}
486 486
 
487 487
 
488
-            // advanced_editor
489
-            if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
488
+			// advanced_editor
489
+			if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
490 490
 
491
-                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
491
+				echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
492 492
 
493
-            }
493
+			}
494 494
 
495 495
 
496 496
 
497 497
 
498
-            ?>
498
+			?>
499 499
 
500 500
 
501 501
             <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?>
@@ -508,38 +508,38 @@  discard block
 block discarded – undo
508 508
 
509 509
             <?php
510 510
 
511
-            $pricearr = array();
512
-            if (isset($field_info->packages) && $field_info->packages != '') {
513
-                $pricearr = explode(',', trim($field_info->packages, ','));
514
-            } else {
515
-                $package_info = array();
511
+			$pricearr = array();
512
+			if (isset($field_info->packages) && $field_info->packages != '') {
513
+				$pricearr = explode(',', trim($field_info->packages, ','));
514
+			} else {
515
+				$package_info = array();
516 516
 
517
-                $package_info = geodir_post_package_info($package_info, '', $post_type);
518
-                $pricearr[] = $package_info->pid;
519
-            }
517
+				$package_info = geodir_post_package_info($package_info, '', $post_type);
518
+				$pricearr[] = $package_info->pid;
519
+			}
520 520
 
521
-            ob_start()
522
-            ?>
521
+			ob_start()
522
+			?>
523 523
 
524 524
             <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple">
525 525
                 <?php
526
-                if (!empty($pricearr)) {
527
-                    foreach ($pricearr as $val) {
528
-                        ?>
526
+				if (!empty($pricearr)) {
527
+					foreach ($pricearr as $val) {
528
+						?>
529 529
                         <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php
530
-                    }
531
-                }
532
-                ?>
530
+					}
531
+				}
532
+				?>
533 533
             </select>
534 534
 
535 535
             <?php
536
-            $html = ob_get_clean();
536
+			$html = ob_get_clean();
537 537
 
538 538
 			/**
539 539
 			 * Filter the price packages list.
540 540
 			 *
541 541
 			 * Filter the price packages list in custom field form in admin
542
-             * custom fields settings.
542
+			 * custom fields settings.
543 543
 			 *
544 544
 			 * @since 1.0.0
545 545
 			 *
@@ -548,25 +548,25 @@  discard block
 block discarded – undo
548 548
 			 */
549 549
 			echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info);
550 550
 
551
-            ?>
551
+			?>
552 552
 
553 553
 
554 554
 
555 555
             <?php
556 556
 
557
-            // is_required
558
-            if(has_filter("geodir_cfa_is_required_{$field_type}")){
557
+			// is_required
558
+			if(has_filter("geodir_cfa_is_required_{$field_type}")){
559 559
 
560
-                echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
560
+				echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
561 561
 
562
-            }else{
563
-                $value = '';
564
-                if (isset($field_info->is_required)) {
565
-                    $value = esc_attr($field_info->is_required);
566
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
567
-                    $value = $cf['defaults']['is_required'];
568
-                }
569
-                ?>
562
+			}else{
563
+				$value = '';
564
+				if (isset($field_info->is_required)) {
565
+					$value = esc_attr($field_info->is_required);
566
+				}elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
567
+					$value = $cf['defaults']['is_required'];
568
+				}
569
+				?>
570 570
                 <li>
571 571
                     <label for="is_required" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is required :', 'geodirectory'); ?>
572 572
                         <div class="gdcf-tooltip">
@@ -578,14 +578,14 @@  discard block
 block discarded – undo
578 578
 
579 579
                         <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled"  value="1"
580 580
                             <?php if ($value == '1') {
581
-                                echo 'checked';
582
-                            } ?>/>
581
+								echo 'checked';
582
+							} ?>/>
583 583
                         <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>
584 584
 
585 585
                         <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0"
586 586
                             <?php if ($value == '0' || !$value) {
587
-                                echo 'checked';
588
-                            } ?>/>
587
+								echo 'checked';
588
+							} ?>/>
589 589
                         <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>
590 590
 
591 591
                     </div>
@@ -593,21 +593,21 @@  discard block
 block discarded – undo
593 593
                 </li>
594 594
 
595 595
                 <?php
596
-            }
596
+			}
597 597
 
598
-            // required_msg
599
-            if(has_filter("geodir_cfa_required_msg_{$field_type}")){
598
+			// required_msg
599
+			if(has_filter("geodir_cfa_required_msg_{$field_type}")){
600 600
 
601
-                echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
601
+				echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
602 602
 
603
-            }else{
604
-                $value = '';
605
-                if (isset($field_info->required_msg)) {
606
-                    $value = esc_attr($field_info->required_msg);
607
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
608
-                    $value = $cf['defaults']['required_msg'];
609
-                }
610
-                ?>
603
+			}else{
604
+				$value = '';
605
+				if (isset($field_info->required_msg)) {
606
+					$value = esc_attr($field_info->required_msg);
607
+				}elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
608
+					$value = $cf['defaults']['required_msg'];
609
+				}
610
+				?>
611 611
                 <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;'";}?>>
612 612
                     <label for="required_msg" class="gd-cf-tooltip-wrap">
613 613
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
@@ -621,38 +621,38 @@  discard block
 block discarded – undo
621 621
                     </div>
622 622
                 </li>
623 623
                 <?php
624
-            }
624
+			}
625 625
 
626 626
 
627
-            // required_msg
628
-            if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
627
+			// required_msg
628
+			if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
629 629
 
630
-                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
630
+				echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
631 631
 
632
-            }
632
+			}
633 633
 
634 634
 
635
-            // extra_fields
636
-            if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
635
+			// extra_fields
636
+			if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
637 637
 
638
-                echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
638
+				echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
639 639
 
640
-            }
640
+			}
641 641
 
642 642
 
643
-            // field_icon
644
-            if(has_filter("geodir_cfa_field_icon_{$field_type}")){
643
+			// field_icon
644
+			if(has_filter("geodir_cfa_field_icon_{$field_type}")){
645 645
 
646
-                echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
646
+				echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
647 647
 
648
-            }else{
649
-                $value = '';
650
-                if (isset($field_info->field_icon)) {
651
-                    $value = esc_attr($field_info->field_icon);
652
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
653
-                    $value = $cf['defaults']['field_icon'];
654
-                }
655
-                ?>
648
+			}else{
649
+				$value = '';
650
+				if (isset($field_info->field_icon)) {
651
+					$value = esc_attr($field_info->field_icon);
652
+				}elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
653
+					$value = $cf['defaults']['field_icon'];
654
+				}
655
+				?>
656 656
                 <li>
657 657
                     <h3><?php echo __('Custom css', 'geodirectory'); ?></h3>
658 658
 
@@ -670,22 +670,22 @@  discard block
 block discarded – undo
670 670
 
671 671
                 </li>
672 672
                 <?php
673
-            }
673
+			}
674 674
 
675 675
 
676
-            // css_class
677
-            if(has_filter("geodir_cfa_css_class_{$field_type}")){
676
+			// css_class
677
+			if(has_filter("geodir_cfa_css_class_{$field_type}")){
678 678
 
679
-                echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
679
+				echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
680 680
 
681
-            }else{
682
-                $value = '';
683
-                if (isset($field_info->css_class)) {
684
-                    $value = esc_attr($field_info->css_class);
685
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
686
-                    $value = $cf['defaults']['css_class'];
687
-                }
688
-                ?>
681
+			}else{
682
+				$value = '';
683
+				if (isset($field_info->css_class)) {
684
+					$value = esc_attr($field_info->css_class);
685
+				}elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
686
+					$value = $cf['defaults']['css_class'];
687
+				}
688
+				?>
689 689
                 <li>
690 690
 
691 691
                     <label for="css_class" class="gd-cf-tooltip-wrap">
@@ -698,47 +698,47 @@  discard block
 block discarded – undo
698 698
                     <div class="gd-cf-input-wrap">
699 699
                         <input type="text" name="css_class" id="css_class"
700 700
                                value="<?php if (isset($field_info->css_class)) {
701
-                                   echo esc_attr($field_info->css_class);
702
-                               }?>"/>
701
+								   echo esc_attr($field_info->css_class);
702
+							   }?>"/>
703 703
                     </div>
704 704
                 </li>
705 705
                 <?php
706
-            }
706
+			}
707 707
 
708 708
 
709
-            // cat_sort
710
-            if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
709
+			// cat_sort
710
+			if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
711 711
 
712
-                echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
712
+				echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
713 713
 
714
-            }else{
715
-                $value = '';
716
-                $hide_cat_sort  ='';
717
-                if (isset($field_info->cat_sort)) {
718
-                    $value = esc_attr($field_info->cat_sort);
719
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
720
-                    $value = $cf['defaults']['cat_sort'];
721
-                    $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
722
-                }
714
+			}else{
715
+				$value = '';
716
+				$hide_cat_sort  ='';
717
+				if (isset($field_info->cat_sort)) {
718
+					$value = esc_attr($field_info->cat_sort);
719
+				}elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
720
+					$value = $cf['defaults']['cat_sort'];
721
+					$hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
722
+				}
723 723
 
724
-                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
725
-                ?>
724
+				$hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
725
+				?>
726 726
                 <li <?php echo $hide_cat_sort ;?>>
727 727
                     <h3><?php
728
-                        /**
729
-                         * Filter the section title.
730
-                         *
731
-                         * Filter the section title in custom field form in admin
732
-                         * custom fields settings.
733
-                         *
734
-                         * @since 1.0.0
735
-                         *
736
-                         * @param string $title Title of the section.
737
-                         * @param string $field_type Current field type.
738
-                         */
739
-                        echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
740
-
741
-                        ?></h3>
728
+						/**
729
+						 * Filter the section title.
730
+						 *
731
+						 * Filter the section title in custom field form in admin
732
+						 * custom fields settings.
733
+						 *
734
+						 * @since 1.0.0
735
+						 *
736
+						 * @param string $title Title of the section.
737
+						 * @param string $field_type Current field type.
738
+						 */
739
+						echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
740
+
741
+						?></h3>
742 742
                     <label for="cat_sort" class="gd-cf-tooltip-wrap">
743 743
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
744 744
                         <div class="gdcf-tooltip">
@@ -750,42 +750,42 @@  discard block
 block discarded – undo
750 750
 
751 751
                         <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled"  value="1"
752 752
                             <?php if ($value == '1') {
753
-                                echo 'checked';
754
-                            } ?>/>
753
+								echo 'checked';
754
+							} ?>/>
755 755
                         <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
756 756
 
757 757
                         <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0"
758 758
                             <?php if (!$value) {
759
-                                echo 'checked';
760
-                            } ?>/>
759
+								echo 'checked';
760
+							} ?>/>
761 761
                         <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
762 762
 
763 763
                     </div>
764 764
                 </li>
765 765
                 <?php
766
-            }
767
-
768
-
769
-
770
-            switch ($field_type):
771
-                case 'html':
772
-                case 'file':
773
-                case 'url':
774
-                case 'fieldset':
775
-                    break;
776
-                default:
777
-
778
-                    /**
779
-                     * Called at the end of the advanced custom fields settings page loop.
780
-                     *
781
-                     * Can be used to add or deal with different settings types.
782
-                     *
783
-                     * @since 1.0.0
784
-                     * @since 1.6.6 $cf param added.
785
-                     * @param object $field_info The current fields info.
786
-                     * @param array $cf The custom field settings
787
-                     */
788
-                    do_action('geodir_advance_custom_fields', $field_info,$cf);?>
766
+			}
767
+
768
+
769
+
770
+			switch ($field_type):
771
+				case 'html':
772
+				case 'file':
773
+				case 'url':
774
+				case 'fieldset':
775
+					break;
776
+				default:
777
+
778
+					/**
779
+					 * Called at the end of the advanced custom fields settings page loop.
780
+					 *
781
+					 * Can be used to add or deal with different settings types.
782
+					 *
783
+					 * @since 1.0.0
784
+					 * @since 1.6.6 $cf param added.
785
+					 * @param object $field_info The current fields info.
786
+					 * @param array $cf The custom field settings
787
+					 */
788
+					do_action('geodir_advance_custom_fields', $field_info,$cf);?>
789 789
 
790 790
 
791 791
                 <?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 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 style="background-image: url("'.$cf['icon'].'")"></b>';
74
-}else{
74
+} else {
75 75
     $field_icon = '<i class="fa 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
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
89 89
         <?php
90 90
 
91
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
91
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
92 92
         ?>
93 93
 
94 94
         <?php if ($default): ?>
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
             <i class="fa fa-long-arrow-left " aria-hidden="true"></i>
104 104
             <i class="fa fa-long-arrow-right " aria-hidden="true"></i>
105 105
             <b style="cursor:pointer;"
106
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
106
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b>
107 107
         <?php
108 108
         } else {echo $field_icon;
109 109
             ?>
110 110
             <b style="cursor:pointer;"
111
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b>
111
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type_name.')'); ?></b>
112 112
         <?php
113 113
         }
114 114
         ?>
@@ -131,43 +131,43 @@  discard block
 block discarded – undo
131 131
         } ?>"/>
132 132
         <input type="hidden" name="is_active" id="is_active" value="1"/>
133 133
 
134
-        <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?>
135
-        <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" />
136
-        <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" />
137
-        <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : '';?>" />
134
+        <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : ''; ?>" /><?php // show in sidebar value?>
135
+        <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" />
136
+        <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" />
137
+        <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : ''; ?>" />
138 138
 
139 139
         <ul class="widefat post fixed" border="0" style="width:100%;">
140 140
 
141 141
             <?php
142 142
 
143 143
             // data_type
144
-            if(has_filter("geodir_cfa_data_type_{$field_type}")){
144
+            if (has_filter("geodir_cfa_data_type_{$field_type}")) {
145 145
 
146
-                echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
146
+                echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info);
147 147
 
148
-            }else{
148
+            } else {
149 149
                 $value = '';
150 150
                 if (isset($field_info->data_type)) {
151 151
                     $value = esc_attr($field_info->data_type);
152
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
152
+                }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
153 153
                     $value = $cf['defaults']['data_type'];
154 154
                 }
155 155
                 ?>
156
-                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/>
156
+                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/>
157 157
             <?php
158 158
             }
159 159
 
160 160
 
161 161
             // admin_title
162
-            if(has_filter("geodir_cfa_admin_title_{$field_type}")){
162
+            if (has_filter("geodir_cfa_admin_title_{$field_type}")) {
163 163
 
164
-                echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
164
+                echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info);
165 165
 
166
-            }else{
166
+            } else {
167 167
                 $value = '';
168 168
                 if (isset($field_info->admin_title)) {
169 169
                     $value = esc_attr($field_info->admin_title);
170
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
170
+                }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) {
171 171
                     $value = $cf['defaults']['admin_title'];
172 172
                 }
173 173
                 ?>
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                     </label>
181 181
                     <div class="gd-cf-input-wrap">
182 182
                         <input type="text" name="admin_title" id="admin_title"
183
-                               value="<?php echo $value;?>"/>
183
+                               value="<?php echo $value; ?>"/>
184 184
                     </div>
185 185
                 </li>
186 186
                 <?php
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
 
189 189
 
190 190
             // site_title
191
-            if(has_filter("geodir_cfa_site_title_{$field_type}")){
191
+            if (has_filter("geodir_cfa_site_title_{$field_type}")) {
192 192
 
193
-                echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
193
+                echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info);
194 194
 
195
-            }else{
195
+            } else {
196 196
                 $value = '';
197 197
                 if (isset($field_info->site_title)) {
198 198
                     $value = esc_attr($field_info->site_title);
199
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
199
+                }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) {
200 200
                     $value = $cf['defaults']['site_title'];
201 201
                 }
202 202
                 ?>
@@ -216,15 +216,15 @@  discard block
 block discarded – undo
216 216
 
217 217
 
218 218
             // admin_desc
219
-            if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
219
+            if (has_filter("geodir_cfa_admin_desc_{$field_type}")) {
220 220
 
221
-                echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
221
+                echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info);
222 222
 
223
-            }else{
223
+            } else {
224 224
                 $value = '';
225 225
                 if (isset($field_info->admin_desc)) {
226 226
                     $value = esc_attr($field_info->admin_desc);
227
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
227
+                }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) {
228 228
                     $value = $cf['defaults']['admin_desc'];
229 229
                 }
230 230
                 ?>
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                         </div>
236 236
                     </label>
237 237
                     <div class="gd-cf-input-wrap">
238
-                        <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/>
238
+                        <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/>
239 239
                     </div>
240 240
                 </li>
241 241
                 <?php
@@ -244,26 +244,26 @@  discard block
 block discarded – undo
244 244
 
245 245
 
246 246
             // htmlvar_name
247
-            if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
247
+            if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) {
248 248
 
249
-                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
249
+                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info);
250 250
 
251
-            }else{
251
+            } else {
252 252
                 $value = '';
253 253
                 if (isset($field_info->htmlvar_name)) {
254 254
                     $value = esc_attr($field_info->htmlvar_name);
255
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
255
+                }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) {
256 256
                     $value = $cf['defaults']['htmlvar_name'];
257 257
                 }
258 258
                 ?>
259 259
                 <li>
260
-                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
260
+                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory'); ?>
261 261
                         <div class="gdcf-tooltip">
262 262
                             <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?>
263 263
                         </div>
264 264
                     </label>
265 265
                     <div class="gd-cf-input-wrap">
266
-                        <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');?>"
266
+                        <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'); ?>"
267 267
                                value="<?php if ($value) {
268 268
                                    echo preg_replace('/geodir_/', '', $value, 1);
269 269
                                }?>" <?php if ($default) {
@@ -276,15 +276,15 @@  discard block
 block discarded – undo
276 276
 
277 277
 
278 278
             // is_active
279
-            if(has_filter("geodir_cfa_is_active_{$field_type}")){
279
+            if (has_filter("geodir_cfa_is_active_{$field_type}")) {
280 280
 
281
-                echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
281
+                echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info);
282 282
 
283
-            }else{
283
+            } else {
284 284
                 $value = '';
285 285
                 if (isset($field_info->is_active)) {
286 286
                     $value = esc_attr($field_info->is_active);
287
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
287
+                }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) {
288 288
                     $value = $cf['defaults']['is_active'];
289 289
                 }
290 290
                 ?>
@@ -296,17 +296,17 @@  discard block
 block discarded – undo
296 296
                     </label>
297 297
                     <div class="gd-cf-input-wrap gd-switch">
298 298
 
299
-                        <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
299
+                        <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
300 300
                             <?php if ($value == '1') {
301 301
                                 echo 'checked';
302 302
                             } ?>/>
303
-                        <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
303
+                        <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
304 304
 
305
-                        <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
305
+                        <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
306 306
                             <?php if ($value == '0' || !$value) {
307 307
                                 echo 'checked';
308 308
                             } ?>/>
309
-                        <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
309
+                        <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
310 310
 
311 311
                     </div>
312 312
                 </li>
@@ -315,15 +315,15 @@  discard block
 block discarded – undo
315 315
 
316 316
 
317 317
             // for_admin_use
318
-            if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
318
+            if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) {
319 319
 
320
-                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
320
+                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info);
321 321
 
322
-            }else{
322
+            } else {
323 323
                 $value = '';
324 324
                 if (isset($field_info->for_admin_use)) {
325 325
                     $value = esc_attr($field_info->for_admin_use);
326
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
326
+                }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) {
327 327
                     $value = $cf['defaults']['for_admin_use'];
328 328
                 }
329 329
                 ?>
@@ -335,17 +335,17 @@  discard block
 block discarded – undo
335 335
                     </label>
336 336
                     <div class="gd-cf-input-wrap gd-switch">
337 337
 
338
-                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled"  value="1"
338
+                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled"  value="1"
339 339
                             <?php if ($value == '1') {
340 340
                                 echo 'checked';
341 341
                             } ?>/>
342
-                        <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
342
+                        <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
343 343
 
344
-                        <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0"
344
+                        <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0"
345 345
                             <?php if ($value == '0' || !$value) {
346 346
                                 echo 'checked';
347 347
                             } ?>/>
348
-                        <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
348
+                        <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
349 349
 
350 350
                     </div>
351 351
                 </li>
@@ -354,20 +354,20 @@  discard block
 block discarded – undo
354 354
 
355 355
 
356 356
             // default_value
357
-            if(has_filter("geodir_cfa_default_value_{$field_type}")){
357
+            if (has_filter("geodir_cfa_default_value_{$field_type}")) {
358 358
 
359
-                echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
359
+                echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info);
360 360
 
361
-            }else{
361
+            } else {
362 362
                 $value = '';
363 363
                 if (isset($field_info->default_value)) {
364 364
                     $value = esc_attr($field_info->default_value);
365
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
365
+                }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) {
366 366
                     $value = $cf['defaults']['default_value'];
367 367
                 }
368 368
                 ?>
369 369
                 <li>
370
-                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
370
+                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?>
371 371
                         <div class="gdcf-tooltip">
372 372
                             <?php
373 373
                             if ($field_type == 'checkbox') {
@@ -384,12 +384,12 @@  discard block
 block discarded – undo
384 384
                         <?php if ($field_type == 'checkbox') { ?>
385 385
                             <select name="default_value" id="default_value">
386 386
                                 <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option>
387
-                                <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option>
387
+                                <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option>
388 388
                             </select>
389 389
                         <?php } else if ($field_type == 'email') { ?>
390
-                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
390
+                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
391 391
                         <?php } else { ?>
392
-                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
392
+                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
393 393
                         <?php } ?>
394 394
                     </div>
395 395
                 </li>
@@ -398,15 +398,15 @@  discard block
 block discarded – undo
398 398
 
399 399
 
400 400
             // show_in
401
-            if(has_filter("geodir_cfa_show_in_{$field_type}")){
401
+            if (has_filter("geodir_cfa_show_in_{$field_type}")) {
402 402
 
403
-                echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
403
+                echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info);
404 404
 
405
-            }else{
405
+            } else {
406 406
                 $value = '';
407 407
                 if (isset($field_info->show_in)) {
408 408
                     $value = esc_attr($field_info->show_in);
409
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
409
+                }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) {
410 410
                     $value = esc_attr($cf['defaults']['show_in']);
411 411
                 }
412 412
                 ?>
@@ -439,18 +439,18 @@  discard block
 block discarded – undo
439 439
                          * @param object $field_info The field being displayed info.
440 440
                          * @param string $field_info The type of field.
441 441
                          */
442
-                        $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
442
+                        $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type);
443 443
 
444 444
 
445 445
                         // remove some locations for some field types
446 446
 
447 447
                         // don't show new tab option for some types
448
-                        if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
449
-                        }else{
448
+                        if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
449
+                        } else {
450 450
                             unset($show_in_locations['[owntab]']);
451 451
                         }
452 452
 
453
-                        if(!$display_on_listing){
453
+                        if (!$display_on_listing) {
454 454
                             unset($show_in_locations['[listings]']);
455 455
                         }
456 456
 
@@ -464,17 +464,17 @@  discard block
 block discarded – undo
464 464
                                 option-ajaxchosen="false">
465 465
                             <?php
466 466
 
467
-                            $show_in_values = explode(',',$value);
467
+                            $show_in_values = explode(',', $value);
468 468
 
469
-                            foreach( $show_in_locations as $key => $val){
469
+                            foreach ($show_in_locations as $key => $val) {
470 470
                                 $selected = '';
471 471
 
472
-                                if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
472
+                                if (is_array($show_in_values) && in_array($key, $show_in_values)) {
473 473
                                     $selected = 'selected';
474 474
                                 }
475 475
 
476 476
                                 ?>
477
-                                <option  value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option>
477
+                                <option  value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option>
478 478
                                 <?php
479 479
                             }
480 480
                             ?>
@@ -486,9 +486,9 @@  discard block
 block discarded – undo
486 486
 
487 487
 
488 488
             // advanced_editor
489
-            if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
489
+            if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) {
490 490
 
491
-                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
491
+                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info);
492 492
 
493 493
             }
494 494
 
@@ -499,10 +499,10 @@  discard block
 block discarded – undo
499 499
 
500 500
 
501 501
             <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?>
502
-            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/>
502
+            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/>
503 503
 
504 504
             <?php // we dont need to show the sort order ?>
505
-            <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);} ?>"/>
505
+            <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); } ?>"/>
506 506
 
507 507
 
508 508
 
@@ -555,15 +555,15 @@  discard block
 block discarded – undo
555 555
             <?php
556 556
 
557 557
             // is_required
558
-            if(has_filter("geodir_cfa_is_required_{$field_type}")){
558
+            if (has_filter("geodir_cfa_is_required_{$field_type}")) {
559 559
 
560
-                echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
560
+                echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info);
561 561
 
562
-            }else{
562
+            } else {
563 563
                 $value = '';
564 564
                 if (isset($field_info->is_required)) {
565 565
                     $value = esc_attr($field_info->is_required);
566
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
566
+                }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) {
567 567
                     $value = $cf['defaults']['is_required'];
568 568
                 }
569 569
                 ?>
@@ -576,17 +576,17 @@  discard block
 block discarded – undo
576 576
 
577 577
                     <div class="gd-cf-input-wrap gd-switch">
578 578
 
579
-                        <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled"  value="1"
579
+                        <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled"  value="1"
580 580
                             <?php if ($value == '1') {
581 581
                                 echo 'checked';
582 582
                             } ?>/>
583
-                        <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>
583
+                        <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>
584 584
 
585
-                        <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0"
585
+                        <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0"
586 586
                             <?php if ($value == '0' || !$value) {
587 587
                                 echo 'checked';
588 588
                             } ?>/>
589
-                        <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>
589
+                        <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>
590 590
 
591 591
                     </div>
592 592
 
@@ -596,19 +596,19 @@  discard block
 block discarded – undo
596 596
             }
597 597
 
598 598
             // required_msg
599
-            if(has_filter("geodir_cfa_required_msg_{$field_type}")){
599
+            if (has_filter("geodir_cfa_required_msg_{$field_type}")) {
600 600
 
601
-                echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
601
+                echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info);
602 602
 
603
-            }else{
603
+            } else {
604 604
                 $value = '';
605 605
                 if (isset($field_info->required_msg)) {
606 606
                     $value = esc_attr($field_info->required_msg);
607
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
607
+                }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) {
608 608
                     $value = $cf['defaults']['required_msg'];
609 609
                 }
610 610
                 ?>
611
-                <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;'";}?>>
611
+                <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;'"; }?>>
612 612
                     <label for="required_msg" class="gd-cf-tooltip-wrap">
613 613
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
614 614
                         <div class="gdcf-tooltip">
@@ -625,31 +625,31 @@  discard block
 block discarded – undo
625 625
 
626 626
 
627 627
             // required_msg
628
-            if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
628
+            if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) {
629 629
 
630
-                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
630
+                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info);
631 631
 
632 632
             }
633 633
 
634 634
 
635 635
             // extra_fields
636
-            if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
636
+            if (has_filter("geodir_cfa_extra_fields_{$field_type}")) {
637 637
 
638
-                echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
638
+                echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info);
639 639
 
640 640
             }
641 641
 
642 642
 
643 643
             // field_icon
644
-            if(has_filter("geodir_cfa_field_icon_{$field_type}")){
644
+            if (has_filter("geodir_cfa_field_icon_{$field_type}")) {
645 645
 
646
-                echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
646
+                echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info);
647 647
 
648
-            }else{
648
+            } else {
649 649
                 $value = '';
650 650
                 if (isset($field_info->field_icon)) {
651 651
                     $value = esc_attr($field_info->field_icon);
652
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
652
+                }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) {
653 653
                     $value = $cf['defaults']['field_icon'];
654 654
                 }
655 655
                 ?>
@@ -660,12 +660,12 @@  discard block
 block discarded – undo
660 660
                     <label for="field_icon" class="gd-cf-tooltip-wrap">
661 661
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?>
662 662
                         <div class="gdcf-tooltip">
663
-                            <?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:"fa fa-home"', 'geodirectory');?>
663
+                            <?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:"fa fa-home"', 'geodirectory'); ?>
664 664
                         </div>
665 665
                     </label>
666 666
                     <div class="gd-cf-input-wrap">
667 667
                         <input type="text" name="field_icon" id="field_icon"
668
-                               value="<?php echo $value;?>"/>
668
+                               value="<?php echo $value; ?>"/>
669 669
                     </div>
670 670
 
671 671
                 </li>
@@ -674,15 +674,15 @@  discard block
 block discarded – undo
674 674
 
675 675
 
676 676
             // css_class
677
-            if(has_filter("geodir_cfa_css_class_{$field_type}")){
677
+            if (has_filter("geodir_cfa_css_class_{$field_type}")) {
678 678
 
679
-                echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
679
+                echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info);
680 680
 
681
-            }else{
681
+            } else {
682 682
                 $value = '';
683 683
                 if (isset($field_info->css_class)) {
684 684
                     $value = esc_attr($field_info->css_class);
685
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
685
+                }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) {
686 686
                     $value = $cf['defaults']['css_class'];
687 687
                 }
688 688
                 ?>
@@ -691,8 +691,8 @@  discard block
 block discarded – undo
691 691
                     <label for="css_class" class="gd-cf-tooltip-wrap">
692 692
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?>
693 693
                         <div class="gdcf-tooltip">
694
-                            <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
695
-                            <?php if($field_type=='multiselect'){_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory');}?>
694
+                            <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?>
695
+                            <?php if ($field_type == 'multiselect') {_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory'); }?>
696 696
                         </div>
697 697
                     </label>
698 698
                     <div class="gd-cf-input-wrap">
@@ -707,23 +707,23 @@  discard block
 block discarded – undo
707 707
 
708 708
 
709 709
             // cat_sort
710
-            if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
710
+            if (has_filter("geodir_cfa_cat_sort_{$field_type}")) {
711 711
 
712
-                echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
712
+                echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info);
713 713
 
714
-            }else{
714
+            } else {
715 715
                 $value = '';
716
-                $hide_cat_sort  ='';
716
+                $hide_cat_sort = '';
717 717
                 if (isset($field_info->cat_sort)) {
718 718
                     $value = esc_attr($field_info->cat_sort);
719
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
719
+                }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) {
720 720
                     $value = $cf['defaults']['cat_sort'];
721
-                    $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
721
+                    $hide_cat_sort = ($value === false) ? "style='display:none;'" : '';
722 722
                 }
723 723
 
724
-                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
724
+                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : '';
725 725
                 ?>
726
-                <li <?php echo $hide_cat_sort ;?>>
726
+                <li <?php echo $hide_cat_sort; ?>>
727 727
                     <h3><?php
728 728
                         /**
729 729
                          * Filter the section title.
@@ -742,23 +742,23 @@  discard block
 block discarded – undo
742 742
                     <label for="cat_sort" class="gd-cf-tooltip-wrap">
743 743
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
744 744
                         <div class="gdcf-tooltip">
745
-                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?>
745
+                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?>
746 746
                         </div>
747 747
                     </label>
748 748
 
749 749
                     <div class="gd-cf-input-wrap gd-switch">
750 750
 
751
-                        <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled"  value="1"
751
+                        <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled"  value="1"
752 752
                             <?php if ($value == '1') {
753 753
                                 echo 'checked';
754 754
                             } ?>/>
755
-                        <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
755
+                        <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
756 756
 
757
-                        <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0"
757
+                        <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0"
758 758
                             <?php if (!$value) {
759 759
                                 echo 'checked';
760 760
                             } ?>/>
761
-                        <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
761
+                        <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
762 762
 
763 763
                     </div>
764 764
                 </li>
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
                      * @param object $field_info The current fields info.
786 786
                      * @param array $cf The custom field settings
787 787
                      */
788
-                    do_action('geodir_advance_custom_fields', $field_info,$cf);?>
788
+                    do_action('geodir_advance_custom_fields', $field_info, $cf); ?>
789 789
 
790 790
 
791 791
                 <?php endswitch; ?>
@@ -797,10 +797,10 @@  discard block
 block discarded – undo
797 797
                     <h3></h3>
798 798
                 </label>
799 799
                 <div class="gd-cf-input-wrap">
800
-                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
800
+                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
801 801
                            onclick="save_field('<?php echo esc_attr($result_str); ?>')"/>
802 802
                     <?php if (!$default): ?>
803
-                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
803
+                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
804 804
                                                             onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')"
805 805
                                                             class="button"/></a>
806 806
                     <?php endif; ?>
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_on_add_listing_page.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
     window.gdMaps = window.gdMaps || gdMaps;
83 83
     
84 84
     user_address = false;
85
-    jQuery('#<?php echo $prefix.'address';?>').keypress(function () {
85
+    jQuery('#<?php echo $prefix.'address'; ?>').keypress(function () {
86 86
         user_address = true;
87 87
     });
88 88
 
89 89
     baseMarker = '';
90 90
     geocoder = '';
91
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat :  '39.952484'; ?>;
92
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng :  '-75.163786'; ?>;
93
-    <?php if($lat_lng_blank){$lat='';$lng='';}?>
94
-    var <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12;?>;
91
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat : '39.952484'; ?>;
92
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng : '-75.163786'; ?>;
93
+    <?php if ($lat_lng_blank) {$lat = ''; $lng = ''; }?>
94
+    var <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12; ?>;
95 95
     var minZoomLevel = <?php echo ($is_map_restrict) ? 5 : 0; ?>;
96 96
     var oldstr_address;
97 97
     var oldstr_zip;
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
             do_action('geodir_add_listing_geocode_js_vars');
341 341
             ?>
342 342
             <?php if ($is_map_restrict) { ?>
343
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
344
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
345
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
343
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
344
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
345
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
346 346
                 jQuery.goMap.map.setCenter(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
347 347
                 baseMarker.setPosition(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
348 348
                 updateMarkerPosition(baseMarker.getPosition());
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
             <?php } ?>
352 352
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
353 353
         } else {
354
-            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
354
+            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
355 355
         }
356 356
     }
357 357
     function centerMap(latlng) {
358
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
358
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
359 359
         if (window.gdMaps == 'google') {
360 360
             jQuery.goMap.map.panTo(baseMarker.getPosition());
361 361
         } else if (window.gdMaps == 'osm') {
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         }
365 365
     }
366 366
     function centerMarker() {
367
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
367
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
368 368
         var center = jQuery.goMap.map.getCenter();
369 369
         if (window.gdMaps == 'google') {
370 370
             baseMarker.setPosition(center);
@@ -373,48 +373,48 @@  discard block
 block discarded – undo
373 373
         }
374 374
     }
375 375
     function updateMapZoom(zoom) {
376
-        jQuery('#<?php echo $prefix.'mapzoom';?>').val(zoom);
376
+        jQuery('#<?php echo $prefix.'mapzoom'; ?>').val(zoom);
377 377
     }
378 378
     function updateMarkerPosition(markerlatLng) {
379
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
380
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat());
381
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng());
379
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
380
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat());
381
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng());
382 382
     }
383 383
     function updateMarkerPositionOSM(markerlatLng) {
384
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat);
385
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng);
384
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat);
385
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng);
386 386
     }
387 387
     function updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry) {
388
-        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields);?>';
389
-        <?php ob_start();?>
390
-        var old_country = jQuery("#<?php echo $prefix.'country';?>").val();
391
-        var old_region = jQuery("#<?php echo $prefix.'region';?>").val();
388
+        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields); ?>';
389
+        <?php ob_start(); ?>
390
+        var old_country = jQuery("#<?php echo $prefix.'country'; ?>").val();
391
+        var old_region = jQuery("#<?php echo $prefix.'region'; ?>").val();
392 392
         
393
-        if (user_address == false || jQuery('#<?php echo $prefix.'address';?>').val() == '') {
394
-            jQuery("#<?php echo $prefix.'address';?>").val(getAddress);
393
+        if (user_address == false || jQuery('#<?php echo $prefix.'address'; ?>').val() == '') {
394
+            jQuery("#<?php echo $prefix.'address'; ?>").val(getAddress);
395 395
         }
396 396
         if (getAddress) {
397 397
             oldstr_address = getAddress;
398 398
         }
399 399
 
400
-        jQuery("#<?php echo $prefix.'zip';?>").val(getZip);
400
+        jQuery("#<?php echo $prefix.'zip'; ?>").val(getZip);
401 401
         if (getZip) {
402 402
             oldstr_zip = getZip;
403 403
         }
404 404
         if (set_map_val_in_fields) {
405 405
             if (getCountry) {
406
-                jQuery('#<?php echo $prefix .'country'; ?> option[value=""]').attr("selected",false);
407
-                jQuery('#<?php echo $prefix.'country';?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
408
-                jQuery("#<?php echo $prefix.'country';?>").trigger("chosen:updated");
406
+                jQuery('#<?php echo $prefix.'country'; ?> option[value=""]').attr("selected",false);
407
+                jQuery('#<?php echo $prefix.'country'; ?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
408
+                jQuery("#<?php echo $prefix.'country'; ?>").trigger("chosen:updated");
409 409
             }
410 410
             if (getState) {
411
-                if (jQuery('input[id="<?php echo $prefix.'region';?>"]').attr('id')) {
412
-                    jQuery("#<?php echo $prefix.'region';?>").val(getState);
411
+                if (jQuery('input[id="<?php echo $prefix.'region'; ?>"]').attr('id')) {
412
+                    jQuery("#<?php echo $prefix.'region'; ?>").val(getState);
413 413
                 }
414 414
             }
415 415
             if (getCity) {
416
-                if (jQuery('input[id="<?php echo $prefix.'city';?>"]').attr('id')) {
417
-                    jQuery("#<?php echo $prefix.'city';?>").val(getCity);
416
+                if (jQuery('input[id="<?php echo $prefix.'city'; ?>"]').attr('id')) {
417
+                    jQuery("#<?php echo $prefix.'city'; ?>").val(getCity);
418 418
                 }
419 419
             }
420 420
         }
@@ -430,12 +430,12 @@  discard block
 block discarded – undo
430 430
         ?>
431 431
     }
432 432
     function geodir_codeAddress(set_on_map) {
433
-        var address = jQuery('#<?php echo $prefix.'address';?>').val();
434
-        var zip = jQuery('#<?php echo $prefix.'zip';?>').val();
435
-        var city = jQuery('#<?php echo $prefix.'city';?>').val();
436
-        var region = jQuery('#<?php echo $prefix.'region';?>').val();
437
-        var country = jQuery('#<?php echo $prefix.'country';?>').val();
438
-        var country_selected = jQuery('#<?php echo $prefix.'country';?>').find('option:selected');
433
+        var address = jQuery('#<?php echo $prefix.'address'; ?>').val();
434
+        var zip = jQuery('#<?php echo $prefix.'zip'; ?>').val();
435
+        var city = jQuery('#<?php echo $prefix.'city'; ?>').val();
436
+        var region = jQuery('#<?php echo $prefix.'region'; ?>').val();
437
+        var country = jQuery('#<?php echo $prefix.'country'; ?>').val();
438
+        var country_selected = jQuery('#<?php echo $prefix.'country'; ?>').find('option:selected');
439 439
         var ISO2 = country_selected.data('country_code');
440 440
         if (ISO2 == '--') {
441 441
             ISO2 = '';
@@ -444,13 +444,13 @@  discard block
 block discarded – undo
444 444
             zip = '';
445 445
         }
446 446
         if (typeof city == "undefined") {
447
-            city = '<?php echo addslashes_gpc($city);?>';
447
+            city = '<?php echo addslashes_gpc($city); ?>';
448 448
         }
449 449
         if (typeof region == "undefined") {
450
-            region = '<?php echo addslashes_gpc($region);?>';
450
+            region = '<?php echo addslashes_gpc($region); ?>';
451 451
         }
452 452
         if (typeof country == "undefined") {
453
-            country = '<?php echo addslashes_gpc($country);?>';
453
+            country = '<?php echo addslashes_gpc($country); ?>';
454 454
         }
455 455
         var is_restrict = '<?php echo $is_map_restrict; ?>';
456 456
         <?php ob_start();
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
             if (typeof address === 'undefined')
466 466
                 address = '';
467 467
             <?php
468
-            if(is_admin() && isset($_REQUEST['tab'])){?>
468
+            if (is_admin() && isset($_REQUEST['tab'])) {?>
469 469
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
470 470
                 address = '';
471 471
             }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             geocoder.geocode({'address': address, 'country': ISO2},
513 513
                 function (results, status) {
514 514
                     console.log(status);
515
-                    jQuery("#<?php echo $prefix.'map';?>").goMap();
515
+                    jQuery("#<?php echo $prefix.'map'; ?>").goMap();
516 516
                     if (status == google.maps.GeocoderStatus.OK) {
517 517
                         baseMarker.setPosition(results[0].geometry.location);
518 518
                         jQuery.goMap.map.setCenter(results[0].geometry.location);
@@ -529,21 +529,21 @@  discard block
 block discarded – undo
529 529
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
530 530
                         //}
531 531
                     } else {
532
-                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:','geodirectory'));?> ' + status);
532
+                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:', 'geodirectory')); ?> ' + status);
533 533
                     }
534 534
                 });
535 535
         }
536 536
     }
537 537
     function gdMaxMap() {
538
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
538
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
539 539
 
540
-        jQuery('#<?php echo $prefix.'map';?>').toggleClass('map-fullscreen');
540
+        jQuery('#<?php echo $prefix.'map'; ?>').toggleClass('map-fullscreen');
541 541
         jQuery('.map_category').toggleClass('map_category_fullscreen');
542
-        jQuery('#<?php echo $prefix;?>trigger').toggleClass('map_category_fullscreen');
542
+        jQuery('#<?php echo $prefix; ?>trigger').toggleClass('map_category_fullscreen');
543 543
         jQuery('body').toggleClass('body_fullscreen');
544
-        jQuery('#<?php echo $prefix;?>loading_div').toggleClass('loading_div_fullscreen');
545
-        jQuery('#<?php echo $prefix;?>advmap_nofound').toggleClass('nofound_fullscreen');
546
-        jQuery('#<?php echo $prefix;?>triggermap').toggleClass('triggermap_fullscreen');
544
+        jQuery('#<?php echo $prefix; ?>loading_div').toggleClass('loading_div_fullscreen');
545
+        jQuery('#<?php echo $prefix; ?>advmap_nofound').toggleClass('nofound_fullscreen');
546
+        jQuery('#<?php echo $prefix; ?>triggermap').toggleClass('triggermap_fullscreen');
547 547
         jQuery('.TopLeft').toggleClass('TopLeft_fullscreen');
548 548
         window.setTimeout(function () {
549 549
             if (window.gdMaps == 'google') {
@@ -579,9 +579,9 @@  discard block
 block discarded – undo
579 579
             do_action('geodir_add_listing_geocode_js_vars');
580 580
             ?>
581 581
             <?php if ($is_map_restrict) { ?>
582
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
583
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
584
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
582
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
583
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
584
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
585 585
                 centerMap(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
586 586
                 baseMarker.setLatLng(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
587 587
                 updateMarkerPositionOSM(baseMarker.getLatLng());
@@ -590,39 +590,39 @@  discard block
 block discarded – undo
590 590
             <?php } ?>
591 591
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
592 592
         } else {
593
-            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
593
+            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
594 594
         }
595 595
     }
596 596
     
597 597
     jQuery(function ($) {
598
-        $("#<?php echo $prefix.'map';?>").goMap({
599
-            latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
600
-            longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
601
-            zoom: <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT,
598
+        $("#<?php echo $prefix.'map'; ?>").goMap({
599
+            latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
600
+            longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
601
+            zoom: <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT,
602 602
             maptype: 'ROADMAP', // Map type - HYBRID, ROADMAP, SATELLITE, TERRAIN
603 603
             streetViewControl: true,
604
-            <?php if(get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,';}?>
604
+            <?php if (get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,'; }?>
605 605
         });
606 606
 
607 607
         if (window.gdMaps) {
608 608
             geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : [];
609 609
 
610 610
             baseMarker = $.goMap.createMarker({
611
-                latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
612
-                longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
611
+                latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
612
+                longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
613 613
                 id: 'baseMarker',
614
-                icon: '<?php echo $marker_icon;?>',
614
+                icon: '<?php echo $marker_icon; ?>',
615 615
                 draggable: true,
616 616
                 addToMap: true, // For OSM
617
-                w: parseFloat('<?php echo $icon_size['w'];?>'),
618
-                h: parseFloat('<?php echo $icon_size['h'];?>'),
617
+                w: parseFloat('<?php echo $icon_size['w']; ?>'),
618
+                h: parseFloat('<?php echo $icon_size['h']; ?>'),
619 619
             });
620 620
         } else {
621
-            jQuery('#<?php echo $prefix.'advmap_nofound';?>').hide();
622
-            jQuery('#<?php echo $prefix.'advmap_notloaded';?>').show();
621
+            jQuery('#<?php echo $prefix.'advmap_nofound'; ?>').hide();
622
+            jQuery('#<?php echo $prefix.'advmap_notloaded'; ?>').show();
623 623
         }
624 624
         
625
-        $("#<?php echo $prefix;?>set_address_button").click(function () {
625
+        $("#<?php echo $prefix; ?>set_address_button").click(function () {
626 626
             var set_on_map = true;
627 627
             geodir_codeAddress(set_on_map);
628 628
         });
@@ -656,14 +656,14 @@  discard block
 block discarded – undo
656 656
                 updateMapZoom($.goMap.map.zoom);
657 657
             });
658 658
 
659
-            var maxMap = document.getElementById('<?php echo $prefix;?>triggermap');
659
+            var maxMap = document.getElementById('<?php echo $prefix; ?>triggermap');
660 660
             google.maps.event.addDomListener(maxMap, 'click', gdMaxMap);
661 661
 
662 662
             <?php if ($is_map_restrict) { ?>
663
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country);?>';
663
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country); ?>';
664 664
             geocoder.geocode({'address': CITY_ADDRESS},
665 665
                 function (results, status) {
666
-                    $("#<?php echo $prefix.'map';?>").goMap();
666
+                    $("#<?php echo $prefix.'map'; ?>").goMap();
667 667
                     if (status == google.maps.GeocoderStatus.OK) {
668 668
                         // Bounds for North America
669 669
                         var bound_lat_lng = String(results[0].geometry.bounds);
@@ -674,13 +674,13 @@  discard block
 block discarded – undo
674 674
                             new google.maps.LatLng(bound_lat_lng[2], bound_lat_lng[3])
675 675
                         );
676 676
                     } else {
677
-                        alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status);
677
+                        alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status);
678 678
                     }
679 679
                 });
680 680
             <?php } ?>
681 681
             // Limit the zoom level
682 682
             google.maps.event.addListener($.goMap.map, 'zoom_changed', function () {
683
-                $("#<?php echo $prefix.'map';?>").goMap();
683
+                $("#<?php echo $prefix.'map'; ?>").goMap();
684 684
                 if ($.goMap.map.getZoom() < minZoomLevel) $.goMap.map.setZoom(minZoomLevel);
685 685
             });
686 686
         } else if (window.gdMaps == 'osm') {
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
                 updateMapZoom($.goMap.map.getZoom());
707 707
             });
708 708
 
709
-            L.DomEvent.addListener($('<?php echo $prefix;?>triggermap'), 'click', gdMaxMap);
709
+            L.DomEvent.addListener($('<?php echo $prefix; ?>triggermap'), 'click', gdMaxMap);
710 710
 
711 711
             <?php if ($is_map_restrict) { ?>
712
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country);?>';
712
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country); ?>';
713 713
             geocodePositionOSM('', CITY_ADDRESS);
714 714
             <?php } ?>
715 715
             // Limit the zoom level
@@ -732,14 +732,14 @@  discard block
 block discarded – undo
732 732
 <div class="top_banner_section_inn geodir_map_container clearfix" style="margin-top:10px;">
733 733
     <div class="TopLeft"><span id="<?php echo $prefix; ?>triggermap" style="margin-top:-11px;margin-left:-12px;"></span></div>
734 734
     <div class="TopRight"></div>
735
-    <div id="<?php echo $prefix . 'map'; ?>" class="geodir_map" style="height:300px">
735
+    <div id="<?php echo $prefix.'map'; ?>" class="geodir_map" style="height:300px">
736 736
         <!-- new map start -->
737 737
         <div class="iprelative">
738
-            <div id="<?php echo $prefix . 'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
738
+            <div id="<?php echo $prefix.'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
739 739
             <div id="<?php echo $prefix; ?>loading_div" style="height:300px"></div>
740 740
             <div id="<?php echo $prefix; ?>advmap_counter"></div>
741 741
             <div id="<?php echo $prefix; ?>advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
742
-            <div id="<?php echo $prefix;?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
742
+            <div id="<?php echo $prefix; ?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
743 743
         </div>
744 744
         <!-- new map end -->
745 745
     </div>
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 2 patches
Indentation   +1130 added lines, -1130 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_get_ajax_url()
21 21
 {
22
-    return admin_url('admin-ajax.php?action=geodir_ajax_action');
22
+	return admin_url('admin-ajax.php?action=geodir_ajax_action');
23 23
 }
24 24
 
25 25
 /////////////////////
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89 89
 if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
90
+	add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91 91
 
92 92
 add_filter('parse_query', 'geodir_modified_query');
93 93
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 /* POST AND LOOP ACTIONS */
155 155
 ////////////////////////
156 156
 if (!is_admin()) {
157
-    add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
-    add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
-    /** Exclude Virtual Pages From Pages List **/
160
-    add_action('pre_get_posts', 'set_listing_request', 0);
161
-    add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
-    add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
-    add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
-    add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
157
+	add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
+	add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
+	/** Exclude Virtual Pages From Pages List **/
160
+	add_action('pre_get_posts', 'set_listing_request', 0);
161
+	add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
+	add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
+	add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
+	add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
165 165
 }
166 166
 
167 167
 
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
-    if ($geodir_theme_location) {
227
-        update_option('geodir_theme_location_nav', $geodir_theme_location);
228
-    } else {
229
-        update_option('geodir_theme_location_nav', '');
230
-    }
225
+	$geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
+	if ($geodir_theme_location) {
227
+		update_option('geodir_theme_location_nav', $geodir_theme_location);
228
+	} else {
229
+		update_option('geodir_theme_location_nav', '');
230
+	}
231 231
 }
232 232
 
233 233
 /// add action for theme switch to blank previous theme navigation location setting
@@ -248,32 +248,32 @@  discard block
 block discarded – undo
248 248
  */
249 249
 function geodir_add_post_filters()
250 250
 {
251
-    /**
252
-     * Contains all function for filtering listing.
253
-     *
254
-     * @since 1.0.0
255
-     * @package GeoDirectory
256
-     */
257
-    include_once('geodirectory-functions/listing_filters.php');
251
+	/**
252
+	 * Contains all function for filtering listing.
253
+	 *
254
+	 * @since 1.0.0
255
+	 * @package GeoDirectory
256
+	 */
257
+	include_once('geodirectory-functions/listing_filters.php');
258 258
 }
259 259
 
260 260
 
261 261
 if (!function_exists('geodir_init_defaults')) {
262
-    /**
263
-     * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
-     *
265
-     * @since 1.0.0
266
-     * @package GeoDirectory
267
-     */
268
-    function geodir_init_defaults()
269
-    {
270
-        if (function_exists('geodir_register_defaults')) {
262
+	/**
263
+	 * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
+	 *
265
+	 * @since 1.0.0
266
+	 * @package GeoDirectory
267
+	 */
268
+	function geodir_init_defaults()
269
+	{
270
+		if (function_exists('geodir_register_defaults')) {
271 271
 
272
-            geodir_register_defaults();
272
+			geodir_register_defaults();
273 273
 
274
-        }
274
+		}
275 275
 
276
-    }
276
+	}
277 277
 }
278 278
 
279 279
 
@@ -295,26 +295,26 @@  discard block
 block discarded – undo
295 295
 // CALLED ON 'sidebars_widgets' FILTER
296 296
 
297 297
 if (!function_exists('geodir_restrict_widget')) {
298
-    /**
299
-     * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
-     *
301
-     * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
-     * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
-     * @since 1.0.0
304
-     * @package GeoDirectory
305
-     */
306
-    function geodir_restrict_widget()
307
-    {
308
-        global $is_listing, $is_single_place;
298
+	/**
299
+	 * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
+	 *
301
+	 * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
+	 * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
+	 * @since 1.0.0
304
+	 * @package GeoDirectory
305
+	 */
306
+	function geodir_restrict_widget()
307
+	{
308
+		global $is_listing, $is_single_place;
309 309
 
310
-        // set is listing	
311
-        (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
310
+		// set is listing	
311
+		(geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
312 312
 
313
-        // set is single place
314
-        (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
313
+		// set is single place
314
+		(geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
315 315
 
316 316
 
317
-    }
317
+	}
318 318
 }
319 319
 
320 320
 
@@ -335,31 +335,31 @@  discard block
 block discarded – undo
335 335
  */
336 336
 function geodir_detail_page_sidebar_content_sorting()
337 337
 {
338
-    $arr_detail_page_sidebar_content =
339
-        /**
340
-         * An array of functions to be called to be displayed on the details (post) page sidebar.
341
-         *
342
-         * This filter can be used to remove sections of the details page sidebar,
343
-         * add new sections or rearrange the order of the sections.
344
-         *
345
-         * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
-         * @since 1.0.0
347
-         */
348
-        apply_filters('geodir_detail_page_sidebar_content',
349
-            array('geodir_social_sharing_buttons',
350
-                'geodir_detail_page_google_analytics',
351
-                'geodir_edit_post_link',
352
-                'geodir_detail_page_review_rating',
353
-                'geodir_detail_page_more_info'
354
-            ) // end of array 
355
-        ); // end of apply filter
356
-    if (!empty($arr_detail_page_sidebar_content)) {
357
-        foreach ($arr_detail_page_sidebar_content as $content_function) {
358
-            if (function_exists($content_function)) {
359
-                add_action('geodir_detail_page_sidebar', $content_function);
360
-            }
361
-        }
362
-    }
338
+	$arr_detail_page_sidebar_content =
339
+		/**
340
+		 * An array of functions to be called to be displayed on the details (post) page sidebar.
341
+		 *
342
+		 * This filter can be used to remove sections of the details page sidebar,
343
+		 * add new sections or rearrange the order of the sections.
344
+		 *
345
+		 * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
+		 * @since 1.0.0
347
+		 */
348
+		apply_filters('geodir_detail_page_sidebar_content',
349
+			array('geodir_social_sharing_buttons',
350
+				'geodir_detail_page_google_analytics',
351
+				'geodir_edit_post_link',
352
+				'geodir_detail_page_review_rating',
353
+				'geodir_detail_page_more_info'
354
+			) // end of array 
355
+		); // end of apply filter
356
+	if (!empty($arr_detail_page_sidebar_content)) {
357
+		foreach ($arr_detail_page_sidebar_content as $content_function) {
358
+			if (function_exists($content_function)) {
359
+				add_action('geodir_detail_page_sidebar', $content_function);
360
+			}
361
+		}
362
+	}
363 363
 }
364 364
 
365 365
 add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
  */
375 375
 function geodir_add_to_favourite_link()
376 376
 {
377
-    global $post, $preview;
378
-    if (!$preview && geodir_is_page('detail')) {
379
-        ?>
377
+	global $post, $preview;
378
+	if (!$preview && geodir_is_page('detail')) {
379
+		?>
380 380
         <p class="edit_link">
381 381
             <?php geodir_favourite_html($post->post_author, $post->ID); ?>
382 382
         </p>
383 383
     <?php
384
-    }
384
+	}
385 385
 }
386 386
 
387 387
 /**
@@ -395,41 +395,41 @@  discard block
 block discarded – undo
395 395
  */
396 396
 function geodir_social_sharing_buttons()
397 397
 {
398
-    global $preview;
399
-    ob_start(); // Start  buffering;
400
-    /**
401
-     * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
-     *
403
-     * @since 1.0.0
404
-     */
405
-    do_action('geodir_before_social_sharing_buttons');
406
-    if (!$preview) {
407
-        ?>
398
+	global $preview;
399
+	ob_start(); // Start  buffering;
400
+	/**
401
+	 * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
+	 *
403
+	 * @since 1.0.0
404
+	 */
405
+	do_action('geodir_before_social_sharing_buttons');
406
+	if (!$preview) {
407
+		?>
408 408
         <div class="likethis">
409 409
             <?php geodir_twitter_tweet_button(); ?>
410 410
             <?php geodir_fb_like_button(); ?>
411 411
             <?php geodir_google_plus_button(); ?>
412 412
         </div>
413 413
     <?php
414
-    }// end of if, if its a preview or not
415
-
416
-    /**
417
-     * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
-     *
419
-     * @since 1.0.0
420
-     */
421
-    do_action('geodir_after_social_sharing_buttons');
422
-    $content_html = ob_get_clean();
423
-    if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
-        /**
427
-         * Filter the geodir_social_sharing_buttons() function content.
428
-         *
429
-         * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
-         */
431
-        echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
-    }
414
+	}// end of if, if its a preview or not
415
+
416
+	/**
417
+	 * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
+	 *
419
+	 * @since 1.0.0
420
+	 */
421
+	do_action('geodir_after_social_sharing_buttons');
422
+	$content_html = ob_get_clean();
423
+	if (trim($content_html) != '')
424
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
+	if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
+		/**
427
+		 * Filter the geodir_social_sharing_buttons() function content.
428
+		 *
429
+		 * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
+		 */
431
+		echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
+	}
433 433
 
434 434
 
435 435
 }
@@ -447,46 +447,46 @@  discard block
 block discarded – undo
447 447
  */
448 448
 function geodir_edit_post_link()
449 449
 {
450
-    global $post, $preview;
451
-    ob_start(); // Start buffering;
452
-    /**
453
-     * This is called before the edit post link html in the function geodir_edit_post_link()
454
-     *
455
-     * @since 1.0.0
456
-     */
457
-    do_action('geodir_before_edit_post_link');
458
-    if (!$preview) {
459
-        $is_current_user_owner = geodir_listing_belong_to_current_user();
450
+	global $post, $preview;
451
+	ob_start(); // Start buffering;
452
+	/**
453
+	 * This is called before the edit post link html in the function geodir_edit_post_link()
454
+	 *
455
+	 * @since 1.0.0
456
+	 */
457
+	do_action('geodir_before_edit_post_link');
458
+	if (!$preview) {
459
+		$is_current_user_owner = geodir_listing_belong_to_current_user();
460 460
         
461
-        if ($is_current_user_owner) {
462
-            $post_id = $post->ID;
461
+		if ($is_current_user_owner) {
462
+			$post_id = $post->ID;
463 463
             
464
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
465
-                $post_id = (int)$_REQUEST['pid'];
466
-            }
464
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
465
+				$post_id = (int)$_REQUEST['pid'];
466
+			}
467 467
 
468
-            $postlink = get_permalink(geodir_add_listing_page_id());
469
-            $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
470
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
471
-        }
472
-    }// end of if, if its a preview or not
473
-    /**
474
-     * This is called after the edit post link html in the function geodir_edit_post_link()
475
-     *
476
-     * @since 1.0.0
477
-     */
478
-    do_action('geodir_after_edit_post_link');
479
-    $content_html = ob_get_clean();
480
-    if (trim($content_html) != '')
481
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
483
-        /**
484
-         * Filter the geodir_edit_post_link() function content.
485
-         *
486
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
487
-         */
488
-        echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
489
-    }
468
+			$postlink = get_permalink(geodir_add_listing_page_id());
469
+			$editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
470
+			echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
471
+		}
472
+	}// end of if, if its a preview or not
473
+	/**
474
+	 * This is called after the edit post link html in the function geodir_edit_post_link()
475
+	 *
476
+	 * @since 1.0.0
477
+	 */
478
+	do_action('geodir_after_edit_post_link');
479
+	$content_html = ob_get_clean();
480
+	if (trim($content_html) != '')
481
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
+	if ((int)get_option('geodir_disable_user_links_section') != 1) {
483
+		/**
484
+		 * Filter the geodir_edit_post_link() function content.
485
+		 *
486
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
487
+		 */
488
+		echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
489
+	}
490 490
 }
491 491
 
492 492
 /**
@@ -500,42 +500,42 @@  discard block
 block discarded – undo
500 500
  */
501 501
 function geodir_detail_page_google_analytics()
502 502
 {
503
-    global $post,$preview;
504
-    if($preview){return '';}
505
-    $package_info = array();
506
-    $package_info = geodir_post_package_info($package_info, $post);
503
+	global $post,$preview;
504
+	if($preview){return '';}
505
+	$package_info = array();
506
+	$package_info = geodir_post_package_info($package_info, $post);
507 507
 
508
-    $id = trim(get_option('geodir_ga_account_id'));
508
+	$id = trim(get_option('geodir_ga_account_id'));
509 509
 
510
-    if (!$id) {
511
-        return; //if no Google Analytics ID then bail.
512
-    }
510
+	if (!$id) {
511
+		return; //if no Google Analytics ID then bail.
512
+	}
513 513
 
514
-    ob_start(); // Start buffering;
515
-    /**
516
-     * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
517
-     *
518
-     * @since 1.0.0
519
-     */
520
-    do_action('geodir_before_google_analytics');
514
+	ob_start(); // Start buffering;
515
+	/**
516
+	 * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
517
+	 *
518
+	 * @since 1.0.0
519
+	 */
520
+	do_action('geodir_before_google_analytics');
521 521
     
522
-    $refresh_time = get_option('geodir_ga_refresh_time', 5);
523
-    /**
524
-     * Filter the time interval to check & refresh new users results.
525
-     *
526
-     * @since 1.5.9
527
-     *
528
-     * @param int $refresh_time Time interval to check & refresh new users results.
529
-     */
530
-    $refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
531
-    $refresh_time = absint($refresh_time * 1000);
522
+	$refresh_time = get_option('geodir_ga_refresh_time', 5);
523
+	/**
524
+	 * Filter the time interval to check & refresh new users results.
525
+	 *
526
+	 * @since 1.5.9
527
+	 *
528
+	 * @param int $refresh_time Time interval to check & refresh new users results.
529
+	 */
530
+	$refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
531
+	$refresh_time = absint($refresh_time * 1000);
532 532
     
533
-    $hide_refresh = get_option('geodir_ga_auto_refresh');
533
+	$hide_refresh = get_option('geodir_ga_auto_refresh');
534 534
     
535
-    $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
536
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
537
-        $page_url = urlencode($_SERVER['REQUEST_URI']);
538
-        ?>
535
+	$auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
536
+	if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
537
+		$page_url = urlencode($_SERVER['REQUEST_URI']);
538
+		?>
539 539
         <script type="text/javascript">
540 540
             var gd_gaTimeOut;
541 541
             var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
@@ -787,15 +787,15 @@  discard block
 block discarded – undo
787 787
                     var labels = results[1].rows.map(function(row) { return +row[0]; });
788 788
 
789 789
                     <?php
790
-                    // Here we list the shorthand days of the week so it can be used in translation.
791
-                    __("Mon",'geodirectory');
792
-                    __("Tue",'geodirectory');
793
-                    __("Wed",'geodirectory');
794
-                    __("Thu",'geodirectory');
795
-                    __("Fri",'geodirectory');
796
-                    __("Sat",'geodirectory');
797
-                    __("Sun",'geodirectory');
798
-                    ?>
790
+					// Here we list the shorthand days of the week so it can be used in translation.
791
+					__("Mon",'geodirectory');
792
+					__("Tue",'geodirectory');
793
+					__("Wed",'geodirectory');
794
+					__("Thu",'geodirectory');
795
+					__("Fri",'geodirectory');
796
+					__("Sat",'geodirectory');
797
+					__("Sun",'geodirectory');
798
+					?>
799 799
 
800 800
                     labels = [
801 801
                         "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
@@ -1044,24 +1044,24 @@  discard block
 block discarded – undo
1044 1044
         </span>
1045 1045
 
1046 1046
     <?php
1047
-    }
1048
-    /**
1049
-     * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1050
-     *
1051
-     * @since 1.0.0
1052
-     */
1053
-    do_action('geodir_after_google_analytics');
1054
-    $content_html = ob_get_clean();
1055
-    if (trim($content_html) != '')
1056
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1057
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1058
-        /**
1059
-         * Filter the geodir_edit_post_link() function content.
1060
-         *
1061
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
1062
-         */
1063
-        echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1064
-    }
1047
+	}
1048
+	/**
1049
+	 * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1050
+	 *
1051
+	 * @since 1.0.0
1052
+	 */
1053
+	do_action('geodir_after_google_analytics');
1054
+	$content_html = ob_get_clean();
1055
+	if (trim($content_html) != '')
1056
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1057
+	if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1058
+		/**
1059
+		 * Filter the geodir_edit_post_link() function content.
1060
+		 *
1061
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
1062
+		 */
1063
+		echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1064
+	}
1065 1065
 }
1066 1066
 
1067 1067
 /**
@@ -1077,90 +1077,90 @@  discard block
 block discarded – undo
1077 1077
  */
1078 1078
 function geodir_detail_page_review_rating()
1079 1079
 {
1080
-    global $post, $preview, $post_images;
1081
-    ob_start(); // Start  buffering;
1082
-    /**
1083
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1084
-     *
1085
-     * This is called outside the check for an actual rating and the check for preview page.
1086
-     *
1087
-     * @since 1.0.0
1088
-     */
1089
-    do_action('geodir_before_detail_page_review_rating');
1090
-
1091
-    $comment_count = geodir_get_review_count_total($post->ID);
1092
-    $post_avgratings = geodir_get_post_rating($post->ID);
1093
-
1094
-    if ($post_avgratings != 0 && !$preview) {
1095
-        /**
1096
-         * This is called before the rating html in the function geodir_detail_page_review_rating().
1097
-         *
1098
-         * This is called inside the check for an actual rating and the check for preview page.
1099
-         *
1100
-         * @since 1.0.0
1101
-         * @param float $post_avgratings Average rating for the surrent post.
1102
-         * @param int $post->ID Current post ID.
1103
-         */
1104
-        do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1105
-
1106
-        $html = '<p style=" float:left;">';
1107
-        $html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1108
-        $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1109
-        $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1080
+	global $post, $preview, $post_images;
1081
+	ob_start(); // Start  buffering;
1082
+	/**
1083
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1084
+	 *
1085
+	 * This is called outside the check for an actual rating and the check for preview page.
1086
+	 *
1087
+	 * @since 1.0.0
1088
+	 */
1089
+	do_action('geodir_before_detail_page_review_rating');
1090
+
1091
+	$comment_count = geodir_get_review_count_total($post->ID);
1092
+	$post_avgratings = geodir_get_post_rating($post->ID);
1093
+
1094
+	if ($post_avgratings != 0 && !$preview) {
1095
+		/**
1096
+		 * This is called before the rating html in the function geodir_detail_page_review_rating().
1097
+		 *
1098
+		 * This is called inside the check for an actual rating and the check for preview page.
1099
+		 *
1100
+		 * @since 1.0.0
1101
+		 * @param float $post_avgratings Average rating for the surrent post.
1102
+		 * @param int $post->ID Current post ID.
1103
+		 */
1104
+		do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1105
+
1106
+		$html = '<p style=" float:left;">';
1107
+		$html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1108
+		$html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1109
+		$post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1110 1110
        
1111 1111
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1112 1112
 	   
1113 1113
 	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1114 1114
 
1115
-        $html .= '<span class="item">';
1116
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1115
+		$html .= '<span class="item">';
1116
+		$html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1117 1117
 
1118
-        if ($post_images) {
1119
-            foreach ($post_images as $img) {
1120
-                $post_img = $img->src;
1121
-                break;
1122
-            }
1123
-        }
1124
-
1125
-        if (isset($post_img) && $post_img) {
1126
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1127
-        }
1128
-
1129
-        $html .= '</span>';
1130
-
1131
-        echo $html .= '</div>';
1132
-        /**
1133
-         * This is called after the rating html in the function geodir_detail_page_review_rating().
1134
-         *
1135
-         * This is called inside the check for an actual rating and the check for preview page.
1136
-         *
1137
-         * @since 1.0.0
1138
-         * @param float $post_avgratings Average rating for the surrent post.
1139
-         * @param int $post->ID Current post ID.
1140
-         */
1141
-        do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1142
-    }
1143
-    /**
1144
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1145
-     *
1146
-     * This is called outside the check for an actual rating and the check for preview page.
1147
-     *
1148
-     * @since 1.0.0
1149
-     */
1150
-    do_action('geodir_after_detail_page_review_rating');
1151
-    $content_html = ob_get_clean();
1152
-    if (trim($content_html) != '') {
1153
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1154
-    }
1155
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1156
-        /**
1157
-         * Filter the geodir_detail_page_review_rating() function content.
1158
-         *
1159
-         * @since 1.0.0
1160
-         * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1161
-         */
1162
-        echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1163
-    }
1118
+		if ($post_images) {
1119
+			foreach ($post_images as $img) {
1120
+				$post_img = $img->src;
1121
+				break;
1122
+			}
1123
+		}
1124
+
1125
+		if (isset($post_img) && $post_img) {
1126
+			$html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1127
+		}
1128
+
1129
+		$html .= '</span>';
1130
+
1131
+		echo $html .= '</div>';
1132
+		/**
1133
+		 * This is called after the rating html in the function geodir_detail_page_review_rating().
1134
+		 *
1135
+		 * This is called inside the check for an actual rating and the check for preview page.
1136
+		 *
1137
+		 * @since 1.0.0
1138
+		 * @param float $post_avgratings Average rating for the surrent post.
1139
+		 * @param int $post->ID Current post ID.
1140
+		 */
1141
+		do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1142
+	}
1143
+	/**
1144
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1145
+	 *
1146
+	 * This is called outside the check for an actual rating and the check for preview page.
1147
+	 *
1148
+	 * @since 1.0.0
1149
+	 */
1150
+	do_action('geodir_after_detail_page_review_rating');
1151
+	$content_html = ob_get_clean();
1152
+	if (trim($content_html) != '') {
1153
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1154
+	}
1155
+	if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1156
+		/**
1157
+		 * Filter the geodir_detail_page_review_rating() function content.
1158
+		 *
1159
+		 * @since 1.0.0
1160
+		 * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1161
+		 */
1162
+		echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1163
+	}
1164 1164
 }
1165 1165
 
1166 1166
 /**
@@ -1172,35 +1172,35 @@  discard block
 block discarded – undo
1172 1172
  */
1173 1173
 function geodir_detail_page_more_info()
1174 1174
 {
1175
-    ob_start(); // Start  buffering;
1176
-    /**
1177
-     * This is called before the info section html.
1178
-     *
1179
-     * @since 1.0.0
1180
-     */
1181
-    do_action('geodir_before_detail_page_more_info');
1182
-    if ($geodir_post_detail_fields = geodir_show_listing_info('detail')) {
1183
-        echo $geodir_post_detail_fields;
1184
-    }
1185
-    /**
1186
-     * This is called after the info section html.
1187
-     *
1188
-     * @since 1.0.0
1189
-     */
1190
-    do_action('geodir_after_detail_page_more_info');
1191
-
1192
-    $content_html = ob_get_clean();
1193
-    if (trim($content_html) != '')
1194
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1195
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1196
-        /**
1197
-         * Filter the output html for function geodir_detail_page_more_info().
1198
-         *
1199
-         * @since 1.0.0
1200
-         * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1201
-         */
1202
-        echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1203
-    }
1175
+	ob_start(); // Start  buffering;
1176
+	/**
1177
+	 * This is called before the info section html.
1178
+	 *
1179
+	 * @since 1.0.0
1180
+	 */
1181
+	do_action('geodir_before_detail_page_more_info');
1182
+	if ($geodir_post_detail_fields = geodir_show_listing_info('detail')) {
1183
+		echo $geodir_post_detail_fields;
1184
+	}
1185
+	/**
1186
+	 * This is called after the info section html.
1187
+	 *
1188
+	 * @since 1.0.0
1189
+	 */
1190
+	do_action('geodir_after_detail_page_more_info');
1191
+
1192
+	$content_html = ob_get_clean();
1193
+	if (trim($content_html) != '')
1194
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1195
+	if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1196
+		/**
1197
+		 * Filter the output html for function geodir_detail_page_more_info().
1198
+		 *
1199
+		 * @since 1.0.0
1200
+		 * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1201
+		 */
1202
+		echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1203
+	}
1204 1204
 }
1205 1205
 
1206 1206
 
@@ -1214,15 +1214,15 @@  discard block
 block discarded – undo
1214 1214
  */
1215 1215
 function geodir_localize_all_js_msg()
1216 1216
 {// 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
1217
-    if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1218
-        $ajax_url = admin_url('admin-ajax.php');
1219
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1220
-        $ajax_url = admin_url('admin-ajax.php');
1221
-    } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1222
-        $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1223
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1224
-        $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1225
-    }
1217
+	if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1218
+		$ajax_url = admin_url('admin-ajax.php');
1219
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1220
+		$ajax_url = admin_url('admin-ajax.php');
1221
+	} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1222
+		$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1223
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1224
+		$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1225
+	}
1226 1226
 	
1227 1227
 	/**
1228 1228
 	 * Filter the allowed image type extensions for post images.
@@ -1232,60 +1232,60 @@  discard block
 block discarded – undo
1232 1232
 	 */
1233 1233
 	$allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
1234 1234
 	
1235
-    $default_marker_icon = get_option('geodir_default_marker_icon');
1236
-    $default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1237
-    $default_marker_width = $default_marker_size['w'];
1238
-    $default_marker_height = $default_marker_size['h'];
1235
+	$default_marker_icon = get_option('geodir_default_marker_icon');
1236
+	$default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1237
+	$default_marker_width = $default_marker_size['w'];
1238
+	$default_marker_height = $default_marker_size['h'];
1239 1239
     
1240
-    $arr_alert_msg = array(
1241
-        'geodir_plugin_url' => geodir_plugin_url(),
1242
-        'geodir_admin_ajax_url' => $ajax_url,
1243
-        'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1244
-        'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1245
-        'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1246
-        'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1247
-        //start not show alert msg
1248
-        'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1249
-        'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1250
-        'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1251
-        'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1252
-        'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1253
-        // end not show alert msg
1254
-        'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1255
-        'my_main_listing_del' => __('Deleting the main listing of a franchise will turn all franchises in regular listings. Are you sure wish to delete this main listing?', 'geodirectory'),
1256
-        //start not show alert msg
1257
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1258
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1259
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1260
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1261
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1262
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1263
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1264
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1265
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1266
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1267
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1268
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1269
-        'geodir_default_marker_icon' => $default_marker_icon,
1270
-        'geodir_default_marker_w' => $default_marker_width,
1271
-        'geodir_default_marker_h' => $default_marker_height,
1272
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1273
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1274
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1275
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1276
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1277
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1278
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1279
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1280
-        /* on/off dragging for phone devices */
1281
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1282
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1283
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1284
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1285
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1286
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1287
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1288
-        'geodir_action_remove' => __('Remove', 'geodirectory'),
1240
+	$arr_alert_msg = array(
1241
+		'geodir_plugin_url' => geodir_plugin_url(),
1242
+		'geodir_admin_ajax_url' => $ajax_url,
1243
+		'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1244
+		'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1245
+		'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1246
+		'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1247
+		//start not show alert msg
1248
+		'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1249
+		'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1250
+		'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1251
+		'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1252
+		'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1253
+		// end not show alert msg
1254
+		'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1255
+		'my_main_listing_del' => __('Deleting the main listing of a franchise will turn all franchises in regular listings. Are you sure wish to delete this main listing?', 'geodirectory'),
1256
+		//start not show alert msg
1257
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1258
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1259
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1260
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1261
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1262
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1263
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1264
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1265
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1266
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1267
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1268
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1269
+		'geodir_default_marker_icon' => $default_marker_icon,
1270
+		'geodir_default_marker_w' => $default_marker_width,
1271
+		'geodir_default_marker_h' => $default_marker_height,
1272
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1273
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1274
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1275
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1276
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1277
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1278
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1279
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1280
+		/* on/off dragging for phone devices */
1281
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1282
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1283
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1284
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1285
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1286
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1287
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1288
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1289 1289
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1290 1290
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1291 1291
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1293,35 +1293,35 @@  discard block
 block discarded – undo
1293 1293
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1294 1294
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1295 1295
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1296
-        'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1297
-        'geodir_map_name' => geodir_map_name(),
1298
-        'osmStart' => __('Start', 'geodirectory'),
1299
-        'osmVia' => __('Via {viaNumber}', 'geodirectory'),
1300
-        'osmEnd' => __('Enter Your Location', 'geodirectory'),
1301
-        'ga_delete_check' => __('Are you wish to Deauthorize and break Analytics?', 'geodirectory'),
1302
-
1303
-    );
1304
-
1305
-    /**
1306
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1307
-     *
1308
-     * With this filter you can add, remove or change translated JS strings.
1309
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1310
-     *
1311
-     * @since 1.0.0
1312
-     */
1313
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1314
-
1315
-    foreach ($arr_alert_msg as $key => $value) {
1316
-        if (!is_scalar($value))
1317
-            continue;
1318
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1319
-    }
1296
+		'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1297
+		'geodir_map_name' => geodir_map_name(),
1298
+		'osmStart' => __('Start', 'geodirectory'),
1299
+		'osmVia' => __('Via {viaNumber}', 'geodirectory'),
1300
+		'osmEnd' => __('Enter Your Location', 'geodirectory'),
1301
+		'ga_delete_check' => __('Are you wish to Deauthorize and break Analytics?', 'geodirectory'),
1302
+
1303
+	);
1304
+
1305
+	/**
1306
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1307
+	 *
1308
+	 * With this filter you can add, remove or change translated JS strings.
1309
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1310
+	 *
1311
+	 * @since 1.0.0
1312
+	 */
1313
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1320 1314
 
1321
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1322
-    echo '<script>';
1323
-    echo $script;
1324
-    echo '</script>';
1315
+	foreach ($arr_alert_msg as $key => $value) {
1316
+		if (!is_scalar($value))
1317
+			continue;
1318
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1319
+	}
1320
+
1321
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1322
+	echo '<script>';
1323
+	echo $script;
1324
+	echo '</script>';
1325 1325
 }
1326 1326
 
1327 1327
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1337,11 +1337,11 @@  discard block
 block discarded – undo
1337 1337
  */
1338 1338
 function geodir_admin_bar_site_menu($wp_admin_bar)
1339 1339
 {
1340
-    if (get_option("geodir_installed")) {
1341
-        if (current_user_can('manage_options')) {
1342
-            $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1343
-        }
1344
-    }
1340
+	if (get_option("geodir_installed")) {
1341
+		if (current_user_can('manage_options')) {
1342
+			$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1343
+		}
1344
+	}
1345 1345
 }
1346 1346
 
1347 1347
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1367,25 +1367,25 @@  discard block
 block discarded – undo
1367 1367
  */
1368 1368
 function geodir_store_sidebars()
1369 1369
 {
1370
-    global $geodir_sidebars;
1371
-    global $sidebars_widgets;
1372
-
1373
-    if (!is_array($sidebars_widgets))
1374
-        $sidebars_widgets = wp_get_sidebars_widgets();
1375
-    $geodir_old_sidebars = array();
1376
-
1377
-    if (is_array($geodir_sidebars)) {
1378
-        foreach ($geodir_sidebars as $val) {
1379
-            if (is_array($sidebars_widgets)) {
1380
-                if (array_key_exists($val, $sidebars_widgets))
1381
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1382
-                else
1383
-                    $geodir_old_sidebars[$val] = array();
1384
-            }
1385
-        }
1386
-    }
1387
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1388
-    geodir_option_version_backup('geodir_sidebars');
1370
+	global $geodir_sidebars;
1371
+	global $sidebars_widgets;
1372
+
1373
+	if (!is_array($sidebars_widgets))
1374
+		$sidebars_widgets = wp_get_sidebars_widgets();
1375
+	$geodir_old_sidebars = array();
1376
+
1377
+	if (is_array($geodir_sidebars)) {
1378
+		foreach ($geodir_sidebars as $val) {
1379
+			if (is_array($sidebars_widgets)) {
1380
+				if (array_key_exists($val, $sidebars_widgets))
1381
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1382
+				else
1383
+					$geodir_old_sidebars[$val] = array();
1384
+			}
1385
+		}
1386
+	}
1387
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1388
+	geodir_option_version_backup('geodir_sidebars');
1389 1389
 
1390 1390
 }
1391 1391
 
@@ -1399,28 +1399,28 @@  discard block
 block discarded – undo
1399 1399
  */
1400 1400
 function geodir_restore_sidebars()
1401 1401
 {
1402
-    global $sidebars_widgets;
1403
-
1404
-    if (!is_array($sidebars_widgets))
1405
-        $sidebars_widgets = wp_get_sidebars_widgets();
1406
-
1407
-    if (is_array($sidebars_widgets)) {
1408
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1409
-        if (is_array($geodir_old_sidebars)) {
1410
-            foreach ($geodir_old_sidebars as $key => $val) {
1411
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1412
-                {
1413
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1414
-                }
1402
+	global $sidebars_widgets;
1415 1403
 
1404
+	if (!is_array($sidebars_widgets))
1405
+		$sidebars_widgets = wp_get_sidebars_widgets();
1416 1406
 
1417
-            }
1418
-        }
1407
+	if (is_array($sidebars_widgets)) {
1408
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1409
+		if (is_array($geodir_old_sidebars)) {
1410
+			foreach ($geodir_old_sidebars as $key => $val) {
1411
+				if(0 === strpos($key, 'geodir_'))// if gd widget
1412
+				{
1413
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1414
+				}
1419 1415
 
1420
-    }
1421 1416
 
1422
-    update_option('sidebars_widgets', $sidebars_widgets);
1423
-    update_option('geodir_sidebars', '');
1417
+			}
1418
+		}
1419
+
1420
+	}
1421
+
1422
+	update_option('sidebars_widgets', $sidebars_widgets);
1423
+	update_option('geodir_sidebars', '');
1424 1424
 }
1425 1425
 
1426 1426
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1433,9 +1433,9 @@  discard block
 block discarded – undo
1433 1433
  */
1434 1434
 function geodir_after_listing_post_gridview()
1435 1435
 {
1436
-    global $gridview_columns;
1436
+	global $gridview_columns;
1437 1437
 
1438
-    $gridview_columns = '';
1438
+	$gridview_columns = '';
1439 1439
 
1440 1440
 }
1441 1441
 
@@ -1463,11 +1463,11 @@  discard block
 block discarded – undo
1463 1463
  */
1464 1464
 function so_handle_038($url, $original_url, $_context)
1465 1465
 {
1466
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1467
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1468
-    }
1466
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1467
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1468
+	}
1469 1469
 
1470
-    return $url;
1470
+	return $url;
1471 1471
 }
1472 1472
 
1473 1473
 
@@ -1483,34 +1483,34 @@  discard block
 block discarded – undo
1483 1483
 function geodir_after_main_form_fields() {
1484 1484
 	global $gd_session;
1485 1485
 	
1486
-    if (get_option('geodir_accept_term_condition')) {
1487
-        global $post;
1488
-        $term_condition = '';
1489
-        if (isset($_REQUEST['backandedit'])) {
1490
-            $post = (object)$gd_session->get('listing');
1491
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1492
-        }
1493
-
1494
-        ?>
1486
+	if (get_option('geodir_accept_term_condition')) {
1487
+		global $post;
1488
+		$term_condition = '';
1489
+		if (isset($_REQUEST['backandedit'])) {
1490
+			$post = (object)$gd_session->get('listing');
1491
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1492
+		}
1493
+
1494
+		?>
1495 1495
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1496 1496
             <label>&nbsp;</label>
1497 1497
 
1498 1498
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1499 1499
 				<span style="display:block"> 
1500 1500
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1501
-                    echo 'checked="checked"';
1502
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1501
+					echo 'checked="checked"';
1502
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1503 1503
                        class="geodir_textfield" value="1"
1504 1504
                        style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1505 1505
 				</span>
1506 1506
             </div>
1507 1507
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1508
-                    _e($required_msg, 'geodirectory');
1509
-                } ?></span>
1508
+					_e($required_msg, 'geodirectory');
1509
+				} ?></span>
1510 1510
         </div>
1511 1511
     <?php
1512 1512
 
1513
-    }
1513
+	}
1514 1514
 }
1515 1515
 
1516 1516
 
@@ -1535,42 +1535,42 @@  discard block
 block discarded – undo
1535 1535
  */
1536 1536
 function geodir_detail_page_tab_is_display($is_display, $tab)
1537 1537
 {
1538
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1538
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1539 1539
 
1540
-    if ($tab == 'post_profile') {
1541
-        /** This action is documented in geodirectory_template_actions.php */
1542
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1540
+	if ($tab == 'post_profile') {
1541
+		/** This action is documented in geodirectory_template_actions.php */
1542
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1543 1543
         
1544
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1545
-            $is_display = false;
1546
-        }
1547
-    }
1544
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1545
+			$is_display = false;
1546
+		}
1547
+	}
1548 1548
     
1549
-    if ($tab == 'post_info')
1550
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1549
+	if ($tab == 'post_info')
1550
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1551 1551
     
1552
-    if ($tab == 'post_images')
1553
-        $is_display = (!empty($post_images)) ? true : false;
1552
+	if ($tab == 'post_images')
1553
+		$is_display = (!empty($post_images)) ? true : false;
1554 1554
 
1555
-    if ($tab == 'post_video')
1556
-        $is_display = (!empty($video)) ? true : false;
1555
+	if ($tab == 'post_video')
1556
+		$is_display = (!empty($video)) ? true : false;
1557 1557
 
1558
-    if ($tab == 'special_offers')
1559
-        $is_display = (!empty($special_offers)) ? true : false;
1558
+	if ($tab == 'special_offers')
1559
+		$is_display = (!empty($special_offers)) ? true : false;
1560 1560
 
1561
-    if ($tab == 'reviews')
1562
-        $is_display = (geodir_is_page('detail')) ? true : false;
1561
+	if ($tab == 'reviews')
1562
+		$is_display = (geodir_is_page('detail')) ? true : false;
1563 1563
 
1564
-    if ($tab == 'related_listing') {
1565
-       $message = __('No listings found which match your selection.', 'geodirectory');
1564
+	if ($tab == 'related_listing') {
1565
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1566 1566
        
1567
-       /** This action is documented in geodirectory-functions/template_functions.php */
1568
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1567
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1568
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1569 1569
        
1570
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1571
-    }
1570
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1571
+	}
1572 1572
 
1573
-    return $is_display;
1573
+	return $is_display;
1574 1574
 }
1575 1575
 
1576 1576
 
@@ -1586,69 +1586,69 @@  discard block
 block discarded – undo
1586 1586
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1587 1587
  */
1588 1588
 function geodir_changes_in_custom_fields_table() {
1589
-    global $wpdb, $plugin_prefix;
1589
+	global $wpdb, $plugin_prefix;
1590 1590
 	
1591 1591
 	// Remove unused virtual page
1592 1592
 	$listings_page_id = (int)get_option('geodir_listing_page');
1593 1593
 	if ($listings_page_id) {
1594 1594
 		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1595
-        delete_option('geodir_listing_page');
1595
+		delete_option('geodir_listing_page');
1596 1596
 	}
1597 1597
 
1598
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1599
-        $wpdb->query(
1600
-            $wpdb->prepare(
1601
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1602
-                array('1', '1', 'admin')
1603
-            )
1604
-        );
1598
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1599
+		$wpdb->query(
1600
+			$wpdb->prepare(
1601
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1602
+				array('1', '1', 'admin')
1603
+			)
1604
+		);
1605 1605
 
1606 1606
 
1607
-        /* --- terms meta value set --- */
1607
+		/* --- terms meta value set --- */
1608 1608
 
1609
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1609
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1610 1610
 
1611
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1611
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1612 1612
 
1613
-        if (!empty($options_data)) {
1613
+		if (!empty($options_data)) {
1614 1614
 
1615
-            foreach ($options_data as $optobj) {
1615
+			foreach ($options_data as $optobj) {
1616 1616
 
1617
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1617
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1618 1618
 
1619
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1619
+				$taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1620 1620
 
1621
-                if (!empty($taxonomies_data)) {
1621
+				if (!empty($taxonomies_data)) {
1622 1622
 
1623
-                    foreach ($taxonomies_data as $taxobj) {
1623
+					foreach ($taxonomies_data as $taxobj) {
1624 1624
 
1625
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1626
-                        $post_type = $taxObject->object_type[0];
1625
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1626
+						$post_type = $taxObject->object_type[0];
1627 1627
 
1628
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1628
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1629 1629
 
1630
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1630
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1631 1631
 
1632
-                        if ($duplicate_data) {
1632
+						if ($duplicate_data) {
1633 1633
 
1634
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1634
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1635 1635
 
1636
-                        } else {
1636
+						} else {
1637 1637
 
1638
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1638
+							$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1639 1639
 
1640
-                        }
1640
+						}
1641 1641
 
1642
-                    }
1642
+					}
1643 1643
 
1644
-                }
1644
+				}
1645 1645
 
1646
-            }
1647
-        }
1646
+			}
1647
+		}
1648 1648
 
1649
-        update_option('geodir_changes_in_custom_fields_table', '1');
1649
+		update_option('geodir_changes_in_custom_fields_table', '1');
1650 1650
 
1651
-    }
1651
+	}
1652 1652
 
1653 1653
 }
1654 1654
 
@@ -1667,24 +1667,24 @@  discard block
 block discarded – undo
1667 1667
 function geodir_location_slug_check($slug)
1668 1668
 {
1669 1669
 
1670
-    global $wpdb, $table_prefix;
1670
+	global $wpdb, $table_prefix;
1671 1671
 
1672
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1672
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1673 1673
 
1674
-    if ($slug_exists) {
1674
+	if ($slug_exists) {
1675 1675
 
1676
-        $suffix = 1;
1677
-        do {
1678
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1679
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1680
-            $suffix++;
1681
-        } while ($location_slug_check && $suffix < 100);
1676
+		$suffix = 1;
1677
+		do {
1678
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1679
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1680
+			$suffix++;
1681
+		} while ($location_slug_check && $suffix < 100);
1682 1682
 
1683
-        $slug = $alt_location_name;
1683
+		$slug = $alt_location_name;
1684 1684
 
1685
-    }
1685
+	}
1686 1686
 
1687
-    return $slug;
1687
+	return $slug;
1688 1688
 
1689 1689
 }
1690 1690
 
@@ -1709,42 +1709,42 @@  discard block
 block discarded – undo
1709 1709
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1710 1710
 {
1711 1711
 
1712
-    global $wpdb, $plugin_prefix, $table_prefix;
1712
+	global $wpdb, $plugin_prefix, $table_prefix;
1713 1713
 
1714
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1714
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1715 1715
 
1716
-    $slug = $tern_data->slug;
1716
+	$slug = $tern_data->slug;
1717 1717
 
1718
-    /**
1719
-     * Filter if a term slug exists.
1720
-     *
1721
-     * @since 1.0.0
1722
-     * @package GeoDirectory
1723
-     * @param bool $bool Default: false.
1724
-     * @param string $slug The term slug.
1725
-     * @param int $term_id The term ID.
1726
-     */
1727
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1718
+	/**
1719
+	 * Filter if a term slug exists.
1720
+	 *
1721
+	 * @since 1.0.0
1722
+	 * @package GeoDirectory
1723
+	 * @param bool $bool Default: false.
1724
+	 * @param string $slug The term slug.
1725
+	 * @param int $term_id The term ID.
1726
+	 */
1727
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1728 1728
 
1729
-    if ($slug_exists) {
1729
+	if ($slug_exists) {
1730 1730
 
1731
-        $suffix = 1;
1732
-        do {
1733
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1731
+		$suffix = 1;
1732
+		do {
1733
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1734 1734
 
1735
-            /** This action is documented in geodirectory_hooks_actions.php */
1736
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1735
+			/** This action is documented in geodirectory_hooks_actions.php */
1736
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1737 1737
 
1738
-            $suffix++;
1739
-        } while ($term_slug_check && $suffix < 100);
1738
+			$suffix++;
1739
+		} while ($term_slug_check && $suffix < 100);
1740 1740
 
1741
-        $slug = $new_slug;
1741
+		$slug = $new_slug;
1742 1742
 
1743
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1743
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1744 1744
 
1745
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1745
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1746 1746
 
1747
-    }
1747
+	}
1748 1748
 	
1749 1749
 	// Update tag in detail table.
1750 1750
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1785,21 +1785,21 @@  discard block
 block discarded – undo
1785 1785
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1786 1786
 {
1787 1787
 
1788
-    global $wpdb, $table_prefix;
1788
+	global $wpdb, $table_prefix;
1789 1789
 
1790
-    $default_location = geodir_get_default_location();
1790
+	$default_location = geodir_get_default_location();
1791 1791
 
1792
-    $country_slug = $default_location->country_slug;
1793
-    $region_slug = $default_location->region_slug;
1794
-    $city_slug = $default_location->city_slug;
1792
+	$country_slug = $default_location->country_slug;
1793
+	$region_slug = $default_location->region_slug;
1794
+	$city_slug = $default_location->city_slug;
1795 1795
 
1796
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1797
-        return $slug_exists = true;
1796
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1797
+		return $slug_exists = true;
1798 1798
 
1799
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1800
-        return $slug_exists = true;
1799
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1800
+		return $slug_exists = true;
1801 1801
 
1802
-    return $slug_exists;
1802
+	return $slug_exists;
1803 1803
 }
1804 1804
 
1805 1805
 
@@ -1818,75 +1818,75 @@  discard block
 block discarded – undo
1818 1818
  */
1819 1819
 function geodir_custom_page_title($title = '', $sep = '')
1820 1820
 {
1821
-    global $wp;
1822
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1823
-        return $title;
1824
-    }
1821
+	global $wp;
1822
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1823
+		return $title;
1824
+	}
1825 1825
 
1826
-    if ($sep == '') {
1827
-        /**
1828
-         * Filter the page title separator.
1829
-         *
1830
-         * @since 1.0.0
1831
-         * @package GeoDirectory
1832
-         * @param string $sep The separator, default: `|`.
1833
-         */
1834
-        $sep = apply_filters('geodir_page_title_separator', '|');
1835
-    }
1826
+	if ($sep == '') {
1827
+		/**
1828
+		 * Filter the page title separator.
1829
+		 *
1830
+		 * @since 1.0.0
1831
+		 * @package GeoDirectory
1832
+		 * @param string $sep The separator, default: `|`.
1833
+		 */
1834
+		$sep = apply_filters('geodir_page_title_separator', '|');
1835
+	}
1836 1836
 
1837 1837
 
1838
-    $gd_page = '';
1839
-    if(geodir_is_page('home')){
1840
-        $gd_page = 'home';
1841
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1842
-    }
1843
-    elseif(geodir_is_page('detail')){
1844
-        $gd_page = 'detail';
1845
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1846
-    }
1847
-    elseif(geodir_is_page('pt')){
1848
-        $gd_page = 'pt';
1849
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1850
-    }
1851
-    elseif(geodir_is_page('listing')){
1852
-        $gd_page = 'listing';
1853
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1854
-    }
1855
-    elseif(geodir_is_page('location')){
1856
-        $gd_page = 'location';
1857
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1858
-    }
1859
-    elseif(geodir_is_page('search')){
1860
-        $gd_page = 'search';
1861
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1862
-    }
1863
-    elseif(geodir_is_page('add-listing')){
1864
-        $gd_page = 'add-listing';
1865
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1866
-    }
1867
-    elseif(geodir_is_page('author')){
1868
-        $gd_page = 'author';
1869
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1870
-    }
1871
-    elseif(geodir_is_page('login')){
1872
-        $gd_page = 'login';
1873
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1874
-    }
1875
-    elseif(geodir_is_page('listing-success')){
1876
-        $gd_page = 'listing-success';
1877
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1878
-    }
1838
+	$gd_page = '';
1839
+	if(geodir_is_page('home')){
1840
+		$gd_page = 'home';
1841
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1842
+	}
1843
+	elseif(geodir_is_page('detail')){
1844
+		$gd_page = 'detail';
1845
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1846
+	}
1847
+	elseif(geodir_is_page('pt')){
1848
+		$gd_page = 'pt';
1849
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1850
+	}
1851
+	elseif(geodir_is_page('listing')){
1852
+		$gd_page = 'listing';
1853
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1854
+	}
1855
+	elseif(geodir_is_page('location')){
1856
+		$gd_page = 'location';
1857
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1858
+	}
1859
+	elseif(geodir_is_page('search')){
1860
+		$gd_page = 'search';
1861
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1862
+	}
1863
+	elseif(geodir_is_page('add-listing')){
1864
+		$gd_page = 'add-listing';
1865
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1866
+	}
1867
+	elseif(geodir_is_page('author')){
1868
+		$gd_page = 'author';
1869
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1870
+	}
1871
+	elseif(geodir_is_page('login')){
1872
+		$gd_page = 'login';
1873
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1874
+	}
1875
+	elseif(geodir_is_page('listing-success')){
1876
+		$gd_page = 'listing-success';
1877
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1878
+	}
1879 1879
 
1880 1880
 
1881
-    /**
1882
-     * Filter page meta title to replace variables.
1883
-     *
1884
-     * @since 1.5.4
1885
-     * @param string $title The page title including variables.
1886
-     * @param string $gd_page The GeoDirectory page type if any.
1887
-     * @param string $sep The title separator symbol.
1888
-     */
1889
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1881
+	/**
1882
+	 * Filter page meta title to replace variables.
1883
+	 *
1884
+	 * @since 1.5.4
1885
+	 * @param string $title The page title including variables.
1886
+	 * @param string $gd_page The GeoDirectory page type if any.
1887
+	 * @param string $sep The title separator symbol.
1888
+	 */
1889
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1890 1890
 
1891 1891
 }
1892 1892
 
@@ -1902,36 +1902,36 @@  discard block
 block discarded – undo
1902 1902
 function geodir_set_post_attachment()
1903 1903
 {
1904 1904
 
1905
-    if (!get_option('geodir_set_post_attachments')) {
1905
+	if (!get_option('geodir_set_post_attachments')) {
1906 1906
 
1907
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1908
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1907
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1908
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1909 1909
 
1910
-        $all_postypes = geodir_get_posttypes();
1910
+		$all_postypes = geodir_get_posttypes();
1911 1911
 
1912
-        foreach($all_postypes as $post_type){
1913
-            $args = array(
1914
-                'posts_per_page' => -1,
1915
-                'post_type' => $post_type,
1916
-                'post_status' => 'publish');
1912
+		foreach($all_postypes as $post_type){
1913
+			$args = array(
1914
+				'posts_per_page' => -1,
1915
+				'post_type' => $post_type,
1916
+				'post_status' => 'publish');
1917 1917
 
1918
-            $posts_array = get_posts($args);
1918
+			$posts_array = get_posts($args);
1919 1919
 
1920
-            if (!empty($posts_array)) {
1920
+			if (!empty($posts_array)) {
1921 1921
 
1922
-                foreach ($posts_array as $post) {
1922
+				foreach ($posts_array as $post) {
1923 1923
 
1924
-                    geodir_set_wp_featured_image($post->ID);
1924
+					geodir_set_wp_featured_image($post->ID);
1925 1925
 
1926
-                }
1926
+				}
1927 1927
 
1928
-            }
1929
-        }
1928
+			}
1929
+		}
1930 1930
 
1931 1931
 
1932
-        update_option('geodir_set_post_attachments', '1');
1932
+		update_option('geodir_set_post_attachments', '1');
1933 1933
 
1934
-    }
1934
+	}
1935 1935
 
1936 1936
 }
1937 1937
 
@@ -1948,19 +1948,19 @@  discard block
 block discarded – undo
1948 1948
 function geodir_remove_url_seperator()
1949 1949
 {
1950 1950
 
1951
-    if (!get_option('geodir_remove_url_seperator')) {
1951
+	if (!get_option('geodir_remove_url_seperator')) {
1952 1952
 
1953
-        if (get_option('geodir_listingurl_separator'))
1954
-            delete_option('geodir_listingurl_separator');
1953
+		if (get_option('geodir_listingurl_separator'))
1954
+			delete_option('geodir_listingurl_separator');
1955 1955
 
1956
-        if (get_option('geodir_detailurl_separator'))
1957
-            delete_option('geodir_detailurl_separator');
1956
+		if (get_option('geodir_detailurl_separator'))
1957
+			delete_option('geodir_detailurl_separator');
1958 1958
 
1959
-        flush_rewrite_rules(false);
1959
+		flush_rewrite_rules(false);
1960 1960
 
1961
-        update_option('geodir_remove_url_seperator', '1');
1961
+		update_option('geodir_remove_url_seperator', '1');
1962 1962
 
1963
-    }
1963
+	}
1964 1964
 
1965 1965
 }
1966 1966
 
@@ -1976,19 +1976,19 @@  discard block
 block discarded – undo
1976 1976
  */
1977 1977
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
1978 1978
 {
1979
-    foreach ($permalink_arr as $key => $value) {
1979
+	foreach ($permalink_arr as $key => $value) {
1980 1980
 
1981
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
1982
-            unset($permalink_arr[$key]);
1981
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
1982
+			unset($permalink_arr[$key]);
1983 1983
 
1984
-    }
1984
+	}
1985 1985
 
1986
-    return $permalink_arr;
1986
+	return $permalink_arr;
1987 1987
 
1988 1988
 }
1989 1989
 
1990 1990
 if (!is_admin()) {
1991
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
1991
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
1992 1992
 }
1993 1993
 /**
1994 1994
  * Set status from draft to publish.
@@ -2001,16 +2001,16 @@  discard block
 block discarded – undo
2001 2001
  */
2002 2002
 function geodir_set_status_draft_to_publish_for_own_post($post)
2003 2003
 {
2004
-    $user_id = get_current_user_id();
2004
+	$user_id = get_current_user_id();
2005 2005
 
2006
-    if(!$user_id){return $post;}
2006
+	if(!$user_id){return $post;}
2007 2007
 
2008
-    $gd_post_types = geodir_get_posttypes();
2008
+	$gd_post_types = geodir_get_posttypes();
2009 2009
 
2010
-    if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2011
-        $post[0]->post_status = 'publish';
2012
-    }
2013
-    return $post;
2010
+	if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2011
+		$post[0]->post_status = 'publish';
2012
+	}
2013
+	return $post;
2014 2014
 }
2015 2015
 
2016 2016
 
@@ -2102,33 +2102,33 @@  discard block
 block discarded – undo
2102 2102
  */
2103 2103
 function geodir_detail_page_tab_headings_change($tabs_arr)
2104 2104
 {
2105
-    global $wpdb;
2105
+	global $wpdb;
2106 2106
 
2107
-    $post_type = geodir_get_current_posttype();
2107
+	$post_type = geodir_get_current_posttype();
2108 2108
 
2109
-    $all_postypes = geodir_get_posttypes();
2109
+	$all_postypes = geodir_get_posttypes();
2110 2110
 
2111
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2111
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2112 2112
 
2113
-        if (array_key_exists('post_video', $tabs_arr)) {
2113
+		if (array_key_exists('post_video', $tabs_arr)) {
2114 2114
 
2115
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2115
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2116 2116
 
2117
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2118
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2119
-        }
2117
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2118
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2119
+		}
2120 2120
 
2121
-        if (array_key_exists('special_offers', $tabs_arr)) {
2121
+		if (array_key_exists('special_offers', $tabs_arr)) {
2122 2122
 
2123
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2123
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2124 2124
 
2125
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2126
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2127
-        }
2125
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2126
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2127
+		}
2128 2128
 
2129
-    }
2129
+	}
2130 2130
 
2131
-    return $tabs_arr;
2131
+	return $tabs_arr;
2132 2132
 
2133 2133
 }
2134 2134
 
@@ -2141,10 +2141,10 @@  discard block
 block discarded – undo
2141 2141
  */
2142 2142
 function geodir_remove_template_redirect_actions()
2143 2143
 {
2144
-    if (geodir_is_page('login')){
2145
-        remove_all_actions('template_redirect');
2146
-        remove_action('init', 'avia_modify_front', 10);
2147
-    }
2144
+	if (geodir_is_page('login')){
2145
+		remove_all_actions('template_redirect');
2146
+		remove_action('init', 'avia_modify_front', 10);
2147
+	}
2148 2148
 }
2149 2149
 
2150 2150
 
@@ -2166,51 +2166,51 @@  discard block
 block discarded – undo
2166 2166
 function geodirectory_before_featured_image_delete($attachment_id)
2167 2167
 {
2168 2168
 
2169
-    global $wpdb, $plugin_prefix;
2169
+	global $wpdb, $plugin_prefix;
2170 2170
 
2171
-    $post_id = get_post_field('post_parent', $attachment_id);
2171
+	$post_id = get_post_field('post_parent', $attachment_id);
2172 2172
 
2173
-    $attachment_url = wp_get_attachment_url($attachment_id);
2173
+	$attachment_url = wp_get_attachment_url($attachment_id);
2174 2174
 
2175
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2175
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2176 2176
 
2177
-        $post_type = get_post_type($post_id);
2177
+		$post_type = get_post_type($post_id);
2178 2178
 
2179
-        $all_postypes = geodir_get_posttypes();
2179
+		$all_postypes = geodir_get_posttypes();
2180 2180
 
2181
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2182
-            return false;
2181
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2182
+			return false;
2183 2183
 
2184
-        $uploads = wp_upload_dir();
2184
+		$uploads = wp_upload_dir();
2185 2185
 
2186
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2186
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2187 2187
 
2188
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2188
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2189 2189
 
2190
-        $wpdb->query(
2191
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2192
-                array($post_id, $split_img_file_path)
2193
-            )
2194
-        );
2190
+		$wpdb->query(
2191
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2192
+				array($post_id, $split_img_file_path)
2193
+			)
2194
+		);
2195 2195
 
2196
-        $attachment_data = $wpdb->get_row(
2197
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2198
-                array($post_id)
2199
-            )
2200
-        );
2196
+		$attachment_data = $wpdb->get_row(
2197
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2198
+				array($post_id)
2199
+			)
2200
+		);
2201 2201
 
2202
-        if (!empty($attachment_data)) {
2203
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2204
-        }
2202
+		if (!empty($attachment_data)) {
2203
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2204
+		}
2205 2205
 
2206 2206
 
2207
-        $table_name = $plugin_prefix . $post_type . '_detail';
2207
+		$table_name = $plugin_prefix . $post_type . '_detail';
2208 2208
 
2209
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2209
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2210 2210
 
2211
-        geodir_set_wp_featured_image($post_id);
2211
+		geodir_set_wp_featured_image($post_id);
2212 2212
 
2213
-    }
2213
+	}
2214 2214
 
2215 2215
 }
2216 2216
 
@@ -2228,79 +2228,79 @@  discard block
 block discarded – undo
2228 2228
 function geodir_temp_set_post_attachment()
2229 2229
 {
2230 2230
 
2231
-    global $wpdb, $plugin_prefix;
2231
+	global $wpdb, $plugin_prefix;
2232 2232
 
2233
-    $all_postypes = geodir_get_posttypes();
2233
+	$all_postypes = geodir_get_posttypes();
2234 2234
 
2235
-    foreach ($all_postypes as $posttype) {
2235
+	foreach ($all_postypes as $posttype) {
2236 2236
 
2237
-        $tablename = $plugin_prefix . $posttype . '_detail';
2237
+		$tablename = $plugin_prefix . $posttype . '_detail';
2238 2238
 
2239
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2239
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2240 2240
 
2241
-        if (!empty($get_post_data)) {
2241
+		if (!empty($get_post_data)) {
2242 2242
 
2243
-            foreach ($get_post_data as $data) {
2243
+			foreach ($get_post_data as $data) {
2244 2244
 
2245
-                $post_id = $data->post_id;
2245
+				$post_id = $data->post_id;
2246 2246
 
2247
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2247
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2248 2248
 
2249
-                if (!empty($attachment_data)) {
2249
+				if (!empty($attachment_data)) {
2250 2250
 
2251
-                    foreach ($attachment_data as $attach) {
2251
+					foreach ($attachment_data as $attach) {
2252 2252
 
2253
-                        $file_info = pathinfo($attach->file);
2253
+						$file_info = pathinfo($attach->file);
2254 2254
 
2255
-                        $sub_dir = '';
2256
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2257
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2255
+						$sub_dir = '';
2256
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2257
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2258 2258
 
2259
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2260
-                        $uploads_path = $uploads['basedir'];
2259
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2260
+						$uploads_path = $uploads['basedir'];
2261 2261
 
2262
-                        $file_name = $file_info['basename'];
2262
+						$file_name = $file_info['basename'];
2263 2263
 
2264
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2264
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2265 2265
 
2266
-                        if (!file_exists($img_arr['path'])) {
2266
+						if (!file_exists($img_arr['path'])) {
2267 2267
 
2268
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2268
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2269 2269
 
2270
-                        }
2270
+						}
2271 2271
 
2272
-                    }
2272
+					}
2273 2273
 
2274
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2274
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2275 2275
 
2276
-                    if (!empty($attachment_data)) {
2276
+					if (!empty($attachment_data)) {
2277 2277
 
2278
-                        if ($attachment_data->ID)
2279
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2278
+						if ($attachment_data->ID)
2279
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2280 2280
 
2281
-                    } else {
2281
+					} else {
2282 2282
 
2283
-                        if (has_post_thumbnail($post_id)) {
2283
+						if (has_post_thumbnail($post_id)) {
2284 2284
 
2285
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2285
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2286 2286
 
2287
-                            wp_delete_attachment($post_thumbnail_id);
2287
+							wp_delete_attachment($post_thumbnail_id);
2288 2288
 
2289
-                        }
2289
+						}
2290 2290
 
2291
-                    }
2291
+					}
2292 2292
 
2293
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2293
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2294 2294
 
2295
-                    geodir_set_wp_featured_image($post_id);
2295
+					geodir_set_wp_featured_image($post_id);
2296 2296
 
2297
-                }
2297
+				}
2298 2298
 
2299
-            }
2299
+			}
2300 2300
 
2301
-        }
2301
+		}
2302 2302
 
2303
-    }
2303
+	}
2304 2304
 
2305 2305
 }
2306 2306
 
@@ -2318,9 +2318,9 @@  discard block
 block discarded – undo
2318 2318
 function geodir_default_rating_star_icon()
2319 2319
 {
2320 2320
 
2321
-    if (!get_option('geodir_default_rating_star_icon')) {
2322
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2323
-    }
2321
+	if (!get_option('geodir_default_rating_star_icon')) {
2322
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2323
+	}
2324 2324
 
2325 2325
 }
2326 2326
 
@@ -2338,27 +2338,27 @@  discard block
 block discarded – undo
2338 2338
  */
2339 2339
 function geodir_user_post_listing_count($user_id=null)
2340 2340
 {
2341
-    global $wpdb, $plugin_prefix, $current_user;
2342
-    if(!$user_id){
2343
-        $user_id = $current_user->ID;
2344
-    }
2341
+	global $wpdb, $plugin_prefix, $current_user;
2342
+	if(!$user_id){
2343
+		$user_id = $current_user->ID;
2344
+	}
2345 2345
 
2346
-    $user_id = $current_user->ID;
2347
-    $all_postypes = geodir_get_posttypes();
2348
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2346
+	$user_id = $current_user->ID;
2347
+	$all_postypes = geodir_get_posttypes();
2348
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2349 2349
 
2350
-    $user_listing = array();
2351
-    if (is_array($all_posts) && !empty($all_posts)) {
2352
-        foreach ($all_posts as $ptype) {
2353
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2350
+	$user_listing = array();
2351
+	if (is_array($all_posts) && !empty($all_posts)) {
2352
+		foreach ($all_posts as $ptype) {
2353
+			$total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2354 2354
 
2355
-            if ($total_posts > 0) {
2356
-                $user_listing[$ptype] = $total_posts;
2357
-            }
2358
-        }
2359
-    }
2355
+			if ($total_posts > 0) {
2356
+				$user_listing[$ptype] = $total_posts;
2357
+			}
2358
+		}
2359
+	}
2360 2360
 
2361
-    return $user_listing;
2361
+	return $user_listing;
2362 2362
 }
2363 2363
 
2364 2364
 
@@ -2378,189 +2378,189 @@  discard block
 block discarded – undo
2378 2378
  */
2379 2379
 function geodir_detail_page_custom_field_tab($tabs_arr)
2380 2380
 {
2381
-    global $post;
2382
-
2383
-    $post_type = geodir_get_current_posttype();
2384
-    $all_postypes = geodir_get_posttypes();
2385
-
2386
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2387
-        $package_info = array();
2388
-        $package_info = geodir_post_package_info($package_info, $post);
2389
-        $post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
2390
-        $fields_location = 'owntab';
2391
-
2392
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2393
-        //remove video and special offers if it is already set to show
2394
-        if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2395
-            $unset_video = true;
2396
-        }
2397
-
2398
-        if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2399
-            $unset_special_offers = true;
2400
-        }
2401
-        if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2402
-            foreach($custom_fields as $key => $custom_field){
2403
-                if($custom_field['name']=='geodir_video' && isset($unset_video)){
2404
-                    unset($custom_fields[$key]);
2405
-                }
2406
-                if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2407
-                    unset($custom_fields[$key]);
2408
-                }
2409
-            }
2410
-        }
2381
+	global $post;
2411 2382
 
2383
+	$post_type = geodir_get_current_posttype();
2384
+	$all_postypes = geodir_get_posttypes();
2412 2385
 
2413
-        if (!empty($custom_fields)) {
2414
-            $parse_custom_fields = array();
2415
-            foreach ($custom_fields as $field) {
2416
-                $field = stripslashes_deep($field); // strip slashes
2417
-                $type = $field;
2418
-                $field_name = $field['htmlvar_name'];
2419
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2420
-                    $post->{$field_name} = $_REQUEST[$field_name];
2421
-                }
2422
-
2423
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2424
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2425
-                        continue;
2426
-                    }
2386
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2387
+		$package_info = array();
2388
+		$package_info = geodir_post_package_info($package_info, $post);
2389
+		$post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
2390
+		$fields_location = 'owntab';
2427 2391
 
2428
-                    $parse_custom_fields[] = $field;
2429
-                }
2430
-            }
2431
-            $custom_fields = $parse_custom_fields;
2432
-        }
2433
-        //print_r($custom_fields);
2434
-        if (!empty($custom_fields)) {
2392
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2393
+		//remove video and special offers if it is already set to show
2394
+		if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2395
+			$unset_video = true;
2396
+		}
2435 2397
 
2436
-            global $field_set_start;
2398
+		if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2399
+			$unset_special_offers = true;
2400
+		}
2401
+		if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2402
+			foreach($custom_fields as $key => $custom_field){
2403
+				if($custom_field['name']=='geodir_video' && isset($unset_video)){
2404
+					unset($custom_fields[$key]);
2405
+				}
2406
+				if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2407
+					unset($custom_fields[$key]);
2408
+				}
2409
+			}
2410
+		}
2437 2411
 
2438
-            $post = stripslashes_deep($post); // strip slashes
2439
-            
2440
-            $field_set_start = 0;
2441
-            $fieldset_count = 0;
2442
-            $fieldset = '';
2443
-            $total_fields = count($custom_fields);
2444
-            $count_field = 0;
2445
-            $fieldset_arr = array();
2446
-            $i = 0;
2447
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2448
-
2449
-            foreach ($custom_fields as $field) {
2450
-                $count_field++;
2451
-                $field_name = $field['htmlvar_name'];
2452
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2453
-                    $post->{$field_name} = $_REQUEST[$field_name];
2454
-                }
2455 2412
 
2456
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2457
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2458
-                    $site_title = trim($field['site_title']);
2459
-                    $type = $field;
2460
-                    $variables_array = array();
2413
+		if (!empty($custom_fields)) {
2414
+			$parse_custom_fields = array();
2415
+			foreach ($custom_fields as $field) {
2416
+				$field = stripslashes_deep($field); // strip slashes
2417
+				$type = $field;
2418
+				$field_name = $field['htmlvar_name'];
2419
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2420
+					$post->{$field_name} = $_REQUEST[$field_name];
2421
+				}
2461 2422
 
2462
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2463
-                        continue;
2464
-                    }
2423
+				if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2424
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2425
+						continue;
2426
+					}
2465 2427
 
2466
-                    if ($type['type'] != 'fieldset') {
2467
-                        $i++;
2468
-                        $variables_array['post_id'] = $post->ID;
2469
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2470
-                        $variables_array['value'] = '';
2471
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2472
-                    }else{
2473
-                        $i = 0;
2474
-                        $fieldset_count++;
2475
-                        $field_set_start = 1;
2476
-                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2477
-                        $fieldset_arr[$fieldset_count]['label'] = $label;
2478
-                    }
2428
+					$parse_custom_fields[] = $field;
2429
+				}
2430
+			}
2431
+			$custom_fields = $parse_custom_fields;
2432
+		}
2433
+		//print_r($custom_fields);
2434
+		if (!empty($custom_fields)) {
2479 2435
 
2436
+			global $field_set_start;
2480 2437
 
2481
-                    if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2482
-                    $type = stripslashes_deep($type); // strip slashes
2483
-                    if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2484
-                    $html = '';
2485
-                    $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2486
-                    if($html_var=='post'){$html_var='post_address';}
2487
-                    $field_icon = geodir_field_icon_proccess($type);
2488
-                    $filed_type = $type['type'];
2489
-
2490
-                    /**
2491
-                     * Filter the output for custom fields.
2492
-                     *
2493
-                     * Here we can remove or add new functions depending on the field type.
2494
-                     *
2495
-                     * @param string $html The html to be filtered (blank).
2496
-                     * @param string $fields_location The location the field is to be show.
2497
-                     * @param array $type The array of field values.
2498
-                     */
2499
-                    $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2500
-
2501
-
2502
-                    /**
2503
-                     * Filter custom field output in tab.
2504
-                     *
2505
-                     * @since 1.5.6
2506
-                     *
2507
-                     * @param string $html_var The HTML variable name for the field.
2508
-                     * @param string $html Custom field unfiltered HTML.
2509
-                     * @param array $variables_array Custom field variables array.
2510
-                     */
2511
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2512
-
2513
-                    $fieldset_html = '';
2514
-                    if ($field_set_start == 1) {
2515
-                        $add_html = false;
2516
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2517
-                            if ($fieldset != '') {
2518
-                                $add_html = true;
2519
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2520
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2521
-                            }
2522
-                            $fieldset_html = $fieldset;
2523
-                            $fieldset = '';
2524
-                        } else {
2525
-                            $fieldset .= $html;
2526
-                            if ($total_fields == $count_field && $fieldset != '') {
2527
-                                $add_html = true;
2528
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2529
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2530
-                                $fieldset_html = $fieldset;
2531
-                            }
2532
-                        }
2533
-
2534
-                        if ($add_html) {
2535
-                            $tabs_arr[$htmlvar_name] = array(
2536
-                                'heading_text' => __($label, 'geodirectory'),
2537
-                                'is_active_tab' => false,
2538
-                                /**
2539
-                                 * Filter if a custom field should be displayed on the details page tab.
2540
-                                 *
2541
-                                 * @since 1.0.0
2542
-                                 * @param string $htmlvar_name The field HTML var name.
2543
-                                 */
2544
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2545
-                                'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2546
-                            );
2547
-                        }
2548
-                    } else {
2549
-                        if ($html != '') {
2550
-                            $tabs_arr[$html_var] = array(
2551
-                                'heading_text' => __($label, 'geodirectory'),
2552
-                                'is_active_tab' => false,
2553
-                                /** This action is documented in geodirectory_hooks_actions.php */
2554
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2555
-                                'tab_content' => $html
2556
-                            );
2557
-                        }
2558
-                    }
2559
-                }
2560
-            }
2561
-        }
2562
-    }
2563
-    return $tabs_arr;
2438
+			$post = stripslashes_deep($post); // strip slashes
2439
+            
2440
+			$field_set_start = 0;
2441
+			$fieldset_count = 0;
2442
+			$fieldset = '';
2443
+			$total_fields = count($custom_fields);
2444
+			$count_field = 0;
2445
+			$fieldset_arr = array();
2446
+			$i = 0;
2447
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2448
+
2449
+			foreach ($custom_fields as $field) {
2450
+				$count_field++;
2451
+				$field_name = $field['htmlvar_name'];
2452
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2453
+					$post->{$field_name} = $_REQUEST[$field_name];
2454
+				}
2455
+
2456
+				if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2457
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2458
+					$site_title = trim($field['site_title']);
2459
+					$type = $field;
2460
+					$variables_array = array();
2461
+
2462
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2463
+						continue;
2464
+					}
2465
+
2466
+					if ($type['type'] != 'fieldset') {
2467
+						$i++;
2468
+						$variables_array['post_id'] = $post->ID;
2469
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2470
+						$variables_array['value'] = '';
2471
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2472
+					}else{
2473
+						$i = 0;
2474
+						$fieldset_count++;
2475
+						$field_set_start = 1;
2476
+						$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2477
+						$fieldset_arr[$fieldset_count]['label'] = $label;
2478
+					}
2479
+
2480
+
2481
+					if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2482
+					$type = stripslashes_deep($type); // strip slashes
2483
+					if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2484
+					$html = '';
2485
+					$html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2486
+					if($html_var=='post'){$html_var='post_address';}
2487
+					$field_icon = geodir_field_icon_proccess($type);
2488
+					$filed_type = $type['type'];
2489
+
2490
+					/**
2491
+					 * Filter the output for custom fields.
2492
+					 *
2493
+					 * Here we can remove or add new functions depending on the field type.
2494
+					 *
2495
+					 * @param string $html The html to be filtered (blank).
2496
+					 * @param string $fields_location The location the field is to be show.
2497
+					 * @param array $type The array of field values.
2498
+					 */
2499
+					$html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2500
+
2501
+
2502
+					/**
2503
+					 * Filter custom field output in tab.
2504
+					 *
2505
+					 * @since 1.5.6
2506
+					 *
2507
+					 * @param string $html_var The HTML variable name for the field.
2508
+					 * @param string $html Custom field unfiltered HTML.
2509
+					 * @param array $variables_array Custom field variables array.
2510
+					 */
2511
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2512
+
2513
+					$fieldset_html = '';
2514
+					if ($field_set_start == 1) {
2515
+						$add_html = false;
2516
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2517
+							if ($fieldset != '') {
2518
+								$add_html = true;
2519
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2520
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2521
+							}
2522
+							$fieldset_html = $fieldset;
2523
+							$fieldset = '';
2524
+						} else {
2525
+							$fieldset .= $html;
2526
+							if ($total_fields == $count_field && $fieldset != '') {
2527
+								$add_html = true;
2528
+								$label = $fieldset_arr[$fieldset_count]['label'];
2529
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2530
+								$fieldset_html = $fieldset;
2531
+							}
2532
+						}
2533
+
2534
+						if ($add_html) {
2535
+							$tabs_arr[$htmlvar_name] = array(
2536
+								'heading_text' => __($label, 'geodirectory'),
2537
+								'is_active_tab' => false,
2538
+								/**
2539
+								 * Filter if a custom field should be displayed on the details page tab.
2540
+								 *
2541
+								 * @since 1.0.0
2542
+								 * @param string $htmlvar_name The field HTML var name.
2543
+								 */
2544
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2545
+								'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2546
+							);
2547
+						}
2548
+					} else {
2549
+						if ($html != '') {
2550
+							$tabs_arr[$html_var] = array(
2551
+								'heading_text' => __($label, 'geodirectory'),
2552
+								'is_active_tab' => false,
2553
+								/** This action is documented in geodirectory_hooks_actions.php */
2554
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2555
+								'tab_content' => $html
2556
+							);
2557
+						}
2558
+					}
2559
+				}
2560
+			}
2561
+		}
2562
+	}
2563
+	return $tabs_arr;
2564 2564
 }
2565 2565
 
2566 2566
 /* display add listing page for wpml */
@@ -2584,39 +2584,39 @@  discard block
 block discarded – undo
2584 2584
  */
2585 2585
 function geodir_add_post_status_author_page()
2586 2586
 {
2587
-    global $wpdb, $post;
2588
-
2589
-    $html = '';
2590
-    if (get_current_user_id()) {
2591
-
2592
-        $is_author_page = apply_filters('geodir_post_status_is_author_page', geodir_is_page('author'));
2593
-        if ($is_author_page && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
2594
-
2595
-            // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
2596
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
2597
-            $status = "<strong>(";
2598
-            $status_icon = '<i class="fa fa-play"></i>';
2599
-            if ($real_status == 'publish') {
2600
-                $status .= __('Published', 'geodirectory');
2601
-            } else {
2602
-                $status .= __('Not published', 'geodirectory');
2603
-                $status_icon = '<i class="fa fa-pause"></i>';
2604
-            }
2605
-            $status .= ")</strong>";
2587
+	global $wpdb, $post;
2588
+
2589
+	$html = '';
2590
+	if (get_current_user_id()) {
2591
+
2592
+		$is_author_page = apply_filters('geodir_post_status_is_author_page', geodir_is_page('author'));
2593
+		if ($is_author_page && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
2594
+
2595
+			// we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
2596
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
2597
+			$status = "<strong>(";
2598
+			$status_icon = '<i class="fa fa-play"></i>';
2599
+			if ($real_status == 'publish') {
2600
+				$status .= __('Published', 'geodirectory');
2601
+			} else {
2602
+				$status .= __('Not published', 'geodirectory');
2603
+				$status_icon = '<i class="fa fa-pause"></i>';
2604
+			}
2605
+			$status .= ")</strong>";
2606 2606
 
2607
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2608
-        }
2609
-    }
2607
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2608
+		}
2609
+	}
2610 2610
 
2611
-    if ($html != '') {
2612
-        /**
2613
-         * Filter the post status text on the author page.
2614
-         *
2615
-         * @since 1.0.0
2616
-         * @param string $html The HTML of the status.
2617
-         */
2618
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
2619
-    }
2611
+	if ($html != '') {
2612
+		/**
2613
+		 * Filter the post status text on the author page.
2614
+		 *
2615
+		 * @since 1.0.0
2616
+		 * @param string $html The HTML of the status.
2617
+		 */
2618
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
2619
+	}
2620 2620
 
2621 2621
 
2622 2622
 }
@@ -2630,21 +2630,21 @@  discard block
 block discarded – undo
2630 2630
  */
2631 2631
 function geodir_init_no_rating()
2632 2632
 {
2633
-    if (get_option('geodir_disable_rating')) {
2634
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
2635
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
2636
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
2637
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
2638
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
2639
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
2640
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
2641
-
2642
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
2643
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
2644
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
2645
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
2646
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
2647
-    }
2633
+	if (get_option('geodir_disable_rating')) {
2634
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
2635
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
2636
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
2637
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
2638
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
2639
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
2640
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
2641
+
2642
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
2643
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
2644
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
2645
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
2646
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
2647
+	}
2648 2648
 }
2649 2649
 
2650 2650
 /**
@@ -2656,24 +2656,24 @@  discard block
 block discarded – undo
2656 2656
  */
2657 2657
 function geodir_no_rating_rating_fields()
2658 2658
 {
2659
-    global $post;
2659
+	global $post;
2660 2660
 
2661
-    $post_types = geodir_get_posttypes();
2661
+	$post_types = geodir_get_posttypes();
2662 2662
 
2663
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
2664
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
2665
-            if (get_option('geodir_reviewrating_enable_rating')) {
2666
-                echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
2667
-            } else {
2668
-                echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2669
-            }
2670
-            if (get_option('geodir_reviewrating_enable_images')) {
2671
-                geodir_reviewrating_rating_img_html();
2672
-            }
2673
-        } else {
2674
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2675
-        }
2676
-    }
2663
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
2664
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
2665
+			if (get_option('geodir_reviewrating_enable_rating')) {
2666
+				echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
2667
+			} else {
2668
+				echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2669
+			}
2670
+			if (get_option('geodir_reviewrating_enable_images')) {
2671
+				geodir_reviewrating_rating_img_html();
2672
+			}
2673
+		} else {
2674
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2675
+		}
2676
+	}
2677 2677
 }
2678 2678
 
2679 2679
 /**
@@ -2687,11 +2687,11 @@  discard block
 block discarded – undo
2687 2687
  */
2688 2688
 function geodir_no_rating_comment_text($content, $comment = '')
2689 2689
 {
2690
-    if (!is_admin()) {
2691
-        return '<div class="description">' . $content . '</div>';
2692
-    } else {
2693
-        return $content;
2694
-    }
2690
+	if (!is_admin()) {
2691
+		return '<div class="description">' . $content . '</div>';
2692
+	} else {
2693
+		return $content;
2694
+	}
2695 2695
 }
2696 2696
 
2697 2697
 /**
@@ -2704,7 +2704,7 @@  discard block
 block discarded – undo
2704 2704
  */
2705 2705
 function geodir_no_rating_review_rating_html($content = '')
2706 2706
 {
2707
-    return NULL;
2707
+	return NULL;
2708 2708
 }
2709 2709
 
2710 2710
 /**
@@ -2718,19 +2718,19 @@  discard block
 block discarded – undo
2718 2718
  */
2719 2719
 function geodir_no_rating_get_sort_options($options, $post_type = '')
2720 2720
 {
2721
-    $new_options = array();
2722
-    if (!empty($options)) {
2723
-        foreach ($options as $option) {
2724
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
2725
-                continue;
2726
-            }
2727
-            $new_options[] = $option;
2728
-        }
2721
+	$new_options = array();
2722
+	if (!empty($options)) {
2723
+		foreach ($options as $option) {
2724
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
2725
+				continue;
2726
+			}
2727
+			$new_options[] = $option;
2728
+		}
2729 2729
 
2730
-        $options = $new_options;
2731
-    }
2730
+		$options = $new_options;
2731
+	}
2732 2732
 
2733
-    return $options;
2733
+	return $options;
2734 2734
 }
2735 2735
 
2736 2736
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -2744,11 +2744,11 @@  discard block
 block discarded – undo
2744 2744
  */
2745 2745
 function geodir_all_js_msg_no_rating($msg = array())
2746 2746
 {
2747
-    if (get_option('geodir_disable_rating')) {
2748
-        $msg['gd_cmt_no_rating'] = true;
2749
-    }
2747
+	if (get_option('geodir_disable_rating')) {
2748
+		$msg['gd_cmt_no_rating'] = true;
2749
+	}
2750 2750
 
2751
-    return $msg;
2751
+	return $msg;
2752 2752
 }
2753 2753
 
2754 2754
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -2762,13 +2762,13 @@  discard block
 block discarded – undo
2762 2762
  */
2763 2763
 function geodir_body_class_no_rating($classes = array())
2764 2764
 {
2765
-    if (get_option('geodir_disable_rating')) {
2766
-        $classes[] = 'gd-no-rating';
2767
-    }
2765
+	if (get_option('geodir_disable_rating')) {
2766
+		$classes[] = 'gd-no-rating';
2767
+	}
2768 2768
     
2769
-    $classes[] = 'gd-map-' . geodir_map_name();
2769
+	$classes[] = 'gd-map-' . geodir_map_name();
2770 2770
 
2771
-    return $classes;
2771
+	return $classes;
2772 2772
 }
2773 2773
 
2774 2774
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -2782,13 +2782,13 @@  discard block
 block discarded – undo
2782 2782
  */
2783 2783
 function geodir_admin_body_class_no_rating($class = '')
2784 2784
 {
2785
-    if (get_option('geodir_disable_rating')) {
2786
-        $class .= ' gd-no-rating';
2787
-    }
2785
+	if (get_option('geodir_disable_rating')) {
2786
+		$class .= ' gd-no-rating';
2787
+	}
2788 2788
     
2789
-    $class .= ' gd-map-' . geodir_map_name();
2789
+	$class .= ' gd-map-' . geodir_map_name();
2790 2790
 
2791
-    return $class;
2791
+	return $class;
2792 2792
 }
2793 2793
 
2794 2794
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -2801,10 +2801,10 @@  discard block
 block discarded – undo
2801 2801
  */
2802 2802
 function geodir_wp_head_no_rating()
2803 2803
 {
2804
-    if (get_option('geodir_disable_rating')) {
2805
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
2806
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
2807
-    }
2804
+	if (get_option('geodir_disable_rating')) {
2805
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
2806
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
2807
+	}
2808 2808
 }
2809 2809
 
2810 2810
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -2821,36 +2821,36 @@  discard block
 block discarded – undo
2821 2821
  * @return array Translation texts.
2822 2822
  */
2823 2823
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
2824
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2825
-
2826
-    $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
2827
-
2828
-    /**
2829
-     * Filters the geodirectory option names that requires to add for translation.
2830
-     *
2831
-     * @since 1.5.7
2832
-     * @package GeoDirectory
2833
-     *
2834
-     * @param  array $gd_options Array of option names.
2835
-     */
2836
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
2837
-    $gd_options = array_unique($gd_options);
2838
-
2839
-    if (!empty($gd_options)) {
2840
-        foreach ($gd_options as $gd_option) {
2841
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
2842
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
2824
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2825
+
2826
+	$gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
2827
+
2828
+	/**
2829
+	 * Filters the geodirectory option names that requires to add for translation.
2830
+	 *
2831
+	 * @since 1.5.7
2832
+	 * @package GeoDirectory
2833
+	 *
2834
+	 * @param  array $gd_options Array of option names.
2835
+	 */
2836
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
2837
+	$gd_options = array_unique($gd_options);
2838
+
2839
+	if (!empty($gd_options)) {
2840
+		foreach ($gd_options as $gd_option) {
2841
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
2842
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
2843 2843
                 
2844
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
2845
-                    $translation_texts[] = stripslashes_deep($option_value);
2846
-                }
2847
-            }
2848
-        }
2849
-    }
2844
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
2845
+					$translation_texts[] = stripslashes_deep($option_value);
2846
+				}
2847
+			}
2848
+		}
2849
+	}
2850 2850
 
2851
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
2851
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
2852 2852
 
2853
-    return $translation_texts;
2853
+	return $translation_texts;
2854 2854
 }
2855 2855
 
2856 2856
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
@@ -2864,15 +2864,15 @@  discard block
 block discarded – undo
2864 2864
 
2865 2865
 add_filter('get_comments_link', 'gd_get_comments_link', 10, 2);
2866 2866
 function gd_get_comments_link($comments_link, $post_id) {
2867
-    $post_type = get_post_type($post_id);
2867
+	$post_type = get_post_type($post_id);
2868 2868
 
2869
-    $all_postypes = geodir_get_posttypes();
2870
-    if (in_array($post_type, $all_postypes)) {
2871
-        $comments_link = str_replace('#comments', '#reviews', $comments_link);
2872
-        $comments_link = str_replace('#respond', '#reviews', $comments_link);
2873
-    }
2869
+	$all_postypes = geodir_get_posttypes();
2870
+	if (in_array($post_type, $all_postypes)) {
2871
+		$comments_link = str_replace('#comments', '#reviews', $comments_link);
2872
+		$comments_link = str_replace('#respond', '#reviews', $comments_link);
2873
+	}
2874 2874
 
2875
-    return $comments_link;
2875
+	return $comments_link;
2876 2876
 }
2877 2877
 
2878 2878
 
@@ -2890,11 +2890,11 @@  discard block
 block discarded – undo
2890 2890
 function geodir_add_nav_menu_class( $args )
2891 2891
 {
2892 2892
 
2893
-        if(isset($args['menu_class'])){
2894
-            $args['menu_class'] = $args['menu_class']." gd-menu-z";
2895
-        }
2893
+		if(isset($args['menu_class'])){
2894
+			$args['menu_class'] = $args['menu_class']." gd-menu-z";
2895
+		}
2896 2896
     
2897
-    return $args;
2897
+	return $args;
2898 2898
 }
2899 2899
 
2900 2900
 add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
@@ -2911,15 +2911,15 @@  discard block
 block discarded – undo
2911 2911
  * @return string Filtered locale ID.
2912 2912
  */
2913 2913
 function geodir_wpml_filter_locale($locale) {
2914
-    global $sitepress;
2914
+	global $sitepress;
2915 2915
     
2916
-    $post_type = !empty($_REQUEST['post_type']) ? $_REQUEST['post_type'] : (!empty($_REQUEST['post']) ? get_post_type($_REQUEST['post']) : '');
2916
+	$post_type = !empty($_REQUEST['post_type']) ? $_REQUEST['post_type'] : (!empty($_REQUEST['post']) ? get_post_type($_REQUEST['post']) : '');
2917 2917
     
2918
-    if (!empty($sitepress) && $sitepress->is_post_edit_screen() && $post_type && in_array($post_type, geodir_get_posttypes()) && $current_lang = $sitepress->get_current_language()) {
2919
-        $locale = $sitepress->get_locale($current_lang);
2920
-    }
2918
+	if (!empty($sitepress) && $sitepress->is_post_edit_screen() && $post_type && in_array($post_type, geodir_get_posttypes()) && $current_lang = $sitepress->get_current_language()) {
2919
+		$locale = $sitepress->get_locale($current_lang);
2920
+	}
2921 2921
     
2922
-    return $locale;
2922
+	return $locale;
2923 2923
 }
2924 2924
 
2925 2925
 /**
@@ -2929,13 +2929,13 @@  discard block
 block discarded – undo
2929 2929
  * @package GeoDirectory
2930 2930
  */
2931 2931
 function geodir_wpml_set_filter() {
2932
-    if (!function_exists('icl_object_id') || defined('DOING_AJAX')) {
2933
-        return;
2934
-    }
2935
-    if (is_admin()) {
2936
-        //add_filter('locale', 'geodir_wpml_filter_locale', 100, 1);
2937
-    } else {
2938
-    }
2932
+	if (!function_exists('icl_object_id') || defined('DOING_AJAX')) {
2933
+		return;
2934
+	}
2935
+	if (is_admin()) {
2936
+		//add_filter('locale', 'geodir_wpml_filter_locale', 100, 1);
2937
+	} else {
2938
+	}
2939 2939
 }
2940 2940
 add_filter('plugins_loaded', 'geodir_wpml_set_filter');
2941 2941
 
@@ -2948,44 +2948,44 @@  discard block
 block discarded – undo
2948 2948
  * @return array Filtered languages.
2949 2949
  */
2950 2950
 function geodir_wpml_filter_ls_languages($languages) {
2951
-    global $gd_icl_ls_languages;
2951
+	global $gd_icl_ls_languages;
2952 2952
     
2953
-    if (geodir_is_geodir_page()) {
2954
-        if ($gd_icl_ls_languages) {
2955
-            return $languages;
2956
-        }
2953
+	if (geodir_is_geodir_page()) {
2954
+		if ($gd_icl_ls_languages) {
2955
+			return $languages;
2956
+		}
2957 2957
         
2958
-        $keep_vars = array();
2958
+		$keep_vars = array();
2959 2959
         
2960
-        if (geodir_is_page('add-listing')) {
2961
-            $keep_vars = array('listing_type', 'package_id');
2962
-        } else if (geodir_is_page('search')) {
2963
-            $keep_vars = array('geodir_search', 'stype', 'snear', 'set_location_type', 'set_location_val', 'sgeo_lat', 'sgeo_lon');
2964
-        } else if (geodir_is_page('author')) {
2965
-            $keep_vars = array('geodir_dashbord', 'stype', 'list');
2966
-        } else if (geodir_is_page('login')) {
2967
-            $keep_vars = array('forgot', 'signup');
2968
-        }        
2960
+		if (geodir_is_page('add-listing')) {
2961
+			$keep_vars = array('listing_type', 'package_id');
2962
+		} else if (geodir_is_page('search')) {
2963
+			$keep_vars = array('geodir_search', 'stype', 'snear', 'set_location_type', 'set_location_val', 'sgeo_lat', 'sgeo_lon');
2964
+		} else if (geodir_is_page('author')) {
2965
+			$keep_vars = array('geodir_dashbord', 'stype', 'list');
2966
+		} else if (geodir_is_page('login')) {
2967
+			$keep_vars = array('forgot', 'signup');
2968
+		}        
2969 2969
         
2970
-        if (!empty($keep_vars)) {
2971
-            foreach ( $languages as $code => $url) {
2972
-                $filter_url = $url['url'];
2970
+		if (!empty($keep_vars)) {
2971
+			foreach ( $languages as $code => $url) {
2972
+				$filter_url = $url['url'];
2973 2973
                 
2974
-                foreach ($keep_vars as $var) {
2975
-                    if (isset($_GET[$var]) && !is_array($_GET[$var])) {
2976
-                        $filter_url = remove_query_arg(array($var), $filter_url);
2977
-                        $filter_url = add_query_arg(array($var => $_GET[$var]), $filter_url);
2978
-                    }
2979
-                }
2974
+				foreach ($keep_vars as $var) {
2975
+					if (isset($_GET[$var]) && !is_array($_GET[$var])) {
2976
+						$filter_url = remove_query_arg(array($var), $filter_url);
2977
+						$filter_url = add_query_arg(array($var => $_GET[$var]), $filter_url);
2978
+					}
2979
+				}
2980 2980
                 
2981
-                if ($filter_url != $url['url']) {
2982
-                    $languages[$code]['url'] = $filter_url;
2983
-                }
2984
-            }
2985
-            $gd_icl_ls_languages = true;
2986
-        }
2987
-    }
2981
+				if ($filter_url != $url['url']) {
2982
+					$languages[$code]['url'] = $filter_url;
2983
+				}
2984
+			}
2985
+			$gd_icl_ls_languages = true;
2986
+		}
2987
+	}
2988 2988
 
2989
-    return $languages;
2989
+	return $languages;
2990 2990
 }
2991 2991
 add_filter( 'icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1 );
2992 2992
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 /* WP REVIEW COUNT ACTIONS */
177 177
 ////////////////////////
178 178
 
179
-add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
179
+add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
180 180
 //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
181
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
181
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
182 182
 //add_action('created_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
184 184
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
226 226
     if ($geodir_theme_location) {
227 227
         update_option('geodir_theme_location_nav', $geodir_theme_location);
228 228
     } else {
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
322 322
 
323
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
324
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
323
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
324
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
325 325
 
326 326
 // Detail page sidebar content 
327 327
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
     do_action('geodir_after_social_sharing_buttons');
422 422
     $content_html = ob_get_clean();
423 423
     if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
424
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
425
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
426 426
         /**
427 427
          * Filter the geodir_social_sharing_buttons() function content.
428 428
          *
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
             $post_id = $post->ID;
463 463
             
464 464
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
465
-                $post_id = (int)$_REQUEST['pid'];
465
+                $post_id = (int) $_REQUEST['pid'];
466 466
             }
467 467
 
468 468
             $postlink = get_permalink(geodir_add_listing_page_id());
469 469
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
470
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
470
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
471 471
         }
472 472
     }// end of if, if its a preview or not
473 473
     /**
@@ -478,8 +478,8 @@  discard block
 block discarded – undo
478 478
     do_action('geodir_after_edit_post_link');
479 479
     $content_html = ob_get_clean();
480 480
     if (trim($content_html) != '')
481
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
481
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
482
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
483 483
         /**
484 484
          * Filter the geodir_edit_post_link() function content.
485 485
          *
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
  */
501 501
 function geodir_detail_page_google_analytics()
502 502
 {
503
-    global $post,$preview;
504
-    if($preview){return '';}
503
+    global $post, $preview;
504
+    if ($preview) {return ''; }
505 505
     $package_info = array();
506 506
     $package_info = geodir_post_package_info($package_info, $post);
507 507
 
@@ -533,14 +533,14 @@  discard block
 block discarded – undo
533 533
     $hide_refresh = get_option('geodir_ga_auto_refresh');
534 534
     
535 535
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
536
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
536
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
537 537
         $page_url = urlencode($_SERVER['REQUEST_URI']);
538 538
         ?>
539 539
         <script type="text/javascript">
540 540
             var gd_gaTimeOut;
541
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
542
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
543
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
541
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
542
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
543
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
544 544
             ga_data1 = false;
545 545
             ga_data2 = false;
546 546
             ga_data3 = false;
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
             }
682 682
 
683 683
             function gdga_noResults() {
684
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
684
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
685 685
                 jQuery('#gdga-legend-container').html('');
686 686
             }
687 687
 
@@ -713,18 +713,18 @@  discard block
 block discarded – undo
713 713
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
714 714
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
715 715
 
716
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
717
-                        '<?php _e('Feb', 'geodirectory');?>',
718
-                        '<?php _e('Mar', 'geodirectory');?>',
719
-                        '<?php _e('Apr', 'geodirectory');?>',
720
-                        '<?php _e('May', 'geodirectory');?>',
721
-                        '<?php _e('Jun', 'geodirectory');?>',
722
-                        '<?php _e('Jul', 'geodirectory');?>',
723
-                        '<?php _e('Aug', 'geodirectory');?>',
724
-                        '<?php _e('Sep', 'geodirectory');?>',
725
-                        '<?php _e('Oct', 'geodirectory');?>',
726
-                        '<?php _e('Nov', 'geodirectory');?>',
727
-                        '<?php _e('Dec', 'geodirectory');?>'];
716
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
717
+                        '<?php _e('Feb', 'geodirectory'); ?>',
718
+                        '<?php _e('Mar', 'geodirectory'); ?>',
719
+                        '<?php _e('Apr', 'geodirectory'); ?>',
720
+                        '<?php _e('May', 'geodirectory'); ?>',
721
+                        '<?php _e('Jun', 'geodirectory'); ?>',
722
+                        '<?php _e('Jul', 'geodirectory'); ?>',
723
+                        '<?php _e('Aug', 'geodirectory'); ?>',
724
+                        '<?php _e('Sep', 'geodirectory'); ?>',
725
+                        '<?php _e('Oct', 'geodirectory'); ?>',
726
+                        '<?php _e('Nov', 'geodirectory'); ?>',
727
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
728 728
 
729 729
                     // Ensure the data arrays are at least as long as the labels array.
730 730
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -737,13 +737,13 @@  discard block
 block discarded – undo
737 737
                         labels : labels,
738 738
                         datasets : [
739 739
                             {
740
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
740
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
741 741
                                 fillColor : "rgba(220,220,220,0.5)",
742 742
                                 strokeColor : "rgba(220,220,220,1)",
743 743
                                 data : data2
744 744
                             },
745 745
                             {
746
-                                label: '<?php _e('This Year', 'geodirectory');?>',
746
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
747 747
                                 fillColor : "rgba(151,187,205,0.5)",
748 748
                                 strokeColor : "rgba(151,187,205,1)",
749 749
                                 data : data1
@@ -788,30 +788,30 @@  discard block
 block discarded – undo
788 788
 
789 789
                     <?php
790 790
                     // Here we list the shorthand days of the week so it can be used in translation.
791
-                    __("Mon",'geodirectory');
792
-                    __("Tue",'geodirectory');
793
-                    __("Wed",'geodirectory');
794
-                    __("Thu",'geodirectory');
795
-                    __("Fri",'geodirectory');
796
-                    __("Sat",'geodirectory');
797
-                    __("Sun",'geodirectory');
791
+                    __("Mon", 'geodirectory');
792
+                    __("Tue", 'geodirectory');
793
+                    __("Wed", 'geodirectory');
794
+                    __("Thu", 'geodirectory');
795
+                    __("Fri", 'geodirectory');
796
+                    __("Sat", 'geodirectory');
797
+                    __("Sun", 'geodirectory');
798 798
                     ?>
799 799
 
800 800
                     labels = [
801
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
802
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
803
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
804
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
805
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
806
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
807
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
801
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
802
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
803
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
804
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
805
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
806
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
807
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
808 808
                     ];
809 809
 
810 810
                     var data = {
811 811
                         labels : labels,
812 812
                         datasets : [
813 813
                             {
814
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
814
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
815 815
                                 fillColor : "rgba(220,220,220,0.5)",
816 816
                                 strokeColor : "rgba(220,220,220,1)",
817 817
                                 pointColor : "rgba(220,220,220,1)",
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
                                 data : data2
820 820
                             },
821 821
                             {
822
-                                label: '<?php _e('This Week', 'geodirectory');?>',
822
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
823 823
                                 fillColor : "rgba(151,187,205,0.5)",
824 824
                                 strokeColor : "rgba(151,187,205,1)",
825 825
                                 pointColor : "rgba(151,187,205,1)",
@@ -1026,18 +1026,18 @@  discard block
 block discarded – undo
1026 1026
         </style>
1027 1027
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1028 1028
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1029
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1029
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1030 1030
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1031
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1031
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1032 1032
             <div id="gd-active-users-container">
1033
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1033
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1034 1034
                     <b class="gd-ActiveUsers-value">0</b>
1035 1035
                 </div>
1036 1036
             </div>
1037 1037
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1038
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1039
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1040
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1038
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1039
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1040
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1041 1041
             </select>
1042 1042
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1043 1043
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1053,8 +1053,8 @@  discard block
 block discarded – undo
1053 1053
     do_action('geodir_after_google_analytics');
1054 1054
     $content_html = ob_get_clean();
1055 1055
     if (trim($content_html) != '')
1056
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1057
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1056
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1057
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1058 1058
         /**
1059 1059
          * Filter the geodir_edit_post_link() function content.
1060 1060
          *
@@ -1110,10 +1110,10 @@  discard block
 block discarded – undo
1110 1110
        
1111 1111
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1112 1112
 	   
1113
-	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1113
+	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
1114 1114
 
1115 1115
         $html .= '<span class="item">';
1116
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1116
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1117 1117
 
1118 1118
         if ($post_images) {
1119 1119
             foreach ($post_images as $img) {
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
         }
1124 1124
 
1125 1125
         if (isset($post_img) && $post_img) {
1126
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1126
+            $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />';
1127 1127
         }
1128 1128
 
1129 1129
         $html .= '</span>';
@@ -1150,9 +1150,9 @@  discard block
 block discarded – undo
1150 1150
     do_action('geodir_after_detail_page_review_rating');
1151 1151
     $content_html = ob_get_clean();
1152 1152
     if (trim($content_html) != '') {
1153
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1153
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1154 1154
     }
1155
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1155
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1156 1156
         /**
1157 1157
          * Filter the geodir_detail_page_review_rating() function content.
1158 1158
          *
@@ -1191,8 +1191,8 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
     $content_html = ob_get_clean();
1193 1193
     if (trim($content_html) != '')
1194
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1195
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1194
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1195
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1196 1196
         /**
1197 1197
          * Filter the output html for function geodir_detail_page_more_info().
1198 1198
          *
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1292 1292
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1293 1293
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1294
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1294
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1295 1295
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1296 1296
         'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1297 1297
         'geodir_map_name' => geodir_map_name(),
@@ -1315,10 +1315,10 @@  discard block
 block discarded – undo
1315 1315
     foreach ($arr_alert_msg as $key => $value) {
1316 1316
         if (!is_scalar($value))
1317 1317
             continue;
1318
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1318
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1319 1319
     }
1320 1320
 
1321
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1321
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1322 1322
     echo '<script>';
1323 1323
     echo $script;
1324 1324
     echo '</script>';
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
         $geodir_old_sidebars = get_option('geodir_sidebars');
1409 1409
         if (is_array($geodir_old_sidebars)) {
1410 1410
             foreach ($geodir_old_sidebars as $key => $val) {
1411
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1411
+                if (0 === strpos($key, 'geodir_'))// if gd widget
1412 1412
                 {
1413 1413
                     $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1414 1414
                 }
@@ -1487,7 +1487,7 @@  discard block
 block discarded – undo
1487 1487
         global $post;
1488 1488
         $term_condition = '';
1489 1489
         if (isset($_REQUEST['backandedit'])) {
1490
-            $post = (object)$gd_session->get('listing');
1490
+            $post = (object) $gd_session->get('listing');
1491 1491
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1492 1492
         }
1493 1493
 
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
                     echo 'checked="checked"';
1502 1502
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1503 1503
                        class="geodir_textfield" value="1"
1504
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1504
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1505 1505
 				</span>
1506 1506
             </div>
1507 1507
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1541,7 +1541,7 @@  discard block
 block discarded – undo
1541 1541
         /** This action is documented in geodirectory_template_actions.php */
1542 1542
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1543 1543
         
1544
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1544
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1545 1545
             $is_display = false;
1546 1546
         }
1547 1547
     }
@@ -1589,16 +1589,16 @@  discard block
 block discarded – undo
1589 1589
     global $wpdb, $plugin_prefix;
1590 1590
 	
1591 1591
 	// Remove unused virtual page
1592
-	$listings_page_id = (int)get_option('geodir_listing_page');
1592
+	$listings_page_id = (int) get_option('geodir_listing_page');
1593 1593
 	if ($listings_page_id) {
1594
-		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1594
+		$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1595 1595
         delete_option('geodir_listing_page');
1596 1596
 	}
1597 1597
 
1598 1598
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1599 1599
         $wpdb->query(
1600 1600
             $wpdb->prepare(
1601
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1601
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1602 1602
                 array('1', '1', 'admin')
1603 1603
             )
1604 1604
         );
@@ -1606,9 +1606,9 @@  discard block
 block discarded – undo
1606 1606
 
1607 1607
         /* --- terms meta value set --- */
1608 1608
 
1609
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1609
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1610 1610
 
1611
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1611
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1612 1612
 
1613 1613
         if (!empty($options_data)) {
1614 1614
 
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
 
1617 1617
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1618 1618
 
1619
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1619
+                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1620 1620
 
1621 1621
                 if (!empty($taxonomies_data)) {
1622 1622
 
@@ -1625,17 +1625,17 @@  discard block
 block discarded – undo
1625 1625
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1626 1626
                         $post_type = $taxObject->object_type[0];
1627 1627
 
1628
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1628
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1629 1629
 
1630
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1630
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1631 1631
 
1632 1632
                         if ($duplicate_data) {
1633 1633
 
1634
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1634
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1635 1635
 
1636 1636
                         } else {
1637 1637
 
1638
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1638
+                            $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1639 1639
 
1640 1640
                         }
1641 1641
 
@@ -1669,14 +1669,14 @@  discard block
 block discarded – undo
1669 1669
 
1670 1670
     global $wpdb, $table_prefix;
1671 1671
 
1672
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1672
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1673 1673
 
1674 1674
     if ($slug_exists) {
1675 1675
 
1676 1676
         $suffix = 1;
1677 1677
         do {
1678
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1679
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1678
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1679
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1680 1680
             $suffix++;
1681 1681
         } while ($location_slug_check && $suffix < 100);
1682 1682
 
@@ -1730,7 +1730,7 @@  discard block
 block discarded – undo
1730 1730
 
1731 1731
         $suffix = 1;
1732 1732
         do {
1733
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1733
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1734 1734
 
1735 1735
             /** This action is documented in geodirectory_hooks_actions.php */
1736 1736
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1742,7 +1742,7 @@  discard block
 block discarded – undo
1742 1742
 
1743 1743
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1744 1744
 
1745
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1745
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1746 1746
 
1747 1747
     }
1748 1748
 	
@@ -1751,18 +1751,18 @@  discard block
 block discarded – undo
1751 1751
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1752 1752
 	
1753 1753
 	$post_types = geodir_get_posttypes();
1754
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1755
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1754
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1755
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1756 1756
 		
1757 1757
 		if (!empty($posts_obj)) {
1758 1758
 			foreach ($posts_obj as $post_obj) {
1759 1759
 				$post_id = $post_obj->object_id;
1760 1760
 				
1761
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1761
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1762 1762
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1763 1763
 				
1764
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1765
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1764
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1765
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1766 1766
 			}
1767 1767
 		}
1768 1768
 	}
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1797 1797
         return $slug_exists = true;
1798 1798
 
1799
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1799
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1800 1800
         return $slug_exists = true;
1801 1801
 
1802 1802
     return $slug_exists;
@@ -1836,43 +1836,43 @@  discard block
 block discarded – undo
1836 1836
 
1837 1837
 
1838 1838
     $gd_page = '';
1839
-    if(geodir_is_page('home')){
1839
+    if (geodir_is_page('home')) {
1840 1840
         $gd_page = 'home';
1841 1841
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1842 1842
     }
1843
-    elseif(geodir_is_page('detail')){
1843
+    elseif (geodir_is_page('detail')) {
1844 1844
         $gd_page = 'detail';
1845 1845
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1846 1846
     }
1847
-    elseif(geodir_is_page('pt')){
1847
+    elseif (geodir_is_page('pt')) {
1848 1848
         $gd_page = 'pt';
1849 1849
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1850 1850
     }
1851
-    elseif(geodir_is_page('listing')){
1851
+    elseif (geodir_is_page('listing')) {
1852 1852
         $gd_page = 'listing';
1853 1853
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1854 1854
     }
1855
-    elseif(geodir_is_page('location')){
1855
+    elseif (geodir_is_page('location')) {
1856 1856
         $gd_page = 'location';
1857 1857
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1858 1858
     }
1859
-    elseif(geodir_is_page('search')){
1859
+    elseif (geodir_is_page('search')) {
1860 1860
         $gd_page = 'search';
1861 1861
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1862 1862
     }
1863
-    elseif(geodir_is_page('add-listing')){
1863
+    elseif (geodir_is_page('add-listing')) {
1864 1864
         $gd_page = 'add-listing';
1865 1865
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1866 1866
     }
1867
-    elseif(geodir_is_page('author')){
1867
+    elseif (geodir_is_page('author')) {
1868 1868
         $gd_page = 'author';
1869 1869
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1870 1870
     }
1871
-    elseif(geodir_is_page('login')){
1871
+    elseif (geodir_is_page('login')) {
1872 1872
         $gd_page = 'login';
1873 1873
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1874 1874
     }
1875
-    elseif(geodir_is_page('listing-success')){
1875
+    elseif (geodir_is_page('listing-success')) {
1876 1876
         $gd_page = 'listing-success';
1877 1877
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1878 1878
     }
@@ -1904,12 +1904,12 @@  discard block
 block discarded – undo
1904 1904
 
1905 1905
     if (!get_option('geodir_set_post_attachments')) {
1906 1906
 
1907
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1908
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1907
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1908
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1909 1909
 
1910 1910
         $all_postypes = geodir_get_posttypes();
1911 1911
 
1912
-        foreach($all_postypes as $post_type){
1912
+        foreach ($all_postypes as $post_type) {
1913 1913
             $args = array(
1914 1914
                 'posts_per_page' => -1,
1915 1915
                 'post_type' => $post_type,
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
 {
2004 2004
     $user_id = get_current_user_id();
2005 2005
 
2006
-    if(!$user_id){return $post;}
2006
+    if (!$user_id) {return $post; }
2007 2007
 
2008 2008
     $gd_post_types = geodir_get_posttypes();
2009 2009
 
@@ -2112,7 +2112,7 @@  discard block
 block discarded – undo
2112 2112
 
2113 2113
         if (array_key_exists('post_video', $tabs_arr)) {
2114 2114
 
2115
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2115
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2116 2116
 
2117 2117
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2118 2118
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
 
2121 2121
         if (array_key_exists('special_offers', $tabs_arr)) {
2122 2122
 
2123
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2123
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2124 2124
 
2125 2125
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2126 2126
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2141,7 +2141,7 @@  discard block
 block discarded – undo
2141 2141
  */
2142 2142
 function geodir_remove_template_redirect_actions()
2143 2143
 {
2144
-    if (geodir_is_page('login')){
2144
+    if (geodir_is_page('login')) {
2145 2145
         remove_all_actions('template_redirect');
2146 2146
         remove_action('init', 'avia_modify_front', 10);
2147 2147
     }
@@ -2188,25 +2188,25 @@  discard block
 block discarded – undo
2188 2188
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2189 2189
 
2190 2190
         $wpdb->query(
2191
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2191
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2192 2192
                 array($post_id, $split_img_file_path)
2193 2193
             )
2194 2194
         );
2195 2195
 
2196 2196
         $attachment_data = $wpdb->get_row(
2197
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2197
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2198 2198
                 array($post_id)
2199 2199
             )
2200 2200
         );
2201 2201
 
2202 2202
         if (!empty($attachment_data)) {
2203
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2203
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2204 2204
         }
2205 2205
 
2206 2206
 
2207
-        $table_name = $plugin_prefix . $post_type . '_detail';
2207
+        $table_name = $plugin_prefix.$post_type.'_detail';
2208 2208
 
2209
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2209
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2210 2210
 
2211 2211
         geodir_set_wp_featured_image($post_id);
2212 2212
 
@@ -2234,9 +2234,9 @@  discard block
 block discarded – undo
2234 2234
 
2235 2235
     foreach ($all_postypes as $posttype) {
2236 2236
 
2237
-        $tablename = $plugin_prefix . $posttype . '_detail';
2237
+        $tablename = $plugin_prefix.$posttype.'_detail';
2238 2238
 
2239
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2239
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2240 2240
 
2241 2241
         if (!empty($get_post_data)) {
2242 2242
 
@@ -2244,7 +2244,7 @@  discard block
 block discarded – undo
2244 2244
 
2245 2245
                 $post_id = $data->post_id;
2246 2246
 
2247
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2247
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2248 2248
 
2249 2249
                 if (!empty($attachment_data)) {
2250 2250
 
@@ -2261,22 +2261,22 @@  discard block
 block discarded – undo
2261 2261
 
2262 2262
                         $file_name = $file_info['basename'];
2263 2263
 
2264
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2264
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2265 2265
 
2266 2266
                         if (!file_exists($img_arr['path'])) {
2267 2267
 
2268
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2268
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2269 2269
 
2270 2270
                         }
2271 2271
 
2272 2272
                     }
2273 2273
 
2274
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2274
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2275 2275
 
2276 2276
                     if (!empty($attachment_data)) {
2277 2277
 
2278 2278
                         if ($attachment_data->ID)
2279
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2279
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2280 2280
 
2281 2281
                     } else {
2282 2282
 
@@ -2290,7 +2290,7 @@  discard block
 block discarded – undo
2290 2290
 
2291 2291
                     }
2292 2292
 
2293
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2293
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2294 2294
 
2295 2295
                     geodir_set_wp_featured_image($post_id);
2296 2296
 
@@ -2319,7 +2319,7 @@  discard block
 block discarded – undo
2319 2319
 {
2320 2320
 
2321 2321
     if (!get_option('geodir_default_rating_star_icon')) {
2322
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2322
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2323 2323
     }
2324 2324
 
2325 2325
 }
@@ -2336,10 +2336,10 @@  discard block
 block discarded – undo
2336 2336
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2337 2337
  * @return array User listing count for each post type.
2338 2338
  */
2339
-function geodir_user_post_listing_count($user_id=null)
2339
+function geodir_user_post_listing_count($user_id = null)
2340 2340
 {
2341 2341
     global $wpdb, $plugin_prefix, $current_user;
2342
-    if(!$user_id){
2342
+    if (!$user_id) {
2343 2343
         $user_id = $current_user->ID;
2344 2344
     }
2345 2345
 
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
     $user_listing = array();
2351 2351
     if (is_array($all_posts) && !empty($all_posts)) {
2352 2352
         foreach ($all_posts as $ptype) {
2353
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2353
+            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2354 2354
 
2355 2355
             if ($total_posts > 0) {
2356 2356
                 $user_listing[$ptype] = $total_posts;
@@ -2391,19 +2391,19 @@  discard block
 block discarded – undo
2391 2391
 
2392 2392
         $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2393 2393
         //remove video and special offers if it is already set to show
2394
-        if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2394
+        if (isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']) {
2395 2395
             $unset_video = true;
2396 2396
         }
2397 2397
 
2398
-        if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2398
+        if (isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']) {
2399 2399
             $unset_special_offers = true;
2400 2400
         }
2401
-        if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2402
-            foreach($custom_fields as $key => $custom_field){
2403
-                if($custom_field['name']=='geodir_video' && isset($unset_video)){
2401
+        if (isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)) {
2402
+            foreach ($custom_fields as $key => $custom_field) {
2403
+                if ($custom_field['name'] == 'geodir_video' && isset($unset_video)) {
2404 2404
                     unset($custom_fields[$key]);
2405 2405
                 }
2406
-                if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2406
+                if ($custom_field['name'] == 'geodir_special_offers' && isset($unset_special_offers)) {
2407 2407
                     unset($custom_fields[$key]);
2408 2408
                 }
2409 2409
             }
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
                     $post->{$field_name} = $_REQUEST[$field_name];
2421 2421
                 }
2422 2422
 
2423
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2423
+                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
2424 2424
                     if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2425 2425
                         continue;
2426 2426
                     }
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
                     $post->{$field_name} = $_REQUEST[$field_name];
2454 2454
                 }
2455 2455
 
2456
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2456
+                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
2457 2457
                     $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2458 2458
                     $site_title = trim($field['site_title']);
2459 2459
                     $type = $field;
@@ -2469,21 +2469,21 @@  discard block
 block discarded – undo
2469 2469
                         $variables_array['label'] = __($type['site_title'], 'geodirectory');
2470 2470
                         $variables_array['value'] = '';
2471 2471
                         $variables_array['value'] = $post->{$type['htmlvar_name']};
2472
-                    }else{
2472
+                    } else {
2473 2473
                         $i = 0;
2474 2474
                         $fieldset_count++;
2475 2475
                         $field_set_start = 1;
2476
-                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2476
+                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2477 2477
                         $fieldset_arr[$fieldset_count]['label'] = $label;
2478 2478
                     }
2479 2479
 
2480 2480
 
2481
-                    if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2481
+                    if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
2482 2482
                     $type = stripslashes_deep($type); // strip slashes
2483
-                    if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2483
+                    if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
2484 2484
                     $html = '';
2485 2485
                     $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2486
-                    if($html_var=='post'){$html_var='post_address';}
2486
+                    if ($html_var == 'post') {$html_var = 'post_address'; }
2487 2487
                     $field_icon = geodir_field_icon_proccess($type);
2488 2488
                     $filed_type = $type['type'];
2489 2489
 
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
                      * @param string $fields_location The location the field is to be show.
2497 2497
                      * @param array $type The array of field values.
2498 2498
                      */
2499
-                    $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2499
+                    $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
2500 2500
 
2501 2501
 
2502 2502
                     /**
@@ -2542,7 +2542,7 @@  discard block
 block discarded – undo
2542 2542
                                  * @param string $htmlvar_name The field HTML var name.
2543 2543
                                  */
2544 2544
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2545
-                                'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2545
+                                'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>'
2546 2546
                             );
2547 2547
                         }
2548 2548
                     } else {
@@ -2604,7 +2604,7 @@  discard block
 block discarded – undo
2604 2604
             }
2605 2605
             $status .= ")</strong>";
2606 2606
 
2607
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2607
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
2608 2608
         }
2609 2609
     }
2610 2610
 
@@ -2688,7 +2688,7 @@  discard block
 block discarded – undo
2688 2688
 function geodir_no_rating_comment_text($content, $comment = '')
2689 2689
 {
2690 2690
     if (!is_admin()) {
2691
-        return '<div class="description">' . $content . '</div>';
2691
+        return '<div class="description">'.$content.'</div>';
2692 2692
     } else {
2693 2693
         return $content;
2694 2694
     }
@@ -2766,7 +2766,7 @@  discard block
 block discarded – undo
2766 2766
         $classes[] = 'gd-no-rating';
2767 2767
     }
2768 2768
     
2769
-    $classes[] = 'gd-map-' . geodir_map_name();
2769
+    $classes[] = 'gd-map-'.geodir_map_name();
2770 2770
 
2771 2771
     return $classes;
2772 2772
 }
@@ -2786,7 +2786,7 @@  discard block
 block discarded – undo
2786 2786
         $class .= ' gd-no-rating';
2787 2787
     }
2788 2788
     
2789
-    $class .= ' gd-map-' . geodir_map_name();
2789
+    $class .= ' gd-map-'.geodir_map_name();
2790 2790
 
2791 2791
     return $class;
2792 2792
 }
@@ -2821,7 +2821,7 @@  discard block
 block discarded – undo
2821 2821
  * @return array Translation texts.
2822 2822
  */
2823 2823
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
2824
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2824
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
2825 2825
 
2826 2826
     $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
2827 2827
 
@@ -2887,17 +2887,17 @@  discard block
 block discarded – undo
2887 2887
  * @param array $args The array of menu arguments.
2888 2888
  * @return array The modified arguments.
2889 2889
  */
2890
-function geodir_add_nav_menu_class( $args )
2890
+function geodir_add_nav_menu_class($args)
2891 2891
 {
2892 2892
 
2893
-        if(isset($args['menu_class'])){
2893
+        if (isset($args['menu_class'])) {
2894 2894
             $args['menu_class'] = $args['menu_class']." gd-menu-z";
2895 2895
         }
2896 2896
     
2897 2897
     return $args;
2898 2898
 }
2899 2899
 
2900
-add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
2900
+add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class');
2901 2901
 
2902 2902
 /**
2903 2903
  * Filters WordPress locale ID.
@@ -2968,7 +2968,7 @@  discard block
 block discarded – undo
2968 2968
         }        
2969 2969
         
2970 2970
         if (!empty($keep_vars)) {
2971
-            foreach ( $languages as $code => $url) {
2971
+            foreach ($languages as $code => $url) {
2972 2972
                 $filter_url = $url['url'];
2973 2973
                 
2974 2974
                 foreach ($keep_vars as $var) {
@@ -2988,4 +2988,4 @@  discard block
 block discarded – undo
2988 2988
 
2989 2989
     return $languages;
2990 2990
 }
2991
-add_filter( 'icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1 );
2992 2991
\ No newline at end of file
2992
+add_filter('icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1);
2993 2993
\ No newline at end of file
Please login to merge, or discard this patch.