Test Failed
Push — master ( 7a266a...e0908c )
by Stiofan
55:02
created
geodirectory-templates/listing-listview.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 ?>
76 76
 
77 77
                 <li class="clearfix <?php if ($grid_view_class) {
78
-                    echo 'geodir-gridview ' . $grid_view_class;
78
+                    echo 'geodir-gridview '.$grid_view_class;
79 79
                 } else {
80 80
                     echo ' geodir-listview ';
81 81
                 } ?> <?php if ($post_view_class) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                                     echo geodir_show_badges_on_image('featured', $post, get_permalink());
117 117
                                 }
118 118
 
119
-                                $geodir_days_new = (int)get_option('geodir_listing_new_days');
119
+                                $geodir_days_new = (int) get_option('geodir_listing_new_days');
120 120
 
121 121
                                 if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
122 122
                                     echo geodir_show_badges_on_image('new', $post, get_permalink());
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
                             do_action('geodir_after_listing_post_title', 'listview', $post); ?>
174 174
 
175 175
                             <?php /// Print Distance
176
-                            if ( ( isset( $_REQUEST['sgeo_lat'] ) && $_REQUEST['sgeo_lat'] != '' ) || ( $related_nearest && $related_parent_lat ) ) {
177
-                                if ( $related_nearest && $related_parent_lat ) {
176
+                            if ((isset($_REQUEST['sgeo_lat']) && $_REQUEST['sgeo_lat'] != '') || ($related_nearest && $related_parent_lat)) {
177
+                                if ($related_nearest && $related_parent_lat) {
178 178
                                     $startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
179 179
                                 } else {
180 180
                                     $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
                                         } else {
198 198
                                             $uom = __('meters', 'geodirectory');
199 199
                                         }
200
-                                        echo round($distance) . ' ' . $uom . '<br />';
200
+                                        echo round($distance).' '.$uom.'<br />';
201 201
                                     } else {
202 202
                                         if ($uom == 'miles') {
203 203
                                             $uom = __('miles', 'geodirectory');
204 204
                                         } else {
205 205
                                             $uom = __('km', 'geodirectory');
206 206
                                         }
207
-                                        echo round($distance, 2) . ' ' . $uom . '<br />';
207
+                                        echo round($distance, 2).' '.$uom.'<br />';
208 208
                                     }
209 209
                                     ?>
210 210
                                 </h3>
@@ -234,13 +234,13 @@  discard block
 block discarded – undo
234 234
                                  */
235 235
                                 $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
236 236
                                 if ($show_listing_excerpt) {
237
-                                    if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
238
-                                        $content_out = geodir_max_excerpt( $character_count );
237
+                                    if (isset($character_count) && ($character_count || $character_count == '0')) {
238
+                                        $content_out = geodir_max_excerpt($character_count);
239 239
                                     } else {
240 240
                                         $content_out = get_the_excerpt();
241 241
                                     }
242
-                                    if ( ! empty( $content_out ) ) {
243
-                                        echo "<p>" . $content_out . "</p>";
242
+                                    if (!empty($content_out)) {
243
+                                        echo "<p>".$content_out."</p>";
244 244
                                     }
245 245
                                 }
246 246
                                 ?></div>
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                          * @param object $post The post object.
265 265
                          * @param string $view The view type, default 'listing'.
266 266
                          */
267
-                        do_action( 'geodir_after_listing_content', $post, 'listing' ); ?>
267
+                        do_action('geodir_after_listing_content', $post, 'listing'); ?>
268 268
                         <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'listing'); ?>">
269 269
                             <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'listing'); ?>">
270 270
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                                  * @param object $post The post object.
277 277
                                  * @param string $view The view type, default 'listing'.
278 278
                                  */
279
-                                do_action( 'geodir_before_review_html', $post, 'listing' );
279
+                                do_action('geodir_before_review_html', $post, 'listing');
280 280
 
281 281
                                 $review_show = geodir_is_reviews_show('listview');
282 282
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                                  *
320 320
                                  * @since 1.0.0
321 321
                                  */
322
-                                do_action( 'geodir_after_favorite_html', $post->ID, 'listing' );
322
+                                do_action('geodir_after_favorite_html', $post->ID, 'listing');
323 323
 
324 324
 
325 325
                                 /**
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                                  * @param int $post->ID The post id.
331 331
                                  * @param object $post The post object.
332 332
                                  */
333
-                                do_action( 'geodir_listing_after_pinpoint', $post->ID ,$post);
333
+                                do_action('geodir_listing_after_pinpoint', $post->ID, $post);
334 334
 
335 335
                                 if ($post->post_author == get_current_user_id()) { ?>
336 336
                                     <?php
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
                                                    title="<?php _e('Edit Listing', 'geodirectory'); ?>">
360 360
                                                     <?php
361 361
                                                     $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fas fa-edit');
362
-                                                    echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
362
+                                                    echo '<i class="'.$geodir_listing_edit_icon.'"></i>';
363 363
                                                     ?>
364 364
                                                     <?php _e('Edit', 'geodirectory'); ?>
365 365
                                                 </a>
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                                                    title="<?php _e('Delete Listing', 'geodirectory'); ?>">
368 368
                                                     <?php
369 369
                                                     $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fas fa-times');
370
-                                                    echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
370
+                                                    echo '<i class="'.$geodir_listing_delete_icon.'"></i>';
371 371
                                                     ?>
372 372
                                                     <?php _e('Delete', 'geodirectory'); ?>
373 373
                                                 </a>
Please login to merge, or discard this patch.
geodirectory-templates/widget-listing-listview.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             /** This action is documented in geodirectory-templates/listing-listview.php */
30 30
             do_action('geodir_before_listing_post_listview');
31 31
             $all_postypes = geodir_get_posttypes();
32
-            $geodir_days_new = (int)get_option('geodir_listing_new_days');
32
+            $geodir_days_new = (int) get_option('geodir_listing_new_days');
33 33
             foreach ($widget_listings as $widget_listing) {
34 34
                 global $gd_widget_listing_type;
35 35
                 $post = $widget_listing;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
47 47
                 ?>
48 48
                 <li class="clearfix <?php if ($grid_view_class) {
49
-                    echo 'geodir-gridview ' . $grid_view_class;
49
+                    echo 'geodir-gridview '.$grid_view_class;
50 50
                 } else {
51 51
                     echo ' geodir-listview ';
52 52
                 } ?> <?php if ($post_view_class) {
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
                             /** This action is documented in geodirectory-templates/listing-listview.php */
99 99
                             do_action('geodir_after_listing_post_title', 'listview', $post); ?>
100 100
                             <?php /// Print Distance
101
-                            if ( ( isset( $_REQUEST['sgeo_lat'] ) && $_REQUEST['sgeo_lat'] != '' ) || ( $related_nearest && $related_parent_lat ) ) {
102
-                                if ( $related_nearest && $related_parent_lat ) {
101
+                            if ((isset($_REQUEST['sgeo_lat']) && $_REQUEST['sgeo_lat'] != '') || ($related_nearest && $related_parent_lat)) {
102
+                                if ($related_nearest && $related_parent_lat) {
103 103
                                     $startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
104 104
                                 } else {
105 105
                                     $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                                         } else {
122 122
                                             $uom = __('meters', 'geodirectory');
123 123
                                         }
124
-                                        echo round($distance) . ' ' . __($uom, 'geodirectory') . '
124
+                                        echo round($distance).' '.__($uom, 'geodirectory').'
125 125
 			<br />
126 126
 			';
127 127
                                     } else {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                                         } else {
131 131
                                             $uom = __('km', 'geodirectory');
132 132
                                         }
133
-                                        echo round($distance, 2) . ' ' . __($uom, 'geodirectory') . '
133
+                                        echo round($distance, 2).' '.__($uom, 'geodirectory').'
134 134
 			<br />
135 135
 			';
136 136
                                     }
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
                                      */
155 155
                                     $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'widget', $post);
156 156
                                     if ($show_listing_excerpt) {
157
-                                        if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
158
-                                            $content_out = geodir_max_excerpt( $character_count );
157
+                                        if (isset($character_count) && ($character_count || $character_count == '0')) {
158
+                                            $content_out = geodir_max_excerpt($character_count);
159 159
                                         } else {
160 160
                                             $content_out = get_the_excerpt();
161 161
                                         }
162
-                                        if ( ! empty( $content_out ) ) {
163
-                                            echo "<p>" . $content_out . "</p>";
162
+                                        if (!empty($content_out)) {
163
+                                            echo "<p>".$content_out."</p>";
164 164
                                         }
165 165
                                     }
166 166
                                     ?>
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                          * @param object $post The post object.
180 180
                          * @param string $view The view type, default 'widget'.
181 181
                          */
182
-                        do_action( 'geodir_after_listing_content', $post, 'widget' ); ?>
182
+                        do_action('geodir_after_listing_content', $post, 'widget'); ?>
183 183
                         <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'widget'); ?>">
184 184
                             <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'widget'); ?>">
185 185
                                 <?php
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
                                  * @param object $post The post object.
191 191
                                  * @param string $view The view type, default 'widget'.
192 192
                                  */
193
-                                do_action( 'geodir_before_review_html', $post, 'widget' );
193
+                                do_action('geodir_before_review_html', $post, 'widget');
194 194
                                 $review_show = geodir_is_reviews_show('listview');
195 195
                                 if ($review_show) {
196 196
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                                  *
216 216
                                  * @since 1.0.0
217 217
                                  */
218
-                                do_action( 'geodir_after_favorite_html', $post->ID, 'widget' );
218
+                                do_action('geodir_after_favorite_html', $post->ID, 'widget');
219 219
 
220 220
                                 if ($post->post_author == get_current_user_id()) {
221 221
                                     $addplacelink = get_permalink(geodir_add_listing_page_id());
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                        title="<?php _e('Edit Listing', 'geodirectory'); ?>">
236 236
                         <?php
237 237
                         $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fas fa-edit');
238
-                        echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
238
+                        echo '<i class="'.$geodir_listing_edit_icon.'"></i>';
239 239
                         ?>
240 240
                         <?php _e('Edit', 'geodirectory'); ?>
241 241
                     </a>
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                        title="<?php _e('Delete Listing', 'geodirectory'); ?>">
244 244
                         <?php
245 245
                         $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fas fa-times');
246
-                        echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
246
+                        echo '<i class="'.$geodir_listing_delete_icon.'"></i>';
247 247
                         ?>
248 248
                         <?php _e('Delete', 'geodirectory'); ?>
249 249
                     </a>
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_predefined.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @package GeoDirectory
16 16
  * @see `geodir_custom_field_save` for array details.
17 17
  */
18
-function geodir_custom_fields_predefined($post_type=''){
18
+function geodir_custom_fields_predefined($post_type = '') {
19 19
 
20 20
     $custom_fields = array();
21 21
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             'default_value'       =>  '',
76 76
             'show_in' 	          =>  '[detail],[listing]',
77 77
             'is_required'         =>  true,
78
-            'option_values'       =>  __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'),
78
+            'option_values'       =>  __('Select Status/,For Sale,For Rent,Sold,Let', 'geodirectory'),
79 79
             'validation_pattern'  =>  '',
80 80
             'validation_msg'      =>  '',
81 81
             'required_msg'        =>  '',
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             'default_value'       =>  '',
105 105
             'show_in' 	          =>  '[detail],[listing]',
106 106
             'is_required'         =>  true,
107
-            'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
107
+            'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'),
108 108
             'validation_pattern'  =>  '',
109 109
             'validation_msg'      =>  '',
110 110
             'required_msg'        =>  '',
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             'default_value'       =>  '',
134 134
             'show_in' 	          =>  '[detail],[listing]',
135 135
             'is_required'         =>  true,
136
-            'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'),
136
+            'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage', 'geodirectory'),
137 137
             'validation_pattern'  =>  '',
138 138
             'validation_msg'      =>  '',
139 139
             'required_msg'        =>  '',
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             'default_value'       =>  '',
163 163
             'show_in' 	          =>  '[detail],[listing]',
164 164
             'is_required'         =>  true,
165
-            'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
165
+            'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
166 166
             'validation_pattern'  =>  '',
167 167
             'validation_msg'      =>  '',
168 168
             'required_msg'        =>  '',
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
             'default_value'       =>  '',
192 192
             'show_in' 	          =>  '[detail],[listing]',
193 193
             'is_required'         =>  true,
194
-            'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
194
+            'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
195 195
             'validation_pattern'  =>  '',
196 196
             'validation_msg'      =>  '',
197 197
             'required_msg'        =>  '',
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             'default_value'       =>  '',
249 249
             'show_in' 	          =>  '[detail],[listing]',
250 250
             'is_required'         =>  true,
251
-            'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
251
+            'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'),
252 252
             'validation_pattern'  =>  '',
253 253
             'validation_msg'      =>  '',
254 254
             'required_msg'        =>  '',
@@ -328,15 +328,15 @@  discard block
 block discarded – undo
328 328
         'defaults'    => array(
329 329
             'data_type'           =>  'VARCHAR',
330 330
             'admin_title'         =>  __('Job Type', 'geodirectory'),
331
-            'site_title'          =>  __('Job Type','geodirectory'),
332
-            'admin_desc'          =>  __('Select the type of job.','geodirectory'),
331
+            'site_title'          =>  __('Job Type', 'geodirectory'),
332
+            'admin_desc'          =>  __('Select the type of job.', 'geodirectory'),
333 333
             'htmlvar_name'        =>  'job_type',
334 334
             'is_active'           =>  true,
335 335
             'for_admin_use'       =>  false,
336 336
             'default_value'       =>  '',
337 337
             'show_in' 	          =>  '[detail],[listing]',
338 338
             'is_required'         =>  true,
339
-            'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'),
339
+            'option_values'       =>  __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other', 'geodirectory'),
340 340
             'validation_pattern'  =>  '',
341 341
             'validation_msg'      =>  '',
342 342
             'required_msg'        =>  '',
@@ -356,16 +356,16 @@  discard block
 block discarded – undo
356 356
         'description' =>  __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'),
357 357
         'defaults'    => array(
358 358
             'data_type'           =>  'VARCHAR',
359
-            'admin_title'         =>  __('Job Sector','geodirectory'),
360
-            'site_title'          =>  __('Job Sector','geodirectory'),
361
-            'admin_desc'          =>  __('Select the job sector.','geodirectory'),
359
+            'admin_title'         =>  __('Job Sector', 'geodirectory'),
360
+            'site_title'          =>  __('Job Sector', 'geodirectory'),
361
+            'admin_desc'          =>  __('Select the job sector.', 'geodirectory'),
362 362
             'htmlvar_name'        =>  'job_sector',
363 363
             'is_active'           =>  true,
364 364
             'for_admin_use'       =>  false,
365 365
             'default_value'       =>  '',
366 366
             'show_in' 	          =>  '[detail]',
367 367
             'is_required'         =>  true,
368
-            'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'),
368
+            'option_values'       =>  __('Select Sector/,Private Sector,Public Sector,Agencies', 'geodirectory'),
369 369
             'validation_pattern'  =>  '',
370 370
             'validation_msg'      =>  '',
371 371
             'required_msg'        =>  '',
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
     /**
381 381
      * @see `geodir_custom_fields`
382 382
      */
383
-    return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type);
383
+    return apply_filters('geodir_custom_fields_predefined', $custom_fields, $post_type);
384 384
 }
385 385
 
386 386
 
@@ -394,11 +394,11 @@  discard block
 block discarded – undo
394 394
  * @since 1.6.9
395 395
  * @return string The html to output.
396 396
  */
397
-function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){
397
+function geodir_predefined_custom_field_output_twitter_feed($html, $location, $cf) {
398 398
     global $post;
399 399
 
400 400
 
401
-    if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
401
+    if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
402 402
 
403 403
         $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
404 404
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         }
414 414
 
415 415
 
416
-        $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
416
+        $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">';
417 417
 
418 418
         $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>';
419 419
         $html .= '</div>';
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 
423 423
     return $html;
424 424
 }
425
-add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3);
425
+add_filter('geodir_custom_field_output_text_key_twitter_feed', 'geodir_predefined_custom_field_output_twitter_feed', 10, 3);
426 426
 
427 427
 /**
428 428
  * Filter the get_directions custom field output to show a link.
@@ -434,38 +434,38 @@  discard block
 block discarded – undo
434 434
  * @since 1.6.9
435 435
  * @return string The html to output.
436 436
  */
437
-function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) {
437
+function geodir_predefined_custom_field_output_get_directions($html, $location, $cf) {
438 438
     global $post;
439 439
 
440 440
 
441
-    if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){
441
+    if (isset($post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset($post->post_latitude) && $post->post_latitude) {
442 442
 
443
-        $field_icon = geodir_field_icon_proccess( $cf );
444
-        if ( strpos( $field_icon, 'http' ) !== false ) {
443
+        $field_icon = geodir_field_icon_proccess($cf);
444
+        if (strpos($field_icon, 'http') !== false) {
445 445
             $field_icon_af = '';
446
-        } elseif ( $field_icon == '' ) {
446
+        } elseif ($field_icon == '') {
447 447
             $field_icon_af = '<i class="fas fa-location-arrow"></i>';
448 448
         } else {
449 449
             $field_icon_af = $field_icon;
450 450
             $field_icon    = '';
451 451
         }
452 452
 
453
-        $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' );
453
+        $link_text = isset($post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __('Get Directions', 'geodirectory');
454 454
 
455
-        $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">';
455
+        $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">';
456 456
 
457
-        if(isset( $cf['field_icon'] ) && $cf['field_icon']){
457
+        if (isset($cf['field_icon']) && $cf['field_icon']) {
458 458
             $html .= $field_icon_af;
459 459
         }
460 460
 
461 461
         // We use maps.apple.com here because it will handle redirects nicely in most cases
462
-        $html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>';
462
+        $html .= '<a href="https://maps.apple.com/?daddr='.$post->post_latitude.','.$post->post_longitude.'" target="_blank" >'.$link_text.'</a>';
463 463
         $html .= '</div>';
464 464
 
465
-    }else{
466
-        $html ='';
465
+    } else {
466
+        $html = '';
467 467
     }
468 468
 
469 469
     return $html;
470 470
 }
471
-add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3);
471
+add_filter('geodir_custom_field_output_text_key_get_directions', 'geodir_predefined_custom_field_output_get_directions', 10, 3);
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_functions.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
     if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array)) {
56 56
 
57
-        if(isset($map_jason[$post->ID])){return null;}
57
+        if (isset($map_jason[$post->ID])) {return null; }
58 58
 
59 59
         $srcharr = array("'", "/", "-", '"', '\\');
60 60
         $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
61 61
 
62
-        $default_category = isset($post->default_category) ? $post->default_category : geodir_get_post_meta($post->ID,'default_category');
62
+        $default_category = isset($post->default_category) ? $post->default_category : geodir_get_post_meta($post->ID, 'default_category');
63 63
 
64 64
         $geodir_cat_icons = geodir_get_term_icon();
65 65
         $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$default_category]) ? $geodir_cat_icons[$default_category] : '';
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $title = str_replace($srcharr, $replarr, $post_title);
69 69
 
70 70
         if (is_ssl()) {
71
-            $icon = str_replace("http:","https:",$icon );
71
+            $icon = str_replace("http:", "https:", $icon);
72 72
         }
73 73
         
74 74
         if ($icon != '') {
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
             $icon_size = array('w' => 36, 'h' => 45);
85 85
         }
86 86
 
87
-        $post_latitude = isset($post->post_latitude) ? $post->post_latitude : geodir_get_post_meta($post->ID,'post_latitude');
88
-        $post_longitude = isset($post->post_longitude) ? $post->post_longitude : geodir_get_post_meta($post->ID,'post_longitude');
87
+        $post_latitude = isset($post->post_latitude) ? $post->post_latitude : geodir_get_post_meta($post->ID, 'post_latitude');
88
+        $post_longitude = isset($post->post_longitude) ? $post->post_longitude : geodir_get_post_meta($post->ID, 'post_longitude');
89 89
 
90 90
 
91
-        $post_json = '{"id":"' . $post->ID
92
-                     . '","t": "' . $title
93
-                     . '","lt": "' . $post_latitude
94
-                     . '","ln": "' . $post_longitude
95
-                     . '","mk_id":"' . $post->ID . '_' . $default_category
96
-                     . '","i":"' . $icon
97
-                     . '","w":"' . $icon_size['w']
98
-                     . '","h":"' . $icon_size['h'] . '"}';
91
+        $post_json = '{"id":"'.$post->ID
92
+                     . '","t": "'.$title
93
+                     . '","lt": "'.$post_latitude
94
+                     . '","ln": "'.$post_longitude
95
+                     . '","mk_id":"'.$post->ID.'_'.$default_category
96
+                     . '","i":"'.$icon
97
+                     . '","w":"'.$icon_size['w']
98
+                     . '","h":"'.$icon_size['h'].'"}';
99 99
 
100 100
         /**
101 101
          * Filter the json data when creating output for post json marker..
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
          * @param string $post_json JSON representation of the post marker info.
105 105
          * @param object $post The post object.
106 106
          */
107
-        $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
107
+        $post_map_json = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
108 108
 
109 109
         // only assign it if it has a value
110
-        if($post_map_json){
110
+        if ($post_map_json) {
111 111
             $map_jason[$post->ID] = $post_map_json;
112 112
         }
113 113
 
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
             if (is_array($map_jason) && !empty($map_jason)) {
132 132
 
133 133
                 // on details page only show the main marker on the map
134
-                if(geodir_is_page('detail')){
134
+                if (geodir_is_page('detail')) {
135 135
                     global $post;
136
-                    if(isset($map_jason[$post->ID])){
136
+                    if (isset($map_jason[$post->ID])) {
137 137
                         $map_jason = array($map_jason[$post->ID]);
138 138
                     }
139 139
                 }
140
-                $canvas_jason = $canvas . "_jason";
140
+                $canvas_jason = $canvas."_jason";
141 141
                 $map_canvas_arr[$canvas] = array_unique($map_jason);
142 142
                 unset($cat_content_info);
143 143
                 $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
                     $json_content = substr(implode(',', $cat_content_info), 1);
147 147
                     $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
148 148
                     $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
149
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
149
+                    $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
150 150
                 } else {
151 151
                     $canvas_jason = '[{"totalcount":"0"}]';
152 152
                 }
153
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
153
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
154 154
 
155 155
                 /**
156 156
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
                  * @param string $canvas Map canvas array key.
163 163
                  * @param array $map_canvas_jason_args Map canvas args.
164 164
                  */
165
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
165
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
166 166
 
167
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
167
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
168 168
             } else {
169 169
                 $canvas_jason = '[{"totalcount":"0"}]';
170
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
170
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
171 171
 
172 172
                 /**
173 173
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
                  * @param string $canvas Map canvas array key.
180 180
                  * @param array $map_canvas_jason_args Map canvas args.
181 181
                  */
182
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
183
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
182
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
183
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
184 184
             }
185 185
         }
186 186
 
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
             $display = !$child_collapse ? '' : 'display:none';
246 246
         }
247 247
 
248
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
248
+        $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">';
249 249
 
250 250
         $geodir_cat_icons = geodir_get_term_icon();
251 251
 
252
-        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
252
+        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place';
253 253
         if ($is_home_map && $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype')) {
254 254
             $geodir_default_map_search_pt = $homemap_catlist_ptype;
255 255
         }
@@ -264,23 +264,23 @@  discard block
 block discarded – undo
264 264
 
265 265
                 // Untick the category by default on home map
266 266
                 if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
267
-                    if (geodir_wpml_is_taxonomy_translated($post_type . 'category')) { // if WPML
267
+                    if (geodir_wpml_is_taxonomy_translated($post_type.'category')) { // if WPML
268 268
                         global $sitepress;
269 269
                         $default_lang = $sitepress->get_default_language();
270 270
                         $term_id = geodir_wpml_object_id($cat_term->term_id, $post_type.'category', true, $default_lang);
271
-                    }else{
271
+                    } else {
272 272
                         $term_id = $cat_term->term_id;
273 273
                     }
274
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) {
274
+                    if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$term_id, $geodir_home_map_untick)) {
275 275
                         $checked = '';
276 276
                     }
277 277
                 }
278 278
 
279
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
280
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
281
-                $term_check .= '  title="' . esc_attr(geodir_utf8_ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
282
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '"/>';
283
-                $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . geodir_utf8_ucfirst($cat_term->name) . '</label><i class="fas fa-long-arrow-alt-down"></i>';
279
+                $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"';
280
+                $term_check .= ' name="'.$map_canvas_name.'_cat[]" ';
281
+                $term_check .= '  title="'.esc_attr(geodir_utf8_ucfirst($cat_term->name)).'" value="'.$cat_term->term_id.'" onclick="javascript:build_map_ajax_search_param(\''.$map_canvas_name.'\',false, this)">';
282
+                $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.geodir_utf8_ucfirst($cat_term->name).'"/>';
283
+                $out .= '<li>'.$term_check.'<label for="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'">'.$term_img.geodir_utf8_ucfirst($cat_term->name).'</label><i class="fas fa-long-arrow-alt-down"></i>';
284 284
 
285 285
             endif;
286 286
 
@@ -392,19 +392,19 @@  discard block
 block discarded – undo
392 392
  * @package GeoDirectory
393 393
  */
394 394
 function geodir_map_load_script() {
395
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'google-maps-api', 'done')) {
395
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('google-maps-api', 'done')) {
396 396
         $plugin_url = geodir_plugin_url();
397 397
 ?>
398 398
 <script type="text/javascript">
399 399
 if (!(window.google && typeof google.maps !== 'undefined')) {
400
-    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
400
+    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
401 401
     document.getElementsByTagName("head")[0].appendChild(css);
402
-    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION;?>");
402
+    var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION; ?>");
403 403
     document.getElementsByTagName("head")[0].appendChild(css);
404
-    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
405
-    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/osm.geocode.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
406
-    document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
407
-    document.write('<' + 'script id="geodirectory-o-overlappingmarker-script" src="<?php echo $plugin_url;?>/geodirectory-assets/jawj/oms-leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
404
+    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
405
+    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/osm.geocode.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
406
+    document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
407
+    document.write('<' + 'script id="geodirectory-o-overlappingmarker-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/jawj/oms-leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
408 408
 }
409 409
 </script>
410 410
 <?php
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_template_tags.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -132,12 +132,12 @@  discard block
 block discarded – undo
132 132
 
133 133
     if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
134 134
     } else {
135
-        $geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
135
+        $geodir_map_options['height'] = $geodir_map_options['height'].'px';
136 136
     }
137 137
 
138 138
     if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
139 139
     } else {
140
-        $geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
140
+        $geodir_map_options['width'] = $geodir_map_options['width'].'px';
141 141
     }
142 142
 
143 143
     /**
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
171 171
 
172
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
172
+    if (count((array) $post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
173 173
         // Set default map options
174 174
 
175
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
175
+        wp_enqueue_script('geodir-map-widget', geodir_plugin_url().'/geodirectory-functions/map-functions/js/map.min.js', array(), false, true);
176 176
 
177 177
         wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
178 178
 
@@ -191,41 +191,41 @@  discard block
 block discarded – undo
191 191
 		 */
192 192
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
193 193
         ?>
194
-        <div id="catcher_<?php echo $map_canvas_name;?>"></div>
194
+        <div id="catcher_<?php echo $map_canvas_name; ?>"></div>
195 195
         <div class="stick_trigger_container">
196 196
             <div class="trigger_sticky triggeroff_sticky"></div>
197
-            <div class="top_banner_section geodir_map_container <?php echo $map_class_name;?>"
198
-                 id="sticky_map_<?php echo $map_canvas_name;?>"
199
-                 style="min-height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
197
+            <div class="top_banner_section geodir_map_container <?php echo $map_class_name; ?>"
198
+                 id="sticky_map_<?php echo $map_canvas_name; ?>"
199
+                 style="min-height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
200 200
 
201 201
                 <div class="map_background">
202 202
                     <div class="top_banner_section_in clearfix">
203
-                        <div class="<?php echo $map_canvas_name;?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name;?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fas fa-expand-arrows-alt"></i></span></div>
204
-                        <div class="<?php echo $map_canvas_name;?>_TopRight TopRight"></div>
205
-                        <div id="<?php echo $map_canvas_name;?>_wrapper" class="main_map_wrapper"
206
-                             style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
203
+                        <div class="<?php echo $map_canvas_name; ?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name; ?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fas fa-expand-arrows-alt"></i></span></div>
204
+                        <div class="<?php echo $map_canvas_name; ?>_TopRight TopRight"></div>
205
+                        <div id="<?php echo $map_canvas_name; ?>_wrapper" class="main_map_wrapper"
206
+                             style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
207 207
                             <!-- new map start -->
208 208
                             <div class="iprelative">
209
-                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name;?>"
210
-                                     style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
211
-                                <div id="<?php echo $map_canvas_name;?>_loading_div" class="loading_div"
212
-                                     style=" height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
209
+                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name; ?>"
210
+                                     style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
211
+                                <div id="<?php echo $map_canvas_name; ?>_loading_div" class="loading_div"
212
+                                     style=" height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
213 213
                                 <!--<div id="home_map_counter"></div>        -->
214
-                                <div id="<?php echo $map_canvas_name;?>_map_nofound"
214
+                                <div id="<?php echo $map_canvas_name; ?>_map_nofound"
215 215
                                      class="advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
216
-                                <div id="<?php echo $map_canvas_name;?>_map_notloaded"
216
+                                <div id="<?php echo $map_canvas_name; ?>_map_notloaded"
217 217
                                      class="advmap_notloaded"><?php _e('<h3>Google Map Not Loaded</h3><p>Sorry, unable to load Google Maps API.', 'geodirectory'); ?></div>
218 218
                             </div>
219 219
                             <!-- new map end -->
220 220
                         </div>
221
-                        <div class="<?php echo $map_canvas_name;?>_BottomLeft BottomLeft"></div>
221
+                        <div class="<?php echo $map_canvas_name; ?>_BottomLeft BottomLeft"></div>
222 222
                     </div>
223 223
                 </div>
224 224
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
225
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
225
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="1"/>
226 226
                 <?php } else {
227 227
                     ?>
228
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
228
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="0"/>
229 229
                 <?php }
230 230
 
231 231
                 if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                       <div class="gd-input-group-addon gd-directions-right gd-mylocation-go"><input type="button" value="<?php _e('Get Directions', 'geodirectory'); ?>" class="<?php echo $map_canvas_name; ?>_getdirection" id="directions" onclick="calcRoute('<?php echo $map_canvas_name; ?>')" /></div>
246 246
                     </div>
247 247
                     <script>
248
-                        <?php if(geodir_is_page('detail')){?>
248
+                        <?php if (geodir_is_page('detail')) {?>
249 249
                         jQuery(function () {
250 250
                             gd_initialize_ac();
251 251
                         });
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                                 // Create the autocomplete object, restricting the search
257 257
                                 // to geographical location types.
258 258
                                 autocomplete = new google.maps.places.Autocomplete(
259
-                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name;?>_fromAddress')),
259
+                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name; ?>_fromAddress')),
260 260
                                     {types: ['geocode']});
261 261
                                 // When the user selects an address from the dropdown,
262 262
                                 // populate the address fields in the form.
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                                 
271 271
                                 if (window.gdMaps == 'osm') {
272 272
                                     window.setTimeout(function() {
273
-                                        calcRoute('<?php echo $map_canvas_name;?>');
273
+                                        calcRoute('<?php echo $map_canvas_name; ?>');
274 274
                                     }, 1000);
275 275
                                 }
276 276
                             }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				 */
325 325
 				$map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
326 326
 				?>
327
-                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
327
+                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel; ?>">
328 328
                     <?php
329 329
                     $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
330 330
                     $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
@@ -334,12 +334,12 @@  discard block
 block discarded – undo
334 334
 					}
335 335
                     ?>
336 336
                     <div
337
-                        class="map-category-listing<?php echo $map_cat_class;?>">
337
+                        class="map-category-listing<?php echo $map_cat_class; ?>">
338 338
                         <div class="gd-trigger gd-triggeroff"><i class="fas fa-compress"></i><i class="fas fa-expand"></i></div>
339
-                        <div id="<?php echo $map_canvas_name;?>_cat"
340
-                             class="<?php echo $map_canvas_name;?>_map_category  map_category"
341
-                             <?php if ($child_collapse){ ?>checked="checked" <?php }?>
342
-                             style="max-height:<?php echo $geodir_map_options['height'];?>;">
339
+                        <div id="<?php echo $map_canvas_name; ?>_cat"
340
+                             class="<?php echo $map_canvas_name; ?>_map_category  map_category"
341
+                             <?php if ($child_collapse) { ?>checked="checked" <?php }?>
342
+                             style="max-height:<?php echo $geodir_map_options['height']; ?>;">
343 343
                             <input
344 344
                                 onkeydown="if(event.keyCode == 13){build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false)}"
345 345
                                 type="text"
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
352 352
                                 <?php } else {$child_collapse = "0";
353 353
                                     ?>
354
-                                    <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
354
+                                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="0"/>
355 355
                                 <?php } ?>
356 356
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
357 357
                                 <div class="geodir_toggle">
358
-                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'),0,true,0,$map_canvas_name,$child_collapse,true); ?>
358
+                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'), 0, true, 0, $map_canvas_name, $child_collapse, true); ?>
359 359
                                     <script>jQuery( document ).ready(function() {
360 360
                                             geodir_show_sub_cat_collapse_button();
361 361
                                         });</script>
@@ -384,21 +384,21 @@  discard block
 block discarded – undo
384 384
 					$city = $country != 'me' ? $city : '';
385 385
                     $gd_neighbourhood = $country != 'me' ? $gd_neighbourhood : '';
386 386
                     ?>
387
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
388
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
389
-                           value="<?php echo $country;?>"/>
390
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_region" name="gd_region"
391
-                           value="<?php echo $region;?>"/>
392
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_city" name="gd_city"
393
-                           value="<?php echo $city;?>"/>
394
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
395
-                           value="<?php echo $gd_neighbourhood;?>"/>
387
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="1"/>
388
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_country" name="gd_country"
389
+                           value="<?php echo $country; ?>"/>
390
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_region" name="gd_region"
391
+                           value="<?php echo $region; ?>"/>
392
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_city" name="gd_city"
393
+                           value="<?php echo $city; ?>"/>
394
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_neighbourhood" name="gd_neighbourhood"
395
+                           value="<?php echo $gd_neighbourhood; ?>"/>
396 396
                 <?php } else { //end of location filter
397 397
                     ?>
398
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
398
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="0"/>
399 399
                 <?php }?>
400 400
 
401
-                <input type="hidden" id="<?php echo $map_canvas_name;?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt;?>"/>
401
+                <input type="hidden" id="<?php echo $map_canvas_name; ?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt; ?>"/>
402 402
 
403 403
                 <input type="hidden" name="limitstart" value=""/>
404 404
 
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
                     }
416 416
                     if (count($map_post_types) > 1) {
417 417
                         ?>
418
-                        <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
419
-                             style="max-width:<?php echo $map_width;?>!important;">
418
+                        <div class="map-places-listing" id="<?php echo $map_canvas_name; ?>_posttype_menu"
419
+                             style="max-width:<?php echo $map_width; ?>!important;">
420 420
 
421 421
                             <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
422 422
                             <div class="geodir-map-posttype-list"><?php } ?>
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
                                     foreach ($post_types as $post_type => $args) {
428 428
                                         if (!in_array($post_type, $exclude_post_types)) {
429 429
                                             $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
430
-											echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __($args->labels->name, 'geodirectory') . '</a></li>';
430
+											echo '<li id="'.$post_type.'" '.$class.'><a href="javascript:void(0);" onclick="jQuery(\'#'.$map_canvas_name.'_posttype\').val(\''.$post_type.'\');build_map_ajax_search_param(\''.$map_canvas_name.'\', true)">'.__($args->labels->name, 'geodirectory').'</a></li>';
431 431
                                         }
432 432
                                     }
433 433
                                     ?>
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
         <script type="text/javascript">
453 453
 
454 454
             jQuery(document).ready(function () {
455
-                build_map_ajax_search_param('<?php echo $map_canvas_name;?>', false);
456
-                map_sticky('<?php echo $map_canvas_name;?>');
455
+                build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false);
456
+                map_sticky('<?php echo $map_canvas_name; ?>');
457 457
             });
458 458
 
459 459
         </script>
@@ -464,18 +464,18 @@  discard block
 block discarded – undo
464 464
             <script>
465 465
                 (function () {
466 466
                     var screenH = jQuery(window).height();
467
-                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']);?>";
467
+                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']); ?>";
468 468
 
469 469
                     var ptypeH = '';
470
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
471
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
470
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
471
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
472 472
                     }
473 473
 
474
-                    jQuery("#sticky_map_<?php echo $map_canvas_name;?>").css("min-height", screenH * (heightVH / 100) + 'px');
475
-                    jQuery("#<?php echo $map_canvas_name;?>_wrapper").height(screenH * (heightVH / 100) + 'px');
476
-                    jQuery("#<?php echo $map_canvas_name;?>").height(screenH * (heightVH / 100) + 'px');
477
-                    jQuery("#<?php echo $map_canvas_name;?>_loading_div").height(screenH * (heightVH / 100) + 'px');
478
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
474
+                    jQuery("#sticky_map_<?php echo $map_canvas_name; ?>").css("min-height", screenH * (heightVH / 100) + 'px');
475
+                    jQuery("#<?php echo $map_canvas_name; ?>_wrapper").height(screenH * (heightVH / 100) + 'px');
476
+                    jQuery("#<?php echo $map_canvas_name; ?>").height(screenH * (heightVH / 100) + 'px');
477
+                    jQuery("#<?php echo $map_canvas_name; ?>_loading_div").height(screenH * (heightVH / 100) + 'px');
478
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
479 479
 
480 480
                 }());
481 481
             </script>
@@ -487,13 +487,13 @@  discard block
 block discarded – undo
487 487
             <script>
488 488
                 (function () {
489 489
                     var screenH = jQuery(window).height();
490
-                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']);?>";
490
+                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']); ?>";
491 491
                     var ptypeH = '';
492
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
493
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
492
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
493
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
494 494
                     }
495 495
 
496
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", heightVH - ptypeH + 'px');
496
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", heightVH - ptypeH + 'px');
497 497
 
498 498
                 }());
499 499
             </script>
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
          * @param array $geodir_map_options Array of map settings.
509 509
          * @param string $map_canvas_name The canvas name and ID for the map.
510 510
          */
511
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
511
+        do_action('geodir_map_after_render', $geodir_map_options, $map_canvas_name);
512 512
 
513 513
 
514 514
     endif; // Exclude posttypes if end
Please login to merge, or discard this patch.
geodirectory-functions/shortcode_functions.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
             $value = 100;
30 30
         }
31 31
         // Re-add the percent symbol
32
-        $value = $value . '%';
32
+        $value = $value.'%';
33 33
     } elseif ((strlen($value) - 2) == strpos(trim($value), 'px')) {
34 34
         // Get the absint & re-add the 'px'
35
-        $value = preg_replace('/\D/', '', $value) . 'px';
35
+        $value = preg_replace('/\D/', '', $value).'px';
36 36
     } else {
37 37
         $value = preg_replace('/\D/', '', $value);
38 38
     }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     }
212 212
     if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
213 213
 
214
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
214
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
215 215
 
216 216
         add_filter('posts_fields', 'geodir_posts_fields', 1);
217 217
         add_filter('posts_join', 'geodir_posts_join', 1);
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 
256 256
     $taxonomies = geodir_get_taxonomies($post_type);
257 257
 
258
-    $categories = get_terms(array('taxonomy' => $taxonomies[0],'hide_empty' => false));
258
+    $categories = get_terms(array('taxonomy' => $taxonomies[0], 'hide_empty' => false));
259 259
 
260 260
     $cat_id = 0;
261 261
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
     }
489 489
 
490 490
     if (!empty($post_type)) {
491
-        $table = $plugin_prefix . $post_type . '_detail';
491
+        $table = $plugin_prefix.$post_type.'_detail';
492 492
         
493 493
         if (!geodir_prepare_custom_sorting($sort_choice, $table)) {
494 494
             $sort_choice = '';
@@ -581,10 +581,10 @@  discard block
 block discarded – undo
581 581
 	$add_location_filter = !empty($args['add_location_filter']) ? true : false;
582 582
 	$list_sort 			 = !empty($args['list_sort']) ? $args['list_sort'] : 'latest';
583 583
 	$character_count	 = isset($args['character_count']) ? $args['character_count'] : '';
584
-	$layout 			 = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf';
584
+	$layout = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf';
585 585
 	$listing_width 		 = !empty($args['listing_width']) ? $args['listing_width'] : '';
586
-	$with_pagination 	 = !empty($args['with_pagination']) ? true : false;
587
-	$event_type 	 	 = !empty($args['event_type']) ? $args['event_type'] : '';
586
+	$with_pagination = !empty($args['with_pagination']) ? true : false;
587
+	$event_type = !empty($args['event_type']) ? $args['event_type'] : '';
588 588
     $shortcode_content   = !empty($args['shortcode_content']) ? trim($args['shortcode_content']) : '';
589 589
     $tags                = !empty($args['tags']) ? $args['tags'] : array();
590 590
     /**
@@ -598,13 +598,13 @@  discard block
 block discarded – undo
598 598
     $shortcode_content = apply_filters('geodir_sc_gd_listings_not_found_content', $shortcode_content, $args);
599 599
 		
600 600
 	$top_pagination 	 = $with_pagination && !empty($args['top_pagination']) ? true : false;
601
-	$bottom_pagination 	 = $with_pagination && !empty($args['bottom_pagination']) ? true : false;
601
+	$bottom_pagination = $with_pagination && !empty($args['bottom_pagination']) ? true : false;
602 602
 	
603 603
 	$shortcode_atts		 = !empty($args['shortcode_atts']) ? $args['shortcode_atts'] : array();
604 604
 
605 605
 	// ajax mode
606
-	$geodir_ajax		 = !empty($args['geodir_ajax']) ? true : false;
607
-	$pageno 	 		 = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1;
606
+	$geodir_ajax = !empty($args['geodir_ajax']) ? true : false;
607
+	$pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1;
608 608
 	
609 609
 	$query_args = array(
610 610
         'posts_per_page' => $post_number,
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
         // Clean tags
669 669
         if (!is_array($tags)) {
670 670
             $comma = _x(',', 'tag delimiter');
671
-            if ( ',' !== $comma ) {
671
+            if (',' !== $comma) {
672 672
                 $tags = str_replace($comma, ',', $tags);
673 673
             }
674 674
             $tags = explode(',', trim($tags, " \n\t\r\0\x0B,"));
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         
678 678
         if (!empty($tags)) {
679 679
             $tag_query = array(
680
-                'taxonomy' => $post_type . '_tags',
680
+                'taxonomy' => $post_type.'_tags',
681 681
                 'field' => 'name',
682 682
                 'terms' => $tags
683 683
             );
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 		$widget_listings = $total_posts > 0 ? geodir_get_widget_listings($query_args) : array();
708 708
 	}
709 709
 	$current_gridview_columns_widget = $gridview_columns_widget;
710
-    $identifier = ' gd-wgt-pagi-' . mt_rand();
710
+    $identifier = ' gd-wgt-pagi-'.mt_rand();
711 711
     ob_start();
712 712
 	if (!empty($widget_listings) || $with_no_results) {
713 713
 		if (!$geodir_ajax) {
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
          */
719 719
         do_action('geodir_before_sc_gd_listings');
720 720
 		?>
721
-        <div class="geodir_locations geodir_location_listing geodir-sc-gd-listings <?php echo $identifier;?>">
721
+        <div class="geodir_locations geodir_location_listing geodir-sc-gd-listings <?php echo $identifier; ?>">
722 722
             <?php if ($title != '') { ?>
723 723
             <div class="geodir_list_heading clearfix">
724 724
                 <?php echo $title; ?>
@@ -788,8 +788,8 @@  discard block
 block discarded – undo
788 788
             </div><p class="geodir-sclisting-loading" style="display:none;"><i class="fas fa-cog fa-spin"></i></p></div>
789 789
 <script type="text/javascript">
790 790
 /* <![CDATA[ */
791
-jQuery(document).on('click', '.<?php echo trim($identifier);?> .gd-wgt-page', function(e) {
792
-    var container = jQuery( '.<?php echo trim($identifier);?>');
791
+jQuery(document).on('click', '.<?php echo trim($identifier); ?> .gd-wgt-page', function(e) {
792
+    var container = jQuery( '.<?php echo trim($identifier); ?>');
793 793
     var obj = this;
794 794
     var pid = parseInt(jQuery(this).data('page'));
795 795
     var items = jQuery(obj).closest('.gd-sc-content');
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
         return false;
800 800
     }
801 801
     
802
-    var scatts = "<?php echo addslashes(json_encode($shortcode_atts));?>";
802
+    var scatts = "<?php echo addslashes(json_encode($shortcode_atts)); ?>";
803 803
     
804 804
     var data = {
805 805
       'action': 'geodir_sclistings',
@@ -889,16 +889,16 @@  discard block
 block discarded – undo
889 889
 	if ($max_page > 1 || $always_show) {
890 890
 		// Extra pagination info
891 891
 		$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
892
-		$start_no = ( $pageno - 1 ) * $posts_per_page + 1;
892
+		$start_no = ($pageno - 1) * $posts_per_page + 1;
893 893
 		$end_no = min($pageno * $posts_per_page, $numposts);
894 894
 		
895 895
 		if ($geodir_pagination_more_info != '') {
896
-			$pagination_info = '<div class="gd-pagination-details gd-pagination-details-' . $geodir_pagination_more_info . '">' . wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts) . '</div>';
896
+			$pagination_info = '<div class="gd-pagination-details gd-pagination-details-'.$geodir_pagination_more_info.'">'.wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts).'</div>';
897 897
 			
898 898
 			if ($geodir_pagination_more_info == 'before') {
899
-				$before = $before . $pagination_info;
899
+				$before = $before.$pagination_info;
900 900
 			} else if ($geodir_pagination_more_info == 'after') {
901
-				$after = $pagination_info . $after;
901
+				$after = $pagination_info.$after;
902 902
 			}
903 903
 		}
904 904
 			
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
 		}
909 909
 		
910 910
 		if (($pageno - 1) > 0) {
911
-            echo '<a class="gd-page-sc-prev gd-wgt-page" data-page="' . (int)($pageno - 1) . '" href="javascript:void(0);">' . $prelabel . '</a>&nbsp;';
911
+            echo '<a class="gd-page-sc-prev gd-wgt-page" data-page="'.(int) ($pageno - 1).'" href="javascript:void(0);">'.$prelabel.'</a>&nbsp;';
912 912
 		}
913 913
 		
914 914
 		for ($i = $pageno - $half_pages_to_show; $i <= $pageno + $half_pages_to_show; $i++) {
@@ -916,17 +916,17 @@  discard block
 block discarded – undo
916 916
 				if ($i == $pageno) {
917 917
 					echo "<strong class='on' class='gd-page-sc-act'>$i</strong>";
918 918
 				} else {
919
-					echo ' <a class="gd-page-sc-no gd-wgt-page" data-page="' . (int)$i . '" href="javascript:void(0);">' . $i . '</a> ';
919
+					echo ' <a class="gd-page-sc-no gd-wgt-page" data-page="'.(int) $i.'" href="javascript:void(0);">'.$i.'</a> ';
920 920
 				}
921 921
 			}
922 922
 		}
923 923
 		
924 924
 		if (($pageno + 1) <= $max_page) {
925
-			echo '&nbsp;<a class="gd-page-sc-nxt gd-wgt-page" data-page="' . (int)($pageno + 1) . '" href="javascript:void(0);">' . $nxtlabel . '</a>';
925
+			echo '&nbsp;<a class="gd-page-sc-nxt gd-wgt-page" data-page="'.(int) ($pageno + 1).'" href="javascript:void(0);">'.$nxtlabel.'</a>';
926 926
 		}
927 927
 		
928 928
 		if ($pageno < $max_page) {
929
-			echo '&nbsp;<a class="gd-page-sc-lst gd-wgt-page" data-page="' . (int)$max_page . '" href="javascript:void(0);">&raquo;</a>';
929
+			echo '&nbsp;<a class="gd-page-sc-lst gd-wgt-page" data-page="'.(int) $max_page.'" href="javascript:void(0);">&raquo;</a>';
930 930
 		}
931 931
 		echo "</div> $after </div>";
932 932
 	}
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
     $scatts = isset($_POST['scatts']) ? $_POST['scatts'] : NULL;
950 950
     $pageno = isset($_POST['pageno']) ? absint($_POST['pageno']) : 1;
951 951
 	
952
-	$shortcode_atts = !empty($scatts) ? (array)json_decode(stripslashes_deep($scatts)) : NULL;
952
+	$shortcode_atts = !empty($scatts) ? (array) json_decode(stripslashes_deep($scatts)) : NULL;
953 953
 	
954 954
 	if (!empty($shortcode_atts) && is_array($shortcode_atts)) {
955 955
 		$shortcode_atts['pageno'] = $pageno;
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_input_functions.php 1 patch
Spacing   +233 added lines, -233 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string The html to output for the custom field.
19 19
  */
20
-function geodir_cfi_fieldset($html,$cf){
20
+function geodir_cfi_fieldset($html, $cf) {
21 21
 
22 22
     $html_var = $cf['htmlvar_name'];
23 23
 
24 24
     // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
25
+    if (has_filter("geodir_custom_field_input_fieldset_{$html_var}")) {
26 26
         /**
27 27
          * Filter the fieldset html by individual custom field.
28 28
          *
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
          * @param array $cf The custom field array.
31 31
          * @since 1.6.6
32 32
          */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
33
+        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}", $html, $cf);
34 34
     }
35 35
 
36 36
     // If no html then we run the standard output.
37
-    if(empty($html)) {
37
+    if (empty($html)) {
38 38
 
39 39
         ob_start(); // Start  buffering;
40 40
         ?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42
-            gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo __( $cf['site_title'], 'geodirectory' ); ?>
43
-            <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . __( $cf['desc'], 'geodirectory' ) . ' )</small>';
42
+            gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo __($cf['site_title'], 'geodirectory'); ?>
43
+            <?php if ($cf['desc'] != '') {
44
+                echo '<small>( '.__($cf['desc'], 'geodirectory').' )</small>';
45 45
             } ?></h5>
46 46
         <?php
47 47
         $html = ob_get_clean();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     return $html;
51 51
 }
52
-add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
52
+add_filter('geodir_custom_field_input_fieldset', 'geodir_cfi_fieldset', 10, 2);
53 53
 
54 54
 
55 55
 
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
  *
63 63
  * @return string The html to output for the custom field.
64 64
  */
65
-function geodir_cfi_text($html,$cf){
65
+function geodir_cfi_text($html, $cf) {
66 66
 
67 67
     $html_var = $cf['htmlvar_name'];
68 68
 
69 69
     // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
70
+    if (has_filter("geodir_custom_field_input_text_{$html_var}")) {
71 71
         /**
72 72
          * Filter the text html by individual custom field.
73 73
          *
@@ -75,41 +75,41 @@  discard block
 block discarded – undo
75 75
          * @param array $cf The custom field array.
76 76
          * @since 1.6.6
77 77
          */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
78
+        $html = apply_filters("geodir_custom_field_input_text_{$html_var}", $html, $cf);
79 79
     }
80 80
 
81 81
     // If no html then we run the standard output.
82
-    if(empty($html)) {
82
+    if (empty($html)) {
83 83
 
84 84
         ob_start(); // Start  buffering;
85 85
 
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if (isset($cf['data_type']) && $cf['data_type'] == 'INT') {$type = 'number'; }
90
+        elseif (isset($cf['data_type']) && $cf['data_type'] == 'FLOAT') {$type = 'float'; }
91 91
 
92 92
         //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
93
+        if (isset($cf['validation_pattern']) && $cf['validation_pattern']) {
94 94
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
95
+        } else {$validation = ''; }
96 96
 
97 97
         // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
98
+        if (isset($cf['validation_msg']) && $cf['validation_msg']) {
99 99
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
100
+        } else {$validation_msg = ''; }
101 101
         ?>
102 102
 
103
-        <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+        <div id="<?php echo $cf['name']; ?>_row"
104
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 107
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
108
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
109 109
             </label>
110
-            <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
112
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
110
+            <input field_type="<?php echo $type; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
111
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> />
112
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
113 113
             <?php if ($cf['is_required']) { ?>
114 114
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
115 115
             <?php } ?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     return $html;
123 123
 }
124
-add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
124
+add_filter('geodir_custom_field_input_text', 'geodir_cfi_text', 10, 2);
125 125
 
126 126
 
127 127
 /**
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return string The html to output for the custom field.
135 135
  */
136
-function geodir_cfi_email($html,$cf){
136
+function geodir_cfi_email($html, $cf) {
137 137
 
138 138
     $html_var = $cf['htmlvar_name'];
139 139
 
140 140
     // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
141
+    if (has_filter("geodir_custom_field_input_email_{$html_var}")) {
142 142
         /**
143 143
          * Filter the email html by individual custom field.
144 144
          *
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
          * @param array $cf The custom field array.
147 147
          * @since 1.6.6
148 148
          */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
149
+        $html = apply_filters("geodir_custom_field_input_email_{$html_var}", $html, $cf);
150 150
     }
151 151
 
152 152
     // If no html then we run the standard output.
153
-    if(empty($html)) {
153
+    if (empty($html)) {
154 154
 
155 155
         ob_start(); // Start  buffering;
156 156
         $value = geodir_get_cf_value($cf);
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
             $value = '';
160 160
         }?>
161 161
 
162
-        <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
162
+        <div id="<?php echo $cf['name']; ?>_row"
163
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 166
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
167
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
168 168
             </label>
169
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
170
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
171
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
169
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
170
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/>
171
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
172 172
             <?php if ($cf['is_required']) { ?>
173 173
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
174 174
             <?php } ?>
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     return $html;
182 182
 }
183
-add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
183
+add_filter('geodir_custom_field_input_email', 'geodir_cfi_email', 10, 2);
184 184
 
185 185
 
186 186
 
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
  *
194 194
  * @return string The html to output for the custom field.
195 195
  */
196
-function geodir_cfi_phone($html,$cf){
196
+function geodir_cfi_phone($html, $cf) {
197 197
 
198 198
     $html_var = $cf['htmlvar_name'];
199 199
 
200 200
     // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
201
+    if (has_filter("geodir_custom_field_input_phone_{$html_var}")) {
202 202
         /**
203 203
          * Filter the phone html by individual custom field.
204 204
          *
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
          * @param array $cf The custom field array.
207 207
          * @since 1.6.6
208 208
          */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
209
+        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}", $html, $cf);
210 210
     }
211 211
 
212 212
     // If no html then we run the standard output.
213
-    if(empty($html)) {
213
+    if (empty($html)) {
214 214
 
215 215
         ob_start(); // Start  buffering;
216 216
         $value = geodir_get_cf_value($cf);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
             $value = '';
220 220
         }?>
221 221
 
222
-        <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
222
+        <div id="<?php echo $cf['name']; ?>_row"
223
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 226
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
227
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
228 228
             </label>
229
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
230
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
231
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
229
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
230
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/>
231
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
232 232
             <?php if ($cf['is_required']) { ?>
233 233
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
234 234
             <?php } ?>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
     return $html;
242 242
 }
243
-add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
243
+add_filter('geodir_custom_field_input_phone', 'geodir_cfi_phone', 10, 2);
244 244
 
245 245
 
246 246
 
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
  *
254 254
  * @return string The html to output for the custom field.
255 255
  */
256
-function geodir_cfi_url($html,$cf){
256
+function geodir_cfi_url($html, $cf) {
257 257
 
258 258
     $html_var = $cf['htmlvar_name'];
259 259
 
260 260
     // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
261
+    if (has_filter("geodir_custom_field_input_url_{$html_var}")) {
262 262
         /**
263 263
          * Filter the url html by individual custom field.
264 264
          *
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
          * @param array $cf The custom field array.
267 267
          * @since 1.6.6
268 268
          */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
269
+        $html = apply_filters("geodir_custom_field_input_url_{$html_var}", $html, $cf);
270 270
     }
271 271
 
272 272
     // If no html then we run the standard output.
273
-    if(empty($html)) {
273
+    if (empty($html)) {
274 274
 
275 275
         ob_start(); // Start  buffering;
276 276
         $value = geodir_get_cf_value($cf);
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
             $value = '';
280 280
         }?>
281 281
 
282
-        <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
282
+        <div id="<?php echo $cf['name']; ?>_row"
283
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 286
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
287
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
288 288
             </label>
289
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
289
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
290
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield"
291 291
                    oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')"
292 292
                    onchange="try{setCustomValidity('')}catch(e){}"
293 293
             />
294
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
294
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
295 295
             <?php if ($cf['is_required']) { ?>
296 296
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
297 297
             <?php } ?>
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     return $html;
305 305
 }
306
-add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
306
+add_filter('geodir_custom_field_input_url', 'geodir_cfi_url', 10, 2);
307 307
 
308 308
 
309 309
 /**
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
  *
316 316
  * @return string The html to output for the custom field.
317 317
  */
318
-function geodir_cfi_radio($html,$cf){
318
+function geodir_cfi_radio($html, $cf) {
319 319
 
320 320
     $html_var = $cf['htmlvar_name'];
321 321
 
322 322
     // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
323
+    if (has_filter("geodir_custom_field_input_radio_{$html_var}")) {
324 324
         /**
325 325
          * Filter the radio html by individual custom field.
326 326
          *
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
          * @param array $cf The custom field array.
329 329
          * @since 1.6.6
330 330
          */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
331
+        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}", $html, $cf);
332 332
     }
333 333
 
334 334
     // If no html then we run the standard output.
335
-    if(empty($html)) {
335
+    if (empty($html)) {
336 336
 
337 337
         ob_start(); // Start  buffering;
338 338
         $value = geodir_get_cf_value($cf);
339 339
 
340 340
         ?>
341
-        <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
341
+        <div id="<?php echo $cf['name']; ?>_row"
342
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 345
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
346
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349 349
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
                     foreach ($option_values as $option_value) {
353 353
                         if (empty($option_value['optgroup'])) {
354 354
                             ?>
355
-                            <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked(stripslashes($value), $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
355
+                            <span class="gd-radios"><input name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" <?php checked(stripslashes($value), $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357 357
                         }
358 358
                     }
359 359
                 }
360 360
             }
361 361
             ?>
362
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
362
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
365 365
             <?php } ?>
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     return $html;
373 373
 }
374
-add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
374
+add_filter('geodir_custom_field_input_radio', 'geodir_cfi_radio', 10, 2);
375 375
 
376 376
 
377 377
 /**
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return string The html to output for the custom field.
385 385
  */
386
-function geodir_cfi_checkbox($html,$cf){
386
+function geodir_cfi_checkbox($html, $cf) {
387 387
 
388 388
     $html_var = $cf['htmlvar_name'];
389 389
 
390 390
     // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
391
+    if (has_filter("geodir_custom_field_input_checkbox_{$html_var}")) {
392 392
         /**
393 393
          * Filter the checkbox html by individual custom field.
394 394
          *
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
          * @param array $cf The custom field array.
397 397
          * @since 1.6.6
398 398
          */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
399
+        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}", $html, $cf);
400 400
     }
401 401
 
402 402
     // If no html then we run the standard output.
403
-    if(empty($html)) {
403
+    if (empty($html)) {
404 404
 
405 405
         ob_start(); // Start  buffering;
406 406
         $value = geodir_get_cf_value($cf);
@@ -411,22 +411,22 @@  discard block
 block discarded – undo
411 411
         }
412 412
         ?>
413 413
 
414
-        <div id="<?php echo $cf['name'];?>_row"
415
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
414
+        <div id="<?php echo $cf['name']; ?>_row"
415
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
416 416
             <label>
417 417
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
418 418
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
419
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
419
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
420 420
             </label>
421 421
             <?php if ($value != '1') {
422 422
                 $value = '0';
423 423
             }?>
424
-            <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
424
+            <input type="hidden" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" value="<?php echo esc_attr($value); ?>"/>
425 425
             <input  <?php if ($value == '1') {
426 426
                 echo 'checked="checked"';
427
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
428
-                 onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
429
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
427
+            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="checkbox"
428
+                 onchange="if(this.checked){jQuery('#<?php echo $cf['name']; ?>').val('1');} else{ jQuery('#<?php echo $cf['name']; ?>').val('0');}"/>
429
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
430 430
             <?php if ($cf['is_required']) { ?>
431 431
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
432 432
             <?php } ?>
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
     return $html;
440 440
 }
441
-add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
441
+add_filter('geodir_custom_field_input_checkbox', 'geodir_cfi_checkbox', 10, 2);
442 442
 
443 443
 
444 444
 /**
@@ -450,12 +450,12 @@  discard block
 block discarded – undo
450 450
  *
451 451
  * @return string The html to output for the custom field.
452 452
  */
453
-function geodir_cfi_textarea($html,$cf){
453
+function geodir_cfi_textarea($html, $cf) {
454 454
 
455 455
     $html_var = $cf['htmlvar_name'];
456 456
 
457 457
     // Check if there is a custom field specific filter.
458
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
458
+    if (has_filter("geodir_custom_field_input_textarea_{$html_var}")) {
459 459
         /**
460 460
          * Filter the textarea html by individual custom field.
461 461
          *
@@ -463,11 +463,11 @@  discard block
 block discarded – undo
463 463
          * @param array $cf The custom field array.
464 464
          * @since 1.6.6
465 465
          */
466
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
466
+        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}", $html, $cf);
467 467
     }
468 468
 
469 469
     // If no html then we run the standard output.
470
-    if(empty($html)) {
470
+    if (empty($html)) {
471 471
 
472 472
         ob_start(); // Start  buffering;
473 473
         $value = geodir_get_cf_value($cf);
@@ -475,32 +475,32 @@  discard block
 block discarded – undo
475 475
         $extra_fields = unserialize($cf['extra_fields']);
476 476
         ?>
477 477
 
478
-        <div id="<?php echo $cf['name'];?>_row"
479
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
478
+        <div id="<?php echo $cf['name']; ?>_row"
479
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
480 480
             <label>
481 481
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
482 482
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
483
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
483
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
484 484
             </label><?php
485 485
 
486 486
 
487 487
             if (is_array($extra_fields) && in_array('1', $extra_fields)) {
488 488
 
489
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
489
+                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
490 490
 
491
-            <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
491
+            <div class="editor" field_id="<?php echo $cf['name']; ?>" field_type="editor">
492 492
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
493 493
                 </div><?php
494 494
 
495 495
             } else {
496 496
 
497
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
498
-                            id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
497
+                ?><textarea field_type="<?php echo $cf['type']; ?>" class="geodir_textarea" name="<?php echo $cf['name']; ?>"
498
+                            id="<?php echo $cf['name']; ?>"><?php echo stripslashes($value); ?></textarea><?php
499 499
 
500 500
             }?>
501 501
 
502 502
 
503
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
503
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
504 504
             <?php if ($cf['is_required']) { ?>
505 505
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
506 506
             <?php } ?>
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 
513 513
     return $html;
514 514
 }
515
-add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
515
+add_filter('geodir_custom_field_input_textarea', 'geodir_cfi_textarea', 10, 2);
516 516
 
517 517
 
518 518
 /**
@@ -524,12 +524,12 @@  discard block
 block discarded – undo
524 524
  *
525 525
  * @return string The html to output for the custom field.
526 526
  */
527
-function geodir_cfi_select($html,$cf){
527
+function geodir_cfi_select($html, $cf) {
528 528
 
529 529
     $html_var = $cf['htmlvar_name'];
530 530
 
531 531
     // Check if there is a custom field specific filter.
532
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
532
+    if (has_filter("geodir_custom_field_input_select_{$html_var}")) {
533 533
         /**
534 534
          * Filter the select html by individual custom field.
535 535
          *
@@ -537,22 +537,22 @@  discard block
 block discarded – undo
537 537
          * @param array $cf The custom field array.
538 538
          * @since 1.6.6
539 539
          */
540
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
540
+        $html = apply_filters("geodir_custom_field_input_select_{$html_var}", $html, $cf);
541 541
     }
542 542
 
543 543
     // If no html then we run the standard output.
544
-    if(empty($html)) {
544
+    if (empty($html)) {
545 545
 
546 546
         ob_start(); // Start  buffering;
547 547
         $value = geodir_get_cf_value($cf);
548 548
 
549 549
         ?>
550
-        <div id="<?php echo $cf['name'];?>_row"
551
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550
+        <div id="<?php echo $cf['name']; ?>_row"
551
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
552 552
             <label>
553 553
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
554 554
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
555
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
555
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
556 556
             </label>
557 557
             <?php
558 558
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -562,22 +562,22 @@  discard block
 block discarded – undo
562 562
                     if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
563 563
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
564 564
 
565
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
565
+                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
566 566
                     } else {
567 567
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
568 568
                         $option_value = isset($option_row['value']) ? $option_row['value'] : '';
569 569
                         $selected = $option_value == stripslashes($value) ? 'selected="selected"' : '';
570 570
 
571
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
571
+                        $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
572 572
                     }
573 573
                 }
574 574
             }
575 575
             ?>
576
-            <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
576
+            <select field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
577 577
                     class="geodir_textfield textfield_x chosen_select"
578
-                    data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
579
-                    option-ajaxchosen="false"><?php echo $select_options;?></select>
580
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
578
+                    data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'&hellip;'; ?>"
579
+                    option-ajaxchosen="false"><?php echo $select_options; ?></select>
580
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
581 581
             <?php if ($cf['is_required']) { ?>
582 582
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
583 583
             <?php } ?>
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 
590 590
     return $html;
591 591
 }
592
-add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
592
+add_filter('geodir_custom_field_input_select', 'geodir_cfi_select', 10, 2);
593 593
 
594 594
 
595 595
 /**
@@ -601,12 +601,12 @@  discard block
 block discarded – undo
601 601
  *
602 602
  * @return string The html to output for the custom field.
603 603
  */
604
-function geodir_cfi_multiselect($html,$cf){
604
+function geodir_cfi_multiselect($html, $cf) {
605 605
 
606 606
     $html_var = $cf['htmlvar_name'];
607 607
 
608 608
     // Check if there is a custom field specific filter.
609
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
609
+    if (has_filter("geodir_custom_field_input_multiselect_{$html_var}")) {
610 610
         /**
611 611
          * Filter the multiselect html by individual custom field.
612 612
          *
@@ -614,11 +614,11 @@  discard block
 block discarded – undo
614 614
          * @param array $cf The custom field array.
615 615
          * @since 1.6.6
616 616
          */
617
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
617
+        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}", $html, $cf);
618 618
     }
619 619
 
620 620
     // If no html then we run the standard output.
621
-    if(empty($html)) {
621
+    if (empty($html)) {
622 622
 
623 623
         ob_start(); // Start  buffering;
624 624
         $value = geodir_get_cf_value($cf);
@@ -655,9 +655,9 @@  discard block
 block discarded – undo
655 655
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
656 656
 
657 657
                                 if ($multi_display == 'select') {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
658
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
659 659
                                 } else {
660
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
660
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : '';
661 661
                                 }
662 662
                             } else {
663 663
                                 if (!is_array($value) && $value != '') {
@@ -690,9 +690,9 @@  discard block
 block discarded – undo
690 690
                                 }
691 691
 
692 692
                                 if ($multi_display == 'select') {
693
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
693
+                                    $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
694 694
                                 } else {
695
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
695
+                                    $select_options .= '<li><input name="'.$cf['name'].'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" />&nbsp;'.$option_label.' </li>';
696 696
                                 }
697 697
                             }
698 698
                         }
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 
713 713
     return $html;
714 714
 }
715
-add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
715
+add_filter('geodir_custom_field_input_multiselect', 'geodir_cfi_multiselect', 10, 2);
716 716
 
717 717
 
718 718
 /**
@@ -724,12 +724,12 @@  discard block
 block discarded – undo
724 724
  *
725 725
  * @return string The html to output for the custom field.
726 726
  */
727
-function geodir_cfi_html($html,$cf){
727
+function geodir_cfi_html($html, $cf) {
728 728
 
729 729
     $html_var = $cf['htmlvar_name'];
730 730
 
731 731
     // Check if there is a custom field specific filter.
732
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
732
+    if (has_filter("geodir_custom_field_input_html_{$html_var}")) {
733 733
         /**
734 734
          * Filter the html html by individual custom field.
735 735
          *
@@ -737,11 +737,11 @@  discard block
 block discarded – undo
737 737
          * @param array $cf The custom field array.
738 738
          * @since 1.6.6
739 739
          */
740
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
740
+        $html = apply_filters("geodir_custom_field_input_html_{$html_var}", $html, $cf);
741 741
     }
742 742
 
743 743
     // If no html then we run the standard output.
744
-    if(empty($html)) {
744
+    if (empty($html)) {
745 745
 
746 746
         ob_start(); // Start  buffering;
747 747
         $value = geodir_get_cf_value($cf);
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 
775 775
     return $html;
776 776
 }
777
-add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
777
+add_filter('geodir_custom_field_input_html', 'geodir_cfi_html', 10, 2);
778 778
 
779 779
 
780 780
 
@@ -787,12 +787,12 @@  discard block
 block discarded – undo
787 787
  *
788 788
  * @return string The html to output for the custom field.
789 789
  */
790
-function geodir_cfi_datepicker($html,$cf){
790
+function geodir_cfi_datepicker($html, $cf) {
791 791
 
792 792
     $html_var = $cf['htmlvar_name'];
793 793
 
794 794
     // Check if there is a custom field specific filter.
795
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
795
+    if (has_filter("geodir_custom_field_input_datepicker_{$html_var}")) {
796 796
         /**
797 797
          * Filter the datepicker html by individual custom field.
798 798
          *
@@ -800,11 +800,11 @@  discard block
 block discarded – undo
800 800
          * @param array $cf The custom field array.
801 801
          * @since 1.6.6
802 802
          */
803
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
803
+        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}", $html, $cf);
804 804
     }
805 805
 
806 806
     // If no html then we run the standard output.
807
-    if(empty($html)) {
807
+    if (empty($html)) {
808 808
 
809 809
         ob_start(); // Start  buffering;
810 810
         $value = geodir_get_cf_value($cf);
@@ -816,23 +816,23 @@  discard block
 block discarded – undo
816 816
             $extra_fields['date_format'] = 'yy-mm-dd';
817 817
 
818 818
         $date_format = $extra_fields['date_format'];
819
-        $jquery_date_format  = $date_format;
819
+        $jquery_date_format = $date_format;
820 820
 
821 821
 
822 822
         // check if we need to change the format or not
823 823
         $date_format_len = strlen(str_replace(' ', '', $date_format));
824
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
824
+        if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
825 825
 
826
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
827
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
826
+            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
827
+            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
828 828
 
829 829
             $date_format = str_replace($search, $replace, $date_format);
830
-        }else{
831
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
830
+        } else {
831
+            $jquery_date_format = geodir_date_format_php_to_jqueryui($jquery_date_format);
832 832
         }
833 833
 
834
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
835
-        if($value && !isset($_REQUEST['backandedit'])) {
834
+        if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty
835
+        if ($value && !isset($_REQUEST['backandedit'])) {
836 836
             //$time = strtotime($value);
837 837
             //$value = date_i18n($date_format, $time);
838 838
         }
@@ -843,37 +843,37 @@  discard block
 block discarded – undo
843 843
 
844 844
             jQuery(function () {
845 845
 
846
-                jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
846
+                jQuery("#<?php echo $cf['name']; ?>").datepicker({changeMonth: true, changeYear: true <?php
847 847
                     /**
848 848
                      * Used to add extra option to datepicker per custom field.
849 849
                      *
850 850
                      * @since 1.5.7
851 851
                      * @param string $name The custom field name.
852 852
                      */
853
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
853
+                    echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>});
854 854
 
855
-                jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
855
+                jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format; ?>');
856 856
 
857
-                <?php if(!empty($value)){?>
858
-                jQuery("#<?php echo $name;?>").datepicker("setDate", '<?php echo $value;?>');
857
+                <?php if (!empty($value)) {?>
858
+                jQuery("#<?php echo $name; ?>").datepicker("setDate", '<?php echo $value; ?>');
859 859
                 <?php } ?>
860 860
 
861 861
             });
862 862
 
863 863
         </script>
864
-        <div id="<?php echo $name;?>_row"
865
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
864
+        <div id="<?php echo $name; ?>_row"
865
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
866 866
             <label>
867 867
 
868 868
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
869 869
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
870
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
870
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
871 871
             </label>
872 872
 
873
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
874
-                   value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
873
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
874
+                   value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
875 875
 
876
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
876
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
877 877
             <?php if ($cf['is_required']) { ?>
878 878
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
879 879
             <?php } ?>
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 
886 886
     return $html;
887 887
 }
888
-add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
888
+add_filter('geodir_custom_field_input_datepicker', 'geodir_cfi_datepicker', 10, 2);
889 889
 
890 890
 
891 891
 /**
@@ -897,12 +897,12 @@  discard block
 block discarded – undo
897 897
  *
898 898
  * @return string The html to output for the custom field.
899 899
  */
900
-function geodir_cfi_time($html,$cf){
900
+function geodir_cfi_time($html, $cf) {
901 901
 
902 902
     $html_var = $cf['htmlvar_name'];
903 903
 
904 904
     // Check if there is a custom field specific filter.
905
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
905
+    if (has_filter("geodir_custom_field_input_time_{$html_var}")) {
906 906
         /**
907 907
          * Filter the time html by individual custom field.
908 908
          *
@@ -910,11 +910,11 @@  discard block
 block discarded – undo
910 910
          * @param array $cf The custom field array.
911 911
          * @since 1.6.6
912 912
          */
913
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
913
+        $html = apply_filters("geodir_custom_field_input_time_{$html_var}", $html, $cf);
914 914
     }
915 915
 
916 916
     // If no html then we run the standard output.
917
-    if(empty($html)) {
917
+    if (empty($html)) {
918 918
 
919 919
         ob_start(); // Start  buffering;
920 920
         $value = geodir_get_cf_value($cf);
@@ -927,25 +927,25 @@  discard block
 block discarded – undo
927 927
         <script type="text/javascript">
928 928
             jQuery(document).ready(function () {
929 929
 
930
-                jQuery('#<?php echo $name;?>').timepicker({
930
+                jQuery('#<?php echo $name; ?>').timepicker({
931 931
                     showPeriod: true,
932 932
                     showLeadingZero: true,
933 933
                     showPeriod: true,
934 934
                 });
935 935
             });
936 936
         </script>
937
-        <div id="<?php echo $name;?>_row"
938
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
937
+        <div id="<?php echo $name; ?>_row"
938
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
939 939
             <label>
940 940
 
941 941
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
942 942
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
943
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
943
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
944 944
             </label>
945
-            <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
946
-                   id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
945
+            <input readonly="readonly" field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>"
946
+                   id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
947 947
 
948
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
948
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
949 949
             <?php if ($cf['is_required']) { ?>
950 950
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
951 951
             <?php } ?>
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 
957 957
     return $html;
958 958
 }
959
-add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
959
+add_filter('geodir_custom_field_input_time', 'geodir_cfi_time', 10, 2);
960 960
 
961 961
 
962 962
 /**
@@ -968,12 +968,12 @@  discard block
 block discarded – undo
968 968
  *
969 969
  * @return string The html to output for the custom field.
970 970
  */
971
-function geodir_cfi_address($html,$cf){
971
+function geodir_cfi_address($html, $cf) {
972 972
 
973 973
     $html_var = $cf['htmlvar_name'];
974 974
 
975 975
     // Check if there is a custom field specific filter.
976
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
976
+    if (has_filter("geodir_custom_field_input_address_{$html_var}")) {
977 977
         /**
978 978
          * Filter the address html by individual custom field.
979 979
          *
@@ -981,11 +981,11 @@  discard block
 block discarded – undo
981 981
          * @param array $cf The custom field array.
982 982
          * @since 1.6.6
983 983
          */
984
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
984
+        $html = apply_filters("geodir_custom_field_input_address_{$html_var}", $html, $cf);
985 985
     }
986 986
 
987 987
     // If no html then we run the standard output.
988
-    if(empty($html)) {
988
+    if (empty($html)) {
989 989
 
990 990
         global $gd_session;
991 991
         ob_start(); // Start  buffering;
@@ -998,12 +998,12 @@  discard block
 block discarded – undo
998 998
         $site_title = $cf['site_title'];
999 999
         $is_admin = $cf['is_admin'];
1000 1000
         $extra_fields = stripslashes_deep(unserialize($cf['extra_fields']));
1001
-        $prefix = $name . '_';
1001
+        $prefix = $name.'_';
1002 1002
 
1003
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
1004
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
1003
+        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address');
1004
+        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code ');
1005 1005
         ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
1006
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
1006
+        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview');
1007 1007
 
1008 1008
         $address = '';
1009 1009
         $zip = '';
@@ -1014,21 +1014,21 @@  discard block
 block discarded – undo
1014 1014
 
1015 1015
         if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1016 1016
             $post = $gd_ses_listing;
1017
-            $address = $post[$prefix . 'address'];
1018
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1019
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1020
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1021
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1022
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1017
+            $address = $post[$prefix.'address'];
1018
+            $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : '';
1019
+            $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : '';
1020
+            $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : '';
1021
+            $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : '';
1022
+            $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : '';
1023 1023
         } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1024
-            $post_info = (array)$post_info;
1025
-
1026
-            $address = $post_info[$prefix . 'address'];
1027
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1028
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1029
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1030
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1031
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1024
+            $post_info = (array) $post_info;
1025
+
1026
+            $address = $post_info[$prefix.'address'];
1027
+            $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : '';
1028
+            $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : '';
1029
+            $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : '';
1030
+            $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : '';
1031
+            $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : '';
1032 1032
         }
1033 1033
 
1034 1034
         $location = geodir_get_default_location();
@@ -1066,18 +1066,18 @@  discard block
 block discarded – undo
1066 1066
         $locate_me = !empty($extra_fields['show_map']) && geodir_map_name() != 'none' ? true : false;
1067 1067
         $locate_me_class = $locate_me ? ' gd-form-control' : '';
1068 1068
         ?>
1069
-        <div id="geodir_<?php echo $prefix . 'address';?>_row"
1070
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1071
-            <label><?php _e($address_title, 'geodirectory'); ?> <?php if ($is_required) echo '<span>*</span>';?></label>
1069
+        <div id="geodir_<?php echo $prefix.'address'; ?>_row"
1070
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1071
+            <label><?php _e($address_title, 'geodirectory'); ?> <?php if ($is_required) echo '<span>*</span>'; ?></label>
1072 1072
             <?php if ($locate_me) { ?>
1073 1073
             <div class="gd-input-group gd-locate-me">
1074 1074
             <?php } ?>
1075
-                <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>" id="<?php echo $prefix . 'address';?>" class="geodir_textfield<?php echo $locate_me_class;?>" value="<?php echo esc_attr(stripslashes($address)); ?>" />
1075
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>" id="<?php echo $prefix.'address'; ?>" class="geodir_textfield<?php echo $locate_me_class; ?>" value="<?php echo esc_attr(stripslashes($address)); ?>" />
1076 1076
                 <?php if ($locate_me) { ?>
1077 1077
                 <span onclick="gdGeoLocateMe(this, 'add-listing');" class="gd-locate-me-btn gd-input-group-addon" title="<?php esc_attr_e('My location', 'geodirlocation'); ?>"><i class="fas fa-crosshairs fa-fw" aria-hidden="true"></i></span>
1078 1078
             </div>
1079 1079
             <?php } ?>
1080
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1080
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1081 1081
             <?php if ($is_required) { ?>
1082 1082
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1083 1083
             <?php } ?>
@@ -1096,14 +1096,14 @@  discard block
 block discarded – undo
1096 1096
 
1097 1097
         if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1098 1098
 
1099
-            <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1099
+            <div id="geodir_<?php echo $prefix.'zip'; ?>_row"
1100 1100
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
1101 1101
                 <label>
1102 1102
                     <?php _e($zip_title, 'geodirectory'); ?>
1103 1103
                     <?php /*if($is_required) echo '<span>*</span>';*/ ?>
1104 1104
                 </label>
1105
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>"
1106
-                       id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill"
1105
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>"
1106
+                       id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill"
1107 1107
                        value="<?php echo esc_attr(stripslashes($zip)); ?>"/>
1108 1108
                 <?php /*if($is_required) {?>
1109 1109
 					<span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span>
@@ -1113,14 +1113,14 @@  discard block
 block discarded – undo
1113 1113
 
1114 1114
         <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?>
1115 1115
 
1116
-            <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1116
+            <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1117 1117
                 <?php
1118 1118
                 /**
1119 1119
                  * Contains add listing page map functions.
1120 1120
                  *
1121 1121
                  * @since 1.0.0
1122 1122
                  */
1123
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1123
+                include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1124 1124
                 if ($lat_lng_blank) {
1125 1125
                     $lat = '';
1126 1126
                     $lng = '';
@@ -1131,14 +1131,14 @@  discard block
 block discarded – undo
1131 1131
             <?php
1132 1132
             /* show lat lng */
1133 1133
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1134
-            <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1134
+            <div id="geodir_<?php echo $prefix.'latitude'; ?>_row"
1135 1135
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1136 1136
                 <label>
1137 1137
                     <?php echo PLACE_ADDRESS_LAT; ?>
1138 1138
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1139 1139
                 </label>
1140
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1141
-                       id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
1140
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>"
1141
+                       id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield"
1142 1142
                        value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/>
1143 1143
                 <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span>
1144 1144
                 <?php if ($is_required) { ?>
@@ -1146,14 +1146,14 @@  discard block
 block discarded – undo
1146 1146
                 <?php } ?>
1147 1147
             </div>
1148 1148
 
1149
-            <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1149
+            <div id="geodir_<?php echo $prefix.'longitude'; ?>_row"
1150 1150
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1151 1151
                 <label>
1152 1152
                     <?php echo PLACE_ADDRESS_LNG; ?>
1153 1153
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1154 1154
                 </label>
1155
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1156
-                       id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
1155
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>"
1156
+                       id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield"
1157 1157
                        value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/>
1158 1158
                 <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span>
1159 1159
                 <?php if ($is_required) { ?>
@@ -1163,32 +1163,32 @@  discard block
 block discarded – undo
1163 1163
         <?php } ?>
1164 1164
 
1165 1165
         <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?>
1166
-            <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1166
+            <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1167 1167
                 <label><?php _e($mapview_title, 'geodirectory'); ?></label>
1168 1168
 
1169 1169
 
1170 1170
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1171 1171
                                                             class="gd-checkbox"
1172
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1173
-                                                            id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1172
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1173
+                                                            id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1174 1174
                             echo 'checked="checked"';
1175 1175
                         } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1176 1176
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1177 1177
                                                              class="gd-checkbox"
1178
-                                                             name="<?php echo $prefix . 'mapview'; ?>"
1178
+                                                             name="<?php echo $prefix.'mapview'; ?>"
1179 1179
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1180 1180
                             echo 'checked="checked"';
1181 1181
                         } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1182 1182
 
1183 1183
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1184 1184
                                                             class="gd-checkbox"
1185
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1185
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1186 1186
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1187 1187
                             echo 'checked="checked"';
1188 1188
                         } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1189 1189
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1190 1190
                                                             class="gd-checkbox"
1191
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1191
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1192 1192
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1193 1193
                             echo 'checked="checked"';
1194 1194
                         } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1201 1201
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1202 1202
                 echo esc_attr($mapzoom);
1203
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1203
+            } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/>
1204 1204
         <?php }
1205 1205
 
1206 1206
         $html = ob_get_clean();
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
 
1209 1209
     return $html;
1210 1210
 }
1211
-add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1211
+add_filter('geodir_custom_field_input_address', 'geodir_cfi_address', 10, 2);
1212 1212
 
1213 1213
 
1214 1214
 
@@ -1221,12 +1221,12 @@  discard block
 block discarded – undo
1221 1221
  *
1222 1222
  * @return string The html to output for the custom field.
1223 1223
  */
1224
-function geodir_cfi_taxonomy($html,$cf){
1224
+function geodir_cfi_taxonomy($html, $cf) {
1225 1225
 
1226 1226
     $html_var = $cf['htmlvar_name'];
1227 1227
 
1228 1228
     // Check if there is a custom field specific filter.
1229
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1229
+    if (has_filter("geodir_custom_field_input_taxonomy_{$html_var}")) {
1230 1230
         /**
1231 1231
          * Filter the taxonomy html by individual custom field.
1232 1232
          *
@@ -1234,11 +1234,11 @@  discard block
 block discarded – undo
1234 1234
          * @param array $cf The custom field array.
1235 1235
          * @since 1.6.6
1236 1236
          */
1237
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1237
+        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}", $html, $cf);
1238 1238
     }
1239 1239
 
1240 1240
     // If no html then we run the standard output.
1241
-    if(empty($html)) {
1241
+    if (empty($html)) {
1242 1242
 
1243 1243
         ob_start(); // Start  buffering;
1244 1244
         $value = geodir_get_cf_value($cf);
@@ -1253,15 +1253,15 @@  discard block
 block discarded – undo
1253 1253
         if ($value == $cf['default']) {
1254 1254
             $value = '';
1255 1255
         } ?>
1256
-        <div id="<?php echo $name;?>_row"
1257
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1256
+        <div id="<?php echo $name; ?>_row"
1257
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1258 1258
             <label>
1259 1259
                 <?php $site_title = __($site_title, 'geodirectory');
1260 1260
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1261
-                <?php if ($is_required) echo '<span>*</span>';?>
1261
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1262 1262
             </label>
1263 1263
 
1264
-            <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1264
+            <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1265 1265
                 <?php
1266 1266
                 global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1267 1267
 
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
 
1274 1274
                     $package_info = array();
1275 1275
 
1276
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1276
+                    $package_info = (array) geodir_post_package_info($package_info, $post, $post_type);
1277 1277
 
1278 1278
                     if (!empty($package_info)) {
1279 1279
 
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 
1301 1301
                     $catadd_limit = $wpdb->get_var(
1302 1302
                         $wpdb->prepare(
1303
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1303
+                            "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d",
1304 1304
                             array($package_id)
1305 1305
                         )
1306 1306
                     );
@@ -1316,13 +1316,13 @@  discard block
 block discarded – undo
1316 1316
                     $required_limit_msg = '';
1317 1317
                     if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1318 1318
 
1319
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1319
+                        $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory');
1320 1320
 
1321 1321
                     } else {
1322 1322
                         $required_limit_msg = $required_msg;
1323 1323
                     }
1324 1324
 
1325
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1325
+                    echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']"  />';
1326 1326
 
1327 1327
 
1328 1328
                     if ($cat_display == 'select' || $cat_display == 'multiselect') {
@@ -1332,11 +1332,11 @@  discard block
 block discarded – undo
1332 1332
                         if ($cat_display == 'multiselect')
1333 1333
                             $multiple = 'multiple="multiple"';
1334 1334
 
1335
-                        echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1335
+                        echo '<select id="'.$name.'" '.$multiple.' type="'.$name.'" name="post_category['.$name.'][]" alt="'.$name.'" field_type="'.$cat_display.'" class="geodir_textfield textfield_x chosen_select" data-placeholder="'.__('Select Category', 'geodirectory').'">';
1336 1336
 
1337 1337
 
1338 1338
                         if ($cat_display == 'select')
1339
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1339
+                            echo '<option value="">'.__('Select Category', 'geodirectory').'</option>';
1340 1340
 
1341 1341
                     }
1342 1342
 
@@ -1354,7 +1354,7 @@  discard block
 block discarded – undo
1354 1354
                 ?>
1355 1355
             </div>
1356 1356
 
1357
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1357
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1358 1358
             <?php if ($is_required) { ?>
1359 1359
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1360 1360
             <?php } ?>
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 
1367 1367
     return $html;
1368 1368
 }
1369
-add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1369
+add_filter('geodir_custom_field_input_taxonomy', 'geodir_cfi_taxonomy', 10, 2);
1370 1370
 
1371 1371
 
1372 1372
 /**
@@ -1378,12 +1378,12 @@  discard block
 block discarded – undo
1378 1378
  *
1379 1379
  * @return string The html to output for the custom field.
1380 1380
  */
1381
-function geodir_cfi_file($html,$cf){
1381
+function geodir_cfi_file($html, $cf) {
1382 1382
 
1383 1383
     $html_var = $cf['htmlvar_name'];
1384 1384
 
1385 1385
     // Check if there is a custom field specific filter.
1386
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1386
+    if (has_filter("geodir_custom_field_input_file_{$html_var}")) {
1387 1387
         /**
1388 1388
          * Filter the file html by individual custom field.
1389 1389
          *
@@ -1391,11 +1391,11 @@  discard block
 block discarded – undo
1391 1391
          * @param array $cf The custom field array.
1392 1392
          * @since 1.6.6
1393 1393
          */
1394
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1394
+        $html = apply_filters("geodir_custom_field_input_file_{$html_var}", $html, $cf);
1395 1395
     }
1396 1396
 
1397 1397
     // If no html then we run the standard output.
1398
-    if(empty($html)) {
1398
+    if (empty($html)) {
1399 1399
 
1400 1400
         ob_start(); // Start  buffering;
1401 1401
         $value = geodir_get_cf_value($cf);
@@ -1438,8 +1438,8 @@  discard block
 block discarded – undo
1438 1438
                 $file_totImg = count($curImages);
1439 1439
         }
1440 1440
 
1441
-        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1442
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1441
+        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? implode(",", $extra_fields['gd_file_types']) : '';
1442
+        $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : '';
1443 1443
 
1444 1444
         ?>
1445 1445
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
@@ -1449,13 +1449,13 @@  discard block
 block discarded – undo
1449 1449
 			</h5>   <?php */
1450 1450
         ?>
1451 1451
 
1452
-        <div id="<?php echo $name;?>_row"
1453
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1452
+        <div id="<?php echo $name; ?>_row"
1453
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1454 1454
 
1455 1455
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1456 1456
                 <label
1457 1457
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1458
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1458
+                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label>
1459 1459
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1460 1460
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1461 1461
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
                        id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/>
1464 1464
                 <?php if ($allowed_file_types != '') { ?>
1465 1465
                     <input type="hidden" name="<?php echo $file_id; ?>_allowed_types"
1466
-                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/>
1466
+                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/>
1467 1467
                 <?php } ?>
1468 1468
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1469 1469
                        value="<?php if (isset($file_totImg)) {
@@ -1479,10 +1479,10 @@  discard block
 block discarded – undo
1479 1479
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1480 1480
                         ?>
1481 1481
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1482
-                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1482
+                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>"
1483 1483
                                class="geodir_button" style="margin-top:10px;"/>
1484 1484
                             <span class="ajaxnonceplu"
1485
-                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span>
1485
+                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span>
1486 1486
                         <?php if ($file_width && $file_height): ?>
1487 1487
                             <span class="plupload-resize"></span>
1488 1488
                             <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span>
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
 
1503 1503
                 </div>
1504 1504
             </div>
1505
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span>
1505
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span>
1506 1506
             <?php if ($is_required) { ?>
1507 1507
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1508 1508
             <?php } ?>
@@ -1515,4 +1515,4 @@  discard block
 block discarded – undo
1515 1515
 
1516 1516
     return $html;
1517 1517
 }
1518
-add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1519 1518
\ No newline at end of file
1519
+add_filter('geodir_custom_field_input_file', 'geodir_cfi_file', 10, 2);
1520 1520
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/post_functions.php 1 patch
Spacing   +246 added lines, -246 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 
27 27
     if (!isset($default_cat) || empty($default_cat)) {
28 28
         $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : '';
29
-    }else{
30
-        if(!is_int($default_cat)){
29
+    } else {
30
+        if (!is_int($default_cat)) {
31 31
             $category = get_term_by('name', $default_cat, $taxonomy);
32
-            if(isset($category->term_id)){
33
-                $default_cat =  $category->term_id;
32
+            if (isset($category->term_id)) {
33
+                $default_cat = $category->term_id;
34 34
             }
35 35
         }
36 36
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     if ($default_pos === false) {
60 60
 
61
-        $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str);
61
+        $change_cat_str = str_replace($default_cat.',y:', $default_cat.',y,d:', $change_cat_str);
62 62
 
63 63
     }
64 64
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             
146 146
             $gd_post = $post;
147 147
             if (!empty($gd_post) && is_array($gd_post)) {
148
-                $gd_post = (object)$post;
148
+                $gd_post = (object) $post;
149 149
                 
150 150
                 // Fix WPML duplicate.
151 151
                 if (geodir_is_wpml() && !empty($request_info['action']) && $request_info['action'] == 'editpost' && !empty($request_info['icl_trid']) && !isset($post['post_date'])) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         $send_post_submit_mail = false;
240 240
 
241 241
         // unhook this function so it doesn't loop infinitely
242
-        remove_action('save_post', 'geodir_post_information_save',10,2);
242
+        remove_action('save_post', 'geodir_post_information_save', 10, 2);
243 243
 
244 244
         if (isset($request_info['pid']) && $request_info['pid'] != '') {
245 245
             $post['ID'] = $request_info['pid'];
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
         }
264 264
 
265 265
         // re-hook this function
266
-        add_action('save_post', 'geodir_post_information_save',10,2);
266
+        add_action('save_post', 'geodir_post_information_save', 10, 2);
267 267
 
268 268
         $post_tags = '';
269 269
         if (!isset($request_info['post_tags'])) {
270 270
 
271 271
             $post_type = $request_info['listing_type'];
272
-            $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names')));
272
+            $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type.'_tags', array('fields' => 'names')));
273 273
 
274 274
         }
275 275
 
@@ -287,13 +287,13 @@  discard block
 block discarded – undo
287 287
         $payment_info = array();
288 288
         $package_info = array();
289 289
 
290
-        $package_info = (array)geodir_post_package_info($package_info, $post);
290
+        $package_info = (array) geodir_post_package_info($package_info, $post);
291 291
 
292 292
         $post_package_id = geodir_get_post_meta($last_post_id, 'package_id');
293 293
 
294 294
         if (!empty($package_info) && !$post_package_id) {
295 295
             if (isset($package_info['days']) && $package_info['days'] != 0) {
296
-                $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days"));
296
+                $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['days']." days"));
297 297
             } else {
298 298
                 $payment_info['expire_date'] = 'Never';
299 299
             }
@@ -314,8 +314,8 @@  discard block
 block discarded – undo
314 314
             $extrafields = $val['extra_fields'];
315 315
 
316 316
             if (trim($type) == 'address') {
317
-                $prefix = $name . '_';
318
-                $address = $prefix . 'address';
317
+                $prefix = $name.'_';
318
+                $address = $prefix.'address';
319 319
 
320 320
                 if (isset($request_info[$address]) && $request_info[$address] != '') {
321 321
                     $gd_post_info[$address] = wp_slash($request_info[$address]);
@@ -325,59 +325,59 @@  discard block
 block discarded – undo
325 325
                     $extrafields = unserialize($extrafields);
326 326
 
327 327
 
328
-                    if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') {
328
+                    if (!isset($request_info[$prefix.'city']) || $request_info[$prefix.'city'] == '') {
329 329
 
330 330
                         $location_result = geodir_get_default_location();
331 331
 
332
-                        $gd_post_info[$prefix . 'city'] = $location_result->city;
333
-                        $gd_post_info[$prefix . 'region'] = $location_result->region;
334
-                        $gd_post_info[$prefix . 'country'] = $location_result->country;
332
+                        $gd_post_info[$prefix.'city'] = $location_result->city;
333
+                        $gd_post_info[$prefix.'region'] = $location_result->region;
334
+                        $gd_post_info[$prefix.'country'] = $location_result->country;
335 335
 
336
-                        $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location
336
+                        $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location
337 337
 
338 338
                     } else {
339 339
 
340
-                        $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city'];
341
-                        $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region'];
342
-                        $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country'];
340
+                        $gd_post_info[$prefix.'city'] = $request_info[$prefix.'city'];
341
+                        $gd_post_info[$prefix.'region'] = $request_info[$prefix.'region'];
342
+                        $gd_post_info[$prefix.'country'] = $request_info[$prefix.'country'];
343 343
 
344 344
                         //----------set post locations when import dummy data-------
345 345
                         $location_result = geodir_get_default_location();
346 346
 
347
-                        $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location
347
+                        $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location
348 348
                         //-----------------------------------------------------------------
349 349
 
350 350
                     }
351 351
 
352 352
 
353
-                    if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) {
354
-                        $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip'];
353
+                    if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix.'zip'])) {
354
+                        $gd_post_info[$prefix.'zip'] = $request_info[$prefix.'zip'];
355 355
                     }
356 356
 
357 357
 
358 358
                     if (isset($extrafields['show_map']) && $extrafields['show_map']) {
359 359
 
360
-                        if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') {
361
-                            $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude'];
360
+                        if (isset($request_info[$prefix.'latitude']) && $request_info[$prefix.'latitude'] != '') {
361
+                            $gd_post_info[$prefix.'latitude'] = $request_info[$prefix.'latitude'];
362 362
                         }
363 363
 
364
-                        if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') {
365
-                            $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude'];
364
+                        if (isset($request_info[$prefix.'longitude']) && $request_info[$prefix.'longitude'] != '') {
365
+                            $gd_post_info[$prefix.'longitude'] = $request_info[$prefix.'longitude'];
366 366
                         }
367 367
 
368
-                        if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') {
369
-                            $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview'];
368
+                        if (isset($request_info[$prefix.'mapview']) && $request_info[$prefix.'mapview'] != '') {
369
+                            $gd_post_info[$prefix.'mapview'] = $request_info[$prefix.'mapview'];
370 370
                         }
371 371
 
372
-                        if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') {
373
-                            $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom'];
372
+                        if (isset($request_info[$prefix.'mapzoom']) && $request_info[$prefix.'mapzoom'] != '') {
373
+                            $gd_post_info[$prefix.'mapzoom'] = $request_info[$prefix.'mapzoom'];
374 374
                         }
375 375
 
376 376
                     }
377 377
 
378 378
                     // show lat lng
379
-                    if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) {
380
-                        $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng'];
379
+                    if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix.'latlng'])) {
380
+                        $gd_post_info[$prefix.'latlng'] = $request_info[$prefix.'latlng'];
381 381
                     }
382 382
                 }
383 383
 
@@ -403,16 +403,16 @@  discard block
 block discarded – undo
403 403
 
404 404
                         // check if we need to change the format or not
405 405
                         $date_format_len = strlen(str_replace(' ', '', $date_format));
406
-                        if($date_format_len>5){// if greater then 5 then it's the old style format.
406
+                        if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
407 407
 
408
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
409
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
408
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
409
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
410 410
 
411 411
                             $date_format = str_replace($search, $replace, $date_format);
412 412
 
413 413
                             $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $request_info[$name]) : $request_info[$name];
414 414
 
415
-                        }else{
415
+                        } else {
416 416
                             $post_htmlvar_value = $request_info[$name];
417 417
                         }
418 418
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                 if (isset($request_info[$name])) {
427 427
                     $gd_post_info[$name] = $request_info[$name];
428 428
                 } else {
429
-                    if (isset($request_info['gd_field_' . $name])) {
429
+                    if (isset($request_info['gd_field_'.$name])) {
430 430
                         $gd_post_info[$name] = ''; /* fix de-select for multiselect */
431 431
                     }
432 432
                 }
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
         }
487 487
 
488 488
         if (is_array($post_tags)) {
489
-            $taxonomy = $request_info['listing_type'] . '_tags';
489
+            $taxonomy = $request_info['listing_type'].'_tags';
490 490
             wp_set_object_terms($last_post_id, $post_tags, $taxonomy);
491 491
         }
492 492
 
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
                 $tmpimgArr = trim($request_info['post_images'], ",");
499 499
                 $tmpimgArr = explode(",", $tmpimgArr);
500 500
                 geodir_save_post_images($last_post_id, $tmpimgArr, $dummy);
501
-            } else{
501
+            } else {
502 502
                 geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy);
503 503
             }
504 504
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
     if (!in_array($post_type, $all_postypes))
580 580
         return false;
581 581
 
582
-    $table = $plugin_prefix . $post_type . '_detail';
582
+    $table = $plugin_prefix.$post_type.'_detail';
583 583
 
584 584
     /**
585 585
      * Apply Filter to change Post info
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
      * @since 1.0.0
590 590
      * @package GeoDirectory
591 591
      */
592
-    $query = apply_filters('geodir_post_info_query', $wpdb->prepare("SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd
592
+    $query = apply_filters('geodir_post_info_query', $wpdb->prepare("SELECT p.*,pd.* FROM ".$wpdb->posts." p,".$table." pd
593 593
 			  WHERE p.ID = pd.post_id
594 594
 			  AND pd.post_id = %d", $post_id));
595 595
 
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 
653 653
         $post_type = get_post_type($post_id);
654 654
 
655
-        $table = $plugin_prefix . $post_type . '_detail';
655
+        $table = $plugin_prefix.$post_type.'_detail';
656 656
 
657 657
         /**
658 658
          * Filter to change Post info
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 
674 674
             $columns = $wpdb->get_col("show columns from $table");
675 675
             foreach ($postmeta as $mkey => $mval) {
676
-                if(in_array($mkey,$columns)) {
676
+                if (in_array($mkey, $columns)) {
677 677
                     if (is_array($mval)) {
678 678
                         $mval = implode(",", $mval);
679 679
                     }
@@ -702,12 +702,12 @@  discard block
 block discarded – undo
702 702
              */
703 703
             do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id);
704 704
 
705
-            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
705
+            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
706 706
 
707 707
                 $query_string_array[] = $post_id;
708 708
                 $wpdb->query(
709 709
                     $wpdb->prepare(
710
-                        "UPDATE " . $table . " SET " . $query_string_escaped . " where post_id =%d",
710
+                        "UPDATE ".$table." SET ".$query_string_escaped." where post_id =%d",
711 711
                         $query_string_array
712 712
                     )
713 713
                 );
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
                 array_unshift($query_string_array, $post_id);
719 719
                 $wpdb->query(
720 720
                     $wpdb->prepare(
721
-                        "INSERT INTO " . $table . " SET post_id = %d," . $query_string_escaped,
721
+                        "INSERT INTO ".$table." SET post_id = %d,".$query_string_escaped,
722 722
                         $query_string_array
723 723
                     )
724 724
                 );
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
         $post_type = get_post_type($post_id);
766 766
 
767
-        $table = $plugin_prefix . $post_type . '_detail';
767
+        $table = $plugin_prefix.$post_type.'_detail';
768 768
 
769 769
         if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) {
770 770
 
@@ -772,11 +772,11 @@  discard block
 block discarded – undo
772 772
                 $meta_value = implode(",", $meta_value);
773 773
             }
774 774
 
775
-            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
775
+            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
776 776
 
777 777
                 $wpdb->query(
778 778
                     $wpdb->prepare(
779
-                        "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d",
779
+                        "UPDATE ".$table." SET ".$postmeta." = '".$meta_value."' where post_id =%d",
780 780
                         array($post_id)
781 781
                     )
782 782
                 );
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 
786 786
                 $wpdb->query(
787 787
                     $wpdb->prepare(
788
-                        "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'",
788
+                        "INSERT INTO ".$table." SET post_id = %d, ".$postmeta." = '".$meta_value."'",
789 789
                         array($post_id)
790 790
                     )
791 791
                 );
@@ -818,14 +818,14 @@  discard block
 block discarded – undo
818 818
 
819 819
         $post_type = get_post_type($post_id);
820 820
 
821
-        $table = $plugin_prefix . $post_type . '_detail';
821
+        $table = $plugin_prefix.$post_type.'_detail';
822 822
 
823 823
         if (is_array($postmeta) && !empty($postmeta) && $post_id) {
824 824
             $post_meta_set_query = '';
825 825
 
826 826
             foreach ($postmeta as $mkey) {
827 827
                 if ($mval != '')
828
-                    $post_meta_set_query .= $mkey . " = '', ";
828
+                    $post_meta_set_query .= $mkey." = '', ";
829 829
             }
830 830
 
831 831
             $post_meta_set_query = trim($post_meta_set_query, ", ");
@@ -834,11 +834,11 @@  discard block
 block discarded – undo
834 834
                 return false;
835 835
             }
836 836
 
837
-            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
837
+            if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
838 838
 
839 839
                 $wpdb->query(
840 840
                     $wpdb->prepare(
841
-                        "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d",
841
+                        "UPDATE ".$table." SET ".$post_meta_set_query." where post_id = %d",
842 842
                         array($post_id)
843 843
                     )
844 844
                 );
@@ -847,11 +847,11 @@  discard block
 block discarded – undo
847 847
             }
848 848
 
849 849
         } elseif ($postmeta != '' && $post_id) {
850
-            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
850
+            if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
851 851
 
852 852
                 $wpdb->query(
853 853
                     $wpdb->prepare(
854
-                        "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d",
854
+                        "UPDATE ".$table." SET ".$postmeta."= '' where post_id = %d",
855 855
                         array($post_id)
856 856
                     )
857 857
                 );
@@ -893,10 +893,10 @@  discard block
 block discarded – undo
893 893
         if (!in_array($post_type, $all_postypes))
894 894
             return false;
895 895
 
896
-        $table = $plugin_prefix . $post_type . '_detail';
896
+        $table = $plugin_prefix.$post_type.'_detail';
897 897
 
898
-        if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') {
899
-            $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)));
898
+        if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$meta_key."'") != '') {
899
+            $meta_value = $wpdb->get_var($wpdb->prepare("SELECT ".$meta_key." from ".$table." where post_id = %d", array($post_id)));
900 900
             
901 901
             if ($meta_value && $meta_value !== '') {
902 902
                 $meta_value = maybe_serialize($meta_value);
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
          * @param string $meta_key The meta key to retrieve.
916 916
          * @param bool $single Optional. Whether to return a single value. Default false.
917 917
          */
918
-        return apply_filters( 'geodir_get_post_meta', $meta_value, $post_id, $meta_key, $single );
918
+        return apply_filters('geodir_get_post_meta', $meta_value, $post_id, $meta_key, $single);
919 919
     }
920 920
 }
921 921
 
@@ -941,13 +941,13 @@  discard block
 block discarded – undo
941 941
 
942 942
         $post_type = get_post_type($post_id);
943 943
 
944
-        $table = $plugin_prefix . $post_type . '_detail';
944
+        $table = $plugin_prefix.$post_type.'_detail';
945 945
 
946 946
         $post_images = geodir_get_images($post_id);
947 947
 
948 948
         $wpdb->query(
949 949
             $wpdb->prepare(
950
-                "UPDATE " . $table . " SET featured_image = '' where post_id =%d",
950
+                "UPDATE ".$table." SET featured_image = '' where post_id =%d",
951 951
                 array($post_id)
952 952
             )
953 953
         );
@@ -977,12 +977,12 @@  discard block
 block discarded – undo
977 977
                 $file_path = '';
978 978
                 /* --------- start ------- */
979 979
 
980
-                $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
980
+                $split_img_path = explode(str_replace(array('http://', 'https://'), '', $uploads['baseurl']), str_replace(array('http://', 'https://'), '', $post_image[$m]));
981 981
 
982 982
                 $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
983 983
 
984 984
 
985
-                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
985
+                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM ".GEODIR_ATTACHMENT_TABLE." WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
986 986
 
987 987
                     /* --------- end ------- */
988 988
                     $curr_img_url = $post_image[$m];
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
                     // If the uploaded file is the right format
1027 1027
                     if (in_array($uploaded_file_type, $allowed_file_types)) {
1028 1028
                         if (!function_exists('wp_handle_upload')) {
1029
-                            require_once(ABSPATH . 'wp-admin/includes/file.php');
1029
+                            require_once(ABSPATH.'wp-admin/includes/file.php');
1030 1030
                         }
1031 1031
 
1032 1032
                         if (!is_dir($geodir_uploadpath)) {
@@ -1034,41 +1034,41 @@  discard block
 block discarded – undo
1034 1034
                         }
1035 1035
 
1036 1036
                         $external_img = false;
1037
-                        if (strpos( str_replace( array('http://','https://'),'',$curr_img_url ), str_replace(array('http://','https://'),'',$uploads['baseurl'] ) ) !== false) {
1037
+                        if (strpos(str_replace(array('http://', 'https://'), '', $curr_img_url), str_replace(array('http://', 'https://'), '', $uploads['baseurl'])) !== false) {
1038 1038
                         } else {
1039 1039
                             $external_img = true;
1040 1040
                         }
1041 1041
 
1042 1042
                         if ($dummy || $external_img) {
1043 1043
                             $uploaded_file = array();
1044
-                            $uploaded = (array)fetch_remote_file($curr_img_url);
1044
+                            $uploaded = (array) fetch_remote_file($curr_img_url);
1045 1045
 
1046 1046
                             if (isset($uploaded['error']) && empty($uploaded['error'])) {
1047 1047
                                 $new_name = basename($uploaded['file']);
1048 1048
                                 $uploaded_file = $uploaded;
1049
-                            }else{
1050
-                                print_r($uploaded);exit;
1049
+                            } else {
1050
+                                print_r($uploaded); exit;
1051 1051
                             }
1052 1052
                             $external_img = false;
1053 1053
                         } else {
1054
-                            $new_name = $post_id . '_' . $file_name;
1054
+                            $new_name = $post_id.'_'.$file_name;
1055 1055
 
1056 1056
                             if ($curr_img_dir == $sub_dir) {
1057
-                                $img_path = $geodir_uploadpath . '/' . $filename;
1058
-                                $img_url = $geodir_uploadurl . '/' . $filename;
1057
+                                $img_path = $geodir_uploadpath.'/'.$filename;
1058
+                                $img_url = $geodir_uploadurl.'/'.$filename;
1059 1059
                             } else {
1060
-                                $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1061
-                                $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1060
+                                $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1061
+                                $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1062 1062
                             }
1063 1063
 
1064 1064
                             $uploaded_file = '';
1065 1065
 
1066 1066
                             if (file_exists($img_path)) {
1067
-                                $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1067
+                                $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1068 1068
                                 $file_path = '';
1069
-                            } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) {
1069
+                            } else if (file_exists($uploads['basedir'].$curr_img_dir.$filename)) {
1070 1070
                                 $uploaded_file = true;
1071
-                                $file_path = $curr_img_dir . '/' . $filename;
1071
+                                $file_path = $curr_img_dir.'/'.$filename;
1072 1072
                             }
1073 1073
 
1074 1074
                             if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path))
@@ -1077,14 +1077,14 @@  discard block
 block discarded – undo
1077 1077
 
1078 1078
                         if (!empty($uploaded_file)) {
1079 1079
                             if (!isset($file_path) || !$file_path) {
1080
-                                $file_path = $sub_dir . '/' . $new_name;
1080
+                                $file_path = $sub_dir.'/'.$new_name;
1081 1081
                             }
1082 1082
 
1083
-                            $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
1083
+                            $postcurr_images[] = str_replace(array('http://', 'https://'), '', $uploads['baseurl'].$file_path);
1084 1084
 
1085 1085
                             if ($menu_order == 1) {
1086 1086
 
1087
-                                $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
1087
+                                $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
1088 1088
 
1089 1089
                             }
1090 1090
 
@@ -1102,12 +1102,12 @@  discard block
 block discarded – undo
1102 1102
 
1103 1103
                             foreach ($attachment as $key => $val) {
1104 1104
                                 if ($val != '')
1105
-                                    $attachment_set .= $key . " = '" . $val . "', ";
1105
+                                    $attachment_set .= $key." = '".$val."', ";
1106 1106
                             }
1107 1107
 
1108 1108
                             $attachment_set = trim($attachment_set, ", ");
1109 1109
 
1110
-                            $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
1110
+                            $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
1111 1111
 
1112 1112
                             $valid_file_ids[] = $wpdb->insert_id;
1113 1113
                         }
@@ -1118,17 +1118,17 @@  discard block
 block discarded – undo
1118 1118
                 } else {
1119 1119
                     $valid_file_ids[] = $find_image;
1120 1120
 
1121
-                    $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
1121
+                    $postcurr_images[] = str_replace(array('http://', 'https://'), '', $post_image[$m]);
1122 1122
 
1123 1123
                     $wpdb->query(
1124 1124
                         $wpdb->prepare(
1125
-                            "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d",
1125
+                            "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d where file =%s AND post_id =%d",
1126 1126
                             array($menu_order, $split_img_path[1], $post_id)
1127 1127
                         )
1128 1128
                     );
1129 1129
 
1130 1130
                     if ($menu_order == 1)
1131
-                        $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1131
+                        $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1132 1132
 
1133 1133
                 }
1134 1134
 
@@ -1152,9 +1152,9 @@  discard block
 block discarded – undo
1152 1152
 
1153 1153
                 foreach ($post_images as $img) {
1154 1154
 
1155
-                    if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
1155
+                    if (!in_array(str_replace(array('http://', 'https://'), '', $img->src), $postcurr_images)) {
1156 1156
 
1157
-                        $invalid_files[] = (object)array('src' => $img->src);
1157
+                        $invalid_files[] = (object) array('src' => $img->src);
1158 1158
 
1159 1159
                     }
1160 1160
 
@@ -1162,12 +1162,12 @@  discard block
 block discarded – undo
1162 1162
 
1163 1163
             }
1164 1164
 
1165
-            $invalid_files = (object)$invalid_files;
1165
+            $invalid_files = (object) $invalid_files;
1166 1166
         }
1167 1167
 
1168 1168
         $remove_files[] = $post_id;
1169 1169
 
1170
-        $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
1170
+        $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ".$valid_files_condition." post_id = %d", $remove_files));
1171 1171
 
1172 1172
         if (!empty($invalid_files))
1173 1173
             geodir_remove_attachments($invalid_files);
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 			rmdir($dirPath);
1208 1208
 	}	*/
1209 1209
 
1210
-    $dirname = $uploads_dir . '/temp_' . $current_user->ID;
1210
+    $dirname = $uploads_dir.'/temp_'.$current_user->ID;
1211 1211
     geodir_delete_directory($dirname);
1212 1212
 }
1213 1213
 
@@ -1229,10 +1229,10 @@  discard block
 block discarded – undo
1229 1229
         return false;
1230 1230
     while ($file = readdir($dir_handle)) {
1231 1231
         if ($file != "." && $file != "..") {
1232
-            if (!is_dir($dirname . "/" . $file))
1233
-                unlink($dirname . "/" . $file);
1232
+            if (!is_dir($dirname."/".$file))
1233
+                unlink($dirname."/".$file);
1234 1234
             else
1235
-                geodir_delete_directory($dirname . '/' . $file);
1235
+                geodir_delete_directory($dirname.'/'.$file);
1236 1236
         }
1237 1237
     }
1238 1238
     closedir($dir_handle);
@@ -1261,8 +1261,8 @@  discard block
 block discarded – undo
1261 1261
             foreach ($postcurr_images as $postimg) {
1262 1262
                 $image_name_arr = explode('/', $postimg->src);
1263 1263
                 $filename = end($image_name_arr);
1264
-                if (file_exists($uploads_dir . '/' . $filename))
1265
-                    unlink($uploads_dir . '/' . $filename);
1264
+                if (file_exists($uploads_dir.'/'.$filename))
1265
+                    unlink($uploads_dir.'/'.$filename);
1266 1266
             }
1267 1267
 
1268 1268
         } // endif
@@ -1303,28 +1303,28 @@  discard block
 block discarded – undo
1303 1303
         }
1304 1304
 
1305 1305
         if (!in_array($post_type, geodir_get_posttypes())) {
1306
-            return false;// if not a GD CPT return;
1306
+            return false; // if not a GD CPT return;
1307 1307
         }
1308 1308
 
1309 1309
 
1310
-        $list_img_size = get_option('geodir_listing_img_size','default');
1310
+        $list_img_size = get_option('geodir_listing_img_size', 'default');
1311 1311
 
1312
-        if( $size=='list-thumb' && $list_img_size != 'default' ){
1313
-            $fimg = get_the_post_thumbnail_url($post_id,$list_img_size);
1314
-            if($fimg){
1312
+        if ($size == 'list-thumb' && $list_img_size != 'default') {
1313
+            $fimg = get_the_post_thumbnail_url($post_id, $list_img_size);
1314
+            if ($fimg) {
1315 1315
                 $uploads = wp_upload_dir(); 
1316 1316
                 $uploads_baseurl = $uploads['baseurl'];
1317
-                $file = str_replace($uploads_baseurl,'',$fimg);
1317
+                $file = str_replace($uploads_baseurl, '', $fimg);
1318 1318
             }
1319 1319
         }
1320 1320
 
1321
-        $table = $plugin_prefix . $post_type . '_detail';
1321
+        $table = $plugin_prefix.$post_type.'_detail';
1322 1322
 
1323 1323
         if (!$file) {
1324 1324
             if (isset($post->featured_image)) {
1325 1325
                 $file = $post->featured_image;
1326 1326
             } else {
1327
-                $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id)));
1327
+                $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM ".$table." WHERE post_id = %d", array($post_id)));
1328 1328
             }
1329 1329
         }
1330 1330
 
@@ -1343,9 +1343,9 @@  discard block
 block discarded – undo
1343 1343
 
1344 1344
             $file_name = $file_info['basename'];
1345 1345
 
1346
-            $uploads_url = $uploads_baseurl . $sub_dir;
1346
+            $uploads_url = $uploads_baseurl.$sub_dir;
1347 1347
 
1348
-            $img_src = $uploads_url . '/' . $file_name;
1348
+            $img_src = $uploads_url.'/'.$file_name;
1349 1349
 
1350 1350
             // jetpack CDN check
1351 1351
             if (strpos($file, '.wp.com/') !== false) {
@@ -1361,8 +1361,8 @@  discard block
 block discarded – undo
1361 1361
              * @param string $uploads_url The server upload directory url.
1362 1362
              * @param string $uploads_baseurl The uploads dir base url.
1363 1363
              */
1364
-            $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$img_src,$file_name,$uploads_url,$uploads_baseurl);
1365
-            $img_arr['path'] = $uploads_path . '/' . $file_name;
1364
+            $img_arr['src'] = apply_filters('geodir_get_featured_image_src', $img_src, $file_name, $uploads_url, $uploads_baseurl);
1365
+            $img_arr['path'] = $uploads_path.'/'.$file_name;
1366 1366
             $width = 0;
1367 1367
             $height = 0;
1368 1368
             if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
                 $file_name = $file_info['basename'];
1406 1406
 
1407 1407
                 $img_arr['src'] = $default_img;
1408
-                $img_arr['path'] = $uploads_path . '/' . $file_name;
1408
+                $img_arr['path'] = $uploads_path.'/'.$file_name;
1409 1409
 
1410 1410
                 $width = 0;
1411 1411
                 $height = 0;
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
         }
1423 1423
 
1424 1424
         if (!empty($img_arr))
1425
-            return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path );
1425
+            return (object) $img_arr; //return (object)array( 'src' => $file_url, 'path' => $file_path );
1426 1426
         else
1427 1427
             return false;
1428 1428
     }
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 
1486 1486
         $arrImages = $wpdb->get_results(
1487 1487
             $wpdb->prepare(
1488
-                "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ",
1488
+                "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d".$not_featured." ORDER BY menu_order ASC, ID DESC $limit_q ",
1489 1489
                 array('%image%', $post_id)
1490 1490
             )
1491 1491
         );
@@ -1511,7 +1511,7 @@  discard block
 block discarded – undo
1511 1511
 
1512 1512
                 $file_name = $file_info['basename'];
1513 1513
 
1514
-                $uploads_url = $uploads_baseurl . $sub_dir;
1514
+                $uploads_url = $uploads_baseurl.$sub_dir;
1515 1515
                 /*
1516 1516
                 * Allows the filter of image src for such things as CDN change.
1517 1517
                 *
@@ -1521,8 +1521,8 @@  discard block
 block discarded – undo
1521 1521
                 * @param string $uploads_url The server upload directory url.
1522 1522
                 * @param string $uploads_baseurl The uploads dir base url.
1523 1523
                 */
1524
-                $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
1525
-                $img_arr['path'] = $uploads_path . '/' . $file_name;
1524
+                $img_arr['src'] = apply_filters('geodir_get_images_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
1525
+                $img_arr['path'] = $uploads_path.'/'.$file_name;
1526 1526
                 $width = 0;
1527 1527
                 $height = 0;
1528 1528
                 if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
@@ -1539,7 +1539,7 @@  discard block
 block discarded – undo
1539 1539
                 $img_arr['content'] = $attechment->content; // add the description to the array
1540 1540
                 $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1.
1541 1541
 
1542
-                $return_arr[] = (object)$img_arr;
1542
+                $return_arr[] = (object) $img_arr;
1543 1543
 
1544 1544
                 $counter++;
1545 1545
             }
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
              * @since 1.6.20
1551 1551
              * @param array $return_arr The array of image objects.
1552 1552
              */
1553
-            return apply_filters('geodir_get_images_arr',$return_arr);
1553
+            return apply_filters('geodir_get_images_arr', $return_arr);
1554 1554
         } else if ($no_images) {
1555 1555
             $default_img = '';
1556 1556
             $default_cat = geodir_get_post_meta($post_id, 'default_category', true);
@@ -1589,7 +1589,7 @@  discard block
 block discarded – undo
1589 1589
                 $img_arr['title'] = $file_info['filename']; // add the title to the array
1590 1590
                 $img_arr['content'] = $file_info['filename']; // add the description to the array
1591 1591
 
1592
-                $return_arr[] = (object)$img_arr;
1592
+                $return_arr[] = (object) $img_arr;
1593 1593
 
1594 1594
                 /**
1595 1595
                  * Filter the images array so things can be changed.
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
                  * @since 1.6.20
1598 1598
                  * @param array $return_arr The array of image objects.
1599 1599
                  */
1600
-                return apply_filters('geodir_get_images_arr',$return_arr);
1600
+                return apply_filters('geodir_get_images_arr', $return_arr);
1601 1601
             } else
1602 1602
                 return false;
1603 1603
         }
@@ -1622,8 +1622,8 @@  discard block
 block discarded – undo
1622 1622
 
1623 1623
         $html = '';
1624 1624
         if (!empty($request)) {
1625
-            if (!is_object($request)){
1626
-                $request = (object)$request;
1625
+            if (!is_object($request)) {
1626
+                $request = (object) $request;
1627 1627
             }
1628 1628
 
1629 1629
             if (isset($request->src) && !isset($request->path)) {
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
             $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
1638 1638
             $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
1639 1639
             if (strpos($img_no_http, $upload_no_http) !== false) {
1640
-                $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path);
1640
+                $request->path = str_replace($img_no_http, $upload_dir['basedir'], $request->path);
1641 1641
             }
1642 1642
             
1643 1643
             $width = 0;
@@ -1654,7 +1654,7 @@  discard block
 block discarded – undo
1654 1654
             $image->height = $height;
1655 1655
             $image->title = isset($request->title) ? $request->title : '';
1656 1656
 
1657
-            $max_size = (object)geodir_get_imagesize($size);
1657
+            $max_size = (object) geodir_get_imagesize($size);
1658 1658
 
1659 1659
             if (!is_wp_error($max_size)) {
1660 1660
                 if ($image->width) {
@@ -1666,13 +1666,13 @@  discard block
 block discarded – undo
1666 1666
                         $width_per = 100;
1667 1667
                 }
1668 1668
 
1669
-                if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
1670
-                    $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '"  /></div>';
1669
+                if (is_admin() && !isset($_REQUEST['geodir_ajax'])) {
1670
+                    $html = '<div class="geodir_thumbnail"><img style="max-height:'.$max_size->h.'px;" alt="place image" src="'.$image->src.'"  /></div>';
1671 1671
                 } else {
1672
-                    if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
1673
-                        $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');" title="'.$image->title.'" aria-label="'.$image->title.'" ></div>';
1674
-                    }else{
1675
-                        $html = '<div data-src="'.str_replace(' ','%20',$image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" title="'.$image->title.'" aria-label="'.$image->title.'"></div>';
1672
+                    if ($size == 'widget-thumb' || !get_option('geodir_lazy_load', 1)) {
1673
+                        $html = '<div class="geodir_thumbnail" style="background-image:url(\''.$image->src.'\');" title="'.$image->title.'" aria-label="'.$image->title.'" ></div>';
1674
+                    } else {
1675
+                        $html = '<div data-src="'.str_replace(' ', '%20', $image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" title="'.$image->title.'" aria-label="'.$image->title.'"></div>';
1676 1676
                     }
1677 1677
 
1678 1678
                 }
@@ -1707,15 +1707,15 @@  discard block
 block discarded – undo
1707 1707
 
1708 1708
         $post_type = get_post_type($post_id);
1709 1709
 
1710
-        $table = $plugin_prefix . $post_type . '_detail';
1710
+        $table = $plugin_prefix.$post_type.'_detail';
1711 1711
 
1712 1712
         if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) {
1713 1713
 
1714
-            if ($taxonomy == $post_type . '_tags') {
1714
+            if ($taxonomy == $post_type.'_tags') {
1715 1715
                 if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
1716 1716
                     geodir_save_post_meta($post_id, 'post_tags', $terms);
1717 1717
                 }
1718
-            } elseif ($taxonomy == $post_type . 'category') {
1718
+            } elseif ($taxonomy == $post_type.'category') {
1719 1719
                 $srcharr = array('"', '\\');
1720 1720
                 $replarr = array("&quot;", '');
1721 1721
 
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 
1738 1738
                     $wpdb->get_var(
1739 1739
                         $wpdb->prepare(
1740
-                            "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ",
1740
+                            "DELETE from ".GEODIR_ICON_TABLE." WHERE cat_id NOT IN ($format) AND post_id = %d ",
1741 1741
                             $cat_ids_array_del
1742 1742
                         )
1743 1743
                     );
@@ -1745,7 +1745,7 @@  discard block
 block discarded – undo
1745 1745
 
1746 1746
                     $post_term = $wpdb->get_col(
1747 1747
                         $wpdb->prepare(
1748
-                            "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id",
1748
+                            "SELECT term_id FROM ".$wpdb->term_taxonomy." WHERE term_taxonomy_id IN($format) GROUP BY term_id",
1749 1749
                             $cat_ids_array
1750 1750
                         )
1751 1751
                     );
@@ -1767,16 +1767,16 @@  discard block
 block discarded – undo
1767 1767
                         $lat = geodir_get_post_meta($post_id, 'post_latitude', true);
1768 1768
                         $lng = geodir_get_post_meta($post_id, 'post_longitude', true);
1769 1769
 
1770
-                        $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
1771
-                        $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true);
1770
+                        $timing = ' - '.date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
1771
+                        $timing .= ' - '.geodir_get_post_meta($post_id, 'st_time', true);
1772 1772
 
1773 1773
                         $json = '{';
1774
-                        $json .= '"id":"' . $post_id . '",';
1775
-                        $json .= '"lat_pos": "' . $lat . '",';
1776
-                        $json .= '"long_pos": "' . $lng . '",';
1777
-                        $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",';
1778
-                        $json .= '"icon":"' . $term_icon . '",';
1779
-                        $json .= '"group":"catgroup' . $cat_id . '"';
1774
+                        $json .= '"id":"'.$post_id.'",';
1775
+                        $json .= '"lat_pos": "'.$lat.'",';
1776
+                        $json .= '"long_pos": "'.$lng.'",';
1777
+                        $json .= '"marker_id":"'.$post_id.'_'.$cat_id.'",';
1778
+                        $json .= '"icon":"'.$term_icon.'",';
1779
+                        $json .= '"group":"catgroup'.$cat_id.'"';
1780 1780
                         $json .= '}';
1781 1781
 
1782 1782
 
@@ -1784,9 +1784,9 @@  discard block
 block discarded – undo
1784 1784
                             $post_marker_json = $json;
1785 1785
 
1786 1786
 
1787
-                        if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
1787
+                        if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".GEODIR_ICON_TABLE." WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
1788 1788
 
1789
-                            $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET
1789
+                            $json_query = $wpdb->prepare("UPDATE ".GEODIR_ICON_TABLE." SET
1790 1790
 										post_title = %s,
1791 1791
 										json = %s
1792 1792
 										WHERE post_id = %d AND cat_id = %d ",
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
 
1795 1795
                         } else {
1796 1796
 
1797
-                            $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET
1797
+                            $json_query = $wpdb->prepare("INSERT INTO ".GEODIR_ICON_TABLE." SET
1798 1798
 										post_id = %d,
1799 1799
 										post_title = %s,
1800 1800
 										cat_id = %d,
@@ -1812,17 +1812,17 @@  discard block
 block discarded – undo
1812 1812
                 if (!empty($post_term) && is_array($post_term)) {
1813 1813
                     $categories = implode(',', $post_term);
1814 1814
 
1815
-                    if ($categories != '' && $categories != 0) $categories = ',' . $categories . ',';
1815
+                    if ($categories != '' && $categories != 0) $categories = ','.$categories.',';
1816 1816
 
1817 1817
                     if (empty($post_marker_json))
1818 1818
                         $post_marker_json = isset($json) ? $json : '';
1819 1819
 
1820
-                    if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
1820
+                    if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
1821 1821
 
1822 1822
                         $wpdb->query(
1823 1823
                             $wpdb->prepare(
1824
-                                "UPDATE " . $table . " SET
1825
-								" . $taxonomy . " = %s,
1824
+                                "UPDATE ".$table." SET
1825
+								" . $taxonomy." = %s,
1826 1826
 								marker_json = %s
1827 1827
 								where post_id = %d",
1828 1828
                                 array($categories, $post_marker_json, $post_id)
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
 
1844 1844
                                     $wpdb->query(
1845 1845
                                         $wpdb->prepare(
1846
-                                            "UPDATE " . $table . " SET
1846
+                                            "UPDATE ".$table." SET
1847 1847
 											default_category = %s
1848 1848
 											where post_id = %d",
1849 1849
                                             array($categories[0], $post_id)
@@ -1868,9 +1868,9 @@  discard block
 block discarded – undo
1868 1868
 
1869 1869
                         $wpdb->query(
1870 1870
                             $wpdb->prepare(
1871
-                                "INSERT INTO " . $table . " SET
1871
+                                "INSERT INTO ".$table." SET
1872 1872
 								post_id = %d,
1873
-								" . $taxonomy . " = %s,
1873
+								" . $taxonomy." = %s,
1874 1874
 								marker_json = %s ",
1875 1875
 
1876 1876
                                 array($post_id, $categories, $post_marker_json)
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
                                     } ?>"><img alt="bubble image" style="max-height:50px;"
2003 2003
                                                src="<?php echo $post_images[0]; ?>"/></a></div>
2004 2004
                             <?php
2005
-                            }else{
2005
+                            } else {
2006 2006
                                 echo '<div class="geodir-bubble_image"></div>';
2007 2007
                             }
2008 2008
                         } else {
@@ -2010,7 +2010,7 @@  discard block
 block discarded – undo
2010 2010
                                 ?>
2011 2011
                                 <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div>
2012 2012
                             <?php
2013
-                            }else{
2013
+                            } else {
2014 2014
                                 echo '<div class="geodir-bubble_image"></div>';
2015 2015
                             }
2016 2016
                         }
@@ -2040,7 +2040,7 @@  discard block
 block discarded – undo
2040 2040
                              * @param object $postinfo_obj The posts info as an object.
2041 2041
                              * @param bool|string $post_preview True if currently in post preview page. Empty string if not.                           *
2042 2042
                              */
2043
-                            do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
2043
+                            do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
2044 2044
                             ?>
2045 2045
                         </div>
2046 2046
                         <?php
@@ -2050,9 +2050,9 @@  discard block
 block discarded – undo
2050 2050
                             <div class="geodir-bubble-meta-fade"></div>
2051 2051
                             <div class="geodir-bubble-meta-bottom">
2052 2052
                                 <?php if ($rating_star != '') { ?>
2053
-                                <span class="geodir-bubble-rating"><?php echo $rating_star;?></span>
2053
+                                <span class="geodir-bubble-rating"><?php echo $rating_star; ?></span>
2054 2054
                                 <?php } ?>
2055
-                                <span class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID);?></span>
2055
+                                <span class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID); ?></span>
2056 2056
                                 <span class="geodir-bubble-reviews">
2057 2057
                                     <a href="<?php echo get_comments_link($ID); ?>" class="geodir-pcomments"><i class="fas fa-comments"></i> <?php echo get_comments_number($ID); ?></a>
2058 2058
                                 </span>
@@ -2091,9 +2091,9 @@  discard block
 block discarded – undo
2091 2091
 function geodir_new_post_default_status()
2092 2092
 {
2093 2093
 
2094
-    $status = get_option( 'geodir_new_post_default_status' );
2094
+    $status = get_option('geodir_new_post_default_status');
2095 2095
 
2096
-    if ( empty( $status ) ) {
2096
+    if (empty($status)) {
2097 2097
         $status = 'publish';
2098 2098
     }
2099 2099
 
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
      *
2103 2103
      * @since 1.6.23
2104 2104
      */
2105
-    return apply_filters( 'geodir_new_post_default_status', $status );
2105
+    return apply_filters('geodir_new_post_default_status', $status);
2106 2106
 
2107 2107
 }
2108 2108
 
@@ -2121,11 +2121,11 @@  discard block
 block discarded – undo
2121 2121
 
2122 2122
         $post_type = get_post_type($post_id);
2123 2123
 
2124
-        $table = $plugin_prefix . $post_type . '_detail';
2124
+        $table = $plugin_prefix.$post_type.'_detail';
2125 2125
 
2126 2126
         $wpdb->query(
2127 2127
             $wpdb->prepare(
2128
-                "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d",
2128
+                "UPDATE ".$table." SET post_status=%s WHERE post_id=%d",
2129 2129
                 array($status, $post_id)
2130 2130
             )
2131 2131
         );
@@ -2197,18 +2197,18 @@  discard block
 block discarded – undo
2197 2197
 
2198 2198
         $post_type = get_post_type($post_id);
2199 2199
 
2200
-        $table = $plugin_prefix . $post_type . '_detail';
2200
+        $table = $plugin_prefix.$post_type.'_detail';
2201 2201
 
2202 2202
         $wpdb->query(
2203 2203
             $wpdb->prepare(
2204
-                "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d",
2204
+                "UPDATE ".$table." SET `post_id` = %d WHERE `post_id` = %d",
2205 2205
                 array($updatingpost, $temppost)
2206 2206
             )
2207 2207
         );
2208 2208
 
2209 2209
         $wpdb->query(
2210 2210
             $wpdb->prepare(
2211
-                "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d",
2211
+                "UPDATE ".GEODIR_ICON_TABLE." SET `post_id` = %d WHERE `post_id` = %d",
2212 2212
                 array($updatingpost, $temppost)
2213 2213
             )
2214 2214
         );
@@ -2217,7 +2217,7 @@  discard block
 block discarded – undo
2217 2217
 
2218 2218
         $wpdb->query(
2219 2219
             $wpdb->prepare(
2220
-                "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d",
2220
+                "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET `post_id` = %d WHERE `post_id` = %d",
2221 2221
                 array($updatingpost, $temppost)
2222 2222
             )
2223 2223
         );
@@ -2255,12 +2255,12 @@  discard block
 block discarded – undo
2255 2255
         if (!in_array($post_type, $all_postypes))
2256 2256
             return false;
2257 2257
 
2258
-        $table = $plugin_prefix . $post_type . '_detail';
2258
+        $table = $plugin_prefix.$post_type.'_detail';
2259 2259
 
2260 2260
         /* Delete custom post meta*/
2261 2261
         $wpdb->query(
2262 2262
             $wpdb->prepare(
2263
-                "DELETE FROM " . $table . " WHERE `post_id` = %d",
2263
+                "DELETE FROM ".$table." WHERE `post_id` = %d",
2264 2264
                 array($deleted_postid)
2265 2265
             )
2266 2266
         );
@@ -2268,22 +2268,22 @@  discard block
 block discarded – undo
2268 2268
         /* Delete post map icons*/
2269 2269
         $wpdb->query(
2270 2270
             $wpdb->prepare(
2271
-                "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d",
2271
+                "DELETE FROM ".GEODIR_ICON_TABLE." WHERE `post_id` = %d",
2272 2272
                 array($deleted_postid)
2273 2273
             )
2274 2274
         );
2275 2275
 
2276 2276
         /* Delete Attachments*/
2277
-        $feat_id = get_post_thumbnail_id( $deleted_postid );// make sure to remove the smaller images
2278
-        if($feat_id){
2279
-            wp_delete_attachment( $feat_id, true);
2277
+        $feat_id = get_post_thumbnail_id($deleted_postid); // make sure to remove the smaller images
2278
+        if ($feat_id) {
2279
+            wp_delete_attachment($feat_id, true);
2280 2280
         }
2281 2281
 
2282 2282
         $postcurr_images = geodir_get_images($deleted_postid);
2283 2283
 
2284 2284
         $wpdb->query(
2285 2285
             $wpdb->prepare(
2286
-                "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d",
2286
+                "DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE `post_id` = %d",
2287 2287
                 array($deleted_postid)
2288 2288
             )
2289 2289
         );
@@ -2338,9 +2338,9 @@  discard block
 block discarded – undo
2338 2338
         $favourite_icon = apply_filters('geodir_favourite_icon', 'fas fa-heart');
2339 2339
 
2340 2340
         $site_id = '';
2341
-        if ( is_multisite() ) {
2341
+        if (is_multisite()) {
2342 2342
             $blog_id = get_current_blog_id();
2343
-            if($blog_id && $blog_id!='1'){$site_id  = '_' . $blog_id ;}
2343
+            if ($blog_id && $blog_id != '1') {$site_id = '_'.$blog_id; }
2344 2344
         }
2345 2345
 
2346 2346
         $user_meta_data = geodir_get_user_favourites($current_user->data->ID);
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
          */
2362 2362
         do_action('geodir_before_add_from_favorite', $post_id);
2363 2363
 
2364
-        echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>';
2364
+        echo '<a href="javascript:void(0);" title="'.$remove_favourite_text.'" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'remove\');"><i class="'.$favourite_icon.'"></i> '.$unfavourite_text.'</a>';
2365 2365
 
2366 2366
         /**
2367 2367
          * Called after adding the post from favourites.
@@ -2419,9 +2419,9 @@  discard block
 block discarded – undo
2419 2419
         $favourite_icon = apply_filters('geodir_favourite_icon', 'fas fa-heart');
2420 2420
 
2421 2421
         $site_id = '';
2422
-        if ( is_multisite() ) {
2422
+        if (is_multisite()) {
2423 2423
             $blog_id = get_current_blog_id();
2424
-            if($blog_id && $blog_id!='1'){$site_id  = '_' . $blog_id ;}
2424
+            if ($blog_id && $blog_id != '1') {$site_id = '_'.$blog_id; }
2425 2425
         }
2426 2426
 
2427 2427
         $user_meta_data = array();
@@ -2446,7 +2446,7 @@  discard block
 block discarded – undo
2446 2446
          */
2447 2447
         do_action('geodir_before_remove_from_favorite', $post_id);
2448 2448
 
2449
-        echo '<a href="javascript:void(0);"  title="' . $add_favourite_text . '" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>';
2449
+        echo '<a href="javascript:void(0);"  title="'.$add_favourite_text.'" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'add\');"><i class="'.$favourite_icon.'"></i> '.$favourite_text.'</a>';
2450 2450
 
2451 2451
         /**
2452 2452
          * Called after removing the post from favourites.
@@ -2538,9 +2538,9 @@  discard block
 block discarded – undo
2538 2538
 
2539 2539
 
2540 2540
         $site_id = '';
2541
-        if ( is_multisite() ) {
2541
+        if (is_multisite()) {
2542 2542
             $blog_id = get_current_blog_id();
2543
-            if($blog_id && $blog_id!='1'){$site_id  = '_' . $blog_id ;}
2543
+            if ($blog_id && $blog_id != '1') {$site_id = '_'.$blog_id; }
2544 2544
         }
2545 2545
 
2546 2546
         $user_meta_data = '';
@@ -2548,24 +2548,24 @@  discard block
 block discarded – undo
2548 2548
             $user_meta_data = geodir_get_user_favourites($current_user->data->ID);
2549 2549
 
2550 2550
         if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
2551
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"  ><a
2551
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"  ><a
2552 2552
                 class="geodir-removetofav-icon" href="javascript:void(0);"
2553
-                onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');"
2554
-                title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?>
2553
+                onclick="javascript:addToFavourite(<?php echo $post_id; ?>,'remove');"
2554
+                title="<?php echo $remove_favourite_text; ?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text; ?>
2555 2555
             </a>   </span><?php
2556 2556
 
2557 2557
         } else {
2558 2558
 
2559 2559
             if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
2560
-                $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\'';
2560
+                $script_text = 'javascript:window.location.href=\''.geodir_login_url().'\'';
2561 2561
             } else
2562
-                $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
2562
+                $script_text = 'javascript:addToFavourite('.$post_id.',\'add\')';
2563 2563
 
2564
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon"
2564
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"><a class="geodir-addtofav-icon"
2565 2565
                                                                                         href="javascript:void(0);"
2566
-                                                                                        onclick="<?php echo $script_text;?>"
2567
-                                                                                        title="<?php echo $add_favourite_text;?>"><i
2568
-                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span>
2566
+                                                                                        onclick="<?php echo $script_text; ?>"
2567
+                                                                                        title="<?php echo $add_favourite_text; ?>"><i
2568
+                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text; ?></a></span>
2569 2569
         <?php }
2570 2570
     }
2571 2571
 }
@@ -2595,7 +2595,7 @@  discard block
 block discarded – undo
2595 2595
 
2596 2596
             $post_type = $taxonomy_obj->object_type[0];
2597 2597
 
2598
-            $table = $plugin_prefix . $post_type . '_detail';
2598
+            $table = $plugin_prefix.$post_type.'_detail';
2599 2599
 
2600 2600
             /**
2601 2601
              * Filter to modify the 'join' query
@@ -2618,8 +2618,8 @@  discard block
 block discarded – undo
2618 2618
             $where = apply_filters('geodir_cat_post_count_where', $where, $term);
2619 2619
 
2620 2620
             $count_query = "SELECT count(post_id) FROM
2621
-							" . $table . " as pd " . $join . "
2622
-							WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where;
2621
+							" . $table." as pd ".$join."
2622
+							WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id."',".$term->taxonomy.") ".$where;
2623 2623
 
2624 2624
             $cat_post_count = $wpdb->get_var($count_query);
2625 2625
             if (empty($cat_post_count) || is_wp_error($cat_post_count))
@@ -2702,13 +2702,13 @@  discard block
 block discarded – undo
2702 2702
     global $post;
2703 2703
     $all_postypes = geodir_get_posttypes();
2704 2704
     if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
2705
-        $out = ' <a class="excerpt-read-more" href="' .  get_permalink($post->ID) . '" title="' . get_the_title($post->ID) . '">';
2705
+        $out = ' <a class="excerpt-read-more" href="'.get_permalink($post->ID).'" title="'.get_the_title($post->ID).'">';
2706 2706
         /**
2707 2707
          * Filter excerpt read more text.
2708 2708
          *
2709 2709
          * @since 1.0.0
2710 2710
          */
2711
-        $out .= apply_filters( 'geodir_max_excerpt_end', __( 'Read more [...]', 'geodirectory' ) );
2711
+        $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
2712 2712
         $out .= '</a>';
2713 2713
         return $out;
2714 2714
     }
@@ -2737,14 +2737,14 @@  discard block
 block discarded – undo
2737 2737
     if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) {
2738 2738
 
2739 2739
         $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy);
2740
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
2740
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
2741 2741
 
2742 2742
         $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']);
2743
-        $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png';
2743
+        $term_icon = $path_parts['dirname'].'/cat_icon_'.$term_id.'.png';
2744 2744
 
2745 2745
         $posts = $wpdb->get_results(
2746 2746
             $wpdb->prepare(
2747
-                "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ",
2747
+                "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM ".$table." WHERE FIND_IN_SET(%s,%1\$s ) ",
2748 2748
                 array($term_id, $taxonomy)
2749 2749
             )
2750 2750
         );
@@ -2756,19 +2756,19 @@  discard block
 block discarded – undo
2756 2756
                 $lng = $post_obj->post_longitude;
2757 2757
 
2758 2758
                 $json = '{';
2759
-                $json .= '"id":"' . $post_obj->post_id . '",';
2760
-                $json .= '"lat_pos": "' . $lat . '",';
2761
-                $json .= '"long_pos": "' . $lng . '",';
2762
-                $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",';
2763
-                $json .= '"icon":"' . $term_icon . '",';
2764
-                $json .= '"group":"catgroup' . $term_id . '"';
2759
+                $json .= '"id":"'.$post_obj->post_id.'",';
2760
+                $json .= '"lat_pos": "'.$lat.'",';
2761
+                $json .= '"long_pos": "'.$lng.'",';
2762
+                $json .= '"marker_id":"'.$post_obj->post_id.'_'.$term_id.'",';
2763
+                $json .= '"icon":"'.$term_icon.'",';
2764
+                $json .= '"group":"catgroup'.$term_id.'"';
2765 2765
                 $json .= '}';
2766 2766
 
2767 2767
                 if ($post_obj->default_category == $term_id) {
2768 2768
 
2769 2769
                     $wpdb->query(
2770 2770
                         $wpdb->prepare(
2771
-                            "UPDATE " . $table . " SET marker_json = %s where post_id = %d",
2771
+                            "UPDATE ".$table." SET marker_json = %s where post_id = %d",
2772 2772
                             array($json, $post_obj->post_id)
2773 2773
                         )
2774 2774
                     );
@@ -2776,7 +2776,7 @@  discard block
 block discarded – undo
2776 2776
 
2777 2777
                 $wpdb->query(
2778 2778
                     $wpdb->prepare(
2779
-                        "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d",
2779
+                        "UPDATE ".GEODIR_ICON_TABLE." SET json = %s WHERE post_id = %d AND cat_id = %d",
2780 2780
                         array($json, $post_obj->post_id, $term_id)
2781 2781
                     )
2782 2782
                 );
@@ -2864,7 +2864,7 @@  discard block
 block discarded – undo
2864 2864
      * @param bool $exclude_admin Do you want to exclude admin from the check?. Default true.
2865 2865
      * return bool
2866 2866
      */
2867
-    return apply_filters('geodir_listing_belong_to_current_user',$result,$listing_id,$current_user->ID,$exclude_admin);
2867
+    return apply_filters('geodir_listing_belong_to_current_user', $result, $listing_id, $current_user->ID, $exclude_admin);
2868 2868
 }
2869 2869
 
2870 2870
 
@@ -2912,7 +2912,7 @@  discard block
 block discarded – undo
2912 2912
 //	print_r($uploads ) ;
2913 2913
     $post_first_image = $wpdb->get_results(
2914 2914
         $wpdb->prepare(
2915
-            "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1  ", array($post_id)
2915
+            "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d and menu_order = 1  ", array($post_id)
2916 2916
         )
2917 2917
     );
2918 2918
 
@@ -2933,9 +2933,9 @@  discard block
 block discarded – undo
2933 2933
 
2934 2934
         $post_type = get_post_type($post_id);
2935 2935
 
2936
-        $table_name = $plugin_prefix . $post_type . '_detail';
2936
+        $table_name = $plugin_prefix.$post_type.'_detail';
2937 2937
 
2938
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id);
2938
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='".$post_first_image[0]->file."' WHERE post_id =".$post_id);
2939 2939
 
2940 2940
         $new_attachment_name = basename($post_first_image[0]->file);
2941 2941
 
@@ -2948,11 +2948,11 @@  discard block
 block discarded – undo
2948 2948
                 wp_delete_attachment($post_thumbnail_id);
2949 2949
 
2950 2950
             }
2951
-            $filename = $uploads['basedir'] . $post_first_image[0]->file;
2951
+            $filename = $uploads['basedir'].$post_first_image[0]->file;
2952 2952
 
2953 2953
             $attachment = array(
2954 2954
                 'post_mime_type' => $post_first_image[0]->mime_type,
2955
-                'guid' => $uploads['baseurl'] . $post_first_image[0]->file,
2955
+                'guid' => $uploads['baseurl'].$post_first_image[0]->file,
2956 2956
                 'post_parent' => $post_id,
2957 2957
                 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title),
2958 2958
                 'post_content' => ''
@@ -2965,7 +2965,7 @@  discard block
 block discarded – undo
2965 2965
 
2966 2966
                 set_post_thumbnail($post_id, $id);
2967 2967
 
2968
-                require_once(ABSPATH . 'wp-admin/includes/image.php');
2968
+                require_once(ABSPATH.'wp-admin/includes/image.php');
2969 2969
                 wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
2970 2970
 
2971 2971
             }
@@ -2998,35 +2998,35 @@  discard block
 block discarded – undo
2998 2998
         $post_id = absint($_POST['post_id']);
2999 2999
         $upload_dir = wp_upload_dir();
3000 3000
         $post_type = get_post_type($_POST['post_id']);
3001
-        $table = $plugin_prefix . $post_type . '_detail';
3001
+        $table = $plugin_prefix.$post_type.'_detail';
3002 3002
 
3003 3003
         $post_arr = $wpdb->get_results($wpdb->prepare(
3004
-            "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1",
3004
+            "SELECT * FROM $wpdb->posts p JOIN ".$table." gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1",
3005 3005
             array($post_id)
3006 3006
         )
3007 3007
             , ARRAY_A);
3008 3008
 
3009 3009
         $arrImages = $wpdb->get_results(
3010 3010
             $wpdb->prepare(
3011
-                "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ",
3011
+                "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ",
3012 3012
                 array('%image%', $post_id)
3013 3013
             )
3014 3014
         );
3015 3015
         if ($arrImages) {
3016 3016
             $image_arr = array();
3017 3017
             foreach ($arrImages as $img) {
3018
-                $image_arr[] = $upload_dir['baseurl'] . $img->file;
3018
+                $image_arr[] = $upload_dir['baseurl'].$img->file;
3019 3019
             }
3020 3020
             $comma_separated = implode(",", $image_arr);
3021 3021
             $post_arr[0]['post_images'] = $comma_separated;
3022 3022
         }
3023 3023
 
3024 3024
 
3025
-        $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category'];
3025
+        $cats = $post_arr[0][$post_arr[0]['post_type'].'category'];
3026 3026
         $cat_arr = array_filter(explode(",", $cats));
3027 3027
         $trans_cat = array();
3028 3028
         foreach ($cat_arr as $cat) {
3029
-            $trans_cat[] = geodir_wpml_object_id($cat, $post_arr[0]['post_type'] . 'category', false);
3029
+            $trans_cat[] = geodir_wpml_object_id($cat, $post_arr[0]['post_type'].'category', false);
3030 3030
         }
3031 3031
 
3032 3032
 
@@ -3068,7 +3068,7 @@  discard block
 block discarded – undo
3068 3068
 
3069 3069
     $get_data = $wpdb->get_results(
3070 3070
         $wpdb->prepare(
3071
-            "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'",
3071
+            "SELECT htmlvar_name, field_type, extra_fields FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1'",
3072 3072
             array($listing_type)
3073 3073
         )
3074 3074
     );
@@ -3081,12 +3081,12 @@  discard block
 block discarded – undo
3081 3081
 
3082 3082
                 $extra_fields = unserialize($data->extra_fields);
3083 3083
 
3084
-                $prefix = $data->htmlvar_name . '_';
3084
+                $prefix = $data->htmlvar_name.'_';
3085 3085
 
3086
-                $fields_info[$prefix . 'address'] = $data->field_type;
3086
+                $fields_info[$prefix.'address'] = $data->field_type;
3087 3087
 
3088 3088
                 if (isset($extra_fields['show_zip']) && $extra_fields['show_zip'])
3089
-                    $fields_info[$prefix . 'zip'] = $data->field_type;
3089
+                    $fields_info[$prefix.'zip'] = $data->field_type;
3090 3090
 
3091 3091
             } else {
3092 3092
 
@@ -3185,18 +3185,18 @@  discard block
 block discarded – undo
3185 3185
  * @since 1.6.22 Added image from location page.
3186 3186
  * @package GeoDirectory
3187 3187
  */
3188
-function geodir_fb_like_thumbnail(){
3188
+function geodir_fb_like_thumbnail() {
3189 3189
 
3190 3190
     $facebook_image = '';
3191 3191
 
3192
-    if(is_single()){// single post
3192
+    if (is_single()) {// single post
3193 3193
         global $post;
3194
-        if(isset($post->featured_image) && $post->featured_image){
3194
+        if (isset($post->featured_image) && $post->featured_image) {
3195 3195
             $upload_dir = wp_upload_dir();
3196 3196
             $facebook_image = $upload_dir['baseurl'].$post->featured_image;
3197 3197
 
3198 3198
         }
3199
-    }elseif(geodir_is_page('location')){// location page
3199
+    }elseif (geodir_is_page('location')) {// location page
3200 3200
         if (function_exists('geodir_get_location_seo')) {
3201 3201
             $seo = geodir_get_location_seo();
3202 3202
             if (isset($seo->seo_image) && $seo->seo_image) {
@@ -3205,11 +3205,11 @@  discard block
 block discarded – undo
3205 3205
             }
3206 3206
         }
3207 3207
 
3208
-        if(!$facebook_image){
3208
+        if (!$facebook_image) {
3209 3209
             global $post;
3210 3210
 
3211
-            if (has_post_thumbnail( $post->ID ) ){
3212
-                $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
3211
+            if (has_post_thumbnail($post->ID)) {
3212
+                $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
3213 3213
                 $facebook_image = isset($image[0]) ? $image[0] : '';
3214 3214
             }
3215 3215
         }
@@ -3222,16 +3222,16 @@  discard block
 block discarded – undo
3222 3222
      * @since 1.6.22
3223 3223
      * @param string $facebook_image The image URL or blank.
3224 3224
      */
3225
-    $facebook_image = apply_filters('geodir_fb_share_image',$facebook_image);
3225
+    $facebook_image = apply_filters('geodir_fb_share_image', $facebook_image);
3226 3226
 
3227
-    if($facebook_image){
3227
+    if ($facebook_image) {
3228 3228
         echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$facebook_image\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n";
3229 3229
     }
3230 3230
 
3231 3231
 
3232 3232
 }
3233 3233
 
3234
-add_action( 'save_post', 'geodir_clear_map_cache_on_save', 10,2 );
3234
+add_action('save_post', 'geodir_clear_map_cache_on_save', 10, 2);
3235 3235
 
3236 3236
 
3237 3237
 /**
@@ -3239,10 +3239,10 @@  discard block
 block discarded – undo
3239 3239
  *
3240 3240
  * @since 1.6.22
3241 3241
  */
3242
-function geodir_delete_map_cache(){
3242
+function geodir_delete_map_cache() {
3243 3243
     $files = glob(realpath(dirname(__FILE__))."/map-functions/map-cache/*.json"); // get all file names
3244
-    foreach($files as $file){ // iterate files
3245
-        if(is_file($file))
3244
+    foreach ($files as $file) { // iterate files
3245
+        if (is_file($file))
3246 3246
             unlink($file); // delete file
3247 3247
     }
3248 3248
 }
@@ -3257,21 +3257,21 @@  discard block
 block discarded – undo
3257 3257
  */
3258 3258
 function geodir_clear_map_cache_on_save($post_id, $post) {
3259 3259
 
3260
-    if(!get_option('geodir_enable_map_cache')){
3260
+    if (!get_option('geodir_enable_map_cache')) {
3261 3261
         return;
3262 3262
     }
3263 3263
 
3264
-    if ( isset( $post->post_type ) && ( $post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post' ) ) {
3264
+    if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) {
3265 3265
         return;
3266 3266
     }
3267 3267
 
3268 3268
     $geodir_posttypes = geodir_get_posttypes();
3269 3269
 
3270
-    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
3270
+    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3271 3271
         return;
3272 3272
     }
3273 3273
 
3274
-    if ( ! wp_is_post_revision( $post_id ) && isset( $post->post_type ) && in_array( $post->post_type, $geodir_posttypes ) ) {
3274
+    if (!wp_is_post_revision($post_id) && isset($post->post_type) && in_array($post->post_type, $geodir_posttypes)) {
3275 3275
         geodir_delete_map_cache();
3276 3276
     }
3277 3277
 
@@ -3287,20 +3287,20 @@  discard block
 block discarded – undo
3287 3287
  * @param array $postarr An array of sanitized, but otherwise unmodified post data.
3288 3288
  * @return array Filtered post data.
3289 3289
  */
3290
-function geodir_fix_pending_listing_post_name( $data, $postarr ) {
3290
+function geodir_fix_pending_listing_post_name($data, $postarr) {
3291 3291
     // Dont' update post name for autosaves
3292
-    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
3292
+    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3293 3293
         return $data;
3294 3294
     }
3295 3295
 
3296
-    if ( !empty( $data['post_name'] ) || empty( $data['post_status'] ) || empty( $data['post_type'] ) || empty( $data['post_title'] ) ) {
3296
+    if (!empty($data['post_name']) || empty($data['post_status']) || empty($data['post_type']) || empty($data['post_title'])) {
3297 3297
         return $data;
3298 3298
     }
3299 3299
 
3300
-    if ( ( 'draft' == $data['post_status'] || 'pending' == $data['post_status'] ) && in_array( $data['post_type'], geodir_get_posttypes() ) ) {
3301
-        $data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'] ), ( !empty( $postarr['ID'] ) ? $postarr['ID'] : 0 ), '', $data['post_type'], $data['post_parent'] );
3300
+    if (('draft' == $data['post_status'] || 'pending' == $data['post_status']) && in_array($data['post_type'], geodir_get_posttypes())) {
3301
+        $data['post_name'] = wp_unique_post_slug(sanitize_title($data['post_title']), (!empty($postarr['ID']) ? $postarr['ID'] : 0), '', $data['post_type'], $data['post_parent']);
3302 3302
     }
3303 3303
 
3304 3304
     return $data;
3305 3305
 }
3306
-add_filter( 'wp_insert_post_data', 'geodir_fix_pending_listing_post_name', 10, 2 );
3307 3306
\ No newline at end of file
3307
+add_filter('wp_insert_post_data', 'geodir_fix_pending_listing_post_name', 10, 2);
3308 3308
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_functions.php 1 patch
Spacing   +419 added lines, -419 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50 50
     {
51 51
         global $wpdb;
52
-        $result = 0;// no rows affected
52
+        $result = 0; // no rows affected
53 53
         if (!geodir_column_exist($db, $column)) {
54 54
             if (!empty($db) && !empty($column))
55 55
                 $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 {
75 75
     global $wpdb, $geodir_post_custom_fields_cache;
76 76
 
77
-    $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
77
+    $cache_stored = $post_type.'_'.$package_id.'_'.$default.'_'.$fields_location;
78 78
 
79 79
     if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80 80
         return $geodir_post_custom_fields_cache[$cache_stored];
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
         $default_query .= " and is_admin = '0' ";
89 89
 
90 90
     if ($fields_location == 'none') {
91
-    } else{
92
-        $fields_location = esc_sql( $fields_location );
91
+    } else {
92
+        $fields_location = esc_sql($fields_location);
93 93
         $default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94 94
     }
95 95
 
96 96
     $post_meta_info = $wpdb->get_results(
97 97
         $wpdb->prepare(
98
-            "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
98
+            "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99 99
             array($post_type)
100 100
         )
101 101
     );
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
      * @param string $field_ins_upd When set to "submit" displays form.
163 163
      * @param string $field_type_key The key of the custom field.
164 164
      */
165
-    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
165
+    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
166 166
     {
167 167
         global $wpdb;
168 168
         $cf = $result_str;
169 169
         if (!is_object($cf)) {
170 170
 
171
-            $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
171
+            $field_info = $wpdb->get_row($wpdb->prepare("select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)));
172 172
 
173 173
         } else {
174 174
             $field_info = $cf;
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
         if ($field_id != '') {
203 203
             $cf = trim($field_id, '_');
204 204
 
205
-            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
-                $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
205
+            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)))) {
206
+                $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d ", array($cf)));
207 207
 
208 208
                 $post_type = $field->post_type;
209 209
                 $htmlvar_name = $field->htmlvar_name;
210 210
 
211 211
                 if ($post_type != '' && $htmlvar_name != '') {
212
-                    $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
212
+                    $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213 213
                 }
214 214
 
215 215
                 /**
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
                 do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224 224
 
225 225
                 if ($field->field_type == 'address') {
226
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
226
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_address`");
227
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_city`");
228
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_region`");
229
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_country`");
230
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_zip`");
231
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_latitude`");
232
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_longitude`");
233
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapview`");
234
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapzoom`");
235 235
                 } else {
236 236
                     if ($field->field_type != 'fieldset') {
237
-                        $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
237
+                        $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."`");
238 238
                     }
239 239
                 }
240 240
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
306 306
 
307 307
         // some servers fail if a POST value is VARCHAR so we change it.
308
-        if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
308
+        if (isset($request_field['data_type']) && $request_field['data_type'] == 'XVARCHAR') {
309 309
             $request_field['data_type'] = 'VARCHAR';
310 310
         }
311 311
 
@@ -318,12 +318,12 @@  discard block
 block discarded – undo
318 318
         $post_type = $request_field['listing_type'];
319 319
 
320 320
         if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
321
-            $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
321
+            $cehhtmlvar_name = 'geodir_'.$cehhtmlvar_name;
322 322
         }
323 323
 
324 324
         $check_html_variable = $wpdb->get_var(
325 325
             $wpdb->prepare(
326
-                "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
326
+                "select htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where id <> %d and htmlvar_name = %s and post_type = %s ",
327 327
                 array($cf, $cehhtmlvar_name, $post_type)
328 328
             )
329 329
         );
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
                 $post_meta_info = $wpdb->get_row(
337 337
                     $wpdb->prepare(
338
-                        "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
338
+                        "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id = %d",
339 339
                         array($cf)
340 340
                     )
341 341
                 );
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             if ($post_type == '') $post_type = 'gd_place';
354 354
 
355 355
 
356
-            $detail_table = $plugin_prefix . $post_type . '_detail';
356
+            $detail_table = $plugin_prefix.$post_type.'_detail';
357 357
 
358 358
             $admin_title = $request_field['admin_title'];
359 359
             $site_title = $request_field['site_title'];
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
             $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
382 382
 
383 383
             
384
-            if(is_array($show_in)){
384
+            if (is_array($show_in)) {
385 385
                 $show_in = implode(",", $request_field['show_in']);
386 386
             }
387 387
             
388 388
             if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
389
-                $htmlvar_name = 'geodir_' . $htmlvar_name;
389
+                $htmlvar_name = 'geodir_'.$htmlvar_name;
390 390
             }
391 391
 
392 392
             $option_values = '';
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 
428 428
             if ($sort_order == '') {
429 429
 
430
-                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
430
+                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM ".GEODIR_CUSTOM_FIELDS_TABLE);
431 431
 
432
-                $sort_order = (int)$last_order + 1;
432
+                $sort_order = (int) $last_order + 1;
433 433
             }
434 434
 
435 435
             $default_value_add = '';
@@ -441,15 +441,15 @@  discard block
 block discarded – undo
441 441
                     case 'address':
442 442
 
443 443
                         if ($htmlvar_name != '') {
444
-                            $prefix = $htmlvar_name . '_';
444
+                            $prefix = $htmlvar_name.'_';
445 445
                         }
446
-                        $old_prefix = $old_html_variable . '_';
446
+                        $old_prefix = $old_html_variable.'_';
447 447
 
448 448
 
449
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
449
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."address` `".$prefix."address` VARCHAR( 254 ) NULL";
450 450
 
451 451
                         if ($default_value != '') {
452
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
452
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
453 453
                         }
454 454
 
455 455
                         $wpdb->query($meta_field_add);
@@ -458,12 +458,12 @@  discard block
 block discarded – undo
458 458
 
459 459
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
460 460
 
461
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
461
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."city'");
462 462
                                 if ($is_column) {
463
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
463
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."city` `".$prefix."city` VARCHAR( 50 ) NULL";
464 464
 
465 465
                                     if ($default_value != '') {
466
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
466
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
467 467
                                     }
468 468
 
469 469
                                     $wpdb->query($meta_field_add);
@@ -471,9 +471,9 @@  discard block
 block discarded – undo
471 471
 
472 472
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
473 473
                                     if ($default_value != '') {
474
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
474
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
475 475
                                     }
476
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
476
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
477 477
 
478 478
                                 }
479 479
 
@@ -483,36 +483,36 @@  discard block
 block discarded – undo
483 483
 
484 484
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
485 485
 
486
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
486
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."region'");
487 487
 
488 488
                                 if ($is_column) {
489
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
489
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."region` `".$prefix."region` VARCHAR( 50 ) NULL";
490 490
 
491 491
                                     if ($default_value != '') {
492
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
492
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
493 493
                                     }
494 494
 
495 495
                                     $wpdb->query($meta_field_add);
496 496
                                 } else {
497 497
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
498 498
                                     if ($default_value != '') {
499
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
499
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
500 500
                                     }
501 501
 
502
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
502
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
503 503
                                 }
504 504
 
505 505
                             }
506 506
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
507 507
 
508
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
508
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."country'");
509 509
 
510 510
                                 if ($is_column) {
511 511
 
512
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
512
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."country` `".$prefix."country` VARCHAR( 50 ) NULL";
513 513
 
514 514
                                     if ($default_value != '') {
515
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
515
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
516 516
                                     }
517 517
 
518 518
                                     $wpdb->query($meta_field_add);
@@ -520,24 +520,24 @@  discard block
 block discarded – undo
520 520
 
521 521
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
522 522
                                     if ($default_value != '') {
523
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
523
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
524 524
                                     }
525 525
 
526
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
526
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
527 527
 
528 528
                                 }
529 529
 
530 530
                             }
531 531
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
532 532
 
533
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
533
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."zip'");
534 534
 
535 535
                                 if ($is_column) {
536 536
 
537
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
537
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."zip` `".$prefix."zip` VARCHAR( 50 ) NULL";
538 538
 
539 539
                                     if ($default_value != '') {
540
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
540
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
541 541
                                     }
542 542
 
543 543
                                     $wpdb->query($meta_field_add);
@@ -545,128 +545,128 @@  discard block
 block discarded – undo
545 545
 
546 546
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
547 547
                                     if ($default_value != '') {
548
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
548
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
549 549
                                     }
550 550
 
551
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
551
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
552 552
 
553 553
                                 }
554 554
 
555 555
                             }
556 556
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
557 557
 
558
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
558
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latitude'");
559 559
                                 if ($is_column) {
560 560
 
561
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
561
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latitude` `".$prefix."latitude` VARCHAR( 20 ) NULL";
562 562
 
563 563
                                     if ($default_value != '') {
564
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
564
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
565 565
                                     }
566 566
 
567 567
                                     $wpdb->query($meta_field_add);
568 568
                                 } else {
569 569
 
570
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
570
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
571 571
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
572 572
                                     if ($default_value != '') {
573
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
573
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
574 574
                                     }
575 575
 
576
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
576
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
577 577
 
578 578
                                 }
579 579
 
580 580
 
581
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
581
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."longitude'");
582 582
 
583 583
                                 if ($is_column) {
584
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
584
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."longitude` `".$prefix."longitude` VARCHAR( 20 ) NULL";
585 585
 
586 586
                                     if ($default_value != '') {
587
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
587
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
588 588
                                     }
589 589
 
590 590
                                     $wpdb->query($meta_field_add);
591 591
                                 } else {
592 592
 
593
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
593
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
594 594
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
595 595
                                     if ($default_value != '') {
596
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
596
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
597 597
                                     }
598 598
 
599
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
599
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
600 600
                                 }
601 601
 
602 602
                             }
603 603
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
604 604
 
605
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
605
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapview'");
606 606
 
607 607
                                 if ($is_column) {
608
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
608
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapview` `".$prefix."mapview` VARCHAR( 15 ) NULL";
609 609
 
610 610
                                     if ($default_value != '') {
611
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
611
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
612 612
                                     }
613 613
 
614 614
                                     $wpdb->query($meta_field_add);
615 615
                                 } else {
616 616
 
617
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
617
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
618 618
 
619 619
                                     $meta_field_add = "VARCHAR( 15 ) NULL";
620 620
                                     if ($default_value != '') {
621
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
621
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
622 622
                                     }
623 623
 
624
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
624
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
625 625
                                 }
626 626
 
627 627
 
628 628
                             }
629 629
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
630 630
 
631
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
631
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapzoom'");
632 632
                                 if ($is_column) {
633
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
633
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapzoom` `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
634 634
 
635 635
                                     if ($default_value != '') {
636
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
636
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
637 637
                                     }
638 638
 
639 639
                                     $wpdb->query($meta_field_add);
640 640
 
641 641
                                 } else {
642 642
 
643
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
643
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
644 644
 
645 645
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
646 646
                                     if ($default_value != '') {
647
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
647
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
648 648
                                     }
649 649
 
650
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
650
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
651 651
                                 }
652 652
 
653 653
                             }
654 654
                             // show lat lng
655 655
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
656
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
656
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latlng'");
657 657
 
658 658
                                 if ($is_column) {
659
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
659
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latlng` `".$prefix."latlng` VARCHAR( 3 ) NULL";
660 660
                                     $meta_field_add .= " DEFAULT '1'";
661 661
 
662 662
                                     $wpdb->query($meta_field_add);
663 663
                                 } else {
664
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
664
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
665 665
 
666 666
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
667 667
                                     $meta_field_add .= " DEFAULT '1'";
668 668
 
669
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
669
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
670 670
                                 }
671 671
 
672 672
                             }
@@ -675,13 +675,13 @@  discard block
 block discarded – undo
675 675
                         break;
676 676
 
677 677
                     case 'checkbox':
678
-                        $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TINYINT(1) NOT NULL";
678
+                        $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TINYINT(1) NOT NULL";
679 679
 						if ($default_value != '') {
680
-							$default_value_add .= " DEFAULT '" . $default_value . "'";
680
+							$default_value_add .= " DEFAULT '".$default_value."'";
681 681
 						}
682 682
 
683 683
                         $alter_result = $wpdb->query($default_value_add);
684
-                        if ( $alter_result === false) {
684
+                        if ($alter_result === false) {
685 685
                             return __('Column change failed, you may have too many columns.', 'geodirectory');
686 686
                         }
687 687
                         break;
@@ -692,30 +692,30 @@  discard block
 block discarded – undo
692 692
                         $op_size = '500';
693 693
 
694 694
                         // only make the field as big as it needs to be.
695
-                        if(isset($option_values) && $option_values && $field_type=='select'){
696
-                            $option_values_arr = explode(',',$option_values);
697
-                            if(is_array($option_values_arr)){
695
+                        if (isset($option_values) && $option_values && $field_type == 'select') {
696
+                            $option_values_arr = explode(',', $option_values);
697
+                            if (is_array($option_values_arr)) {
698 698
                                 $op_max = 0;
699
-                                foreach($option_values_arr as $op_val){
700
-                                    if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
699
+                                foreach ($option_values_arr as $op_val) {
700
+                                    if (strlen($op_val) && strlen($op_val) > $op_max) {$op_max = strlen($op_val); }
701 701
                                 }
702
-                                if($op_max){$op_size =$op_max; }
702
+                                if ($op_max) {$op_size = $op_max; }
703 703
                             }
704
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
705
-                            if(strlen($option_values)){
706
-                                $op_size =  strlen($option_values);
704
+                        }elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
705
+                            if (strlen($option_values)) {
706
+                                $op_size = strlen($option_values);
707 707
                             }
708 708
                         }
709 709
 
710
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
710
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."`VARCHAR( $op_size ) NULL";
711 711
 
712 712
                         if ($default_value != '') {
713
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
713
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
714 714
                         }
715 715
 
716 716
                         $alter_result = $wpdb->query($meta_field_add);
717
-                        if($alter_result===false){
718
-                            return __('Column change failed, you may have too many columns.','geodirectory');
717
+                        if ($alter_result === false) {
718
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
719 719
                         }
720 720
 
721 721
                         if (isset($request_field['cat_display_type']))
@@ -732,9 +732,9 @@  discard block
 block discarded – undo
732 732
                     case 'url':
733 733
                     case 'file':
734 734
 
735
-                        $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
736
-                        if($alter_result===false){
737
-                            return __('Column change failed, you may have too many columns.','geodirectory');
735
+                        $alter_result = $wpdb->query("ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TEXT NULL");
736
+                        if ($alter_result === false) {
737
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
738 738
                         }
739 739
                         if (isset($request_field['advanced_editor']))
740 740
                             $extra_fields = $request_field['advanced_editor'];
@@ -748,24 +748,24 @@  discard block
 block discarded – undo
748 748
                     default:
749 749
                         if ($data_type != 'VARCHAR' && $data_type != '') {
750 750
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
751
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
751
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` DECIMAL(11, ".(int) $decimal_point.") NULL";
752 752
                             } else {
753
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
753
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` ".$data_type." NULL";
754 754
                             }
755 755
 
756 756
                             if (is_numeric($default_value) && $default_value != '') {
757
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
757
+                                $default_value_add .= " DEFAULT '".$default_value."'";
758 758
                             }
759 759
                         } else {
760
-                            $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
760
+                            $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` VARCHAR( 254 ) NULL";
761 761
                             if ($default_value != '') {
762
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
762
+                                $default_value_add .= " DEFAULT '".$default_value."'";
763 763
                             }
764 764
                         }
765 765
 
766 766
                         $alter_result = $wpdb->query($default_value_add);
767
-                        if($alter_result===false){
768
-                            return __('Column change failed, you may have too many columns.','geodirectory');
767
+                        if ($alter_result === false) {
768
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
769 769
                         }
770 770
                         break;
771 771
                 endswitch;
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 
782 782
                     $wpdb->prepare(
783 783
 
784
-                        "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
784
+                        "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
785 785
 					post_type = %s,
786 786
 					admin_title = %s,
787 787
 					site_title = %s,
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 					for_admin_use = %s
816 816
 					where id = %d",
817 817
 
818
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
818
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use, $cf)
819 819
                     )
820 820
 
821 821
                 );
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 
826 826
                 $wpdb->query(
827 827
                     $wpdb->prepare(
828
-                        "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
828
+                        "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
829 829
 					 	site_title=%s
830 830
 					where post_type = %s and htmlvar_name = %s",
831 831
                         array($site_title, $post_type, $htmlvar_name)
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 
835 835
 
836 836
                 if ($cat_sort == '')
837
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
837
+                    $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
838 838
 
839 839
 
840 840
                 /**
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
                         $data_type = '';
855 855
 
856 856
                         if ($htmlvar_name != '') {
857
-                            $prefix = $htmlvar_name . '_';
857
+                            $prefix = $htmlvar_name.'_';
858 858
                         }
859 859
                         $old_prefix = $old_html_variable;
860 860
 
@@ -862,109 +862,109 @@  discard block
 block discarded – undo
862 862
 
863 863
                         $meta_field_add = "VARCHAR( 254 ) NULL";
864 864
                         if ($default_value != '') {
865
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
865
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
866 866
                         }
867 867
 
868
-                        geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
868
+                        geodir_add_column_if_not_exist($detail_table, $prefix."address", $meta_field_add);
869 869
                         //$wpdb->query($meta_field_add);
870 870
 
871 871
 
872 872
                         if (!empty($extra_fields)) {
873 873
 
874 874
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
875
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
875
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."city` VARCHAR( 30 ) NULL";
876 876
                                 $meta_field_add = "VARCHAR( 50 ) NULL";
877 877
                                 if ($default_value != '') {
878
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
878
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
879 879
                                 }
880 880
 
881
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
881
+                                geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
882 882
                                 //$wpdb->query($meta_field_add);
883 883
                             }
884 884
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
885
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
885
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."region` VARCHAR( 30 ) NULL";
886 886
                                 $meta_field_add = "VARCHAR( 50 ) NULL";
887 887
                                 if ($default_value != '') {
888
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
888
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
889 889
                                 }
890 890
 
891
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
891
+                                geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
892 892
                                 //$wpdb->query($meta_field_add);
893 893
                             }
894 894
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
895
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
895
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."country` VARCHAR( 30 ) NULL";
896 896
 
897 897
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
898 898
                                 if ($default_value != '') {
899
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
899
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
900 900
                                 }
901 901
 
902
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
902
+                                geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
903 903
                                 //$wpdb->query($meta_field_add);
904 904
                             }
905 905
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
906
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
906
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."zip` VARCHAR( 15 ) NULL";
907 907
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
908 908
                                 if ($default_value != '') {
909
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
909
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
910 910
                                 }
911 911
 
912
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
912
+                                geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
913 913
                                 //$wpdb->query($meta_field_add);
914 914
                             }
915 915
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
916
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
916
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
917 917
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
918 918
                                 if ($default_value != '') {
919
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
919
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
920 920
                                 }
921 921
 
922
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
922
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
923 923
                                 //$wpdb->query($meta_field_add);
924 924
 
925
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
925
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
926 926
 
927 927
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
928 928
                                 if ($default_value != '') {
929
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
929
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
930 930
                                 }
931 931
 
932
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
932
+                                geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
933 933
 
934 934
                                 //$wpdb->query($meta_field_add);
935 935
                             }
936 936
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
937
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
937
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
938 938
 
939 939
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
940 940
                                 if ($default_value != '') {
941
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
941
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
942 942
                                 }
943 943
 
944
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
944
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
945 945
 
946 946
                                 //$wpdb->query($meta_field_add);
947 947
                             }
948 948
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
949
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
949
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
950 950
 
951 951
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
952 952
                                 if ($default_value != '') {
953
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
953
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
954 954
                                 }
955 955
 
956
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
956
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
957 957
 
958 958
                                 //$wpdb->query($meta_field_add);
959 959
                             }
960 960
                             // show lat lng
961 961
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
962
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
962
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
963 963
 
964 964
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
965 965
                                 $meta_field_add .= " DEFAULT '1'";
966 966
 
967
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
967
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
968 968
                                 //$wpdb->query($meta_field_add);
969 969
                             }
970 970
                         }
@@ -974,8 +974,8 @@  discard block
 block discarded – undo
974 974
                     case 'checkbox':
975 975
                         $data_type = 'TINYINT';
976 976
 
977
-                        $meta_field_add = $data_type . "( 1 ) NOT NULL ";
978
-                        if ((int)$default_value === 1) {
977
+                        $meta_field_add = $data_type."( 1 ) NOT NULL ";
978
+                        if ((int) $default_value === 1) {
979 979
                             $meta_field_add .= " DEFAULT '1'";
980 980
                         }
981 981
 
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
                             }
1009 1009
                         } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
1010 1010
                             if (strlen($option_values)) {
1011
-                                $op_size =  strlen($option_values);
1011
+                                $op_size = strlen($option_values);
1012 1012
                             }
1013 1013
 
1014 1014
                             if (isset($request_field['multi_display_type'])) {
@@ -1016,9 +1016,9 @@  discard block
 block discarded – undo
1016 1016
                             }
1017 1017
                         }
1018 1018
 
1019
-                        $meta_field_add = $data_type . "( $op_size ) NULL ";
1019
+                        $meta_field_add = $data_type."( $op_size ) NULL ";
1020 1020
                         if ($default_value != '') {
1021
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
1021
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
1022 1022
                         }
1023 1023
 
1024 1024
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
@@ -1033,9 +1033,9 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
                         $data_type = 'TEXT';
1035 1035
 
1036
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1036
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1037 1037
 
1038
-                        $meta_field_add = $data_type . " NULL ";
1038
+                        $meta_field_add = $data_type." NULL ";
1039 1039
                         /*if($default_value != '')
1040 1040
 					{ $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
1041 1041
 
@@ -1050,9 +1050,9 @@  discard block
 block discarded – undo
1050 1050
 
1051 1051
                         $data_type = 'DATE';
1052 1052
 
1053
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1053
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1054 1054
 
1055
-                        $meta_field_add = $data_type . " NULL ";
1055
+                        $meta_field_add = $data_type." NULL ";
1056 1056
 
1057 1057
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1058 1058
                         if ($add_result === false) {
@@ -1065,9 +1065,9 @@  discard block
 block discarded – undo
1065 1065
 
1066 1066
                         $data_type = 'TIME';
1067 1067
 
1068
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1068
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1069 1069
 
1070
-                        $meta_field_add = $data_type . " NULL ";
1070
+                        $meta_field_add = $data_type." NULL ";
1071 1071
 
1072 1072
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1073 1073
                         if ($add_result === false) {
@@ -1079,22 +1079,22 @@  discard block
 block discarded – undo
1079 1079
                     default:
1080 1080
 
1081 1081
                         if ($data_type != 'VARCHAR' && $data_type != '') {
1082
-                            $meta_field_add = $data_type . " NULL ";
1082
+                            $meta_field_add = $data_type." NULL ";
1083 1083
 
1084 1084
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
1085
-                                $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1085
+                                $meta_field_add = "DECIMAL(11, ".(int) $decimal_point.") NULL ";
1086 1086
                             }
1087 1087
 
1088 1088
                             if (is_numeric($default_value) && $default_value != '') {
1089
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1090
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1089
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1090
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1091 1091
                             }
1092 1092
                         } else {
1093 1093
                             $meta_field_add = " VARCHAR( 254 ) NULL ";
1094 1094
 
1095 1095
                             if ($default_value != '') {
1096
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1097
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1096
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1097
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1098 1098
                             }
1099 1099
                         }
1100 1100
 
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 
1117 1117
                     $wpdb->prepare(
1118 1118
 
1119
-                        "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1119
+                        "insert into ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1120 1120
 					post_type = %s,
1121 1121
 					admin_title = %s,
1122 1122
 					site_title = %s,
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
 					validation_msg = %s,
1150 1150
 					for_admin_use = %s ",
1151 1151
 
1152
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1152
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use)
1153 1153
 
1154 1154
                     )
1155 1155
 
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 
1162 1162
             }
1163 1163
 
1164
-            return (int)$lastid;
1164
+            return (int) $lastid;
1165 1165
 
1166 1166
 
1167 1167
         } else {
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
             $post_meta_info = $wpdb->query(
1196 1196
                 $wpdb->prepare(
1197
-                    "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1197
+                    "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1198 1198
 															sort_order=%d 
1199 1199
 															where id= %d",
1200 1200
                     array($count, $cf)
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
         global $post;
1217 1217
 
1218 1218
         if (isset($_REQUEST['post'])) {
1219
-            $_REQUEST['pid'] = (int)$_REQUEST['post'];
1219
+            $_REQUEST['pid'] = (int) $_REQUEST['post'];
1220 1220
         }
1221 1221
     }
1222 1222
 
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
      * @param mixed $value Custom field value.
1240 1240
      * @param array $cf Custom field info.
1241 1241
      */
1242
-    return apply_filters( 'geodir_get_cf_value', $value, $cf );
1242
+    return apply_filters('geodir_get_cf_value', $value, $cf);
1243 1243
 }
1244 1244
 
1245 1245
 /**
@@ -1265,16 +1265,16 @@  discard block
 block discarded – undo
1265 1265
     $custom_fields = geodir_post_custom_fields($package_id, $default, $post_type);
1266 1266
 
1267 1267
     foreach ($custom_fields as $key => $val) {
1268
-        if(isset($val['extra_fields'])){$extra_fields = $val['extra_fields'];}
1268
+        if (isset($val['extra_fields'])) {$extra_fields = $val['extra_fields']; }
1269 1269
         $val = stripslashes_deep($val); // strip slashes from labels
1270
-        if(isset($val['extra_fields'])){$val['extra_fields'] = $extra_fields;}
1270
+        if (isset($val['extra_fields'])) {$val['extra_fields'] = $extra_fields; }
1271 1271
 
1272 1272
         $name = $val['name'];
1273 1273
         $type = $val['type'];
1274 1274
         $is_default = $val['is_default'];
1275 1275
 
1276 1276
         /* field available to site admin only for edit */
1277
-        $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1277
+        $for_admin_use = isset($val['for_admin_use']) && (int) $val['for_admin_use'] == 1 ? true : false;
1278 1278
         if ($for_admin_use && !is_super_admin()) {
1279 1279
             continue;
1280 1280
         }
@@ -1299,11 +1299,11 @@  discard block
 block discarded – undo
1299 1299
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1300 1300
          * @see 'geodir_after_custom_form_field_$name'
1301 1301
          */
1302
-        do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1302
+        do_action('geodir_before_custom_form_field_'.$name, $listing_type, $package_id, $val);
1303 1303
 
1304 1304
 
1305 1305
         $custom_field = $val;
1306
-        $html ='';
1306
+        $html = '';
1307 1307
         /**
1308 1308
          * Filter the output for custom fields.
1309 1309
          *
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
          * @param string $html The html to be filtered (blank).
1313 1313
          * @param array $custom_field The custom field array values.
1314 1314
          */
1315
-        echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1315
+        echo apply_filters("geodir_custom_field_input_{$type}", $html, $custom_field);
1316 1316
 
1317 1317
 
1318 1318
 
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1328 1328
          * @see 'geodir_before_custom_form_field_$name'
1329 1329
          */
1330
-        do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1330
+        do_action('geodir_after_custom_form_field_'.$name, $listing_type, $package_id, $val);
1331 1331
 
1332 1332
     }
1333 1333
 
@@ -1353,9 +1353,9 @@  discard block
 block discarded – undo
1353 1353
 
1354 1354
         $filter = $wpdb->get_row(
1355 1355
             $wpdb->prepare(
1356
-                "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1356
+                "SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND ".$key."='".$value."'",
1357 1357
                 array($geodir_post_type)
1358
-            ),ARRAY_A
1358
+            ), ARRAY_A
1359 1359
         );
1360 1360
 
1361 1361
         if ($filter) {
@@ -1368,14 +1368,14 @@  discard block
 block discarded – undo
1368 1368
 }
1369 1369
 
1370 1370
 
1371
-function geodir_field_icon_proccess($cf){
1371
+function geodir_field_icon_proccess($cf) {
1372 1372
 
1373 1373
 
1374 1374
     if (strpos($cf['field_icon'], 'http') !== false) {
1375
-        $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1375
+        $field_icon = ' background: url('.$cf['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1376 1376
     } elseif (strpos($cf['field_icon'], ' fa-') !== false) {
1377
-        $field_icon = '<i class="' . $cf['field_icon'] . ' fa-fw"></i>';
1378
-    }else{
1377
+        $field_icon = '<i class="'.$cf['field_icon'].' fa-fw"></i>';
1378
+    } else {
1379 1379
         $field_icon = $cf['field_icon'];
1380 1380
     }
1381 1381
 
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 
1402 1402
         $package_info = array();
1403 1403
 
1404
-        if(!$preview && !isset($post->post_id)){
1404
+        if (!$preview && !isset($post->post_id)) {
1405 1405
             $post = geodir_get_post_info($post->ID);
1406 1406
         }
1407 1407
 
@@ -1422,14 +1422,14 @@  discard block
 block discarded – undo
1422 1422
 
1423 1423
 
1424 1424
             foreach ($fields_info as $type) {
1425
-                if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
1425
+                if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
1426 1426
                 $type = stripslashes_deep($type); // strip slashes
1427
-                if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
1427
+                if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
1428 1428
                 $html = '';
1429 1429
                 $field_icon = geodir_field_icon_proccess($type);
1430 1430
                 $filed_type = $type['type'];
1431 1431
                 $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
1432
-                if($html_var=='post'){$html_var='post_address';}
1432
+                if ($html_var == 'post') {$html_var = 'post_address'; }
1433 1433
 
1434 1434
                 /**
1435 1435
                  * Filter the output for custom fields.
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
                  * @param string $fields_location The location the field is to be show.
1441 1441
                  * @param array $type The array of field values.
1442 1442
                  */
1443
-                $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1443
+                $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
1444 1444
 
1445 1445
                 $variables_array = array();
1446 1446
 
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
          * @param string $fields_location The location the fields are being output.
1501 1501
          * @since 1.6.9
1502 1502
          */
1503
-        return apply_filters('geodir_show_listing_info',$html,$fields_location);
1503
+        return apply_filters('geodir_show_listing_info', $html, $fields_location);
1504 1504
 
1505 1505
     }
1506 1506
 }
@@ -1575,7 +1575,7 @@  discard block
 block discarded – undo
1575 1575
 
1576 1576
         $post_type = get_post_type($post_id);
1577 1577
         //echo $field_id; exit;
1578
-        $table = $plugin_prefix . $post_type . '_detail';
1578
+        $table = $plugin_prefix.$post_type.'_detail';
1579 1579
 
1580 1580
         $postcurr_images = array();
1581 1581
         $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
@@ -1594,13 +1594,13 @@  discard block
 block discarded – undo
1594 1594
             $geodir_uploadurl = $uploads['url'];
1595 1595
             $sub_dir = $uploads['subdir'];
1596 1596
 
1597
-            $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1597
+            $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
1598 1598
 
1599 1599
             for ($m = 0; $m < count($post_image); $m++) {
1600 1600
 
1601 1601
                 /* --------- start ------- */
1602 1602
 
1603
-                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1603
+                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM ".$table." WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1604 1604
 
1605 1605
 
1606 1606
                     $curr_img_url = $post_image[$m];
@@ -1626,24 +1626,24 @@  discard block
 block discarded – undo
1626 1626
                     //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1627 1627
 
1628 1628
                     if (!function_exists('wp_handle_upload'))
1629
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1629
+                        require_once(ABSPATH.'wp-admin/includes/file.php');
1630 1630
 
1631 1631
                     if (!is_dir($geodir_uploadpath))
1632 1632
                         mkdir($geodir_uploadpath);
1633 1633
 
1634
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1634
+                    $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1];
1635 1635
                     $explode_sub_dir = explode("/", $sub_dir);
1636 1636
                     if ($curr_img_dir == end($explode_sub_dir)) {
1637
-                        $img_path = $geodir_uploadpath . '/' . $filename;
1638
-                        $img_url = $geodir_uploadurl . '/' . $filename;
1637
+                        $img_path = $geodir_uploadpath.'/'.$filename;
1638
+                        $img_url = $geodir_uploadurl.'/'.$filename;
1639 1639
                     } else {
1640
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1641
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1640
+                        $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1641
+                        $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1642 1642
                     }
1643 1643
 
1644 1644
                     $uploaded_file = '';
1645 1645
                     if (file_exists($img_path))
1646
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1646
+                        $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1647 1647
 
1648 1648
                     if ($curr_img_dir != $geodir_uploaddir) {
1649 1649
                         if (file_exists($img_path))
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
                     }
1652 1652
 
1653 1653
                     if (!empty($uploaded_file))
1654
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1654
+                        $file_urls = $geodir_uploadurl.'/'.$new_name;
1655 1655
 
1656 1656
                 } else {
1657 1657
                     $file_urls = $post_image[$m];
@@ -1665,8 +1665,8 @@  discard block
 block discarded – undo
1665 1665
         if (!empty($postcurr_images)) {
1666 1666
 
1667 1667
             if ($file_urls != $postcurr_images) {
1668
-                $invalid_files[] = (object)array('src' => $postcurr_images);
1669
-                $invalid_files = (object)$invalid_files;
1668
+                $invalid_files[] = (object) array('src' => $postcurr_images);
1669
+                $invalid_files = (object) $invalid_files;
1670 1670
             }
1671 1671
         }
1672 1672
 
@@ -1718,9 +1718,9 @@  discard block
 block discarded – undo
1718 1718
     function geodir_upload_dir($upload)
1719 1719
     {
1720 1720
         global $current_user;
1721
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1722
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
1723
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
1721
+        $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID;
1722
+        $upload['path'] = $upload['basedir'].$upload['subdir'];
1723
+        $upload['url'] = $upload['baseurl'].$upload['subdir'];
1724 1724
         return $upload;
1725 1725
     }
1726 1726
 
@@ -1735,20 +1735,20 @@  discard block
 block discarded – undo
1735 1735
         // check ajax nonce
1736 1736
         $imgid = $_POST["imgid"];
1737 1737
 
1738
-        check_ajax_referer($imgid . 'pluploadan');
1738
+        check_ajax_referer($imgid.'pluploadan');
1739 1739
 
1740 1740
         // handle custom file uploaddir
1741 1741
         add_filter('upload_dir', 'geodir_upload_dir');
1742 1742
 
1743 1743
         // change file orientation if needed
1744
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1744
+        $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']);
1745 1745
 
1746 1746
         // handle file upload
1747 1747
         $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1748 1748
         // remove handle custom file uploaddir
1749 1749
         remove_filter('upload_dir', 'geodir_upload_dir');
1750 1750
 
1751
-        if(!isset($status['url']) && isset($status['error'])){
1751
+        if (!isset($status['url']) && isset($status['error'])) {
1752 1752
             print_r($status);
1753 1753
         }
1754 1754
 
@@ -1778,9 +1778,9 @@  discard block
 block discarded – undo
1778 1778
 
1779 1779
     $post_type = get_post_type($post_id);
1780 1780
 
1781
-    $table = $plugin_prefix . $post_type . '_detail';
1781
+    $table = $plugin_prefix.$post_type.'_detail';
1782 1782
 
1783
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1783
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id)));
1784 1784
 
1785 1785
     if ($results) {
1786 1786
         return $results[0]->geodir_video;
@@ -1804,9 +1804,9 @@  discard block
 block discarded – undo
1804 1804
 
1805 1805
     $post_type = get_post_type($post_id);
1806 1806
 
1807
-    $table = $plugin_prefix . $post_type . '_detail';
1807
+    $table = $plugin_prefix.$post_type.'_detail';
1808 1808
 
1809
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1809
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id)));
1810 1810
 
1811 1811
     if ($results) {
1812 1812
         return $results[0]->geodir_special_offers;
@@ -1824,12 +1824,12 @@  discard block
 block discarded – undo
1824 1824
      */
1825 1825
     function geodir_max_upload_size()
1826 1826
     {
1827
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1827
+        $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1828 1828
 
1829 1829
         if ($max_filesize > 0 && $max_filesize < 1) {
1830
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
1830
+            $max_filesize = (int) ($max_filesize * 1024).'kb';
1831 1831
         } else {
1832
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1832
+            $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1833 1833
         }
1834 1834
         /** Filter documented in geodirectory-functions/general_functions.php **/
1835 1835
         return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
@@ -1861,7 +1861,7 @@  discard block
 block discarded – undo
1861 1861
 
1862 1862
             $custom_fields = $wpdb->get_results(
1863 1863
                 $wpdb->prepare(
1864
-                    "select post_type,data_type,field_type,site_title,admin_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1864
+                    "select post_type,data_type,field_type,site_title,admin_title,htmlvar_name,field_icon from ".GEODIR_CUSTOM_FIELDS_TABLE." where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1865 1865
                     array($post_type)
1866 1866
                 ), 'ARRAY_A'
1867 1867
             );
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
 
1989 1989
             $post_meta_info = $wpdb->query(
1990 1990
                 $wpdb->prepare(
1991
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1991
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
1992 1992
 															sort_order=%d 
1993 1993
 															where id= %d",
1994 1994
                     array($count, $cf)
@@ -2070,14 +2070,14 @@  discard block
 block discarded – undo
2070 2070
 
2071 2071
         $check_html_variable = $wpdb->get_var(
2072 2072
             $wpdb->prepare(
2073
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2073
+                "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ",
2074 2074
                 array($cehhtmlvar_name, $post_type, $field_type)
2075 2075
             )
2076 2076
         );
2077 2077
 
2078 2078
         if ($is_default == 1) {
2079 2079
 
2080
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2080
+            $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type)));
2081 2081
 
2082 2082
         }
2083 2083
 
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 
2089 2089
                 $wpdb->prepare(
2090 2090
 
2091
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2091
+                    "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2092 2092
 				post_type = %s,
2093 2093
 				data_type = %s,
2094 2094
 				field_type = %s,
@@ -2119,7 +2119,7 @@  discard block
 block discarded – undo
2119 2119
 
2120 2120
                 $wpdb->prepare(
2121 2121
 
2122
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2122
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2123 2123
 				post_type = %s,
2124 2124
 				data_type = %s,
2125 2125
 				field_type = %s,
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
         }
2146 2146
 
2147 2147
 
2148
-        return (int)$lastid;
2148
+        return (int) $lastid;
2149 2149
 
2150 2150
     }
2151 2151
 }
@@ -2168,7 +2168,7 @@  discard block
 block discarded – undo
2168 2168
         if ($field_id != '') {
2169 2169
             $cf = trim($field_id, '_');
2170 2170
 
2171
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2171
+            $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf)));
2172 2172
 
2173 2173
             return $field_id;
2174 2174
 
@@ -2191,12 +2191,12 @@  discard block
 block discarded – undo
2191 2191
      * @param string $field_ins_upd When set to "submit" displays form.
2192 2192
      * @param bool $default when set to true field will be for admin use only.
2193 2193
      */
2194
-    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2194
+    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
2195 2195
     {
2196 2196
         global $wpdb;
2197 2197
         $cf = $result_str;
2198 2198
         if (!is_object($cf)) {
2199
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2199
+            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf)));
2200 2200
         } else {
2201 2201
             $field_info = $cf;
2202 2202
             $result_str = $cf->id;
@@ -2232,18 +2232,18 @@  discard block
 block discarded – undo
2232 2232
         if ($htmlvar_name == '')
2233 2233
             $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2234 2234
 
2235
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
2235
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
2236 2236
 
2237 2237
         $field_icon = '<i class="fas fa-cog" aria-hidden="true"></i>';
2238 2238
         $cso_arr = geodir_get_custom_sort_options($post_type);
2239 2239
 
2240 2240
         $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2241
-        foreach($cso_arr as $cso){
2242
-            if($cur_field_type==$cso['field_type']){
2241
+        foreach ($cso_arr as $cso) {
2242
+            if ($cur_field_type == $cso['field_type']) {
2243 2243
 
2244 2244
                 if (isset($cso['field_icon']) && strpos($cso['field_icon'], ' fa-') !== false) {
2245 2245
                     $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2246
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2246
+                }elseif (isset($cso['field_icon']) && $cso['field_icon']) {
2247 2247
                     $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cso['field_icon'].'\')"></b>';
2248 2248
                 }
2249 2249
 
@@ -2253,40 +2253,40 @@  discard block
 block discarded – undo
2253 2253
         $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500);
2254 2254
         ?>
2255 2255
 
2256
-        <li class="text" id="licontainer_<?php echo $result_str;?>">
2256
+        <li class="text" id="licontainer_<?php echo $result_str; ?>">
2257 2257
             <form><!-- we need to wrap in a form so we can use radio buttons with same name -->
2258
-            <div class="title title<?php echo $result_str;?> gt-fieldset"
2259
-                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>"
2260
-                 ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
2258
+            <div class="title title<?php echo $result_str; ?> gt-fieldset"
2259
+                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>"
2260
+                 ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
2261 2261
                 <?php
2262 2262
 
2263 2263
                 ?>
2264 2264
 
2265
-                <div title="<?php _e('Click to remove field', 'geodirectory');?>"
2266
-                     onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2265
+                <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
2266
+                     onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2267 2267
                      class="handlediv close"><i class="fas fa-times" aria-hidden="true"></i></div>
2268 2268
 
2269 2269
 
2270
-                <?php echo $field_icon;?>
2270
+                <?php echo $field_icon; ?>
2271 2271
                 <b style="cursor:pointer;"
2272
-                   onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b>
2272
+                   onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b>
2273 2273
 
2274 2274
             </div>
2275 2275
 
2276
-            <div id="field_frm<?php echo $result_str;?>" class="field_frm"
2276
+            <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
2277 2277
                  style="display:<?php if ($field_ins_upd == 'submit') {
2278 2278
                      echo 'block;';
2279 2279
                  } else {
2280 2280
                      echo 'none;';
2281 2281
                  } ?>">
2282 2282
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
2283
-                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
2284
-                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
2285
-                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
2283
+                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
2284
+                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
2285
+                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/>
2286 2286
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
2287 2287
                     echo $field_info->data_type;
2288 2288
                 }?>"/>
2289
-                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
2289
+                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/>
2290 2290
 
2291 2291
 
2292 2292
                 <ul class="widefat post fixed" border="0" style="width:100%;">
@@ -2296,7 +2296,7 @@  discard block
 block discarded – undo
2296 2296
                         <input type="hidden" name="site_title" id="site_title" value="<?php echo esc_attr($site_title); ?>"/>
2297 2297
 
2298 2298
                         <li>
2299
-                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0;?>
2299
+                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0; ?>
2300 2300
 
2301 2301
                             <label for="asc" class="gd-cf-tooltip-wrap">
2302 2302
                                 <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Show Ascending Sort (low to high)', 'geodirectory'); ?>
@@ -2306,24 +2306,24 @@  discard block
 block discarded – undo
2306 2306
                             </label>
2307 2307
                             <div class="gd-cf-input-wrap gd-switch">
2308 2308
 
2309
-                                <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled"  value="1"
2309
+                                <input type="radio" id="asc_yes<?php echo $radio_id; ?>" name="asc" class="gdri-enabled"  value="1"
2310 2310
                                     <?php if ($value == '1') {
2311 2311
                                         echo 'checked';
2312 2312
                                     } ?>/>
2313
-                                <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2313
+                                <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2314 2314
 
2315
-                                <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0"
2315
+                                <input type="radio" id="asc_no<?php echo $radio_id; ?>" name="asc" class="gdri-disabled" value="0"
2316 2316
                                     <?php if ($value == '0' || !$value) {
2317 2317
                                         echo 'checked';
2318 2318
                                     } ?>/>
2319
-                                <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2319
+                                <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2320 2320
 
2321 2321
                             </div>
2322 2322
 
2323 2323
                         </li>
2324 2324
 
2325
-                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
2326
-                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : '';?>
2325
+                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
2326
+                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : ''; ?>
2327 2327
 
2328 2328
                             <label for="asc_title" class="gd-cf-tooltip-wrap">
2329 2329
                                 <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Ascending title', 'geodirectory'); ?>
@@ -2333,14 +2333,14 @@  discard block
 block discarded – undo
2333 2333
                             </label>
2334 2334
                             <div class="gd-cf-input-wrap">
2335 2335
 
2336
-                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value;?>" />
2336
+                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value; ?>" />
2337 2337
                             </div>
2338 2338
 
2339 2339
 
2340 2340
                         </li>
2341 2341
 
2342 2342
 
2343
-                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
2343
+                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
2344 2344
 
2345 2345
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2346 2346
                                 <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
                             <div class="gd-cf-input-wrap">
2352 2352
 
2353 2353
                                 <input type="radio" name="is_default"
2354
-                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
2354
+                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') {
2355 2355
                                     echo 'checked="checked"';
2356 2356
                                 } ?>/>
2357 2357
                             </div>
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
 
2362 2362
 
2363 2363
                         <li>
2364
-                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0;?>
2364
+                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0; ?>
2365 2365
 
2366 2366
                             <label for="desc" class="gd-cf-tooltip-wrap">
2367 2367
                                 <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Show Descending Sort (high to low)', 'geodirectory'); ?>
@@ -2371,24 +2371,24 @@  discard block
 block discarded – undo
2371 2371
                             </label>
2372 2372
                             <div class="gd-cf-input-wrap gd-switch">
2373 2373
 
2374
-                                <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled"  value="1"
2374
+                                <input type="radio" id="desc_yes<?php echo $radio_id; ?>" name="desc" class="gdri-enabled"  value="1"
2375 2375
                                     <?php if ($value == '1') {
2376 2376
                                         echo 'checked';
2377 2377
                                     } ?>/>
2378
-                                <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2378
+                                <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2379 2379
 
2380
-                                <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0"
2380
+                                <input type="radio" id="desc_no<?php echo $radio_id; ?>" name="desc" class="gdri-disabled" value="0"
2381 2381
                                     <?php if ($value == '0' || !$value) {
2382 2382
                                         echo 'checked';
2383 2383
                                     } ?>/>
2384
-                                <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2384
+                                <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2385 2385
 
2386 2386
                             </div>
2387 2387
 
2388 2388
                         </li>
2389 2389
 
2390
-                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
2391
-                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : '';?>
2390
+                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
2391
+                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : ''; ?>
2392 2392
 
2393 2393
                             <label for="desc_title" class="gd-cf-tooltip-wrap">
2394 2394
                                 <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Descending title', 'geodirectory'); ?>
@@ -2398,13 +2398,13 @@  discard block
 block discarded – undo
2398 2398
                             </label>
2399 2399
                             <div class="gd-cf-input-wrap">
2400 2400
 
2401
-                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value;?>" />
2401
+                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value; ?>" />
2402 2402
                             </div>
2403 2403
 
2404 2404
 
2405 2405
                         </li>
2406 2406
 
2407
-                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
2407
+                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
2408 2408
 
2409 2409
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2410 2410
                                 <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2415,7 +2415,7 @@  discard block
 block discarded – undo
2415 2415
                             <div class="gd-cf-input-wrap">
2416 2416
 
2417 2417
                                 <input type="radio" name="is_default"
2418
-                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
2418
+                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') {
2419 2419
                                     echo 'checked="checked"';
2420 2420
                                 } ?>/>
2421 2421
                             </div>
@@ -2440,14 +2440,14 @@  discard block
 block discarded – undo
2440 2440
                             </label>
2441 2441
                             <div class="gd-cf-input-wrap">
2442 2442
 
2443
-                                <input type="text" name="site_title" id="site_title" value="<?php echo $value;?>" />
2443
+                                <input type="text" name="site_title" id="site_title" value="<?php echo $value; ?>" />
2444 2444
                             </div>
2445 2445
 
2446 2446
 
2447 2447
                         </li>
2448 2448
 
2449 2449
                         <li>
2450
-                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : '';?>
2450
+                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : ''; ?>
2451 2451
 
2452 2452
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2453 2453
                                 <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2471,7 +2471,7 @@  discard block
 block discarded – undo
2471 2471
 
2472 2472
 
2473 2473
                     <li>
2474
-                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active: 0;?>
2474
+                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active : 0; ?>
2475 2475
 
2476 2476
                         <label for="is_active" class="gd-cf-tooltip-wrap">
2477 2477
                             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Is active', 'geodirectory'); ?>
@@ -2481,17 +2481,17 @@  discard block
 block discarded – undo
2481 2481
                         </label>
2482 2482
                         <div class="gd-cf-input-wrap gd-switch">
2483 2483
 
2484
-                            <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
2484
+                            <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
2485 2485
                                 <?php if ($value == '1') {
2486 2486
                                     echo 'checked';
2487 2487
                                 } ?>/>
2488
-                            <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2488
+                            <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2489 2489
 
2490
-                            <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
2490
+                            <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
2491 2491
                                 <?php if ($value == '0' || !$value) {
2492 2492
                                     echo 'checked';
2493 2493
                                 } ?>/>
2494
-                            <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2494
+                            <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2495 2495
 
2496 2496
                         </div>
2497 2497
 
@@ -2512,10 +2512,10 @@  discard block
 block discarded – undo
2512 2512
                             <h3></h3>
2513 2513
                         </label>
2514 2514
                         <div class="gd-cf-input-wrap">
2515
-                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
2515
+                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
2516 2516
                                    onclick="save_sort_field('<?php echo esc_attr($result_str); ?>')"/>
2517
-                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
2518
-                                                                    onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2517
+                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
2518
+                                                                    onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2519 2519
                                                                     class="button"/></a>
2520 2520
                         </div>
2521 2521
                     </li>
@@ -2550,7 +2550,7 @@  discard block
 block discarded – undo
2550 2550
         if (!$package_id || !$field_name || !$post_type) {
2551 2551
             return true;
2552 2552
         }
2553
-        $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
2553
+        $sql = $wpdb->prepare("SELECT id FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int) $package_id));
2554 2554
 
2555 2555
         if ($wpdb->get_var($sql)) {
2556 2556
             return true;
@@ -2673,13 +2673,13 @@  discard block
 block discarded – undo
2673 2673
 }
2674 2674
 
2675 2675
 
2676
-function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
2676
+function geodir_cfa_data_type_text($output, $result_str, $cf, $field_info) {
2677 2677
     ob_start();
2678 2678
 
2679 2679
     $dt_value = '';
2680 2680
     if (isset($field_info->data_type)) {
2681 2681
         $dt_value  = esc_attr($field_info->data_type);
2682
-    }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
2682
+    }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
2683 2683
         $dt_value  = $cf['defaults']['data_type'];
2684 2684
     }
2685 2685
     ?>
@@ -2690,15 +2690,15 @@  discard block
 block discarded – undo
2690 2690
             <select name="data_type" id="data_type"
2691 2691
                     onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');">
2692 2692
                 <option
2693
-                    value="XVARCHAR" <?php if ($dt_value  == 'VARCHAR') {
2693
+                    value="XVARCHAR" <?php if ($dt_value == 'VARCHAR') {
2694 2694
                     echo 'selected="selected"';
2695 2695
                 } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
2696 2696
                 <option
2697
-                    value="INT" <?php if ($dt_value   == 'INT') {
2697
+                    value="INT" <?php if ($dt_value == 'INT') {
2698 2698
                     echo 'selected="selected"';
2699 2699
                 } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
2700 2700
                 <option
2701
-                    value="FLOAT" <?php if ($dt_value   == 'FLOAT') {
2701
+                    value="FLOAT" <?php if ($dt_value == 'FLOAT') {
2702 2702
                     echo 'selected="selected"';
2703 2703
                 } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
2704 2704
             </select>
@@ -2711,13 +2711,13 @@  discard block
 block discarded – undo
2711 2711
     $value = '';
2712 2712
     if (isset($field_info->decimal_point)) {
2713 2713
         $value = esc_attr($field_info->decimal_point);
2714
-    }elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
2714
+    }elseif (isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']) {
2715 2715
         $value = $cf['defaults']['decimal_point'];
2716 2716
     }
2717 2717
     ?>
2718 2718
 
2719 2719
     <li class="decimal-point-wrapper"
2720
-        style="<?php echo ($dt_value  == 'FLOAT') ? '' : 'display:none' ?>">
2720
+        style="<?php echo ($dt_value == 'FLOAT') ? '' : 'display:none' ?>">
2721 2721
         <label for="decimal_point"><?php _e('Select decimal point :', 'geodirectory'); ?></label>
2722 2722
         <div class="gd-cf-input-wrap">
2723 2723
             <select name="decimal_point" id="decimal_point">
@@ -2735,41 +2735,41 @@  discard block
 block discarded – undo
2735 2735
     $output = ob_get_clean();
2736 2736
     return $output;
2737 2737
 }
2738
-add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
2738
+add_filter('geodir_cfa_data_type_text', 'geodir_cfa_data_type_text', 10, 4);
2739 2739
 
2740 2740
 // htmlvar not needed for fieldset and taxonomy
2741
-add_filter('geodir_cfa_htmlvar_name_fieldset','__return_empty_string',10,4);
2742
-add_filter('geodir_cfa_htmlvar_name_taxonomy','__return_empty_string',10,4);
2741
+add_filter('geodir_cfa_htmlvar_name_fieldset', '__return_empty_string', 10, 4);
2742
+add_filter('geodir_cfa_htmlvar_name_taxonomy', '__return_empty_string', 10, 4);
2743 2743
 
2744 2744
 
2745 2745
 // default_value not needed for textarea, html, file, fieldset, taxonomy, address
2746
-add_filter('geodir_cfa_default_value_file','__return_empty_string',10,4);
2747
-add_filter('geodir_cfa_default_value_taxonomy','__return_empty_string',10,4);
2748
-add_filter('geodir_cfa_default_value_address','__return_empty_string',10,4);
2749
-add_filter('geodir_cfa_default_value_fieldset','__return_empty_string',10,4);
2746
+add_filter('geodir_cfa_default_value_file', '__return_empty_string', 10, 4);
2747
+add_filter('geodir_cfa_default_value_taxonomy', '__return_empty_string', 10, 4);
2748
+add_filter('geodir_cfa_default_value_address', '__return_empty_string', 10, 4);
2749
+add_filter('geodir_cfa_default_value_fieldset', '__return_empty_string', 10, 4);
2750 2750
 
2751 2751
 // is_required not needed for fieldset
2752
-add_filter('geodir_cfa_is_required_fieldset','__return_empty_string',10,4);
2753
-add_filter('geodir_cfa_required_msg_fieldset','__return_empty_string',10,4);
2752
+add_filter('geodir_cfa_is_required_fieldset', '__return_empty_string', 10, 4);
2753
+add_filter('geodir_cfa_required_msg_fieldset', '__return_empty_string', 10, 4);
2754 2754
 
2755 2755
 // field_icon not needed for fieldset
2756
-add_filter('geodir_cfa_field_icon_fieldset','__return_empty_string',10,4);
2757
-add_filter('geodir_cfa_css_class_fieldset','__return_empty_string',10,4);
2756
+add_filter('geodir_cfa_field_icon_fieldset', '__return_empty_string', 10, 4);
2757
+add_filter('geodir_cfa_css_class_fieldset', '__return_empty_string', 10, 4);
2758 2758
 
2759 2759
 // cat_sort not needed for some fields
2760
-add_filter('geodir_cfa_cat_sort_html','__return_empty_string',10,4);
2761
-add_filter('geodir_cfa_cat_sort_file','__return_empty_string',10,4);
2762
-add_filter('geodir_cfa_cat_sort_url','__return_empty_string',10,4);
2763
-add_filter('geodir_cfa_cat_sort_fieldset','__return_empty_string',10,4);
2764
-add_filter('geodir_cfa_cat_sort_multiselect','__return_empty_string',10,4);
2765
-add_filter('geodir_cfa_cat_sort_textarea','__return_empty_string',10,4);
2766
-add_filter('geodir_cfa_cat_sort_taxonomy','__return_empty_string',10,4);
2767
-add_filter('geodir_cfa_cat_sort_address','__return_empty_string',10,4);
2760
+add_filter('geodir_cfa_cat_sort_html', '__return_empty_string', 10, 4);
2761
+add_filter('geodir_cfa_cat_sort_file', '__return_empty_string', 10, 4);
2762
+add_filter('geodir_cfa_cat_sort_url', '__return_empty_string', 10, 4);
2763
+add_filter('geodir_cfa_cat_sort_fieldset', '__return_empty_string', 10, 4);
2764
+add_filter('geodir_cfa_cat_sort_multiselect', '__return_empty_string', 10, 4);
2765
+add_filter('geodir_cfa_cat_sort_textarea', '__return_empty_string', 10, 4);
2766
+add_filter('geodir_cfa_cat_sort_taxonomy', '__return_empty_string', 10, 4);
2767
+add_filter('geodir_cfa_cat_sort_address', '__return_empty_string', 10, 4);
2768 2768
 
2769 2769
 
2770 2770
 
2771
-function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
2772
-    if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2771
+function geodir_cfa_advanced_editor_geodir_special_offers($output, $result_str, $cf, $field_info) {
2772
+    if ($field_info->htmlvar_name != 'geodir_special_offers') {return ''; }
2773 2773
     ob_start();
2774 2774
     ?>
2775 2775
     <li>
@@ -2800,16 +2800,16 @@  discard block
 block discarded – undo
2800 2800
     $output = ob_get_clean();
2801 2801
     return $output;
2802 2802
 }
2803
-add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
2803
+add_filter('geodir_cfa_advanced_editor_textarea', 'geodir_cfa_advanced_editor_geodir_special_offers', 10, 4);
2804 2804
 
2805 2805
 
2806
-function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
2806
+function geodir_cfa_validation_pattern_text($output, $result_str, $cf, $field_info) {
2807 2807
     ob_start();
2808 2808
 
2809 2809
     $value = '';
2810 2810
     if (isset($field_info->validation_pattern)) {
2811 2811
         $value = esc_attr($field_info->validation_pattern);
2812
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2812
+    }elseif (isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']) {
2813 2813
         $value = esc_attr($cf['defaults']['validation_pattern']);
2814 2814
     }
2815 2815
     ?>
@@ -2829,7 +2829,7 @@  discard block
 block discarded – undo
2829 2829
     $value = '';
2830 2830
     if (isset($field_info->validation_msg)) {
2831 2831
         $value = esc_attr($field_info->validation_msg);
2832
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2832
+    }elseif (isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']) {
2833 2833
         $value = esc_attr($cf['defaults']['validation_msg']);
2834 2834
     }
2835 2835
     ?>
@@ -2850,10 +2850,10 @@  discard block
 block discarded – undo
2850 2850
     $output = ob_get_clean();
2851 2851
     return $output;
2852 2852
 }
2853
-add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
2853
+add_filter('geodir_cfa_validation_pattern_text', 'geodir_cfa_validation_pattern_text', 10, 4);
2854 2854
 
2855 2855
 
2856
-function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
2856
+function geodir_cfa_htmlvar_name_taxonomy($output, $result_str, $cf, $field_info) {
2857 2857
     ob_start();
2858 2858
     global $post_type;
2859 2859
 
@@ -2878,7 +2878,7 @@  discard block
 block discarded – undo
2878 2878
                     ?>
2879 2879
                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
2880 2880
                         echo 'selected="selected"';
2881
-                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2881
+                    }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php
2882 2882
                 }
2883 2883
                 ?>
2884 2884
             </select>
@@ -2889,7 +2889,7 @@  discard block
 block discarded – undo
2889 2889
         <label for="cat_display_type" class="gd-cf-tooltip-wrap">
2890 2890
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Category display type :', 'geodirectory'); ?>
2891 2891
             <div class="gdcf-tooltip">
2892
-                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory');?>
2892
+                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory'); ?>
2893 2893
             </div>
2894 2894
         </label>
2895 2895
         <div class="gd-cf-input-wrap">
@@ -2897,19 +2897,19 @@  discard block
 block discarded – undo
2897 2897
             <select name="cat_display_type" id="cat_display_type">
2898 2898
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
2899 2899
                     echo 'selected="selected"';
2900
-                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2900
+                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
2901 2901
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2902 2902
                     echo 'selected="selected"';
2903
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2903
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
2904 2904
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
2905 2905
                     echo 'selected="selected"';
2906
-                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2906
+                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
2907 2907
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2908 2908
                     echo 'selected="selected"';
2909
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2909
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
2910 2910
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2911 2911
                     echo 'selected="selected"';
2912
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2912
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
2913 2913
             </select>
2914 2914
         </div>
2915 2915
     </li>
@@ -2918,10 +2918,10 @@  discard block
 block discarded – undo
2918 2918
     $output = ob_get_clean();
2919 2919
     return $output;
2920 2920
 }
2921
-add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
2921
+add_filter('geodir_cfa_htmlvar_name_taxonomy', 'geodir_cfa_htmlvar_name_taxonomy', 10, 4);
2922 2922
 
2923 2923
 
2924
-function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
2924
+function geodir_cfa_extra_fields_address($output, $result_str, $cf, $field_info) {
2925 2925
 
2926 2926
     ob_start();
2927 2927
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -2944,32 +2944,32 @@  discard block
 block discarded – undo
2944 2944
         <label for="show_zip" class="gd-cf-tooltip-wrap">
2945 2945
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Display zip/post code :', 'geodirectory'); ?>
2946 2946
             <div class="gdcf-tooltip">
2947
-                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?>
2947
+                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?>
2948 2948
             </div>
2949 2949
         </label>
2950 2950
         <div class="gd-cf-input-wrap gd-switch">
2951 2951
 
2952
-            <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2952
+            <input type="radio" id="show_zip_yes<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2953 2953
                 <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
2954 2954
                     echo 'checked';
2955 2955
                 } ?>/>
2956
-            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2956
+            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2957 2957
 
2958
-            <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2958
+            <input type="radio" id="show_zip_no<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2959 2959
                 <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
2960 2960
                     echo 'checked';
2961 2961
                 } ?>/>
2962
-            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2962
+            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2963 2963
 
2964 2964
 
2965 2965
         </div>
2966 2966
     </li>
2967 2967
 
2968
-    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'";}?> >
2968
+    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'"; }?> >
2969 2969
         <label for="zip_lable" class="gd-cf-tooltip-wrap">
2970 2970
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Zip/Post code label :', 'geodirectory'); ?>
2971 2971
             <div class="gdcf-tooltip">
2972
-                <?php _e('Enter zip/post code field label in address section.', 'geodirectory');?>
2972
+                <?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?>
2973 2973
             </div>
2974 2974
         </label>
2975 2975
         <div class="gd-cf-input-wrap">
@@ -2987,7 +2987,7 @@  discard block
 block discarded – undo
2987 2987
         <label for="map_lable" class="gd-cf-tooltip-wrap">
2988 2988
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Map button label :', 'geodirectory'); ?>
2989 2989
             <div class="gdcf-tooltip">
2990
-                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory');?>
2990
+                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory'); ?>
2991 2991
             </div>
2992 2992
         </label>
2993 2993
         <div class="gd-cf-input-wrap">
@@ -3002,22 +3002,22 @@  discard block
 block discarded – undo
3002 3002
         <label for="show_mapzoom" class="gd-cf-tooltip-wrap">
3003 3003
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Use user zoom level:', 'geodirectory'); ?>
3004 3004
             <div class="gdcf-tooltip">
3005
-                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory');?>
3005
+                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory'); ?>
3006 3006
             </div>
3007 3007
         </label>
3008 3008
         <div class="gd-cf-input-wrap gd-switch">
3009 3009
 
3010
-            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
3010
+            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
3011 3011
                 <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
3012 3012
                     echo 'checked';
3013 3013
                 } ?>/>
3014
-            <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3014
+            <label for="show_mapzoom_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3015 3015
 
3016
-            <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
3016
+            <input type="radio" id="show_mapzoom_no<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
3017 3017
                 <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
3018 3018
                     echo 'checked';
3019 3019
                 } ?>/>
3020
-            <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3020
+            <label for="show_mapzoom_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3021 3021
 
3022 3022
         </div>
3023 3023
     </li>
@@ -3026,22 +3026,22 @@  discard block
 block discarded – undo
3026 3026
         <label for="show_mapview" class="gd-cf-tooltip-wrap">
3027 3027
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Display map view:', 'geodirectory'); ?>
3028 3028
             <div class="gdcf-tooltip">
3029
-                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory');?>
3029
+                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory'); ?>
3030 3030
             </div>
3031 3031
         </label>
3032 3032
         <div class="gd-cf-input-wrap gd-switch">
3033 3033
 
3034
-            <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
3034
+            <input type="radio" id="show_mapview_yes<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
3035 3035
                 <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
3036 3036
                     echo 'checked';
3037 3037
                 } ?>/>
3038
-            <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3038
+            <label for="show_mapview_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3039 3039
 
3040
-            <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
3040
+            <input type="radio" id="show_mapview_no<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
3041 3041
                 <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
3042 3042
                     echo 'checked';
3043 3043
                 } ?>/>
3044
-            <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3044
+            <label for="show_mapview_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3045 3045
 
3046 3046
         </div>
3047 3047
     </li>
@@ -3051,7 +3051,7 @@  discard block
 block discarded – undo
3051 3051
         <label for="mapview_lable" class="gd-cf-tooltip-wrap">
3052 3052
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Map view label:', 'geodirectory'); ?>
3053 3053
             <div class="gdcf-tooltip">
3054
-                <?php _e('Enter mapview field label in address section.', 'geodirectory');?>
3054
+                <?php _e('Enter mapview field label in address section.', 'geodirectory'); ?>
3055 3055
             </div>
3056 3056
         </label>
3057 3057
         <div class="gd-cf-input-wrap">
@@ -3065,22 +3065,22 @@  discard block
 block discarded – undo
3065 3065
         <label for="show_latlng" class="gd-cf-tooltip-wrap">
3066 3066
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Show latitude and longitude', 'geodirectory'); ?>
3067 3067
             <div class="gdcf-tooltip">
3068
-                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory');?>
3068
+                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory'); ?>
3069 3069
             </div>
3070 3070
         </label>
3071 3071
         <div class="gd-cf-input-wrap gd-switch">
3072 3072
 
3073
-            <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3073
+            <input type="radio" id="show_latlng_yes<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3074 3074
                 <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
3075 3075
                     echo 'checked';
3076 3076
                 } ?>/>
3077
-            <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3077
+            <label for="show_latlng_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3078 3078
 
3079
-            <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3079
+            <input type="radio" id="show_latlng_no<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3080 3080
                 <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
3081 3081
                     echo 'checked';
3082 3082
                 } ?>/>
3083
-            <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3083
+            <label for="show_latlng_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3084 3084
 
3085 3085
         </div>
3086 3086
     </li>
@@ -3089,17 +3089,17 @@  discard block
 block discarded – undo
3089 3089
     $html = ob_get_clean();
3090 3090
     return $output.$html;
3091 3091
 }
3092
-add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
3092
+add_filter('geodir_cfa_extra_fields_address', 'geodir_cfa_extra_fields_address', 10, 4);
3093 3093
 
3094 3094
 
3095
-function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
3095
+function geodir_cfa_extra_fields_multiselect($output, $result_str, $cf, $field_info) {
3096 3096
     ob_start();
3097 3097
     ?>
3098 3098
     <li>
3099 3099
         <label for="multi_display_type" class="gd-cf-tooltip-wrap">
3100 3100
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
3101 3101
             <div class="gdcf-tooltip">
3102
-                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory');?>
3102
+                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory'); ?>
3103 3103
             </div>
3104 3104
         </label>
3105 3105
         <div class="gd-cf-input-wrap">
@@ -3107,13 +3107,13 @@  discard block
 block discarded – undo
3107 3107
             <select name="multi_display_type" id="multi_display_type">
3108 3108
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
3109 3109
                     echo 'selected="selected"';
3110
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
3110
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
3111 3111
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
3112 3112
                     echo 'selected="selected"';
3113
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3113
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
3114 3114
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
3115 3115
                     echo 'selected="selected"';
3116
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3116
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
3117 3117
             </select>
3118 3118
 
3119 3119
             <br/>
@@ -3124,17 +3124,17 @@  discard block
 block discarded – undo
3124 3124
     $html = ob_get_clean();
3125 3125
     return $output.$html;
3126 3126
 }
3127
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
3127
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_multiselect', 10, 4);
3128 3128
 
3129 3129
 
3130
-function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
3130
+function geodir_cfa_extra_fields_smr($output, $result_str, $cf, $field_info) {
3131 3131
 
3132 3132
     ob_start();
3133 3133
 
3134 3134
     $value = '';
3135 3135
     if (isset($field_info->option_values)) {
3136 3136
         $value = esc_attr($field_info->option_values);
3137
-    }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
3137
+    }elseif (isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']) {
3138 3138
         $value = esc_attr($cf['defaults']['option_values']);
3139 3139
     }
3140 3140
 
@@ -3144,11 +3144,11 @@  discard block
 block discarded – undo
3144 3144
         <label for="option_values" class="gd-cf-tooltip-wrap">
3145 3145
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
3146 3146
             <div class="gdcf-tooltip">
3147
-                <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
3147
+                <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
3148 3148
                 <br/>
3149
-                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory');?></span>
3149
+                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory'); ?></span>
3150 3150
                     <br/>
3151
-                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
3151
+                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
3152 3152
                     <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
3153 3153
                         <br/>
3154 3154
                         <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
@@ -3159,7 +3159,7 @@  discard block
 block discarded – undo
3159 3159
         </label>
3160 3160
         <div class="gd-cf-input-wrap">
3161 3161
             <input type="text" name="option_values" id="option_values"
3162
-                   value="<?php echo $value;?>"/>
3162
+                   value="<?php echo $value; ?>"/>
3163 3163
             <br/>
3164 3164
 
3165 3165
         </div>
@@ -3169,12 +3169,12 @@  discard block
 block discarded – undo
3169 3169
     $html = ob_get_clean();
3170 3170
     return $output.$html;
3171 3171
 }
3172
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
3173
-add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
3174
-add_filter('geodir_cfa_extra_fields_radio','geodir_cfa_extra_fields_smr',10,4);
3172
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_smr', 10, 4);
3173
+add_filter('geodir_cfa_extra_fields_select', 'geodir_cfa_extra_fields_smr', 10, 4);
3174
+add_filter('geodir_cfa_extra_fields_radio', 'geodir_cfa_extra_fields_smr', 10, 4);
3175 3175
 
3176 3176
 
3177
-function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
3177
+function geodir_cfa_extra_fields_datepicker($output, $result_str, $cf, $field_info) {
3178 3178
     ob_start();
3179 3179
     $extra = array();
3180 3180
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -3185,7 +3185,7 @@  discard block
 block discarded – undo
3185 3185
         <label for="date_format" class="gd-cf-tooltip-wrap">
3186 3186
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
3187 3187
             <div class="gdcf-tooltip">
3188
-                <?php _e('Select the date format.', 'geodirectory');?>
3188
+                <?php _e('Select the date format.', 'geodirectory'); ?>
3189 3189
             </div>
3190 3190
         </label>
3191 3191
         <div class="gd-cf-input-wrap" style="overflow:inherit;">
@@ -3205,16 +3205,16 @@  discard block
 block discarded – undo
3205 3205
              * @since 1.6.5
3206 3206
              * @param array $date_formats The PHP date format array.
3207 3207
              */
3208
-            $date_formats = apply_filters('geodir_date_formats',$date_formats);
3208
+            $date_formats = apply_filters('geodir_date_formats', $date_formats);
3209 3209
             ?>
3210 3210
             <select name="extra[date_format]" id="date_format">
3211 3211
                 <?php
3212
-                foreach($date_formats as $format){
3212
+                foreach ($date_formats as $format) {
3213 3213
                     $selected = '';
3214
-                    if(!empty($extra) && esc_attr($extra['date_format'])==$format){
3214
+                    if (!empty($extra) && esc_attr($extra['date_format']) == $format) {
3215 3215
                         $selected = "selected='selected'";
3216 3216
                     }
3217
-                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3217
+                    echo "<option $selected value='$format'>$format       (".date_i18n($format, time()).")</option>";
3218 3218
                 }
3219 3219
                 ?>
3220 3220
             </select>
@@ -3226,10 +3226,10 @@  discard block
 block discarded – undo
3226 3226
     $html = ob_get_clean();
3227 3227
     return $output.$html;
3228 3228
 }
3229
-add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
3229
+add_filter('geodir_cfa_extra_fields_datepicker', 'geodir_cfa_extra_fields_datepicker', 10, 4);
3230 3230
 
3231 3231
 
3232
-function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
3232
+function geodir_cfa_extra_fields_file($output, $result_str, $cf, $field_info) {
3233 3233
     ob_start();
3234 3234
     $allowed_file_types = geodir_allowed_mime_types();
3235 3235
 
@@ -3240,16 +3240,16 @@  discard block
 block discarded – undo
3240 3240
         <label for="gd_file_types" class="gd-cf-tooltip-wrap">
3241 3241
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
3242 3242
             <div class="gdcf-tooltip">
3243
-                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory');?>
3243
+                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory'); ?>
3244 3244
             </div>
3245 3245
         </label>
3246 3246
         <div class="gd-cf-input-wrap">
3247 3247
             <select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;">
3248
-                <option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
3249
-                <?php foreach ( $allowed_file_types as $format => $types ) { ?>
3250
-                    <optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
3251
-                        <?php foreach ( $types as $ext => $type ) { ?>
3252
-                            <option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option>
3248
+                <option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
3249
+                <?php foreach ($allowed_file_types as $format => $types) { ?>
3250
+                    <optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
3251
+                        <?php foreach ($types as $ext => $type) { ?>
3252
+                            <option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.'.$ext; ?></option>
3253 3253
                         <?php } ?>
3254 3254
                     </optgroup>
3255 3255
                 <?php } ?>
@@ -3261,9 +3261,9 @@  discard block
 block discarded – undo
3261 3261
     $html = ob_get_clean();
3262 3262
     return $output.$html;
3263 3263
 }
3264
-add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
3264
+add_filter('geodir_cfa_extra_fields_file', 'geodir_cfa_extra_fields_file', 10, 4);
3265 3265
 
3266
-function geodir_cfa_extra_fields_text($output,$result_str,$cf,$field_info){
3266
+function geodir_cfa_extra_fields_text($output, $result_str, $cf, $field_info) {
3267 3267
     ob_start();
3268 3268
 
3269 3269
     $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
@@ -3277,15 +3277,15 @@  discard block
 block discarded – undo
3277 3277
     $value = '';
3278 3278
     if ($extra_fields && isset($extra_fields['is_price'])) {
3279 3279
     $value = esc_attr($extra_fields['is_price']);
3280
-    }elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
3280
+    }elseif (isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']) {
3281 3281
     $value = esc_attr($cf['defaults']['extra_fields']['is_price']);
3282 3282
     }
3283 3283
 
3284
-    $show_price_extra = ($value==1) ? 1 : 0;
3284
+    $show_price_extra = ($value == 1) ? 1 : 0;
3285 3285
 
3286
-    $show_price = (isset($field_info->data_type) && ($field_info->data_type=='INT' && $field_info->data_type=='FLOAT')) ? 1 : 0;
3286
+    $show_price = (isset($field_info->data_type) && ($field_info->data_type == 'INT' && $field_info->data_type == 'FLOAT')) ? 1 : 0;
3287 3287
     ?>
3288
-    <li class="gdcf-price-extra-set" <?php if(!$show_price){ echo "style='display:none;'";}?>>
3288
+    <li class="gdcf-price-extra-set" <?php if (!$show_price) { echo "style='display:none;'"; }?>>
3289 3289
         <label for="is_price" class="gd-cf-tooltip-wrap">
3290 3290
             <i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Display as price? :', 'geodirectory'); ?>
3291 3291
             <div class="gdcf-tooltip">
@@ -3294,17 +3294,17 @@  discard block
 block discarded – undo
3294 3294
         </label>
3295 3295
         <div class="gd-cf-input-wrap gd-switch">
3296 3296
 
3297
-            <input type="radio" id="is_price_yes<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-enabled"  value="1"
3297
+            <input type="radio" id="is_price_yes<?php echo $radio_id; ?>" name="extra[is_price]" class="gdri-enabled"  value="1"
3298 3298
                 <?php if ($value == '1') {
3299 3299
                     echo 'checked';
3300 3300
                 } ?>/>
3301
-            <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3301
+            <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3302 3302
 
3303
-            <input type="radio" id="is_price_no<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-disabled" value="0"
3303
+            <input type="radio" id="is_price_no<?php echo $radio_id; ?>" name="extra[is_price]" class="gdri-disabled" value="0"
3304 3304
                 <?php if ($value == '0' || !$value) {
3305 3305
                     echo 'checked';
3306 3306
                 } ?>/>
3307
-            <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3307
+            <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3308 3308
 
3309 3309
         </div>
3310 3310
     </li>
@@ -3314,24 +3314,24 @@  discard block
 block discarded – undo
3314 3314
     $value = '';
3315 3315
     if ($extra_fields && isset($extra_fields['thousand_separator'])) {
3316 3316
         $value = esc_attr($extra_fields['thousand_separator']);
3317
-    }elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
3317
+    }elseif (isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']) {
3318 3318
         $value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']);
3319 3319
     }
3320 3320
     ?>
3321
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3322
-        <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory');?>
3321
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3322
+        <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory'); ?>
3323 3323
             <div class="gdcf-tooltip">
3324 3324
                 <?php _e('Select the thousand separator.', 'geodirectory'); ?>
3325 3325
             </div>
3326 3326
         </label>
3327 3327
         <div class="gd-cf-input-wrap">
3328 3328
                 <select name="extra[thousand_separator]" id="thousand_separator">
3329
-                    <option value="comma" <?php selected(true, $value == 'comma');?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3330
-                    <option value="slash" <?php selected(true, $value == "slash");?>><?php _e('\ (slash)', 'geodirectory'); ?></option>
3331
-                    <option value="period" <?php selected(true, $value == 'period');?>><?php _e('. (period)', 'geodirectory'); ?></option>
3332
-                    <option value="space" <?php selected(true, $value == 'space');?>><?php _e(' (space)', 'geodirectory'); ?></option>
3333
-                    <option value="apostrophe" <?php selected(true, $value == 'apostrophe');?>><?php _e("' (apostrophe)", 'geodirectory'); ?></option>
3334
-                    <option value="none" <?php selected(true, $value == 'none');?>><?php _e('(none)', 'geodirectory'); ?></option>
3329
+                    <option value="comma" <?php selected(true, $value == 'comma'); ?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3330
+                    <option value="slash" <?php selected(true, $value == "slash"); ?>><?php _e('\ (slash)', 'geodirectory'); ?></option>
3331
+                    <option value="period" <?php selected(true, $value == 'period'); ?>><?php _e('. (period)', 'geodirectory'); ?></option>
3332
+                    <option value="space" <?php selected(true, $value == 'space'); ?>><?php _e(' (space)', 'geodirectory'); ?></option>
3333
+                    <option value="apostrophe" <?php selected(true, $value == 'apostrophe'); ?>><?php _e("' (apostrophe)", 'geodirectory'); ?></option>
3334
+                    <option value="none" <?php selected(true, $value == 'none'); ?>><?php _e('(none)', 'geodirectory'); ?></option>
3335 3335
                 </select>
3336 3336
         </div>
3337 3337
     </li>
@@ -3342,20 +3342,20 @@  discard block
 block discarded – undo
3342 3342
     $value = '';
3343 3343
     if ($extra_fields && isset($extra_fields['decimal_separator'])) {
3344 3344
         $value = esc_attr($extra_fields['decimal_separator']);
3345
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
3345
+    }elseif (isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']) {
3346 3346
         $value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']);
3347 3347
     }
3348 3348
     ?>
3349
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3350
-        <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory');?>
3349
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3350
+        <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory'); ?>
3351 3351
             <div class="gdcf-tooltip">
3352 3352
                 <?php _e('Select the decimal separator.', 'geodirectory'); ?>
3353 3353
             </div>
3354 3354
         </label>
3355 3355
         <div class="gd-cf-input-wrap">
3356 3356
             <select name="extra[decimal_separator]" id="decimal_separator">
3357
-                <option value="period" <?php selected(true, $value == 'period');?>><?php _e('. (period)', 'geodirectory'); ?></option>
3358
-                <option value="comma" <?php selected(true, $value == "comma");?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3357
+                <option value="period" <?php selected(true, $value == 'period'); ?>><?php _e('. (period)', 'geodirectory'); ?></option>
3358
+                <option value="comma" <?php selected(true, $value == "comma"); ?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3359 3359
             </select>
3360 3360
         </div>
3361 3361
     </li>
@@ -3365,20 +3365,20 @@  discard block
 block discarded – undo
3365 3365
     $value = '';
3366 3366
     if ($extra_fields && isset($extra_fields['decimal_display'])) {
3367 3367
         $value = esc_attr($extra_fields['decimal_display']);
3368
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
3368
+    }elseif (isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']) {
3369 3369
         $value = esc_attr($cf['defaults']['extra_fields']['decimal_display']);
3370 3370
     }
3371 3371
     ?>
3372
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3373
-        <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory');?>
3372
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3373
+        <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory'); ?>
3374 3374
             <div class="gdcf-tooltip">
3375 3375
                 <?php _e('Select how the decimal is displayed', 'geodirectory'); ?>
3376 3376
             </div>
3377 3377
         </label>
3378 3378
         <div class="gd-cf-input-wrap">
3379 3379
             <select name="extra[decimal_display]" id="decimal_display">
3380
-                <option value="if" <?php selected(true, $value == 'if');?>><?php _e('If used (not .00)', 'geodirectory'); ?></option>
3381
-                <option value="allways" <?php selected(true, $value == "allways");?>><?php _e('Always (.00)', 'geodirectory'); ?></option>
3380
+                <option value="if" <?php selected(true, $value == 'if'); ?>><?php _e('If used (not .00)', 'geodirectory'); ?></option>
3381
+                <option value="allways" <?php selected(true, $value == "allways"); ?>><?php _e('Always (.00)', 'geodirectory'); ?></option>
3382 3382
             </select>
3383 3383
         </div>
3384 3384
     </li>
@@ -3388,12 +3388,12 @@  discard block
 block discarded – undo
3388 3388
     $value = '';
3389 3389
     if ($extra_fields && isset($extra_fields['currency_symbol'])) {
3390 3390
         $value = esc_attr($extra_fields['currency_symbol']);
3391
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
3391
+    }elseif (isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']) {
3392 3392
         $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']);
3393 3393
     }
3394 3394
     ?>
3395
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3396
-        <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory');?>
3395
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3396
+        <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory'); ?>
3397 3397
             <div class="gdcf-tooltip">
3398 3398
                 <?php _e('Select the currency symbol.', 'geodirectory'); ?>
3399 3399
             </div>
@@ -3409,20 +3409,20 @@  discard block
 block discarded – undo
3409 3409
     $value = '';
3410 3410
     if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
3411 3411
         $value = esc_attr($extra_fields['currency_symbol_placement']);
3412
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
3412
+    }elseif (isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']) {
3413 3413
         $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']);
3414 3414
     }
3415 3415
     ?>
3416
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3417
-        <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory');?>
3416
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3417
+        <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fas fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory'); ?>
3418 3418
             <div class="gdcf-tooltip">
3419 3419
                 <?php _e('Select the currency symbol placement.', 'geodirectory'); ?>
3420 3420
             </div>
3421 3421
         </label>
3422 3422
         <div class="gd-cf-input-wrap">
3423 3423
             <select name="extra[currency_symbol_placement]" id="currency_symbol_placement">
3424
-                <option value="left" <?php selected(true, $value == 'left');?>><?php _e('Left', 'geodirectory'); ?></option>
3425
-                <option value="right" <?php selected(true, $value == "right");?>><?php _e('Right', 'geodirectory'); ?></option>
3424
+                <option value="left" <?php selected(true, $value == 'left'); ?>><?php _e('Left', 'geodirectory'); ?></option>
3425
+                <option value="right" <?php selected(true, $value == "right"); ?>><?php _e('Right', 'geodirectory'); ?></option>
3426 3426
             </select>
3427 3427
         </div>
3428 3428
     </li>
@@ -3433,11 +3433,11 @@  discard block
 block discarded – undo
3433 3433
     $html = ob_get_clean();
3434 3434
     return $output.$html;
3435 3435
 }
3436
-add_filter('geodir_cfa_extra_fields_text','geodir_cfa_extra_fields_text',10,4);
3436
+add_filter('geodir_cfa_extra_fields_text', 'geodir_cfa_extra_fields_text', 10, 4);
3437 3437
 
3438
-function geodir_default_custom_fields($post_type='gd_place',$package_id=''){
3438
+function geodir_default_custom_fields($post_type = 'gd_place', $package_id = '') {
3439 3439
     $fields = array();
3440
-    $package = ($package_id=='') ? '' : array($package_id);
3440
+    $package = ($package_id == '') ? '' : array($package_id);
3441 3441
 
3442 3442
     $fields[] = array('listing_type' => $post_type,
3443 3443
                       'data_type' => 'VARCHAR',
@@ -3610,7 +3610,7 @@  discard block
 block discarded – undo
3610 3610
     return  $fields;
3611 3611
 }
3612 3612
 
3613
-function geodir_currency_format_number($number='',$cf=''){
3613
+function geodir_currency_format_number($number = '', $cf = '') {
3614 3614
 
3615 3615
     $cs = isset($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : '';
3616 3616
 
@@ -3619,36 +3619,36 @@  discard block
 block discarded – undo
3619 3619
     $decimal_display = !empty($cf['decimal_display']) ? $cf['decimal_display'] : (!empty($cs['decimal_display']) ? $cs['decimal_display'] : 'if');
3620 3620
     $decimalpoint = '.';
3621 3621
 
3622
-    if(isset($cs['decimal_separator']) && $cs['decimal_separator']=='comma'){
3622
+    if (isset($cs['decimal_separator']) && $cs['decimal_separator'] == 'comma') {
3623 3623
         $decimalpoint = ',';
3624 3624
     }
3625 3625
 
3626 3626
     $separator = ',';
3627 3627
 
3628
-    if(isset($cs['thousand_separator'])){
3629
-        if($cs['thousand_separator']=='comma'){$separator = ',';}
3630
-        if($cs['thousand_separator']=='slash'){$separator = '\\';}
3631
-        if($cs['thousand_separator']=='period'){$separator = '.';}
3632
-        if($cs['thousand_separator']=='space'){$separator = ' ';}
3633
-        if($cs['thousand_separator']=='apostrophe'){$separator = "'";}
3634
-        if($cs['thousand_separator']=='none'){$separator = '';}
3628
+    if (isset($cs['thousand_separator'])) {
3629
+        if ($cs['thousand_separator'] == 'comma') {$separator = ','; }
3630
+        if ($cs['thousand_separator'] == 'slash') {$separator = '\\'; }
3631
+        if ($cs['thousand_separator'] == 'period') {$separator = '.'; }
3632
+        if ($cs['thousand_separator'] == 'space') {$separator = ' '; }
3633
+        if ($cs['thousand_separator'] == 'apostrophe') {$separator = "'"; }
3634
+        if ($cs['thousand_separator'] == 'none') {$separator = ''; }
3635 3635
     }
3636 3636
 
3637 3637
     $currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left';
3638 3638
 
3639
-    if($decimals>0 && $decimal_display=='if'){
3640
-        if(is_int($number) || floor( $number ) == $number)
3639
+    if ($decimals > 0 && $decimal_display == 'if') {
3640
+        if (is_int($number) || floor($number) == $number)
3641 3641
             $decimals = 0;
3642 3642
     }
3643 3643
 
3644
-    $number = number_format($number,$decimals,$decimalpoint,$separator);
3644
+    $number = number_format($number, $decimals, $decimalpoint, $separator);
3645 3645
 
3646 3646
 
3647 3647
 
3648
-    if($currency_symbol_placement=='left'){
3649
-        $number = $symbol . $number;
3650
-    }else{
3651
-        $number = $number . $symbol;
3648
+    if ($currency_symbol_placement == 'left') {
3649
+        $number = $symbol.$number;
3650
+    } else {
3651
+        $number = $number.$symbol;
3652 3652
     }
3653 3653
 
3654 3654
 
Please login to merge, or discard this patch.