Test Failed
Pull Request — master (#238)
by Kiran
09:22
created
geodirectory_template_tags.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53 53
         'geodir_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
54
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
55 55
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56 56
     );
57 57
 
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * }
74 74
      */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
75
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
76 76
 
77 77
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78 78
 
79
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
79
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
80
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
81 81
 
82
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
82
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
83 83
     wp_enqueue_script('geodirectory-lightbox-jquery');
84 84
 
85
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
85
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
86 86
     if ($is_detail_page) {
87 87
         wp_enqueue_script('geodirectory-jquery-simplemodal');
88 88
     }
89 89
 
90 90
     if (in_array($geodir_map_name, array('auto', 'google'))) {
91
-        $map_lang = "&language=" . geodir_get_map_default_language();
91
+        $map_lang = "&language=".geodir_get_map_default_language();
92 92
         /**
93 93
          * Filter the variables that are added to the end of the google maps script call.
94 94
          *
@@ -98,40 +98,40 @@  discard block
 block discarded – undo
98 98
          * @param string $var The string to filter, default is empty string.
99 99
          */
100 100
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
101
+        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL);
102 102
     }
103 103
     
104 104
     if ($geodir_map_name == 'osm') {
105 105
         // Leaflet OpenStreetMap
106
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
106
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107 107
         wp_enqueue_style('geodirectory-leaflet-style');
108 108
             
109
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
109
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110 110
         wp_enqueue_script('geodirectory-leaflet-script');
111 111
         
112
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
112
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113 113
         wp_enqueue_script('geodirectory-leaflet-geo-script');
114 114
     }
115
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
115
+    wp_enqueue_script('jquery-ui-autocomplete');
116 116
     
117
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
117
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
118 118
     wp_enqueue_script('geodirectory-goMap-script');
119 119
 
120 120
 
121
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
121
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122 122
     wp_enqueue_script('chosen');
123 123
 
124
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
124
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125 125
     wp_enqueue_script('geodirectory-choose-ajax');
126 126
 
127
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
127
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128 128
 
129 129
     if (is_page() && geodir_is_page('add-listing')) {
130 130
         // SCRIPT FOR UPLOAD
131 131
         wp_enqueue_script('plupload-all');
132 132
         wp_enqueue_script('jquery-ui-sortable');
133 133
 
134
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
134
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
135 135
         wp_enqueue_script('geodirectory-plupload-script');
136 136
         // SCRIPT FOR UPLOAD END
137 137
 
@@ -178,27 +178,27 @@  discard block
 block discarded – undo
178 178
 
179 179
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180 180
 
181
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
181
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
182 182
     } // End if for add place page
183 183
 
184
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
184
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185 185
     if ($is_detail_page) {
186 186
 		wp_enqueue_script('geodirectory-post-custom-js');
187 187
 	}
188 188
 
189 189
     // font awesome rating script
190 190
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
191
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
191
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
192 192
 		wp_enqueue_script('geodir-barrating-js');
193 193
 	} else { // default rating script
194
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
194
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
195 195
 		wp_enqueue_script('geodir-jRating-js');
196 196
 	}
197 197
 
198
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
198
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199 199
     wp_enqueue_script('geodir-on-document-load');
200 200
 
201
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
201
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202 202
     wp_enqueue_script('google-geometa');
203 203
 }
204 204
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
  */
214 214
 function geodir_header_scripts()
215 215
 {
216
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
216
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
217 217
     echo stripslashes(get_option('geodir_header_scripts'));
218 218
 }
219 219
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
  */
245 245
 function geodir_add_async_forscript($url)
246 246
 {
247
-    if (strpos($url, '#asyncload')===false)
247
+    if (strpos($url, '#asyncload') === false)
248 248
         return $url;
249 249
     else if (is_admin())
250 250
         return str_replace('#asyncload', '', $url);
@@ -263,50 +263,50 @@  discard block
 block discarded – undo
263 263
 {
264 264
 
265 265
 
266
-    if(get_option('geodir_scss_core')) {
266
+    if (get_option('geodir_scss_core')) {
267 267
 
268 268
 
269
-        wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
269
+        wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270 270
         wp_enqueue_style('geodirectory-frontend-style');
271 271
 
272
-        wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
272
+        wp_register_style('geodirectory-media-style', geodir_plugin_url().'/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273 273
         wp_enqueue_style('geodirectory-media-style');
274 274
 
275 275
 
276
-        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
276
+        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277 277
         wp_enqueue_style('geodirectory-jquery-ui-css');
278 278
 
279
-        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
279
+        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280 280
         wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
281 281
 
282
-        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
282
+        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url().'/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283 283
         wp_enqueue_style('geodirectory-flexslider-css');
284 284
 
285
-        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
285
+        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url().'/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286 286
         wp_enqueue_style('geodirectory-thic-box-css');
287 287
 
288
-        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
288
+        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289 289
         wp_enqueue_style('geodirectory-pluplodar-css');
290 290
 
291
-        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
291
+        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292 292
         wp_enqueue_style('geodirectory-lightbox-css');
293 293
 
294
-        wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
294
+        wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295 295
         wp_enqueue_style('geodir-rating-style');
296 296
 
297
-        wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
297
+        wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298 298
         wp_enqueue_style('geodir-chosen-style');
299 299
 
300
-    }else{
301
-        wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
300
+    } else {
301
+        wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302 302
         wp_enqueue_style('geodir-core-scss');
303 303
 
304
-        wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
304
+        wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
305 305
 
306 306
     }
307 307
 
308
-    if(is_rtl()){
309
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
308
+    if (is_rtl()) {
309
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310 310
     wp_enqueue_style('geodirectory-frontend-rtl-style');
311 311
     }
312 312
 
@@ -380,18 +380,18 @@  discard block
 block discarded – undo
380 380
                 $term_id = get_queried_object_id();
381 381
                 $taxonomy = get_query_var('taxonomy');
382 382
 
383
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
-                    $term = get_term($term_id, $post_type . 'category');
383
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
384
+                    $term = get_term($term_id, $post_type.'category');
385 385
                 }
386 386
             }
387 387
             
388
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
388
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
389
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
390 390
                 
391 391
                 if (!is_array($taxonomy_search)) {
392
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
393
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
392
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
393
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
395 395
                 }
396 396
             }
397 397
             
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         if ($max_page > 1 || $always_show) {            
404 404
             // Extra pagination info
405 405
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
406
+            $start_no = ($paged - 1) * $posts_per_page + 1;
407 407
             $end_no = min($paged * $posts_per_page, $numposts);
408 408
 
409 409
             if ($geodir_pagination_more_info != '') {
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
                 } else {
414 414
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415 415
                 }
416
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
416
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
417 417
                 /**
418 418
                  * Adds an extra pagination info above/under pagination.
419 419
                  *
@@ -429,15 +429,15 @@  discard block
 block discarded – undo
429 429
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
430 430
                 
431 431
                 if ($geodir_pagination_more_info == 'before') {
432
-                    $before = $before . $pagination_info;
432
+                    $before = $before.$pagination_info;
433 433
                 } else if ($geodir_pagination_more_info == 'after') {
434
-                    $after = $pagination_info . $after;
434
+                    $after = $pagination_info.$after;
435 435
                 }
436 436
             }
437 437
             
438 438
             echo "$before <div class='Navi'>";
439 439
             if ($paged >= ($pages_to_show - 1)) {
440
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
440
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
441 441
             }
442 442
             previous_posts_link($prelabel);
443 443
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -445,13 +445,13 @@  discard block
 block discarded – undo
445 445
                     if ($i == $paged) {
446 446
                         echo "<strong class='on'>$i</strong>";
447 447
                     } else {
448
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
448
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
449 449
                     }
450 450
                 }
451 451
             }
452 452
             next_posts_link($nxtlabel, $max_page);
453 453
             if (($paged + $half_pages_to_show) < ($max_page)) {
454
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
454
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
455 455
             }
456 456
             echo "</div> $after";
457 457
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         jQuery(function ($) {
490 490
             $("#distance_slider").slider({
491 491
                 range: true,
492
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
492
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
493 493
                 min: 0,
494 494
                 max: <?php echo $dist; ?>,
495 495
                 step: <?php echo $dist_dif; ?>,
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
 
556 556
     <script type="text/javascript">
557
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
557
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
558 558
         var latlng;
559 559
         var address;
560 560
         var dist = 0;
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 				var $form = jQuery(this).closest('form');
567 567
 				
568 568
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
569
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
569
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
570 570
 				
571 571
 				// Disable location based search for disabled location post type.
572 572
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 					}
581 581
 				}
582 582
 				
583
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
583
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
584 584
 					geodir_setsearch($form);
585 585
 				} else {
586 586
 					jQuery(".snear", $form).val('');
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
         });
600 600
         
601 601
 		function geodir_setsearch($form) {
602
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
602
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
603 603
 			geocodeAddress($form);
604 604
 		}
605 605
 
@@ -613,8 +613,8 @@  discard block
 block discarded – undo
613 613
             // Call the geocode function
614 614
             Sgeocoder = (typeof google!=='undefined' && typeof google.maps!=='undefined') ? new google.maps.Geocoder() : {};
615 615
 
616
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
617
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
616
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
617
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
618 618
                     jQuery(".snear", $form).val('');
619 619
                 }
620 620
                 jQuery($form).submit();
@@ -624,23 +624,23 @@  discard block
 block discarded – undo
624 624
                 } else {
625 625
                     var address = jQuery(".snear", $form).val();
626 626
 
627
-                    if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
627
+                    if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
628 628
                         initialise2();
629 629
                     } else {
630 630
                         Sgeocoder.geocode({'address': address<?php
631
-                        if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
632
-                        if($near_add2 =
631
+                        if ($near_add = get_option('geodir_search_near_addition')) {echo '+", '.$near_add.'"'; }
632
+                        if ($near_add2 =
633 633
                         /**
634 634
                          * Adds any extra info to the near search box query when trying to geolocate it via google api.
635 635
                          *
636 636
                          * @since 1.0.0
637 637
                          */
638
-                        apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
638
+                        apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>},
639 639
                             function (results, status) {
640 640
                                 if (status == google.maps.GeocoderStatus.OK) {
641 641
                                     updateSearchPosition(results[0].geometry.location, $form);
642 642
                                 } else {
643
-                                    alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status);
643
+                                    alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
644 644
                                 }
645 645
                             });
646 646
                     }
@@ -672,19 +672,19 @@  discard block
 block discarded – undo
672 672
             var msg;
673 673
             switch (err.code) {
674 674
                 case err.UNKNOWN_ERROR:
675
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
675
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
676 676
                     break;
677 677
                 case err.PERMISSION_DENINED:
678
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
678
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
679 679
                     break;
680 680
                 case err.POSITION_UNAVAILABLE:
681
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
681
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
682 682
                     break;
683 683
                 case err.BREAK:
684
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
684
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
685 685
                     break;
686 686
                 default:
687
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
687
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
688 688
             }
689 689
             jQuery('#info').html(msg);
690 690
         }
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
              * @param object $post The post object.
726 726
              * @param string $link The link to the post.
727 727
              */
728
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
728
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
729 729
             break;
730 730
         case 'new' :
731 731
             /**
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
              * @param object $post The post object.
736 736
              * @param string $link The link to the post.
737 737
              */
738
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
738
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
739 739
             break;
740 740
 
741 741
     }
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/get_markers.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     $gd_post_type = sanitize_text_field($_REQUEST['post_type']);
11 11
     $post_taxonomy = geodir_get_taxonomies($gd_post_type);
12 12
     $map_canvas_name = sanitize_text_field($_REQUEST['map_canvas']);
13
-    $child_collapse = (bool)$_REQUEST['child_collapse'];
13
+    $child_collapse = (bool) $_REQUEST['child_collapse'];
14 14
     echo home_map_taxonomy_walker($post_taxonomy, 0, true, 0, $map_canvas_name, $child_collapse, true);
15 15
     die;
16 16
 }
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
     global $wpdb, $plugin_prefix, $gd_session;
31 31
 
32 32
     if ($_REQUEST['m_id'] != '') {
33
-        $pid = (int)$_REQUEST['m_id'];
33
+        $pid = (int) $_REQUEST['m_id'];
34 34
     } else {
35 35
         echo __('No marker data found', 'geodirectory');
36 36
         exit;
37 37
     }
38 38
 
39 39
     if (isset($_REQUEST['post_preview']) && $_REQUEST['post_preview'] != '' && $gd_ses_listing = $gd_session->get('listing')) {
40
-        $post = (object)$gd_ses_listing;
40
+        $post = (object) $gd_ses_listing;
41 41
         echo geodir_get_infowindow_html($post, $_REQUEST['post_preview']);
42 42
     } else {
43 43
         $geodir_post_type = get_post_type($pid);
44 44
 
45
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
45
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
46 46
 
47
-        $sql = $wpdb->prepare("SELECT * FROM " . $table . " WHERE post_id = %d", array($pid));
47
+        $sql = $wpdb->prepare("SELECT * FROM ".$table." WHERE post_id = %d", array($pid));
48 48
 
49 49
         $postinfo = $wpdb->get_results($sql);
50 50
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     $post_type = isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : 'gd_place';
89 89
 
90 90
     $map_cat_ids_array = array('0');
91
-    $cat_find_array = array(" FIND_IN_SET(%d, pd." . $post_type . "category)");
91
+    $cat_find_array = array(" FIND_IN_SET(%d, pd.".$post_type."category)");
92 92
 
93 93
 
94 94
     $field_default_cat = '';
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
         $map_cat_arr = trim($_REQUEST['cat_id'], ',');
97 97
 
98 98
         if (!empty($map_cat_arr)) {
99
-            $field_default_cat .= "WHEN (default_category IN (" . $map_cat_arr . ")) THEN default_category ";
99
+            $field_default_cat .= "WHEN (default_category IN (".$map_cat_arr.")) THEN default_category ";
100 100
 
101 101
             $map_cat_ids_array = explode(',', $map_cat_arr);
102 102
             $cat_find_array = array();
103 103
             foreach ($map_cat_ids_array as $cat_id) {
104
-                $field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `" . $post_type . "category`) > 0) THEN $cat_id ";
105
-                $cat_find_array[] = " FIND_IN_SET(%d, pd." . $post_type . "category)";
104
+                $field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `".$post_type."category`) > 0) THEN $cat_id ";
105
+                $cat_find_array[] = " FIND_IN_SET(%d, pd.".$post_type."category)";
106 106
                 $main_query_array[] = $cat_id;
107 107
             }
108 108
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
         $field_default_cat = '';
114 114
 
115 115
     if (!empty($cat_find_array))
116
-        $search .= "AND (" . implode(' OR ', $cat_find_array) . ")";
116
+        $search .= "AND (".implode(' OR ', $cat_find_array).")";
117 117
 
118 118
     $main_query_array = $map_cat_ids_array;
119 119
   
120 120
     if (isset($_REQUEST['search']) && !empty($_REQUEST['search']) && $_REQUEST['search'] != __('Title', 'geodirectory')) {
121 121
         $search .= " AND p.post_title LIKE %s";
122
-        $main_query_array[] = "%" . $_REQUEST['search'] . "%";
122
+        $main_query_array[] = "%".$_REQUEST['search']."%";
123 123
     }
124 124
 
125 125
     /**
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
 
142 142
     $gd_posttype = '';
143 143
     if (isset($_REQUEST['gd_posttype']) && $_REQUEST['gd_posttype'] != '') {
144
-        $table = $plugin_prefix . $_REQUEST['gd_posttype'] . '_detail';
144
+        $table = $plugin_prefix.$_REQUEST['gd_posttype'].'_detail';
145 145
         $gd_posttype = " AND p.post_type = %s";
146 146
         $main_query_array[] = $_REQUEST['gd_posttype'];
147 147
 
148 148
     } else
149
-        $table = $plugin_prefix . 'gd_place_detail';
149
+        $table = $plugin_prefix.'gd_place_detail';
150 150
 
151
-    $join = ", " . $table . " AS pd ";
151
+    $join = ", ".$table." AS pd ";
152 152
 
153 153
     /**
154 154
 	 * Filter the SQL JOIN clause for the markers data
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	$search = apply_filters('geodir_home_map_listing_where', $search);
170 170
     $search = str_replace(array("'%", "%'"), array("'%%", "%%'"), $search);
171
-    $cat_type = $post_type . 'category';
171
+    $cat_type = $post_type.'category';
172 172
     if ($post_type == 'gd_event') {
173 173
         $event_select = ", pd.recurring_dates, pd.is_recurring";
174 174
     } else {
175 175
         $event_select = "";
176 176
     }
177 177
 
178
-    $sql_select = 'SELECT pd.default_category, pd.' . $cat_type . ', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude' . $event_select;
178
+    $sql_select = 'SELECT pd.default_category, pd.'.$cat_type.', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude'.$event_select;
179 179
     /**
180 180
 	 * Filter the SQL SELECT clause to retrive fields data
181 181
 	 *
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	$groupby = apply_filters('geodir_home_map_listing_groupby', $groupby);
197 197
 
198
-    $catsql = $wpdb->prepare("$select $field_default_cat FROM " . $wpdb->posts . " as p" . $join . " WHERE p.ID = pd.post_id AND p.post_status = 'publish' " . $search . $gd_posttype . $groupby , $main_query_array);
198
+    $catsql = $wpdb->prepare("$select $field_default_cat FROM ".$wpdb->posts." as p".$join." WHERE p.ID = pd.post_id AND p.post_status = 'publish' ".$search.$gd_posttype.$groupby, $main_query_array);
199 199
     
200 200
 	/**
201 201
 	 * Filter the SQL query to retrive markers data
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                         $e = 0;
258 258
                         foreach ($recurring_dates as $date) {
259 259
                             if (strtotime($date) >= $today) {
260
-                                $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($date));
260
+                                $event_dates .= ' :: '.date_i18n($geodir_date_format, strtotime($date));
261 261
                                 
262 262
                                 $e++;
263 263
                                 if ($e == 3) { // only show 3 event dates
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                     $end_date = !empty($recurring_data['event_end']) && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? $recurring_data['event_end'] : $start_date;
272 272
                 
273 273
                     if ($end_date != '' && strtotime($end_date) >= $today) {
274
-                        $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($start_date)) .' -> ' . date_i18n($geodir_date_format, strtotime($end_date));
274
+                        $event_dates .= ' :: '.date_i18n($geodir_date_format, strtotime($start_date)).' -> '.date_i18n($geodir_date_format, strtotime($end_date));
275 275
                     }
276 276
                 }
277 277
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                 $icon_size = array('w' => 36, 'h' => 45);
300 300
             }
301 301
 
302
-            $content_data[] = '{"id":"' . $catinfo_obj->post_id . '","t": "' . $title . '","lt": "' . $catinfo_obj->post_latitude . '","ln": "' . $catinfo_obj->post_longitude . '","mk_id":"' . $catinfo_obj->post_id . '_' . $catinfo_obj->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"'.$mark_extra.'}';
302
+            $content_data[] = '{"id":"'.$catinfo_obj->post_id.'","t": "'.$title.'","lt": "'.$catinfo_obj->post_latitude.'","ln": "'.$catinfo_obj->post_longitude.'","mk_id":"'.$catinfo_obj->post_id.'_'.$catinfo_obj->default_category.'","i":"'.$icon.'","w":"'.$icon_size['w'].'","h":"'.$icon_size['h'].'"'.$mark_extra.'}';
303 303
             $post_ids[] = $catinfo_obj->post_id;
304 304
         }
305 305
     }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
     $totalcount = count(array_unique($post_ids));
324 324
 
325 325
     if (!empty($cat_content_info)) {
326
-        return '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']';
326
+        return '[{"totalcount":"'.$totalcount.'",'.substr(implode(',', $cat_content_info), 1).']';
327 327
     }
328 328
     else {
329 329
         return '[{"totalcount":"0"}]';
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_functions.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $title = str_replace($srcharr, $replarr, $post_title);
65 65
 
66 66
         if (is_ssl()) {
67
-            $icon = str_replace("http:","https:",$icon );
67
+            $icon = str_replace("http:", "https:", $icon);
68 68
         }
69 69
         
70 70
         if ($icon != '') {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             $icon_size = array('w' => 36, 'h' => 45);
81 81
         }
82 82
 
83
-        $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
83
+        $post_json = '{"id":"'.$post->ID.'","t": "'.$title.'","lt": "'.$post->post_latitude.'","ln": "'.$post->post_longitude.'","mk_id":"'.$post->ID.'_'.$post->default_category.'","i":"'.$icon.'","w":"'.$icon_size['w'].'","h":"'.$icon_size['h'].'"}';
84 84
 
85 85
         /**
86 86
          * Filter the json data when creating output for post json marker..
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
          * @param string $post_json JSON representation of the post marker info.
90 90
          * @param object $post The post object.
91 91
          */
92
-        $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
92
+        $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
93 93
     }
94 94
 }
95 95
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         foreach ($map_canvas_arr as $canvas => $jason) {
110 110
             if (is_array($map_jason) && !empty($map_jason)) {
111 111
 
112
-                $canvas_jason = $canvas . "_jason";
112
+                $canvas_jason = $canvas."_jason";
113 113
                 $map_canvas_arr[$canvas] = array_unique($map_jason);
114 114
                 unset($cat_content_info);
115 115
                 $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
                 if (!empty($cat_content_info)) {
118 118
                     $json_content = substr(implode(',', $cat_content_info), 1);
119 119
                     $json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
120
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
120
+                    $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
121 121
                 } else {
122 122
                     $canvas_jason = '[{"totalcount":"0"}]';
123 123
                 }
124 124
 
125
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
125
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
126 126
 
127 127
                 /**
128 128
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
                  * @param string $canvas Map canvas array key.
135 135
                  * @param array $map_canvas_jason_args Map canvas args.
136 136
                  */
137
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
137
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
138 138
 
139
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
139
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
140 140
             } else {
141 141
                 $canvas_jason = '[{"totalcount":"0"}]';
142
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
142
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
143 143
 
144 144
                 /**
145 145
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
                  * @param string $canvas Map canvas array key.
152 152
                  * @param array $map_canvas_jason_args Map canvas args.
153 153
                  */
154
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
155
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
154
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
155
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
156 156
             }
157 157
         }
158 158
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         }
215 215
 
216 216
 
217
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
217
+        $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">';
218 218
 
219 219
         $geodir_cat_icons = geodir_get_term_icon();
220 220
 
@@ -230,16 +230,16 @@  discard block
 block discarded – undo
230 230
 
231 231
                 // Untick the category by default on home map
232 232
                 if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
233
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
233
+                    if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$cat_term->term_id, $geodir_home_map_untick)) {
234 234
                         $checked = '';
235 235
                     }
236 236
                 }
237 237
 
238
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
239
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
240
-                $term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
241
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
242
-                $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
238
+                $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"';
239
+                $term_check .= ' name="'.$map_canvas_name.'_cat[]" ';
240
+                $term_check .= '  title="'.esc_attr(ucfirst($cat_term->name)).'" value="'.$cat_term->term_id.'" onclick="javascript:build_map_ajax_search_param(\''.$map_canvas_name.'\',false, this)">';
241
+                $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.ucfirst($cat_term->name).'"/>';
242
+                $out .= '<li>'.$term_check.'<label for="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'">'.$term_img.ucfirst($cat_term->name).'</label><i class="fa fa-long-arrow-down"></i>';
243 243
 
244 244
             endif;
245 245
 
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
  * @package GeoDirectory
352 352
  */
353 353
 function geodir_map_load_style() {    
354
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
354
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
355 355
 ?>
356 356
 <script type="text/javascript">
357 357
 if (!(window.google && typeof google.maps !== 'undefined')) {
358
-    document.write('<' + 'link id="geodirectory-leaflet-style-css" media="all" type="text/css" href="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>" rel="stylesheet"' + '>');
358
+    document.write('<' + 'link id="geodirectory-leaflet-style-css" media="all" type="text/css" href="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>" rel="stylesheet"' + '>');
359 359
 }
360 360
 </script>
361 361
 <?php
@@ -371,12 +371,12 @@  discard block
 block discarded – undo
371 371
  * @package GeoDirectory
372 372
  */
373 373
 function geodir_map_load_script() {
374
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
374
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
375 375
 ?>
376 376
 <script type="text/javascript">
377 377
 if (!(window.google && typeof google.maps !== 'undefined')) {
378
-    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
379
-    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
378
+    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
379
+    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
380 380
 }
381 381
 </script>
382 382
 <?php
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_template_tags.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 
130 130
     if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
131 131
     } else {
132
-        $geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
132
+        $geodir_map_options['height'] = $geodir_map_options['height'].'px';
133 133
     }
134 134
 
135 135
     if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
136 136
     } else {
137
-        $geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
137
+        $geodir_map_options['width'] = $geodir_map_options['width'].'px';
138 138
     }
139 139
 
140 140
     /**
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
168 168
 
169
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
169
+    if (count((array) $post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
170 170
         // Set default map options
171 171
 
172
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
172
+        wp_enqueue_script('geodir-map-widget', geodir_plugin_url().'/geodirectory-functions/map-functions/js/map.min.js', array(), false, true);
173 173
 
174 174
         wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
175 175
 
@@ -188,41 +188,41 @@  discard block
 block discarded – undo
188 188
 		 */
189 189
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
190 190
         ?>
191
-        <div id="catcher_<?php echo $map_canvas_name;?>"></div>
191
+        <div id="catcher_<?php echo $map_canvas_name; ?>"></div>
192 192
         <div class="stick_trigger_container">
193 193
             <div class="trigger_sticky triggeroff_sticky"></div>
194
-            <div class="top_banner_section geodir_map_container <?php echo $map_class_name;?>"
195
-                 id="sticky_map_<?php echo $map_canvas_name;?>"
196
-                 style="min-height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
194
+            <div class="top_banner_section geodir_map_container <?php echo $map_class_name; ?>"
195
+                 id="sticky_map_<?php echo $map_canvas_name; ?>"
196
+                 style="min-height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
197 197
 
198 198
                 <div class="map_background">
199 199
                     <div class="top_banner_section_in clearfix">
200
-                        <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="fa fa-arrows-alt"></i></span></div>
201
-                        <div class="<?php echo $map_canvas_name;?>_TopRight TopRight"></div>
202
-                        <div id="<?php echo $map_canvas_name;?>_wrapper" class="main_map_wrapper"
203
-                             style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
200
+                        <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="fa fa-arrows-alt"></i></span></div>
201
+                        <div class="<?php echo $map_canvas_name; ?>_TopRight TopRight"></div>
202
+                        <div id="<?php echo $map_canvas_name; ?>_wrapper" class="main_map_wrapper"
203
+                             style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
204 204
                             <!-- new map start -->
205 205
                             <div class="iprelative">
206
-                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name;?>"
207
-                                     style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
208
-                                <div id="<?php echo $map_canvas_name;?>_loading_div" class="loading_div"
209
-                                     style=" height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
206
+                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name; ?>"
207
+                                     style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
208
+                                <div id="<?php echo $map_canvas_name; ?>_loading_div" class="loading_div"
209
+                                     style=" height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
210 210
                                 <!--<div id="home_map_counter"></div>        -->
211
-                                <div id="<?php echo $map_canvas_name;?>_map_nofound"
211
+                                <div id="<?php echo $map_canvas_name; ?>_map_nofound"
212 212
                                      class="advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
213
-                                <div id="<?php echo $map_canvas_name;?>_map_notloaded"
213
+                                <div id="<?php echo $map_canvas_name; ?>_map_notloaded"
214 214
                                      class="advmap_notloaded"><?php _e('<h3>Google Map Not Loaded</h3><p>Sorry, unable to load Google Maps API.', 'geodirectory'); ?></div>
215 215
                             </div>
216 216
                             <!-- new map end -->
217 217
                         </div>
218
-                        <div class="<?php echo $map_canvas_name;?>_BottomLeft BottomLeft"></div>
218
+                        <div class="<?php echo $map_canvas_name; ?>_BottomLeft BottomLeft"></div>
219 219
                     </div>
220 220
                 </div>
221 221
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
222
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
222
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="1"/>
223 223
                 <?php } else {
224 224
                     ?>
225
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
225
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="0"/>
226 226
                 <?php }
227 227
 
228 228
                 if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                            onclick="calcRoute('<?php echo $map_canvas_name; ?>')"/>
243 243
 
244 244
                     <script>
245
-                        <?php if(geodir_is_page('detail')){?>
245
+                        <?php if (geodir_is_page('detail')) {?>
246 246
                         jQuery(function () {
247 247
                             gd_initialize_ac();
248 248
                         });
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                                 // Create the autocomplete object, restricting the search
254 254
                                 // to geographical location types.
255 255
                                 autocomplete = new google.maps.places.Autocomplete(
256
-                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name;?>_fromAddress')),
256
+                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name; ?>_fromAddress')),
257 257
                                     {types: ['geocode']});
258 258
                                 // When the user selects an address from the dropdown,
259 259
                                 // populate the address fields in the form.
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 				 */
308 308
 				$map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
309 309
 				?>
310
-                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
310
+                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel; ?>">
311 311
                     <?php
312 312
                     $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
313 313
                     $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
@@ -317,12 +317,12 @@  discard block
 block discarded – undo
317 317
 					}
318 318
                     ?>
319 319
                     <div
320
-                        class="map-category-listing<?php echo $map_cat_class;?>">
320
+                        class="map-category-listing<?php echo $map_cat_class; ?>">
321 321
                         <div class="trigger triggeroff"><i class="fa fa-compress"></i><i class="fa fa-expand"></i></div>
322
-                        <div id="<?php echo $map_canvas_name;?>_cat"
323
-                             class="<?php echo $map_canvas_name;?>_map_category  map_category"
324
-                             <?php if ($child_collapse){ ?>checked="checked" <?php }?>
325
-                             style="max-height:<?php echo $geodir_map_options['height'];?>;">
322
+                        <div id="<?php echo $map_canvas_name; ?>_cat"
323
+                             class="<?php echo $map_canvas_name; ?>_map_category  map_category"
324
+                             <?php if ($child_collapse) { ?>checked="checked" <?php }?>
325
+                             style="max-height:<?php echo $geodir_map_options['height']; ?>;">
326 326
                             <input
327 327
                                 onkeydown="if(event.keyCode == 13){build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false)}"
328 328
                                 type="text"
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
335 335
                                 <?php } else {$child_collapse = "0";
336 336
                                     ?>
337
-                                    <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
337
+                                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="0"/>
338 338
                                 <?php } ?>
339 339
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
340 340
                                 <div class="toggle">
341
-                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'),0,true,0,$map_canvas_name,$child_collapse,true); ?>
341
+                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'), 0, true, 0, $map_canvas_name, $child_collapse, true); ?>
342 342
                                     <script>jQuery( document ).ready(function() {
343 343
                                             geodir_show_sub_cat_collapse_button();
344 344
                                         });</script>
@@ -367,21 +367,21 @@  discard block
 block discarded – undo
367 367
 					$city = $country != 'me' ? $city : '';
368 368
                     $gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : '';
369 369
                     ?>
370
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
371
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
372
-                           value="<?php echo $country;?>"/>
373
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_region" name="gd_region"
374
-                           value="<?php echo $region;?>"/>
375
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_city" name="gd_city"
376
-                           value="<?php echo $city;?>"/>
377
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
378
-                           value="<?php echo $gd_neighbourhood;?>"/>
370
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="1"/>
371
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_country" name="gd_country"
372
+                           value="<?php echo $country; ?>"/>
373
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_region" name="gd_region"
374
+                           value="<?php echo $region; ?>"/>
375
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_city" name="gd_city"
376
+                           value="<?php echo $city; ?>"/>
377
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_neighbourhood" name="gd_neighbourhood"
378
+                           value="<?php echo $gd_neighbourhood; ?>"/>
379 379
                 <?php } else { //end of location filter
380 380
                     ?>
381
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
381
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="0"/>
382 382
                 <?php }?>
383 383
 
384
-                <input type="hidden" id="<?php echo $map_canvas_name;?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt;?>"/>
384
+                <input type="hidden" id="<?php echo $map_canvas_name; ?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt; ?>"/>
385 385
 
386 386
                 <input type="hidden" name="limitstart" value=""/>
387 387
 
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
 
390 390
                 <?php if ($geodir_map_options['enable_post_type_filters']) {
391 391
                     $post_types = geodir_get_posttypes('object');
392
-                    if (count((array)($post_types)) > 1) {
392
+                    if (count((array) ($post_types)) > 1) {
393 393
                         ?>
394
-                        <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
395
-                             style="max-width:<?php echo $map_width;?>!important;">
394
+                        <div class="map-places-listing" id="<?php echo $map_canvas_name; ?>_posttype_menu"
395
+                             style="max-width:<?php echo $map_width; ?>!important;">
396 396
 
397 397
                             <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
398 398
                             <div class="geodir-map-posttype-list"><?php } ?>
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
                                     foreach ($post_types as $post_type => $args) {
404 404
                                         if (!in_array($post_type, $exclude_post_types)) {
405 405
                                             $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
406
-											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)">' . __(ucfirst($args->labels->name), 'geodirectory') . '</a></li>';
406
+											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)">'.__(ucfirst($args->labels->name), 'geodirectory').'</a></li>';
407 407
                                         }
408 408
                                     }
409 409
                                     ?>
@@ -428,9 +428,9 @@  discard block
 block discarded – undo
428 428
         <script type="text/javascript">
429 429
 
430 430
             jQuery(document).ready(function () {
431
-                //initMap('<?php echo $map_canvas_name;?>'); // depreciated, no need to load this twice
432
-                build_map_ajax_search_param('<?php echo $map_canvas_name;?>', false);
433
-                map_sticky('<?php echo $map_canvas_name;?>');
431
+                //initMap('<?php echo $map_canvas_name; ?>'); // depreciated, no need to load this twice
432
+                build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false);
433
+                map_sticky('<?php echo $map_canvas_name; ?>');
434 434
             });
435 435
 
436 436
         </script>
@@ -441,18 +441,18 @@  discard block
 block discarded – undo
441 441
             <script>
442 442
                 (function () {
443 443
                     var screenH = jQuery(window).height();
444
-                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']);?>";
444
+                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']); ?>";
445 445
 
446 446
                     var ptypeH = '';
447
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
448
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
447
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
448
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
449 449
                     }
450 450
 
451
-                    jQuery("#sticky_map_<?php echo $map_canvas_name;?>").css("min-height", screenH * (heightVH / 100) + 'px');
452
-                    jQuery("#<?php echo $map_canvas_name;?>_wrapper").height(screenH * (heightVH / 100) + 'px');
453
-                    jQuery("#<?php echo $map_canvas_name;?>").height(screenH * (heightVH / 100) + 'px');
454
-                    jQuery("#<?php echo $map_canvas_name;?>_loading_div").height(screenH * (heightVH / 100) + 'px');
455
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
451
+                    jQuery("#sticky_map_<?php echo $map_canvas_name; ?>").css("min-height", screenH * (heightVH / 100) + 'px');
452
+                    jQuery("#<?php echo $map_canvas_name; ?>_wrapper").height(screenH * (heightVH / 100) + 'px');
453
+                    jQuery("#<?php echo $map_canvas_name; ?>").height(screenH * (heightVH / 100) + 'px');
454
+                    jQuery("#<?php echo $map_canvas_name; ?>_loading_div").height(screenH * (heightVH / 100) + 'px');
455
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
456 456
 
457 457
                 }());
458 458
             </script>
@@ -464,13 +464,13 @@  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("px", "", $geodir_map_options['height']);?>";
467
+                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']); ?>";
468 468
                     var ptypeH = '';
469
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
470
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
469
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
470
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
471 471
                     }
472 472
 
473
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", heightVH - ptypeH + 'px');
473
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", heightVH - ptypeH + 'px');
474 474
 
475 475
                 }());
476 476
             </script>
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
          * @param array $geodir_map_options Array of map settings.
486 486
          * @param string $map_canvas_name The canvas name and ID for the map.
487 487
          */
488
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
488
+        do_action('geodir_map_after_render', $geodir_map_options, $map_canvas_name);
489 489
 
490 490
 
491 491
     endif; // Exclude posttypes if end
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_on_add_listing_page.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -81,16 +81,16 @@  discard block
 block discarded – undo
81 81
     window.gdMaps = window.gdMaps || gdMaps;
82 82
     
83 83
     user_address = false;
84
-    jQuery('#<?php echo $prefix.'address';?>').keypress(function () {
84
+    jQuery('#<?php echo $prefix.'address'; ?>').keypress(function () {
85 85
         user_address = true;
86 86
     });
87 87
 
88 88
     baseMarker = '';
89 89
     geocoder = '';
90
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat :  '39.952484'; ?>;
91
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng :  '-75.163786'; ?>;
92
-    <?php if($lat_lng_blank){$lat='';$lng='';}?>
93
-    var <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12;?>;
90
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat : '39.952484'; ?>;
91
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng : '-75.163786'; ?>;
92
+    <?php if ($lat_lng_blank) {$lat = ''; $lng = ''; }?>
93
+    var <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12; ?>;
94 94
     var minZoomLevel = <?php echo ($is_map_restrict) ? 5 : 0; ?>;
95 95
     var oldstr_address;
96 96
     var oldstr_zip;
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
             do_action('geodir_add_listing_geocode_js_vars');
323 323
             ?>
324 324
             <?php if ($is_map_restrict) { ?>
325
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
326
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
327
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
325
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
326
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
327
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
328 328
                 jQuery.goMap.map.setCenter(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
329 329
                 baseMarker.setPosition(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
330 330
                 updateMarkerPosition(baseMarker.getPosition());
@@ -333,11 +333,11 @@  discard block
 block discarded – undo
333 333
             <?php } ?>
334 334
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
335 335
         } else {
336
-            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
336
+            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
337 337
         }
338 338
     }
339 339
     function centerMap(latlng) {
340
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
340
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
341 341
         if (window.gdMaps == 'google') {
342 342
             jQuery.goMap.map.panTo(baseMarker.getPosition());
343 343
         } else if (window.gdMaps == 'osm') {
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         }
347 347
     }
348 348
     function centerMarker() {
349
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
349
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
350 350
         var center = jQuery.goMap.map.getCenter();
351 351
         if (window.gdMaps == 'google') {
352 352
             baseMarker.setPosition(center);
@@ -355,47 +355,47 @@  discard block
 block discarded – undo
355 355
         }
356 356
     }
357 357
     function updateMapZoom(zoom) {
358
-        jQuery('#<?php echo $prefix.'mapzoom';?>').val(zoom);
358
+        jQuery('#<?php echo $prefix.'mapzoom'; ?>').val(zoom);
359 359
     }
360 360
     function updateMarkerPosition(markerlatLng) {
361
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
362
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat());
363
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng());
361
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
362
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat());
363
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng());
364 364
     }
365 365
     function updateMarkerPositionOSM(markerlatLng) {
366
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat);
367
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng);
366
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat);
367
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng);
368 368
     }
369 369
     function updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry) {
370
-        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields);?>';
371
-        <?php ob_start();?>
372
-        var old_country = jQuery("#<?php echo $prefix.'country';?>").val();
373
-        var old_region = jQuery("#<?php echo $prefix.'region';?>").val();
370
+        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields); ?>';
371
+        <?php ob_start(); ?>
372
+        var old_country = jQuery("#<?php echo $prefix.'country'; ?>").val();
373
+        var old_region = jQuery("#<?php echo $prefix.'region'; ?>").val();
374 374
         
375
-        if (user_address == false || jQuery('#<?php echo $prefix.'address';?>').val() == '') {
376
-            jQuery("#<?php echo $prefix.'address';?>").val(getAddress);
375
+        if (user_address == false || jQuery('#<?php echo $prefix.'address'; ?>').val() == '') {
376
+            jQuery("#<?php echo $prefix.'address'; ?>").val(getAddress);
377 377
         }
378 378
         if (getAddress) {
379 379
             oldstr_address = getAddress;
380 380
         }
381 381
         
382
-        jQuery("#<?php echo $prefix.'zip';?>").val(getZip);
382
+        jQuery("#<?php echo $prefix.'zip'; ?>").val(getZip);
383 383
         if (getZip) {
384 384
             oldstr_zip = getZip;
385 385
         }
386 386
         if (set_map_val_in_fields) {
387 387
             if (getCountry) {
388
-                jQuery('#<?php echo $prefix.'country';?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
389
-                jQuery("#<?php echo $prefix.'country';?>").trigger("chosen:updated");
388
+                jQuery('#<?php echo $prefix.'country'; ?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
389
+                jQuery("#<?php echo $prefix.'country'; ?>").trigger("chosen:updated");
390 390
             }
391 391
             if (getState) {
392
-                if (jQuery('input[id="<?php echo $prefix.'region';?>"]').attr('id')) {
393
-                    jQuery("#<?php echo $prefix.'region';?>").val(getState);
392
+                if (jQuery('input[id="<?php echo $prefix.'region'; ?>"]').attr('id')) {
393
+                    jQuery("#<?php echo $prefix.'region'; ?>").val(getState);
394 394
                 }
395 395
             }
396 396
             if (getCity) {
397
-                if (jQuery('input[id="<?php echo $prefix.'city';?>"]').attr('id')) {
398
-                    jQuery("#<?php echo $prefix.'city';?>").val(getCity);
397
+                if (jQuery('input[id="<?php echo $prefix.'city'; ?>"]').attr('id')) {
398
+                    jQuery("#<?php echo $prefix.'city'; ?>").val(getCity);
399 399
                 }
400 400
             }
401 401
         }
@@ -411,12 +411,12 @@  discard block
 block discarded – undo
411 411
         ?>
412 412
     }
413 413
     function geodir_codeAddress(set_on_map) {
414
-        var address = jQuery('#<?php echo $prefix.'address';?>').val();
415
-        var zip = jQuery('#<?php echo $prefix.'zip';?>').val();
416
-        var city = jQuery('#<?php echo $prefix.'city';?>').val();
417
-        var region = jQuery('#<?php echo $prefix.'region';?>').val();
418
-        var country = jQuery('#<?php echo $prefix.'country';?>').val();
419
-        var country_selected = jQuery('#<?php echo $prefix.'country';?>').find('option:selected');
414
+        var address = jQuery('#<?php echo $prefix.'address'; ?>').val();
415
+        var zip = jQuery('#<?php echo $prefix.'zip'; ?>').val();
416
+        var city = jQuery('#<?php echo $prefix.'city'; ?>').val();
417
+        var region = jQuery('#<?php echo $prefix.'region'; ?>').val();
418
+        var country = jQuery('#<?php echo $prefix.'country'; ?>').val();
419
+        var country_selected = jQuery('#<?php echo $prefix.'country'; ?>').find('option:selected');
420 420
         var ISO2 = country_selected.data('country_code');
421 421
         if (ISO2 == '--') {
422 422
             ISO2 = '';
@@ -425,13 +425,13 @@  discard block
 block discarded – undo
425 425
             zip = '';
426 426
         }
427 427
         if (typeof city == "undefined") {
428
-            city = '<?php echo addslashes_gpc($city);?>';
428
+            city = '<?php echo addslashes_gpc($city); ?>';
429 429
         }
430 430
         if (typeof region == "undefined") {
431
-            region = '<?php echo addslashes_gpc($region);?>';
431
+            region = '<?php echo addslashes_gpc($region); ?>';
432 432
         }
433 433
         if (typeof country == "undefined") {
434
-            country = '<?php echo addslashes_gpc($country);?>';
434
+            country = '<?php echo addslashes_gpc($country); ?>';
435 435
         }
436 436
         var is_restrict = '<?php echo $is_map_restrict; ?>';
437 437
         <?php ob_start();
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
             if (typeof address === 'undefined')
447 447
                 address = '';
448 448
             <?php
449
-            if(is_admin() && isset($_REQUEST['tab'])){?>
449
+            if (is_admin() && isset($_REQUEST['tab'])) {?>
450 450
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
451 451
                 address = '';
452 452
             }
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             geocoder.geocode({'address': address, 'country': ISO2},
487 487
                 function (results, status) {
488 488
                     console.log(status);
489
-                    jQuery("#<?php echo $prefix.'map';?>").goMap();
489
+                    jQuery("#<?php echo $prefix.'map'; ?>").goMap();
490 490
                     if (status == google.maps.GeocoderStatus.OK) {
491 491
                         baseMarker.setPosition(results[0].geometry.location);
492 492
                         jQuery.goMap.map.setCenter(results[0].geometry.location);
@@ -503,21 +503,21 @@  discard block
 block discarded – undo
503 503
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
504 504
                         //}
505 505
                     } else {
506
-                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:','geodirectory'));?> ' + status);
506
+                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:', 'geodirectory')); ?> ' + status);
507 507
                     }
508 508
                 });
509 509
         }
510 510
     }
511 511
     function gdMaxMap() {
512
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
512
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
513 513
 
514
-        jQuery('#<?php echo $prefix.'map';?>').toggleClass('map-fullscreen');
514
+        jQuery('#<?php echo $prefix.'map'; ?>').toggleClass('map-fullscreen');
515 515
         jQuery('.map_category').toggleClass('map_category_fullscreen');
516
-        jQuery('#<?php echo $prefix;?>trigger').toggleClass('map_category_fullscreen');
516
+        jQuery('#<?php echo $prefix; ?>trigger').toggleClass('map_category_fullscreen');
517 517
         jQuery('body').toggleClass('body_fullscreen');
518
-        jQuery('#<?php echo $prefix;?>loading_div').toggleClass('loading_div_fullscreen');
519
-        jQuery('#<?php echo $prefix;?>advmap_nofound').toggleClass('nofound_fullscreen');
520
-        jQuery('#<?php echo $prefix;?>triggermap').toggleClass('triggermap_fullscreen');
518
+        jQuery('#<?php echo $prefix; ?>loading_div').toggleClass('loading_div_fullscreen');
519
+        jQuery('#<?php echo $prefix; ?>advmap_nofound').toggleClass('nofound_fullscreen');
520
+        jQuery('#<?php echo $prefix; ?>triggermap').toggleClass('triggermap_fullscreen');
521 521
         jQuery('.TopLeft').toggleClass('TopLeft_fullscreen');
522 522
         window.setTimeout(function () {
523 523
             if (window.gdMaps == 'google') {
@@ -553,9 +553,9 @@  discard block
 block discarded – undo
553 553
             do_action('geodir_add_listing_geocode_js_vars');
554 554
             ?>
555 555
             <?php if ($is_map_restrict) { ?>
556
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
557
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
558
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
556
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
557
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
558
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
559 559
                 centerMap(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
560 560
                 baseMarker.setLatLng(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
561 561
                 updateMarkerPositionOSM(baseMarker.getLatLng());
@@ -564,39 +564,39 @@  discard block
 block discarded – undo
564 564
             <?php } ?>
565 565
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
566 566
         } else {
567
-            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
567
+            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
568 568
         }
569 569
     }
570 570
     
571 571
     jQuery(function ($) {
572
-        $("#<?php echo $prefix.'map';?>").goMap({
573
-            latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
574
-            longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
575
-            zoom: <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT,
572
+        $("#<?php echo $prefix.'map'; ?>").goMap({
573
+            latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
574
+            longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
575
+            zoom: <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT,
576 576
             maptype: 'ROADMAP', // Map type - HYBRID, ROADMAP, SATELLITE, TERRAIN
577 577
             streetViewControl: true,
578
-            <?php if(get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,';}?>
578
+            <?php if (get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,'; }?>
579 579
         });
580 580
 
581 581
         if (window.gdMaps) {
582 582
             geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : [];
583 583
 
584 584
             baseMarker = $.goMap.createMarker({
585
-                latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
586
-                longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
585
+                latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
586
+                longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
587 587
                 id: 'baseMarker',
588
-                icon: '<?php echo $marker_icon;?>',
588
+                icon: '<?php echo $marker_icon; ?>',
589 589
                 draggable: true,
590 590
                 addToMap: true, // For OSM
591
-                w: parseFloat('<?php echo $icon_size['w'];?>'),
592
-                h: parseFloat('<?php echo $icon_size['h'];?>'),
591
+                w: parseFloat('<?php echo $icon_size['w']; ?>'),
592
+                h: parseFloat('<?php echo $icon_size['h']; ?>'),
593 593
             });
594 594
         } else {
595
-            jQuery('#<?php echo $prefix.'advmap_nofound';?>').hide();
596
-            jQuery('#<?php echo $prefix.'advmap_notloaded';?>').show();
595
+            jQuery('#<?php echo $prefix.'advmap_nofound'; ?>').hide();
596
+            jQuery('#<?php echo $prefix.'advmap_notloaded'; ?>').show();
597 597
         }
598 598
         
599
-        $("#<?php echo $prefix;?>set_address_button").click(function () {
599
+        $("#<?php echo $prefix; ?>set_address_button").click(function () {
600 600
             var set_on_map = true;
601 601
             geodir_codeAddress(set_on_map);
602 602
         });
@@ -630,14 +630,14 @@  discard block
 block discarded – undo
630 630
                 updateMapZoom($.goMap.map.zoom);
631 631
             });
632 632
 
633
-            var maxMap = document.getElementById('<?php echo $prefix;?>triggermap');
633
+            var maxMap = document.getElementById('<?php echo $prefix; ?>triggermap');
634 634
             google.maps.event.addDomListener(maxMap, 'click', gdMaxMap);
635 635
 
636 636
             <?php if ($is_map_restrict) { ?>
637
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country);?>';
637
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country); ?>';
638 638
             geocoder.geocode({'address': CITY_ADDRESS},
639 639
                 function (results, status) {
640
-                    $("#<?php echo $prefix.'map';?>").goMap();
640
+                    $("#<?php echo $prefix.'map'; ?>").goMap();
641 641
                     if (status == google.maps.GeocoderStatus.OK) {
642 642
                         // Bounds for North America
643 643
                         var bound_lat_lng = String(results[0].geometry.bounds);
@@ -648,13 +648,13 @@  discard block
 block discarded – undo
648 648
                             new google.maps.LatLng(bound_lat_lng[2], bound_lat_lng[3])
649 649
                         );
650 650
                     } else {
651
-                        alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status);
651
+                        alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status);
652 652
                     }
653 653
                 });
654 654
             <?php } ?>
655 655
             // Limit the zoom level
656 656
             google.maps.event.addListener($.goMap.map, 'zoom_changed', function () {
657
-                $("#<?php echo $prefix.'map';?>").goMap();
657
+                $("#<?php echo $prefix.'map'; ?>").goMap();
658 658
                 if ($.goMap.map.getZoom() < minZoomLevel) $.goMap.map.setZoom(minZoomLevel);
659 659
             });
660 660
         } else if (window.gdMaps == 'osm') {
@@ -680,10 +680,10 @@  discard block
 block discarded – undo
680 680
                 updateMapZoom($.goMap.map.getZoom());
681 681
             });
682 682
 
683
-            L.DomEvent.addListener($('<?php echo $prefix;?>triggermap'), 'click', gdMaxMap);
683
+            L.DomEvent.addListener($('<?php echo $prefix; ?>triggermap'), 'click', gdMaxMap);
684 684
 
685 685
             <?php if ($is_map_restrict) { ?>
686
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country);?>';
686
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country); ?>';
687 687
             geocodePositionOSM('', CITY_ADDRESS);
688 688
             <?php } ?>
689 689
             // Limit the zoom level
@@ -706,14 +706,14 @@  discard block
 block discarded – undo
706 706
 <div class="top_banner_section_inn geodir_map_container clearfix" style="margin-top:10px;">
707 707
     <div class="TopLeft"><span id="<?php echo $prefix; ?>triggermap" style="margin-top:-11px;margin-left:-12px;"></span></div>
708 708
     <div class="TopRight"></div>
709
-    <div id="<?php echo $prefix . 'map'; ?>" class="geodir_map" style="height:300px">
709
+    <div id="<?php echo $prefix.'map'; ?>" class="geodir_map" style="height:300px">
710 710
         <!-- new map start -->
711 711
         <div class="iprelative">
712
-            <div id="<?php echo $prefix . 'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
712
+            <div id="<?php echo $prefix.'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
713 713
             <div id="<?php echo $prefix; ?>loading_div" style="height:300px"></div>
714 714
             <div id="<?php echo $prefix; ?>advmap_counter"></div>
715 715
             <div id="<?php echo $prefix; ?>advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
716
-            <div id="<?php echo $prefix;?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
716
+            <div id="<?php echo $prefix; ?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
717 717
         </div>
718 718
         <!-- new map end -->
719 719
     </div>
Please login to merge, or discard this patch.
geodirectory-functions/custom_functions.php 1 patch
Spacing   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -51,20 +51,20 @@  discard block
 block discarded – undo
51 51
 			jQuery(listSel).children('li').switchClass('gridview_onehalf gridview_onethird gridview_onefourth', 'gridview_onefifth', 600);
52 52
 		}
53 53
 
54
-		jQuery.post("<?php echo geodir_get_ajax_url();?>&gd_listing_view=" + val, function (data) {
54
+		jQuery.post("<?php echo geodir_get_ajax_url(); ?>&gd_listing_view=" + val, function (data) {
55 55
 			//alert(data );
56 56
 		});
57 57
 	}
58 58
     </script>
59 59
     <div class="geodir-list-view-select">
60 60
         <select name="gd_list_view" id="gd_list_view" onchange="geodir_list_view_select(this);">
61
-            <?php $listing_view = (int)$gd_session->get('gd_listing_view'); ?>
62
-            <option value=""><?php _e('View:', 'geodirectory');?></option>
63
-            <option value="1" <?php selected(1, $listing_view);?>><?php _e('View: List', 'geodirectory');?></option>
64
-            <option value="2" <?php selected(2, $listing_view);?>><?php _e('View: Grid 2', 'geodirectory');?></option>
65
-            <option value="3" <?php selected(3, $listing_view);?>><?php _e('View: Grid 3', 'geodirectory');?></option>
66
-            <option value="4" <?php selected(4, $listing_view);?>><?php _e('View: Grid 4', 'geodirectory');?></option>
67
-            <option value="5" <?php selected(5, $listing_view);?>><?php _e('View: Grid 5', 'geodirectory');?></option>
61
+            <?php $listing_view = (int) $gd_session->get('gd_listing_view'); ?>
62
+            <option value=""><?php _e('View:', 'geodirectory'); ?></option>
63
+            <option value="1" <?php selected(1, $listing_view); ?>><?php _e('View: List', 'geodirectory'); ?></option>
64
+            <option value="2" <?php selected(2, $listing_view); ?>><?php _e('View: Grid 2', 'geodirectory'); ?></option>
65
+            <option value="3" <?php selected(3, $listing_view); ?>><?php _e('View: Grid 3', 'geodirectory'); ?></option>
66
+            <option value="4" <?php selected(4, $listing_view); ?>><?php _e('View: Grid 4', 'geodirectory'); ?></option>
67
+            <option value="5" <?php selected(5, $listing_view); ?>><?php _e('View: Grid 5', 'geodirectory'); ?></option>
68 68
         </select>
69 69
     </div>
70 70
 <?php
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                 $out .= $subex;
116 116
             }
117 117
         }
118
-        $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
118
+        $out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
119 119
         /**
120 120
          * Filter excerpt read more text.
121 121
          *
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
129 129
             $excut = -(mb_strlen($excerpt_more));
130 130
             $out .= mb_substr($excerpt, 0, $excut);
131
-            $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
131
+            $out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
132 132
             /**
133 133
              * Filter excerpt read more text.
134 134
              *
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      * @param object|string $post The post object.
185 185
      * @param string $post_type The post type.
186 186
      */
187
-    return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
187
+    return (object) apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
188 188
 
189 189
 }
190 190
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         $post_title = $productinfo->post_title;
239 239
     }
240 240
 
241
-    $post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>';
241
+    $post_title = '<a href="'.get_permalink($pid).'">'.$post_title.'</a>';
242 242
 
243 243
     $user_info = get_userdata($author_id);
244 244
     $to_email = geodir_get_post_meta($pid, 'geodir_email', true);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     do_action('geodir_after_send_enquiry', $request, 'Enquiry');
269 269
 
270 270
     $client_message = $frnd_comments;
271
-    $client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
271
+    $client_message .= '<br>'.__('From :', 'geodirectory').' '.$yourname.'<br>'.__('Phone :', 'geodirectory').' '.$inq_phone.'<br>'.__('Email :', 'geodirectory').' '.$youremail.'<br><br>'.__('Sent from', 'geodirectory').' - <b><a href="'.trailingslashit(home_url()).'">'.get_option('blogname').'</a></b>.';
272 272
     /**
273 273
      * Filter client message text.
274 274
      *
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         // strip slashes message
299 299
         $client_message = stripslashes_deep($client_message);
300 300
 
301
-        geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email
301
+        geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']); //To client email
302 302
     }
303 303
 
304 304
     /**
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
     do_action('geodir_after_send_enquiry_email', $request);
321 321
     $url = get_permalink($pid);
322 322
     if (strstr($url, '?')) {
323
-        $url = $url . "&send_inquiry=success";
323
+        $url = $url."&send_inquiry=success";
324 324
     } else {
325
-        $url = $url . "?send_inquiry=success";
325
+        $url = $url."?send_inquiry=success";
326 326
     }
327 327
     /**
328 328
      * Filter redirect url after the send enquiry email is sent.
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
      * }
404 404
      */
405 405
     do_action('geodir_before_send_to_friend_email', $request);
406
-    geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email
406
+    geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']); //To client email
407 407
 
408 408
     /**
409 409
      * Called after the send to friend email is sent.
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 
428 428
     $url = get_permalink($pid);
429 429
     if (strstr($url, '?')) {
430
-        $url = $url . "&sendtofrnd=success";
430
+        $url = $url."&sendtofrnd=success";
431 431
     } else {
432
-        $url = $url . "?sendtofrnd=success";
432
+        $url = $url."?sendtofrnd=success";
433 433
     }
434 434
     /**
435 435
      * Filter redirect url after the send to friend email is sent.
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
              *
464 464
              * @since 1.0.0
465 465
              */
466
-            echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
466
+            echo ' <div id="'.apply_filters('geodir_post_gallery_id', 'geodir-post-gallery').'" class="clearfix" >';
467 467
             break;
468 468
         case 'reviews' :
469 469
             echo '<div id="reviews-wrap" class="clearfix"> ';
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
         if (!in_array($post_type, $all_postypes))
530 530
             return false;
531 531
 
532
-        $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
532
+        $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
533 533
 
534 534
         if (!empty($sort_field_info))
535 535
             return $sort_field_info;
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
         if (!in_array($post_type, $all_postypes))
558 558
             return false;
559 559
 
560
-        $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
560
+        $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
561 561
         /**
562 562
          * Filter post sort options.
563 563
          *
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	 *
588 588
 	 * @since 1.4.4
589 589
 	 */
590
-	if ( is_search() ) {
590
+	if (is_search()) {
591 591
 		return;
592 592
 	}
593 593
 
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
             if ($sort->field_type == 'random') {
612 612
                 $key = $sort->field_type;
613 613
                 ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
614
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
614
+                $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
615 615
             }
616 616
 
617 617
             if ($sort->htmlvar_name == 'comment_count') {
@@ -619,21 +619,21 @@  discard block
 block discarded – undo
619 619
             }
620 620
 
621 621
             if ($sort->sort_asc) {
622
-                $key = $sort->htmlvar_name . '_asc';
622
+                $key = $sort->htmlvar_name.'_asc';
623 623
                 $label = $sort->site_title;
624 624
                 if ($sort->asc_title)
625 625
                     $label = $sort->asc_title;
626 626
                 ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
627
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
627
+                $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
628 628
             }
629 629
 
630 630
             if ($sort->sort_desc) {
631
-                $key = $sort->htmlvar_name . '_desc';
631
+                $key = $sort->htmlvar_name.'_desc';
632 632
                 $label = $sort->site_title;
633 633
                 if ($sort->desc_title)
634 634
                     $label = $sort->desc_title;
635 635
                 ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
636
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
636
+                $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
637 637
             }
638 638
 
639 639
         }
@@ -648,9 +648,9 @@  discard block
 block discarded – undo
648 648
             <select name="sort_by" id="sort_by" onchange="javascript:window.location=this.value;">
649 649
 
650 650
                 <option
651
-                    value="<?php echo esc_url( add_query_arg('sort_by', '') );?>" <?php if ($sort_by == '') echo 'selected="selected"';?>><?php _e('Sort By', 'geodirectory');?></option><?php
651
+                    value="<?php echo esc_url(add_query_arg('sort_by', '')); ?>" <?php if ($sort_by == '') echo 'selected="selected"'; ?>><?php _e('Sort By', 'geodirectory'); ?></option><?php
652 652
 
653
-                echo $sort_field_options;?>
653
+                echo $sort_field_options; ?>
654 654
 
655 655
             </select>
656 656
 
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
         $category = array();
720 720
 
721 721
         if (isset($_REQUEST['backandedit'])) {
722
-            $post = (object)$gd_session->get('listing');
722
+            $post = (object) $gd_session->get('listing');
723 723
             $post_type = $post->listing_type;
724 724
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
725 725
                 $post_id = $_REQUEST['pid'];
@@ -734,13 +734,13 @@  discard block
 block discarded – undo
734 734
 
735 735
         if ($relate_to == 'category') {
736 736
 
737
-            $category_taxonomy = $post_type . $relate_to;
737
+            $category_taxonomy = $post_type.$relate_to;
738 738
             if (isset($post->{$category_taxonomy}) && $post->{$category_taxonomy} != '')
739 739
                 $category = explode(',', trim($post->{$category_taxonomy}, ','));
740 740
 
741 741
         } elseif ($relate_to == 'tags') {
742 742
 
743
-            $category_taxonomy = $post_type . '_' . $relate_to;
743
+            $category_taxonomy = $post_type.'_'.$relate_to;
744 744
             if ($post->post_tags != '')
745 745
                 $category = explode(',', trim($post->post_tags, ','));
746 746
             $tax_field = 'name';
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
             if ($add_location_filter != '0') {
797 797
                 $geodir_add_location_url = '1';
798 798
             }
799
-            $viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy);
799
+            $viewall_url = get_term_link((int) $category[0], $post_type.$category_taxonomy);
800 800
             $geodir_add_location_url = NULL;
801 801
         }
802 802
         ob_start();
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
                 $after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
814 814
                 ?>
815 815
                 <div class="location_list_heading clearfix">
816
-                    <?php echo $before_title . $title . $after_title; ?>
816
+                    <?php echo $before_title.$title.$after_title; ?>
817 817
                 </div>
818 818
             <?php
819 819
             }
@@ -893,8 +893,8 @@  discard block
 block discarded – undo
893 893
         $geodir_post_category_str = serialize($geodir_post_category_str);
894 894
     }
895 895
 
896
-    $all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8');
897
-    $script = "var post_category_array = " . json_encode($all_var) . ';';
896
+    $all_var['post_category_array'] = html_entity_decode((string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8');
897
+    $script = "var post_category_array = ".json_encode($all_var).';';
898 898
     echo '<script>';
899 899
     echo $script;
900 900
     echo '</script>';
@@ -996,9 +996,9 @@  discard block
 block discarded – undo
996 996
         }
997 997
     } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
998 998
         if (is_category()) {
999
-            $meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
999
+            $meta_desc .= __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", FALSE));
1000 1000
         } elseif (is_tag()) {
1001
-            $meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
1001
+            $meta_desc .= __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", FALSE));
1002 1002
         }
1003 1003
     } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1004 1004
         $meta_desc .= isset($current_term->description) ? $current_term->description : '';
@@ -1025,8 +1025,8 @@  discard block
 block discarded – undo
1025 1025
     $replace_location = __('Everywhere', 'geodirectory');
1026 1026
     $location_id = NULL;
1027 1027
     if ($geodir_location_manager) {
1028
-        $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1029
-        $location_id = (int)$wpdb->get_var($sql);
1028
+        $sql = $wpdb->prepare("SELECT location_id FROM ".POST_LOCATION_TABLE." WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1029
+        $location_id = (int) $wpdb->get_var($sql);
1030 1030
         $location_type = geodir_what_is_current_location();
1031 1031
         if ($location_type == 'city') {
1032 1032
             $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
@@ -1067,65 +1067,65 @@  discard block
 block discarded – undo
1067 1067
                     $category_id = $category->term_id;
1068 1068
                     $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1069 1069
                     if ($location_id) {
1070
-                        $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1070
+                        $option_name = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id;
1071 1071
                         $cat_loc_option = get_option($option_name);
1072 1072
 
1073 1073
                         $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1074 1074
                         if (!$gd_cat_loc_default) {
1075
-                            $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1075
+                            $option_name = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id.'_'.$location_id;
1076 1076
                             $option = get_option($option_name);
1077 1077
                             $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1078 1078
                         }
1079 1079
                     }
1080
-                    $geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
1080
+                    $geodir_meta_desc = __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", FALSE)).'. '.$category_desc;
1081 1081
                 }
1082 1082
             } else if ($geodir_is_tag) {
1083
-                $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
1083
+                $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", FALSE)).'. '.$geodir_meta_desc;
1084 1084
             }
1085 1085
         }
1086 1086
     }
1087 1087
 
1088 1088
 
1089 1089
     $gd_page = '';
1090
-    if(geodir_is_page('home')){
1090
+    if (geodir_is_page('home')) {
1091 1091
         $gd_page = 'home';
1092 1092
         $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1093 1093
     }
1094
-    elseif(geodir_is_page('detail')){
1094
+    elseif (geodir_is_page('detail')) {
1095 1095
         $gd_page = 'detail';
1096 1096
         $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1097 1097
     }
1098
-    elseif(geodir_is_page('pt')){
1098
+    elseif (geodir_is_page('pt')) {
1099 1099
         $gd_page = 'pt';
1100 1100
         $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1101 1101
     }
1102
-    elseif(geodir_is_page('listing')){
1102
+    elseif (geodir_is_page('listing')) {
1103 1103
         $gd_page = 'listing';
1104 1104
         $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1105 1105
     }
1106
-    elseif(geodir_is_page('location')){
1106
+    elseif (geodir_is_page('location')) {
1107 1107
         $gd_page = 'location';
1108 1108
         $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1109 1109
         $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1110 1110
 
1111 1111
     }
1112
-    elseif(geodir_is_page('search')){
1112
+    elseif (geodir_is_page('search')) {
1113 1113
         $gd_page = 'search';
1114 1114
         $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1115 1115
     }
1116
-    elseif(geodir_is_page('add-listing')){
1116
+    elseif (geodir_is_page('add-listing')) {
1117 1117
         $gd_page = 'add-listing';
1118 1118
         $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1119 1119
     }
1120
-    elseif(geodir_is_page('author')){
1120
+    elseif (geodir_is_page('author')) {
1121 1121
         $gd_page = 'author';
1122 1122
         $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1123 1123
     }
1124
-    elseif(geodir_is_page('login')){
1124
+    elseif (geodir_is_page('login')) {
1125 1125
         $gd_page = 'login';
1126 1126
         $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1127 1127
     }
1128
-    elseif(geodir_is_page('listing-success')){
1128
+    elseif (geodir_is_page('listing-success')) {
1129 1129
         $gd_page = 'listing-success';
1130 1130
         $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1131 1131
     }
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
          * @param string $title The page description including variables.
1154 1154
          * @param string $gd_page The GeoDirectory page type if any.
1155 1155
          */
1156
-        $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
1156
+        $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'), $gd_page, '');
1157 1157
 
1158 1158
         /**
1159 1159
          * Filter SEO meta description.
@@ -1161,20 +1161,20 @@  discard block
 block discarded – undo
1161 1161
          * @since 1.0.0
1162 1162
          * @param string $meta_desc Meta description content.
1163 1163
          */
1164
-        echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
1164
+        echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="'.$meta_desc.'" />', $meta_desc);
1165 1165
     }
1166 1166
 
1167 1167
     // meta keywords
1168 1168
     if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1169
-        $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
1170
-        $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
1169
+        $place_tags = wp_get_post_terms($post->ID, $post->post_type.'_tags', array("fields" => "names"));
1170
+        $place_cats = wp_get_post_terms($post->ID, $post->post_type.'category', array("fields" => "names"));
1171 1171
 
1172
-        $meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
1172
+        $meta_key .= implode(", ", array_merge((array) $place_cats, (array) $place_tags));
1173 1173
     } else {
1174 1174
         $posttags = get_the_tags();
1175 1175
         if ($posttags) {
1176 1176
             foreach ($posttags as $tag) {
1177
-                $meta_key .= $tag->name . ' ';
1177
+                $meta_key .= $tag->name.' ';
1178 1178
             }
1179 1179
         } else {
1180 1180
             $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 
1183 1183
             foreach ($tags as $tag) {
1184 1184
                 if ($xt <= 20) {
1185
-                    $meta_key .= $tag->name . ", ";
1185
+                    $meta_key .= $tag->name.", ";
1186 1186
                 }
1187 1187
 
1188 1188
                 $xt++;
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
     }
1192 1192
 
1193 1193
     $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1194
-    $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1194
+    $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key.', '.$geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1195 1195
     if ($geodir_meta_keys != '') {
1196 1196
         $geodir_meta_keys = strip_tags($geodir_meta_keys);
1197 1197
         $geodir_meta_keys = esc_html($geodir_meta_keys);
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
          * @since 1.0.0
1211 1211
          * @param string $meta_desc Meta keywords.
1212 1212
          */
1213
-        echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
1213
+        echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="'.$meta_key.'" />', $meta_key);
1214 1214
     }
1215 1215
 
1216 1216
 }
@@ -1355,8 +1355,8 @@  discard block
 block discarded – undo
1355 1355
 {
1356 1356
     global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1357 1357
 
1358
-    $post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0;
1359
-    $request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0;
1358
+    $post_id = !empty($post) && isset($post->ID) ? (int) $post->ID : 0;
1359
+    $request_post_id = !empty($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
1360 1360
     $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1361 1361
 
1362 1362
     if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
         if (!empty($post_images)) {
1391 1391
             foreach ($post_images as $image) {
1392 1392
                 $caption = (!empty($image->caption)) ? $image->caption : '';
1393
-                $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">';
1393
+                $thumb_image .= '<a href="'.$image->src.'" title="'.$caption.'">';
1394 1394
                 $thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1395 1395
                 $thumb_image .= '</a>';
1396 1396
             }
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
         $map_args['width'] = '600';
1402 1402
         $map_args['height'] = '300';
1403 1403
         if ($post->post_mapzoom) {
1404
-            $map_args['zoom'] = '' . $post->post_mapzoom . '';
1404
+            $map_args['zoom'] = ''.$post->post_mapzoom.'';
1405 1405
         }
1406 1406
         $map_args['autozoom'] = false;
1407 1407
         $map_args['child_collapse'] = '0';
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
         if (!empty($post_images)) {
1428 1428
             foreach ($post_images as $image) {
1429 1429
                 if ($image != '') {
1430
-                    $thumb_image .= '<a href="' . $image . '">';
1430
+                    $thumb_image .= '<a href="'.$image.'">';
1431 1431
                     $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1432 1432
                     $thumb_image .= '</a>';
1433 1433
                 }
@@ -1469,13 +1469,13 @@  discard block
 block discarded – undo
1469 1469
         $map_args['map_class_name'] = 'geodir-map-preview-page';
1470 1470
     }
1471 1471
 
1472
-    $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1472
+    $arr_detail_page_tabs = geodir_detail_page_tabs_list(); // get this sooner so we can get the active tab for the user
1473 1473
 
1474 1474
     $active_tab = '';
1475 1475
     $active_tab_name = '';
1476 1476
     $default_tab = '';
1477 1477
     $default_tab_name = '';
1478
-    foreach($arr_detail_page_tabs as $tab_index => $tabs){
1478
+    foreach ($arr_detail_page_tabs as $tab_index => $tabs) {
1479 1479
         if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1480 1480
             $active_tab = $tab_index;
1481 1481
             $active_tab_name = __($tabs['heading_text'], 'geodirectory');
@@ -1496,10 +1496,10 @@  discard block
 block discarded – undo
1496 1496
         $active_tab = $default_tab;
1497 1497
         $active_tab_name = $default_tab_name;
1498 1498
     }
1499
-    $tab_list = (get_option('geodir_disable_tabs',true)) ? true : false;
1499
+    $tab_list = (get_option('geodir_disable_tabs', true)) ? true : false;
1500 1500
     ?>
1501 1501
     <div class="geodir-tabs" id="gd-tabs" style="position:relative;">
1502
-        <?php if(!$tab_list){ ?>
1502
+        <?php if (!$tab_list) { ?>
1503 1503
         <div id="geodir-tab-mobile-menu">
1504 1504
             <i class="fa fa-bars"></i>
1505 1505
             <span class="geodir-mobile-active-tab"><?php echo $active_tab_name; ?></span>
@@ -1520,10 +1520,10 @@  discard block
 block discarded – undo
1520 1520
             foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1521 1521
                 if ($detail_page_tab['is_display']) {
1522 1522
 
1523
-                    if(!$tab_list) {
1523
+                    if (!$tab_list) {
1524 1524
                         ?>
1525 1525
                         <dt></dt> <!-- added to comply with validation -->
1526
-                        <dd <?php if ($detail_page_tab['is_active_tab']){ ?>class="geodir-tab-active"<?php } ?> ><a
1526
+                        <dd <?php if ($detail_page_tab['is_active_tab']) { ?>class="geodir-tab-active"<?php } ?> ><a
1527 1527
                                 data-tab="#<?php echo $tab_index; ?>"
1528 1528
                                 data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a>
1529 1529
                         </dd>
@@ -1531,9 +1531,9 @@  discard block
 block discarded – undo
1531 1531
                     }
1532 1532
                     ob_start() // start tab content buffering
1533 1533
                     ?>
1534
-                    <li id="<?php echo $tab_index;?>Tab">
1535
-                        <?php if($tab_list){
1536
-                            $tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'],'geodirectory').'</a></span><hr />';
1534
+                    <li id="<?php echo $tab_index; ?>Tab">
1535
+                        <?php if ($tab_list) {
1536
+                            $tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'], 'geodirectory').'</a></span><hr />';
1537 1537
                             /**
1538 1538
                              * Filter the tab list title html.
1539 1539
                              *
@@ -1542,9 +1542,9 @@  discard block
 block discarded – undo
1542 1542
                              * @param string $tab_index The tab index type.
1543 1543
                              * @param array $detail_page_tab The array of values including title text.
1544 1544
                              */
1545
-                            echo apply_filters('geodir_tab_list_title',$tab_title ,$tab_index ,$detail_page_tab);
1545
+                            echo apply_filters('geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab);
1546 1546
                         }?>
1547
-                        <div id="<?php echo $tab_index;?>" class="hash-offset"></div>
1547
+                        <div id="<?php echo $tab_index; ?>" class="hash-offset"></div>
1548 1548
                         <?php
1549 1549
                         /**
1550 1550
                          * Called before the details tab content is output per tab.
@@ -1562,7 +1562,7 @@  discard block
 block discarded – undo
1562 1562
                          * @since 1.0.0
1563 1563
                          * @todo do we need this if we have the hook above? 'geodir_before_tab_content'
1564 1564
                          */
1565
-                        do_action('geodir_before_' . $tab_index . '_tab_content');
1565
+                        do_action('geodir_before_'.$tab_index.'_tab_content');
1566 1566
                         /// write a code to generate content of each tab
1567 1567
                         switch ($tab_index) {
1568 1568
                             case 'post_profile':
@@ -1594,7 +1594,7 @@  discard block
 block discarded – undo
1594 1594
                                 break;
1595 1595
                             case 'post_video':
1596 1596
                                 /** This action is documented in geodirectory_template_actions.php */
1597
-                                echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
1597
+                                echo apply_filters('the_content', stripslashes($video)); // we apply the_content filter so oembed works also;
1598 1598
                                 break;
1599 1599
                             case 'special_offers':
1600 1600
                                 echo wpautop(stripslashes($special_offers));
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
                          * @since 1.0.0
1633 1633
                          * @todo do we need this if we have the hook above? 'geodir_after_tab_content'
1634 1634
                          */
1635
-                        do_action('geodir_after_' . $tab_index . '_tab_content');
1635
+                        do_action('geodir_after_'.$tab_index.'_tab_content');
1636 1636
                         ?> </li>
1637 1637
                     <?php
1638 1638
                     /**
@@ -1640,7 +1640,7 @@  discard block
 block discarded – undo
1640 1640
                      *
1641 1641
                      * @since 1.0.0
1642 1642
                      */
1643
-                    $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
1643
+                    $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_".$detail_page_tab['tab_content']."_tab_content", ob_get_clean());
1644 1644
                 } // end of if for is_display
1645 1645
             }// end of foreach
1646 1646
 
@@ -1652,7 +1652,7 @@  discard block
 block discarded – undo
1652 1652
              */
1653 1653
             do_action('geodir_after_tab_list');
1654 1654
             ?>
1655
-            <?php if(!$tab_list){?></dl><?php }?>
1655
+            <?php if (!$tab_list) {?></dl><?php }?>
1656 1656
         <ul class="geodir-tabs-content entry-content" style="position:relative;">
1657 1657
             <?php
1658 1658
             foreach ($arr_detail_page_tabs as $detail_page_tab) {
@@ -1670,7 +1670,7 @@  discard block
 block discarded – undo
1670 1670
         </ul>
1671 1671
         <!--gd-tabs-content ul end-->
1672 1672
     </div>
1673
-    <?php if(!$tab_list){ ?>
1673
+    <?php if (!$tab_list) { ?>
1674 1674
     <script>
1675 1675
         if (window.location.hash && window.location.hash.indexOf('&') === -1 && jQuery(window.location.hash + 'Tab').length) {
1676 1676
             hashVal = window.location.hash;
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
     if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1726 1726
         try {
1727 1727
             $exif = exif_read_data($file_path);
1728
-        } catch(Exception $e) {
1728
+        } catch (Exception $e) {
1729 1729
             $exif = array();
1730 1730
         }
1731 1731
     }
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
     $modify = false;
1736 1736
     $orientation = 0;
1737 1737
     if (!empty($exif) && isset($exif['Orientation'])) {
1738
-        switch ((int)$exif['Orientation']) {
1738
+        switch ((int) $exif['Orientation']) {
1739 1739
             case 1:
1740 1740
                 // do nothing
1741 1741
                 break;
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
         }
1812 1812
         
1813 1813
         if ($quality !== null) {
1814
-            $image->set_quality((int)$quality);
1814
+            $image->set_quality((int) $quality);
1815 1815
         }
1816 1816
         
1817 1817
        $result = $image->save($file_path);
@@ -1883,7 +1883,7 @@  discard block
 block discarded – undo
1883 1883
 
1884 1884
         $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
1885 1885
 
1886
-        $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID;
1886
+        $permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID;
1887 1887
         $comment_author_email = $comment->comment_author_email;
1888 1888
         $comment_post_ID = $comment->post_id;
1889 1889
 
@@ -1898,12 +1898,12 @@  discard block
 block discarded – undo
1898 1898
 
1899 1899
         $post_title = get_the_title($comment_post_ID);
1900 1900
         $permalink = get_permalink($comment_post_ID);
1901
-        $comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
1902
-        $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
1901
+        $comment_permalink = $permalink."#comment-".$comment->comment_ID;
1902
+        $read_more = '<a class="comment_excerpt" href="'.$comment_permalink.'">'.__('Read more', 'geodirectory').'</a>';
1903 1903
 
1904 1904
         $comment_content_length = strlen($comment_content);
1905 1905
         if ($comment_content_length > $comment_lenth) {
1906
-            $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more;
1906
+            $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth).'... '.$read_more;
1907 1907
         } else {
1908 1908
             $comment_excerpt = $comment_content;
1909 1909
         }
@@ -1916,37 +1916,37 @@  discard block
 block discarded – undo
1916 1916
 
1917 1917
         if ($comment_id && $na) {
1918 1918
             $comments_echo .= '<li class="clearfix">';
1919
-            $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
1919
+            $comments_echo .= "<span class=\"li".$comment_id." geodir_reviewer_image\">";
1920 1920
             if (function_exists('get_avatar')) {
1921 1921
                 if (!isset($comment->comment_type)) {
1922 1922
                     if ($user_profile_url) {
1923
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1923
+                        $comments_echo .= '<a href="'.$user_profile_url.'">';
1924 1924
                     }
1925
-                    $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1925
+                    $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1926 1926
                     if ($user_profile_url) {
1927 1927
                         $comments_echo .= '</a>';
1928 1928
                     }
1929 1929
                 } elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
1930 1930
                     if ($user_profile_url) {
1931
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1931
+                        $comments_echo .= '<a href="'.$user_profile_url.'">';
1932 1932
                     }
1933
-                    $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1933
+                    $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1934 1934
                 }
1935 1935
             } elseif (function_exists('gravatar')) {
1936 1936
                 if ($user_profile_url) {
1937
-                    $comments_echo .= '<a href="' . $user_profile_url . '">';
1937
+                    $comments_echo .= '<a href="'.$user_profile_url.'">';
1938 1938
                 }
1939 1939
                 $comments_echo .= "<img src=\"";
1940 1940
                 if ('' == $comment->comment_type) {
1941
-                    $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1941
+                    $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1942 1942
                     if ($user_profile_url) {
1943 1943
                         $comments_echo .= '</a>';
1944 1944
                     }
1945 1945
                 } elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
1946 1946
                     if ($user_profile_url) {
1947
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1947
+                        $comments_echo .= '<a href="'.$user_profile_url.'">';
1948 1948
                     }
1949
-                    $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1949
+                    $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1950 1950
                     if ($user_profile_url) {
1951 1951
                         $comments_echo .= '</a>';
1952 1952
                     }
@@ -1957,13 +1957,13 @@  discard block
 block discarded – undo
1957 1957
             $comments_echo .= "</span>\n";
1958 1958
 
1959 1959
             $comments_echo .= '<span class="geodir_reviewer_content">';
1960
-            if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
1961
-            $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
1962
-            if($comment->user_id){$comments_echo .= '</a>';}
1963
-            $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
1964
-            $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
1960
+            if ($comment->user_id) {$comments_echo .= '<a href="'.get_author_posts_url($comment->user_id).'">'; }
1961
+            $comments_echo .= '<span class="geodir_reviewer_author">'.$comment->comment_author.'</span> ';
1962
+            if ($comment->user_id) {$comments_echo .= '</a>'; }
1963
+            $comments_echo .= '<span class="geodir_reviewer_reviewed">'.__('reviewed', 'geodirectory').'</span> ';
1964
+            $comments_echo .= '<a href="'.$permalink.'" class="geodir_reviewer_title">'.$post_title.'</a>';
1965 1965
             $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
1966
-            $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
1966
+            $comments_echo .= '<p class="geodir_reviewer_text">'.$comment_excerpt.'';
1967 1967
             //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
1968 1968
             $comments_echo .= '</p>';
1969 1969
 
@@ -1990,19 +1990,19 @@  discard block
 block discarded – undo
1990 1990
     if (!empty($post_types)) {
1991 1991
         foreach ($post_types as $key => $post_type) {
1992 1992
             $cpt_name = __($post_type->labels->singular_name, 'geodirectory');
1993
-            $post_type_name =   sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
1993
+            $post_type_name = sprintf(__('%s Categories', 'geodirectory'), $cpt_name);
1994 1994
             $taxonomies = geodir_get_taxonomies($key);
1995 1995
             $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL;
1996 1996
             $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL;
1997 1997
 
1998 1998
             if (!empty($cat_terms)) {
1999
-                $return['optgroup_start-' . $key] = $post_type_name;
1999
+                $return['optgroup_start-'.$key] = $post_type_name;
2000 2000
 
2001 2001
                 foreach ($cat_terms as $cat_term) {
2002
-                    $return[$key . '_' . $cat_term->term_id] = $cat_term->name;
2002
+                    $return[$key.'_'.$cat_term->term_id] = $cat_term->name;
2003 2003
                 }
2004 2004
 
2005
-                $return['optgroup_end-' . $key] = $post_type_name;
2005
+                $return['optgroup_end-'.$key] = $post_type_name;
2006 2006
             }
2007 2007
         }
2008 2008
     }
@@ -2094,10 +2094,10 @@  discard block
 block discarded – undo
2094 2094
             stWidget.addEntry({
2095 2095
                 "service": "sharethis",
2096 2096
                 "element": document.getElementById('st_sharethis'),
2097
-                "url": "<?php echo geodir_curPageURL();?>",
2098
-                "title": "<?php echo $post->post_title;?>",
2097
+                "url": "<?php echo geodir_curPageURL(); ?>",
2098
+                "title": "<?php echo $post->post_title; ?>",
2099 2099
                 "type": "chicklet",
2100
-                "text": "<?php _e( 'Share', 'geodirectory' );?>"
2100
+                "text": "<?php _e('Share', 'geodirectory'); ?>"
2101 2101
             });
2102 2102
         </script>
2103 2103
     </div>
@@ -2105,7 +2105,7 @@  discard block
 block discarded – undo
2105 2105
 }
2106 2106
 
2107 2107
 function geodir_listing_bounce_map_pin_on_hover() {
2108
-    if(get_option('geodir_listing_hover_bounce_map_pin',true)) {
2108
+    if (get_option('geodir_listing_hover_bounce_map_pin', true)) {
2109 2109
         ?>
2110 2110
         <script>
2111 2111
             jQuery(function ($) {
@@ -2122,15 +2122,15 @@  discard block
 block discarded – undo
2122 2122
         <?php
2123 2123
     }
2124 2124
 }
2125
-add_action('geodir_after_listing_listview','geodir_listing_bounce_map_pin_on_hover',10);
2125
+add_action('geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10);
2126 2126
 
2127
-add_action('geodir_after_favorite_html','geodir_output_favourite_html_listings',1,1);
2128
-function geodir_output_favourite_html_listings( $post_id){
2127
+add_action('geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1);
2128
+function geodir_output_favourite_html_listings($post_id) {
2129 2129
     geodir_favourite_html('', $post_id);
2130 2130
 }
2131 2131
 
2132
-add_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2133
-function geodir_output_pinpoint_html_listings( $post_id, $post){
2132
+add_action('geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2133
+function geodir_output_pinpoint_html_listings($post_id, $post) {
2134 2134
     global $wp_query;
2135 2135
 
2136 2136
     $show_pin_point = $wp_query->is_main_query();
Please login to merge, or discard this patch.
geodirectory-admin/admin_functions.php 1 patch
Spacing   +901 added lines, -901 removed lines patch added patch discarded remove patch
@@ -46,31 +46,31 @@  discard block
 block discarded – undo
46 46
     function geodir_admin_styles()
47 47
     {
48 48
 
49
-        wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
49
+        wp_register_style('geodirectory-admin-css', geodir_plugin_url().'/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
50 50
         wp_enqueue_style('geodirectory-admin-css');
51 51
 
52
-        wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
52
+        wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
53 53
         wp_enqueue_style('geodirectory-frontend-style');
54 54
 
55
-        wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
55
+        wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
56 56
         wp_enqueue_style('geodir-chosen-style');
57 57
 
58
-        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
58
+        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
59 59
         wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
60 60
 
61
-        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
61
+        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
62 62
         wp_enqueue_style('geodirectory-jquery-ui-css');
63 63
 
64
-        wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url() . '/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION);
64
+        wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url().'/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION);
65 65
         wp_enqueue_style('geodirectory-custom-fields-css');
66 66
 
67
-        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
67
+        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
68 68
         wp_enqueue_style('geodirectory-pluplodar-css');
69 69
 
70
-        wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
70
+        wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
71 71
         wp_enqueue_style('geodir-rating-style');
72 72
 
73
-        wp_register_style('geodir-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION);
73
+        wp_register_style('geodir-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION);
74 74
         wp_enqueue_style('geodir-rtl-style');
75 75
 
76 76
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         wp_register_style('geodirectory-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
90 90
         wp_enqueue_style('geodirectory-font-awesome');
91 91
 
92
-        wp_register_script('geodirectory-admin', geodir_plugin_url() . '/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION);
92
+        wp_register_script('geodirectory-admin', geodir_plugin_url().'/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION);
93 93
         wp_enqueue_script('geodirectory-admin');
94 94
 
95 95
     }
@@ -108,59 +108,59 @@  discard block
 block discarded – undo
108 108
         
109 109
         wp_enqueue_script('jquery');
110 110
 
111
-        wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true);
111
+        wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true);
112 112
 
113
-        wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.js', array(), GEODIRECTORY_VERSION);
113
+        wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.js', array(), GEODIRECTORY_VERSION);
114 114
         wp_enqueue_script('chosen');
115 115
 
116
-        wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION);
116
+        wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION);
117 117
         wp_enqueue_script('geodirectory-choose-ajax');
118 118
 
119 119
         if (isset($_REQUEST['listing_type'])) {
120
-            wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url() . '/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION);
120
+            wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url().'/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION);
121 121
         }
122 122
 
123 123
         wp_enqueue_script('geodirectory-custom-fields-script');
124
-        $plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions';
124
+        $plugin_path = geodir_plugin_url().'/geodirectory-functions/cat-meta-functions';
125 125
 
126
-        wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true);
126
+        wp_enqueue_script('tax-meta-clss', $plugin_path.'/js/tax-meta-clss.js', array('jquery'), null, true);
127 127
 
128 128
         if (in_array($geodir_map_name, array('auto', 'google'))) {
129
-            $map_lang = "&language=" . geodir_get_map_default_language();
129
+            $map_lang = "&language=".geodir_get_map_default_language();
130 130
             /** This filter is documented in geodirectory_template_tags.php */
131 131
             $map_extra = apply_filters('geodir_googlemap_script_extra', '');
132
-            wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
132
+            wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL);
133 133
         }
134 134
         
135 135
         if ($geodir_map_name == 'osm') {
136 136
             // Leaflet OpenStreetMap
137
-            wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
137
+            wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
138 138
             wp_enqueue_style('geodirectory-leaflet-style');
139 139
                 
140
-            wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
140
+            wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
141 141
             wp_enqueue_script('geodirectory-leaflet-script');
142 142
             
143
-            wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION);
143
+            wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION);
144 144
             wp_enqueue_script('geodirectory-leaflet-geo-script');
145 145
         }
146
-        wp_enqueue_script( 'jquery-ui-autocomplete' );
146
+        wp_enqueue_script('jquery-ui-autocomplete');
147 147
         
148
-        wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
148
+        wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
149 149
         wp_enqueue_script('geodirectory-goMap-script');
150 150
 
151
-        wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION);
151
+        wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION);
152 152
         wp_enqueue_script('geodirectory-goMap-script');
153 153
 
154 154
 		// font awesome rating script
155 155
 		if (get_option('geodir_reviewrating_enable_font_awesome')) {
156
-			wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION);
156
+			wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION);
157 157
 			wp_enqueue_script('geodir-barrating-js');
158 158
 		} else { // default rating script
159
-			wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION);
159
+			wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION);
160 160
 			wp_enqueue_script('geodir-jRating-js');
161 161
 		}
162 162
 
163
-        wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js', array(), GEODIRECTORY_VERSION);
163
+        wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js', array(), GEODIRECTORY_VERSION);
164 164
         wp_enqueue_script('geodir-on-document-load');
165 165
 
166 166
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         wp_enqueue_script('plupload-all');
169 169
         wp_enqueue_script('jquery-ui-sortable');
170 170
 
171
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
171
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
172 172
         wp_enqueue_script('geodirectory-plupload-script');
173 173
 
174 174
         // SCRIPT FOR UPLOAD END
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         wp_localize_script('geodirectory-custom-fields-script', 'geodir_admin_ajax', $ajax_cons_data);
223 223
 
224 224
 
225
-        wp_register_script('geodirectory-admin-script', geodir_plugin_url() . '/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION);
225
+        wp_register_script('geodirectory-admin-script', geodir_plugin_url().'/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION);
226 226
         wp_enqueue_script('geodirectory-admin-script');
227 227
 
228 228
         wp_enqueue_style('farbtastic');
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 
231 231
         $screen = get_current_screen();
232 232
         if ($screen->base == 'post' && in_array($screen->post_type, geodir_get_posttypes())) {
233
-            wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation_admin.js');
233
+            wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation_admin.js');
234 234
         }
235 235
 
236
-        $ajax_cons_data = array('url' => __(get_option('siteurl') . '?geodir_ajax=true'));
236
+        $ajax_cons_data = array('url' => __(get_option('siteurl').'?geodir_ajax=true'));
237 237
         wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data);
238 238
 
239 239
     }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory');
258 258
 
259
-        add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984');
259
+        add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url().'/geodirectory-assets/images/favicon.ico', '55.1984');
260 260
 
261 261
 
262 262
     }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                 $geodir_menu_order[] = 'separator-geodirectory';
291 291
                 if (!empty($post_types)) {
292 292
                     foreach ($post_types as $post_type) {
293
-                        $geodir_menu_order[] = 'edit.php?post_type=' . $post_type;
293
+                        $geodir_menu_order[] = 'edit.php?post_type='.$post_type;
294 294
                     }
295 295
                 }
296 296
                 $geodir_menu_order[] = $item;
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
 {
334 334
     if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') {
335 335
         echo '<div id="message" class="updated fade">
336
-                        <p style="float:right;">' . __('Like Geodirectory?', 'geodirectory') . ' <a href="http://wordpress.org/extend/plugins/Geodirectory/" target="_blank">' . __('Support us by leaving a rating!', 'geodirectory') . '</a></p>
337
-                        <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory') . '</strong></p>
336
+                        <p style="float:right;">' . __('Like Geodirectory?', 'geodirectory').' <a href="http://wordpress.org/extend/plugins/Geodirectory/" target="_blank">'.__('Support us by leaving a rating!', 'geodirectory').'</a></p>
337
+                        <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory').'</strong></p>
338 338
                 </div>';
339 339
 
340 340
     }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
     if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') {
343 343
         switch ($_REQUEST['msg']) {
344 344
             case 'success':
345
-                echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>';
345
+                echo '<div id="message" class="updated fade"><p><strong>'.__('Your settings have been saved.', 'geodirectory').'</strong></p></div>';
346 346
                 flush_rewrite_rules(false);
347 347
 
348 348
                 break;
@@ -350,20 +350,20 @@  discard block
 block discarded – undo
350 350
 				$gderr = isset($_REQUEST['gderr']) ? $_REQUEST['gderr'] : '';
351 351
 				
352 352
 				if ($gderr == 21)
353
-			    	echo '<div id="message" class="error fade"><p><strong>' . __('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory') . '</strong></p></div>';
353
+			    	echo '<div id="message" class="error fade"><p><strong>'.__('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory').'</strong></p></div>';
354 354
 				else
355
-					echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>';
355
+					echo '<div id="message" class="error fade"><p><strong>'.__('Error: Your settings have not been saved, please try again.', 'geodirectory').'</strong></p></div>';
356 356
                 break;
357 357
         }
358 358
     }
359 359
 
360 360
     if (!geodir_is_default_location_set()) {
361
-        echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
361
+        echo '<div class="updated fade"><p><strong>'.sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>').'</strong></p></div>';
362 362
 
363 363
     }
364 364
 
365 365
     if (!function_exists('curl_init')) {
366
-        echo '<div class="error"><p><strong>' . __('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory') . '</strong></p></div>';
366
+        echo '<div class="error"><p><strong>'.__('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory').'</strong></p></div>';
367 367
 
368 368
     }
369 369
 }
@@ -379,18 +379,18 @@  discard block
 block discarded – undo
379 379
 function geodir_handle_option_form_submit($current_tab)
380 380
 {
381 381
     global $geodir_settings;
382
-    if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) {
382
+    if (file_exists(dirname(__FILE__).'/option-pages/'.$current_tab.'_array.php')) {
383 383
         /**
384 384
          * Contains settings array for current tab.
385 385
          *
386 386
          * @since 1.0.0
387 387
          * @package GeoDirectory
388 388
          */
389
-        include_once('option-pages/' . $current_tab . '_array.php');
389
+        include_once('option-pages/'.$current_tab.'_array.php');
390 390
     }
391 391
     if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') :
392 392
         if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
393
-        if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
393
+        if (!wp_verify_nonce($_REQUEST['_wpnonce-'.$current_tab], 'geodir-settings-'.$current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
394 394
 		
395 395
 		/**
396 396
 		 * Fires before updating geodirectory admin settings.
@@ -423,13 +423,13 @@  discard block
 block discarded – undo
423 423
          * @param string $current_tab The current settings tab name.
424 424
          * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab.
425 425
          */
426
-        do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]);
426
+        do_action('geodir_update_options_'.$current_tab, $geodir_settings[$current_tab]);
427 427
 
428 428
         flush_rewrite_rules(false);
429 429
 
430 430
         $current_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : '';
431 431
 
432
-        $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $_REQUEST['active_tab'] . '&msg=success');
432
+        $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$_REQUEST['active_tab'].'&msg=success');
433 433
 
434 434
         wp_redirect($redirect_url);
435 435
         exit();
@@ -455,18 +455,18 @@  discard block
 block discarded – undo
455 455
         global $wpdb, $plugin_prefix;
456 456
 
457 457
         if (!geodir_is_default_location_set()) {
458
-            echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
458
+            echo '<div class="updated fade"><p><strong>'.sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>').'</strong></p></div>';
459 459
         } else {
460 460
 
461
-            $geodir_url = admin_url() . 'admin.php?page=geodirectory&tab=general_settings&active_tab=';
461
+            $geodir_url = admin_url().'admin.php?page=geodirectory&tab=general_settings&active_tab=';
462 462
 
463
-            $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'");
463
+            $post_counts = $wpdb->get_var("SELECT count(post_id) FROM ".$plugin_prefix.$post_type."_detail WHERE post_dummy='1'");
464 464
 
465 465
             if ($post_counts > 0) {
466 466
                 $nonce = wp_create_nonce('geodir_dummy_posts_delete_noncename');
467 467
 
468
-                $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . SAMPLE_DATA_SHOW_MSG . '</b><br /><a id="geodir_dummy_delete" class="button_delete" onclick="geodir_autoinstall(this,\'geodir_dummy_delete\',\'' . $nonce . '\',\'' . $post_type . '\')" href="javascript:void(0);" redirect_to="' . $geodir_url . '"  >' . DELETE_BTN_SAMPLE_MSG . '</a></p></div>';
469
-                $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_DELETE_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /></p></div>';
468
+                $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>'.SAMPLE_DATA_SHOW_MSG.'</b><br /><a id="geodir_dummy_delete" class="button_delete" onclick="geodir_autoinstall(this,\'geodir_dummy_delete\',\''.$nonce.'\',\''.$post_type.'\')" href="javascript:void(0);" redirect_to="'.$geodir_url.'"  >'.DELETE_BTN_SAMPLE_MSG.'</a></p></div>';
469
+                $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>'.GEODIR_SAMPLE_DATA_DELETE_MSG.'</b><br><img src="'.geodir_plugin_url().'/geodirectory-assets/images/loadingAnimation.gif" /></p></div>';
470 470
             } else {
471 471
                 $options_list = '';
472 472
                 for ($option = 1; $option <= 30; $option++) {
@@ -474,13 +474,13 @@  discard block
 block discarded – undo
474 474
                     if ($option == 10)
475 475
                         $selected = 'selected="selected"';
476 476
 
477
-                    $options_list .= '<option ' . $selected . ' value="' . $option . '">' . $option . '</option>';
477
+                    $options_list .= '<option '.$selected.' value="'.$option.'">'.$option.'</option>';
478 478
                 }
479 479
 
480 480
                 $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename');
481 481
 
482
-                $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . AUTO_INSATALL_MSG . '</b><br /><select class="selected_sample_data">' . $options_list . '</select><a id="geodir_dummy_insert" class="button_insert" href="javascript:void(0);" onclick="geodir_autoinstall(this,\'geodir_dummy_insert\',\'' . $nonce . '\',\'' . $post_type . '\')"   redirect_to="' . $geodir_url . '" >' . INSERT_BTN_SAMPLE_MSG . '</a></p></div>';
483
-                $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_IMPORT_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /><br><span class="dummy_post_inserted"></span></div>';
482
+                $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>'.AUTO_INSATALL_MSG.'</b><br /><select class="selected_sample_data">'.$options_list.'</select><a id="geodir_dummy_insert" class="button_insert" href="javascript:void(0);" onclick="geodir_autoinstall(this,\'geodir_dummy_insert\',\''.$nonce.'\',\''.$post_type.'\')"   redirect_to="'.$geodir_url.'" >'.INSERT_BTN_SAMPLE_MSG.'</a></p></div>';
483
+                $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>'.GEODIR_SAMPLE_DATA_IMPORT_MSG.'</b><br><img src="'.geodir_plugin_url().'/geodirectory-assets/images/loadingAnimation.gif" /><br><span class="dummy_post_inserted"></span></div>';
484 484
 
485 485
             }
486 486
             echo $dummy_msg;
@@ -488,14 +488,14 @@  discard block
 block discarded – undo
488 488
             <script>
489 489
                 <?php
490 490
                   $default_location = geodir_get_default_location();
491
-                  $city =  isset($default_location->city) ? $default_location->city : '';
492
-                  $region =isset($default_location->region) ? $default_location->region : '';
493
-                  $country =isset($default_location->country) ? $default_location->country : '';
494
-                  $city_latitude =isset($default_location->city_latitude) ? $default_location->city_latitude : '';
495
-                  $city_longitude =isset($default_location->city_longitude) ? $default_location->city_longitude : '';
491
+                  $city = isset($default_location->city) ? $default_location->city : '';
492
+                  $region = isset($default_location->region) ? $default_location->region : '';
493
+                  $country = isset($default_location->country) ? $default_location->country : '';
494
+                  $city_latitude = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
495
+                  $city_longitude = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
496 496
                 ?>
497 497
                 var geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
498
-                var CITY_ADDRESS = '<?php echo $city.','.$region.','.$country;?>';
498
+                var CITY_ADDRESS = '<?php echo $city.','.$region.','.$country; ?>';
499 499
                 var bound_lat_lng;
500 500
                 var latlng = ['<?php echo $city_latitude; ?>', <?php echo $city_longitude; ?>];
501 501
                 var lat = <?php echo $city_latitude; ?>;
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
                                 );
539 539
 
540 540
                             } else {
541
-                                alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status);
541
+                                alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status);
542 542
                             }
543 543
                         });
544 544
                 }
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                     var total_dummy_post_count = jQuery('#sub_' + active_tab).find('.selected_sample_data').val();
552 552
 
553 553
                     if (id == 'geodir_dummy_delete') {
554
-                        if (confirm('<?php _e('Are you sure you want to delete dummy data?' , 'geodirectory'); ?>')) {
554
+                        if (confirm('<?php _e('Are you sure you want to delete dummy data?', 'geodirectory'); ?>')) {
555 555
                             jQuery('#sub_' + active_tab).find('.geodir_auto_install').hide();
556 556
                             jQuery('#sub_' + active_tab).find('.geodir_show_progress').show();
557 557
                             jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&_wpnonce=' + nonce,
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
                         jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&insert_dummy_post_index=' + dummy_post_index + '&city_bound_lat1=' + bound_lat_lng[0] + '&city_bound_lng1=' + bound_lat_lng[1] + '&city_bound_lat2=' + bound_lat_lng[2] + '&city_bound_lng2=' + bound_lat_lng[3] + '&_wpnonce=' + nonce,
571 571
                             function (data) {
572 572
 
573
-                                jQuery(obj).closest('form').find('.dummy_post_inserted').html('<?php _e('Dummy post(s) inserted:','geodirectory');?> ' + dummy_post_index + ' <?php _e('of' ,'geodirectory'); ?> ' + total_dummy_post_count + '');
573
+                                jQuery(obj).closest('form').find('.dummy_post_inserted').html('<?php _e('Dummy post(s) inserted:', 'geodirectory'); ?> ' + dummy_post_index + ' <?php _e('of', 'geodirectory'); ?> ' + total_dummy_post_count + '');
574 574
                                 dummy_post_index++;
575 575
                                 if (dummy_post_index <= total_dummy_post_count)
576 576
                                     geodir_autoinstall(obj, id, nonce, posttype);
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
     global $wpdb, $plugin_prefix;
628 628
 
629 629
 
630
-    $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'");
630
+    $post_ids = $wpdb->get_results("SELECT post_id FROM ".$plugin_prefix."gd_place_detail WHERE post_dummy='1'");
631 631
 
632 632
 
633 633
     foreach ($post_ids as $post_ids_obj) {
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
     }
636 636
 
637 637
     //double check posts are deleted
638
-    $wpdb->get_results("DELETE FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'");
638
+    $wpdb->get_results("DELETE FROM ".$plugin_prefix."gd_place_detail WHERE post_dummy='1'");
639 639
 }
640 640
 
641 641
 /**
@@ -673,14 +673,14 @@  discard block
 block discarded – undo
673 673
 
674 674
 
675 675
                     if (geodir_dummy_folder_exists())
676
-                        $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon";
676
+                        $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon";
677 677
                     else
678 678
                         $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon';
679 679
 
680 680
                     $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url);
681 681
 
682 682
                     $catname = str_replace(' ', '_', $catname);
683
-                    $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
683
+                    $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png");
684 684
 
685 685
                     if (empty($uploaded['error'])) {
686 686
                         $new_path = $uploaded['file'];
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
                     $wp_filetype = wp_check_filetype(basename($new_path), null);
691 691
 
692 692
                     $attachment = array(
693
-                        'guid' => $uploads['baseurl'] . '/' . basename($new_path),
693
+                        'guid' => $uploads['baseurl'].'/'.basename($new_path),
694 694
                         'post_mime_type' => $wp_filetype['type'],
695 695
                         'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)),
696 696
                         'post_content' => '',
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 
701 701
                     // you must first include the image.php file
702 702
                     // for the function wp_generate_attachment_metadata() to work
703
-                    require_once(ABSPATH . 'wp-admin/includes/image.php');
703
+                    require_once(ABSPATH.'wp-admin/includes/image.php');
704 704
                     $attach_data = wp_generate_attachment_metadata($attach_id, $new_path);
705 705
                     wp_update_attachment_metadata($attach_id, $attach_data);
706 706
 
@@ -717,14 +717,14 @@  discard block
 block discarded – undo
717 717
                 $last_catid = wp_insert_term($catname, 'gd_placecategory');
718 718
 
719 719
                 if (geodir_dummy_folder_exists())
720
-                    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon";
720
+                    $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon";
721 721
                 else
722 722
                     $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon';
723 723
 
724 724
                 $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url);
725 725
 
726 726
                 $catname = str_replace(' ', '_', $catname);
727
-                $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
727
+                $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png");
728 728
 
729 729
                 if (empty($uploaded['error'])) {
730 730
                     $new_path = $uploaded['file'];
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
                 $wp_filetype = wp_check_filetype(basename($new_path), null);
735 735
 
736 736
                 $attachment = array(
737
-                    'guid' => $uploads['baseurl'] . '/' . basename($new_path),
737
+                    'guid' => $uploads['baseurl'].'/'.basename($new_path),
738 738
                     'post_mime_type' => $wp_filetype['type'],
739 739
                     'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)),
740 740
                     'post_content' => '',
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 
747 747
                 // you must first include the image.php file
748 748
                 // for the function wp_generate_attachment_metadata() to work
749
-                require_once(ABSPATH . 'wp-admin/includes/image.php');
749
+                require_once(ABSPATH.'wp-admin/includes/image.php');
750 750
                 $attach_data = wp_generate_attachment_metadata($attach_id, $new_path);
751 751
                 wp_update_attachment_metadata($attach_id, $attach_data);
752 752
 
@@ -788,18 +788,18 @@  discard block
 block discarded – undo
788 788
 
789 789
         elseif (isset($value['type']) && $value['type'] == 'image_width') :
790 790
 
791
-            if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) {
792
-                update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']);
793
-                update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']);
794
-                if (isset($_POST[$value['id'] . '_crop'])) :
795
-                    update_option($value['id'] . '_crop', 1);
791
+            if (isset($value['id']) && isset($_POST[$value['id'].'_width'])) {
792
+                update_option($value['id'].'_width', $_POST[$value['id'].'_width']);
793
+                update_option($value['id'].'_height', $_POST[$value['id'].'_height']);
794
+                if (isset($_POST[$value['id'].'_crop'])) :
795
+                    update_option($value['id'].'_crop', 1);
796 796
                 else :
797
-                    update_option($value['id'] . '_crop', 0);
797
+                    update_option($value['id'].'_crop', 0);
798 798
                 endif;
799 799
             } else {
800
-                update_option($value['id'] . '_width', $value['std']);
801
-                update_option($value['id'] . '_height', $value['std']);
802
-                update_option($value['id'] . '_crop', 1);
800
+                update_option($value['id'].'_width', $value['std']);
801
+                update_option($value['id'].'_height', $value['std']);
802
+                update_option($value['id'].'_crop', 1);
803 803
             }
804 804
 
805 805
         elseif (isset($value['type']) && $value['type'] == 'map') :
@@ -841,12 +841,12 @@  discard block
 block discarded – undo
841 841
         elseif (isset($value['type']) && $value['type'] == 'file') :
842 842
 
843 843
 
844
-            if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file
844
+            if (isset($_POST[$value['id'].'_remove']) && $_POST[$value['id'].'_remove']) {// if remove is set then remove the file
845 845
 
846 846
                 if (get_option($value['id'])) {
847 847
                     $image_name_arr = explode('/', get_option($value['id']));
848 848
                     $noimg_name = end($image_name_arr);
849
-                    $img_path = $uploads['path'] . '/' . $noimg_name;
849
+                    $img_path = $uploads['path'].'/'.$noimg_name;
850 850
                     if (file_exists($img_path))
851 851
                         unlink($img_path);
852 852
                 }
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
                 if (get_option($value['id'])) {
875 875
                     $image_name_arr = explode('/', get_option($value['id']));
876 876
                     $noimg_name = end($image_name_arr);
877
-                    $img_path = $uploads['path'] . '/' . $noimg_name;
877
+                    $img_path = $uploads['path'].'/'.$noimg_name;
878 878
                     if (file_exists($img_path))
879 879
                         unlink($img_path);
880 880
                 }
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
             // same menu setting per theme.
896 896
             if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) {
897 897
                 $theme = wp_get_theme();
898
-                update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]);
898
+                update_option('geodir_theme_location_nav_'.$theme->name, $_POST[$value['id']]);
899 899
             }
900 900
 
901 901
             if (isset($value['id']) && isset($_POST[$value['id']])) {
@@ -965,8 +965,8 @@  discard block
 block discarded – undo
965 965
 
966 966
             $listing_slug = $geodir_posttype_info['labels']['singular_name'];
967 967
 
968
-            $tabs[$geodir_post_type . '_fields_settings'] = array(
969
-                'label' => __(ucfirst($listing_slug) . ' Settings', 'geodirectory'),
968
+            $tabs[$geodir_post_type.'_fields_settings'] = array(
969
+                'label' => __(ucfirst($listing_slug).' Settings', 'geodirectory'),
970 970
                 'subtabs' => array(
971 971
                     array('subtab' => 'custom_fields',
972 972
                         'label' => __('Custom Fields', 'geodirectory'),
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
  */
1033 1033
 function geodir_extend_geodirectory_setting_tab($tabs)
1034 1034
 {
1035
-    $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank');
1035
+    $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory').' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank');
1036 1036
     return $tabs;
1037 1037
 }
1038 1038
 
@@ -1092,8 +1092,8 @@  discard block
 block discarded – undo
1092 1092
                     _e('Unknown', 'geodirectory');
1093 1093
                 } else {
1094 1094
                     /* If there is a city id, append 'city name' to the text string. */
1095
-                    $add_location_id = $location_id > 0 ? ' (' . $location_id . ')' : '';
1096
-                    echo(__($location->country, 'geodirectory') . '-' . $location->region . '-' . $location->city . $add_location_id);
1095
+                    $add_location_id = $location_id > 0 ? ' ('.$location_id.')' : '';
1096
+                    echo(__($location->country, 'geodirectory').'-'.$location->region.'-'.$location->city.$add_location_id);
1097 1097
                 }
1098 1098
                 break;
1099 1099
 
@@ -1111,14 +1111,14 @@  discard block
 block discarded – undo
1111 1111
                         $expire_class = 'expire_over';
1112 1112
                     }
1113 1113
                     $date_diff = round(abs(strtotime($d1) - strtotime($d2)) / 86400); // get the difference in days
1114
-                    $date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>';
1114
+                    $date_diff_text = '<br /><span class="'.$expire_class.'">('.$date_diff.' '.$state.')</span>';
1115 1115
                 }
1116 1116
                 /* If no expire_date is found, output a default message. */
1117 1117
                 if (empty($expire_date))
1118 1118
                     echo __('Unknown', 'geodirectory');
1119 1119
                 /* If there is a expire_date, append 'days left' to the text string. */
1120 1120
                 else
1121
-                    echo $expire_date . $date_diff_text;
1121
+                    echo $expire_date.$date_diff_text;
1122 1122
                 break;
1123 1123
 
1124 1124
             /* If displaying the 'categorys' column. */
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
 function geodir_post_information_save($post_id, $post) {
1186 1186
     global $wpdb, $current_user;
1187 1187
 
1188
-    if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) {
1188
+    if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) {
1189 1189
         return;
1190 1190
     }
1191 1191
 
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
                     $tab_id = $value['id'];
1254 1254
 
1255 1255
                 if (isset($value['desc']) && $value['desc'])
1256
-                    $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>';
1256
+                    $desc = '<span style=" text-transform:none;">:- '.$value['desc'].'</span>';
1257 1257
 
1258 1258
                 if (isset($value['name']) && $value['name']) {
1259 1259
                     if ($first_title === true) {
@@ -1261,9 +1261,9 @@  discard block
 block discarded – undo
1261 1261
                     } else {
1262 1262
                         echo '</div>';
1263 1263
                     }
1264
-                    echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>';
1264
+                    echo '<dd id="'.trim($tab_id).'" class="geodir_option_tabs" ><a href="javascript:void(0);">'.$value['name'].'</a></dd>';
1265 1265
 
1266
-                    echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >';
1266
+                    echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >';
1267 1267
                 }
1268 1268
 
1269 1269
                 /**
@@ -1273,21 +1273,21 @@  discard block
 block discarded – undo
1273 1273
                  *
1274 1274
                  * @since 1.0.0
1275 1275
                  */
1276
-                do_action('geodir_settings_' . sanitize_title($value['id']));
1276
+                do_action('geodir_settings_'.sanitize_title($value['id']));
1277 1277
                 break;
1278 1278
 
1279 1279
             case 'no_tabs':
1280 1280
 
1281 1281
                 echo '<div class="inner_content_tab_main">';
1282
-                echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >';
1282
+                echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >';
1283 1283
 
1284 1284
                 break;
1285 1285
 
1286 1286
             case 'sectionstart':
1287 1287
                 if (isset($value['desc']) && $value['desc'])
1288
-                    $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>';
1288
+                    $desc = '<span style=" text-transform:none;"> - '.$value['desc'].'</span>';
1289 1289
                 if (isset($value['name']) && $value['name'])
1290
-                    echo '<h3>' . $value['name'] . $desc . '</h3>';
1290
+                    echo '<h3>'.$value['name'].$desc.'</h3>';
1291 1291
                 /**
1292 1292
                  * Called after a GeoDirectory settings sectionstart is output in the GD settings page.
1293 1293
                  *
@@ -1295,8 +1295,8 @@  discard block
 block discarded – undo
1295 1295
                  *
1296 1296
                  * @since 1.0.0
1297 1297
                  */
1298
-                if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start');
1299
-                echo '<table class="form-table">' . "\n\n";
1298
+                if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_start');
1299
+                echo '<table class="form-table">'."\n\n";
1300 1300
 
1301 1301
                 break;
1302 1302
             case 'sectionend':
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
                  *
1308 1308
                  * @since 1.0.0
1309 1309
                  */
1310
-                if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
1310
+                if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_end');
1311 1311
                 echo '</table>';
1312 1312
                 /**
1313 1313
                  * Called after a GeoDirectory settings sectionend is output in the GD settings page.
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
                  *
1317 1317
                  * @since 1.0.0
1318 1318
                  */
1319
-                if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
1319
+                if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_after');
1320 1320
                 break;
1321 1321
             case 'text':
1322 1322
                 ?>
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
                 <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>"
1326 1326
                                            id="<?php echo esc_attr($value['id']); ?>"
1327 1327
                                            type="<?php echo esc_attr($value['type']); ?>"
1328
-                                           <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1328
+                                           <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1329 1329
                                            style=" <?php echo esc_attr($value['css']); ?>"
1330 1330
                                            value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
1331 1331
                                                echo esc_attr(stripslashes(get_option($value['id'])));
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
                 <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>"
1343 1343
                                            id="<?php echo esc_attr($value['id']); ?>"
1344 1344
                                            type="<?php echo esc_attr($value['type']); ?>"
1345
-                                           <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1345
+                                           <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1346 1346
                                            style="<?php echo esc_attr($value['css']); ?>"
1347 1347
                                            value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
1348 1348
                                                echo esc_attr(stripslashes(get_option($value['id'])));
@@ -1388,17 +1388,17 @@  discard block
 block discarded – undo
1388 1388
                     <?php _e('Width', 'geodirectory'); ?> <input
1389 1389
                         name="<?php echo esc_attr($value['id']); ?>_width"
1390 1390
                         id="<?php echo esc_attr($value['id']); ?>_width" type="text" size="3"
1391
-                        value="<?php if ($size = get_option($value['id'] . '_width')) echo stripslashes($size); else echo $value['std']; ?>"/>
1391
+                        value="<?php if ($size = get_option($value['id'].'_width')) echo stripslashes($size); else echo $value['std']; ?>"/>
1392 1392
 
1393 1393
                     <?php _e('Height', 'geodirectory'); ?> <input
1394 1394
                         name="<?php echo esc_attr($value['id']); ?>_height"
1395 1395
                         id="<?php echo esc_attr($value['id']); ?>_height" type="text" size="3"
1396
-                        value="<?php if ($size = get_option($value['id'] . '_height')) echo stripslashes($size); else echo $value['std']; ?>"/>
1396
+                        value="<?php if ($size = get_option($value['id'].'_height')) echo stripslashes($size); else echo $value['std']; ?>"/>
1397 1397
 
1398 1398
                     <label><?php _e('Hard Crop', 'geodirectory'); ?> <input
1399 1399
                             name="<?php echo esc_attr($value['id']); ?>_crop"
1400 1400
                             id="<?php echo esc_attr($value['id']); ?>_crop"
1401
-                            type="checkbox" <?php if (get_option($value['id'] . '_crop') != '') checked(get_option($value['id'] . '_crop'), 1); else checked(1); ?> /></label>
1401
+                            type="checkbox" <?php if (get_option($value['id'].'_crop') != '') checked(get_option($value['id'].'_crop'), 1); else checked(1); ?> /></label>
1402 1402
 
1403 1403
                     <span class="description"><?php echo $value['desc'] ?></span></td>
1404 1404
                 </tr><?php
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
                                             id="<?php echo esc_attr($value['id']); ?>"
1449 1449
                                             style="<?php echo esc_attr($value['css']); ?>"
1450 1450
                                             class="<?php if (isset($value['class'])) echo $value['class']; ?>"
1451
-                                            data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>"
1451
+                                            data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text']; ?>"
1452 1452
                                             option-ajaxchosen="false">
1453 1453
                         <?php
1454 1454
                         foreach ($value['options'] as $key => $val) {
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
                             } else {
1460 1460
                                 ?>
1461 1461
                                 <option
1462
-                                    value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values)));?>><?php echo ucfirst($val) ?></option>
1462
+                                    value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values))); ?>><?php echo ucfirst($val) ?></option>
1463 1463
                             <?php
1464 1464
                             }
1465 1465
                         }
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
                 ?>
1495 1495
 
1496 1496
                 <tr valign="top">
1497
-                    <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory');?></th>
1497
+                    <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory'); ?></th>
1498 1498
                     <td width="60%">
1499 1499
                         <select name="geodir_default_map_language" style="width:60%">
1500 1500
                             <?php
@@ -1576,7 +1576,7 @@  discard block
 block discarded – undo
1576 1576
 
1577 1577
                 <tr valign="top">
1578 1578
                     <th class="titledesc"
1579
-                        width="40%"><?php _e('Default post type search on map', 'geodirectory');?></th>
1579
+                        width="40%"><?php _e('Default post type search on map', 'geodirectory'); ?></th>
1580 1580
                     <td width="60%">
1581 1581
                         <select name="geodir_default_map_search_pt" style="width:60%">
1582 1582
                             <?php
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
                         $cat_display = 'checkbox';
1618 1618
                         $gd_post_types = get_option('geodir_exclude_post_type_on_map');
1619 1619
                         $gd_cats = get_option('geodir_exclude_cat_on_map');
1620
-                        $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade');
1620
+                        $gd_cats_upgrade = (int) get_option('geodir_exclude_cat_on_map_upgrade');
1621 1621
                         $count = 1;
1622 1622
                         ?>
1623 1623
                         <table width="70%" class="widefat">
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
                                                                                            name="home_map_post_types[]"
1647 1647
                                                                                            id="<?php echo esc_attr($value['id']); ?>"
1648 1648
                                                                                            value="<?php echo $key; ?>"
1649
-                                                                                           class="map_post_type" <?php echo $checked;?> />
1649
+                                                                                           class="map_post_type" <?php echo $checked; ?> />
1650 1650
                                         <?php echo $post_types_obj->labels->singular_name; ?></td>
1651 1651
                                     <td width="40%">
1652 1652
                                         <div class="home_map_category" style="overflow:auto;width:200px;height:100px;"
@@ -1704,12 +1704,12 @@  discard block
 block discarded – undo
1704 1704
                 ?>
1705 1705
                 <fieldset>
1706 1706
                     <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend>
1707
-                    <label for="<?php echo $value['id'];?>">
1707
+                    <label for="<?php echo $value['id']; ?>">
1708 1708
                         <input name="<?php echo esc_attr($value['id']); ?>"
1709
-                               id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio"
1709
+                               id="<?php echo esc_attr($value['id'].$value['value']); ?>" type="radio"
1710 1710
                                value="<?php echo $value['value'] ?>" <?php if (get_option($value['id']) == $value['value']) {
1711 1711
                             echo 'checked="checked"';
1712
-                        }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
1712
+                        }elseif (get_option($value['id']) == '' && $value['std'] == $value['value']) {echo 'checked="checked"'; } ?> />
1713 1713
                         <?php echo $value['desc']; ?></label><br>
1714 1714
                 </fieldset>
1715 1715
                 <?php
@@ -1729,9 +1729,9 @@  discard block
 block discarded – undo
1729 1729
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1730 1730
                 <td class="forminp">
1731 1731
                     <textarea
1732
-                        <?php if (isset($value['args'])) echo $value['args'] . ' '; ?>name="<?php echo esc_attr($value['id']); ?>"
1732
+                        <?php if (isset($value['args'])) echo $value['args'].' '; ?>name="<?php echo esc_attr($value['id']); ?>"
1733 1733
                         id="<?php echo esc_attr($value['id']); ?>"
1734
-                        <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1734
+                        <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1735 1735
                         style="<?php echo esc_attr($value['css']); ?>"><?php if (get_option($value['id'])) echo esc_textarea(stripslashes(get_option($value['id']))); else echo esc_textarea($value['std']); ?></textarea><span
1736 1736
                         class="description"><?php echo $value['desc'] ?></span>
1737 1737
 
@@ -1776,7 +1776,7 @@  discard block
 block discarded – undo
1776 1776
 					}
1777 1777
 				}
1778 1778
 				//
1779
-				$page_setting = (int)get_option($value['id']);
1779
+				$page_setting = (int) get_option($value['id']);
1780 1780
 
1781 1781
                 $args = array('name' => $value['id'],
1782 1782
                     'id' => $value['id'],
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
                 <tr valign="top" class="single_select_page">
1794 1794
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1795 1795
                 <td class="forminp">
1796
-                    <?php echo str_replace(' id=', " data-placeholder='" . __('Select a page...', 'geodirectory') . "' style='" . $value['css'] . "' class='" . $value['class'] . "' " . $disabled . " id=", wp_dropdown_pages($args)); ?>
1796
+                    <?php echo str_replace(' id=', " data-placeholder='".__('Select a page...', 'geodirectory')."' style='".$value['css']."' class='".$value['class']."' ".$disabled." id=", wp_dropdown_pages($args)); ?>
1797 1797
                     <span class="description"><?php echo $value['desc'] ?></span>
1798 1798
                 </td>
1799 1799
                 </tr><?php
@@ -1802,7 +1802,7 @@  discard block
 block discarded – undo
1802 1802
 				}
1803 1803
                 break;
1804 1804
             case 'single_select_country' :
1805
-                $country_setting = (string)get_option($value['id']);
1805
+                $country_setting = (string) get_option($value['id']);
1806 1806
                 if (strstr($country_setting, ':')) :
1807 1807
                     $country = current(explode(':', $country_setting));
1808 1808
                     $state = end(explode(':', $country_setting));
@@ -1825,7 +1825,7 @@  discard block
 block discarded – undo
1825 1825
             case 'multi_select_countries' :
1826 1826
                 $countries = $geodirectory->countries->countries;
1827 1827
                 asort($countries);
1828
-                $selections = (array)get_option($value['id']);
1828
+                $selections = (array) get_option($value['id']);
1829 1829
                 ?>
1830 1830
                 <tr valign="top">
1831 1831
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
@@ -1835,7 +1835,7 @@  discard block
 block discarded – undo
1835 1835
                             title="Country" class="chosen_select">
1836 1836
                         <?php
1837 1837
                         if ($countries) foreach ($countries as $key => $val) :
1838
-                            echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>';
1838
+                            echo '<option value="'.$key.'" '.selected(in_array($key, $selections), true, false).'>'.$val.'</option>';
1839 1839
                         endforeach;
1840 1840
                         ?>
1841 1841
                     </select>
@@ -1847,8 +1847,8 @@  discard block
 block discarded – undo
1847 1847
                 break;
1848 1848
 
1849 1849
             case 'google_analytics' :
1850
-                $selections = (array)get_option($value['id']);
1851
-                if(get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret') ) {
1850
+                $selections = (array) get_option($value['id']);
1851
+                if (get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret')) {
1852 1852
                     ?>
1853 1853
                     <tr valign="top">
1854 1854
                         <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
@@ -1859,20 +1859,20 @@  discard block
 block discarded – undo
1859 1859
 
1860 1860
                             $oAuthURL = "https://accounts.google.com/o/oauth2/auth?";
1861 1861
                             $scope = "scope=https://www.googleapis.com/auth/analytics.readonly";
1862
-                            $state = "&state=123";//any string
1863
-                            $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
1862
+                            $state = "&state=123"; //any string
1863
+                            $redirect_uri = "&redirect_uri=".admin_url('admin-ajax.php')."?action=geodir_ga_callback";
1864 1864
                             $response_type = "&response_type=code";
1865 1865
                             $client_id = "&client_id=".get_option('geodir_ga_client_id');
1866 1866
                             $access_type = "&access_type=offline";
1867 1867
                             $approval_prompt = "&approval_prompt=force";
1868 1868
 
1869
-                            $auth_url = $oAuthURL . $scope . $state . $redirect_uri . $response_type . $client_id . $access_type . $approval_prompt;
1869
+                            $auth_url = $oAuthURL.$scope.$state.$redirect_uri.$response_type.$client_id.$access_type.$approval_prompt;
1870 1870
 
1871 1871
 
1872 1872
                             ?>
1873 1873
                             <script>
1874 1874
                                 function gd_ga_popup() {
1875
-                                    var win = window.open("<?php echo $auth_url;?>", "Google Analytics", "");
1875
+                                    var win = window.open("<?php echo $auth_url; ?>", "Google Analytics", "");
1876 1876
                                     var pollTimer = window.setInterval(function () {
1877 1877
                                         if (win.closed !== false) { // !== is required for compatibility with Opera
1878 1878
                                             window.clearInterval(pollTimer);
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
                             } else {
1895 1895
                                 ?>
1896 1896
                                 <span class="button-primary"
1897
-                                      onclick="gd_ga_popup();"><?php _e('Authorize', 'geodirectory');?></span>
1897
+                                      onclick="gd_ga_popup();"><?php _e('Authorize', 'geodirectory'); ?></span>
1898 1898
                             <?php
1899 1899
                             }
1900 1900
                             ?>
@@ -1965,9 +1965,9 @@  discard block
 block discarded – undo
1965 1965
 
1966 1966
             <?php if (isset($_REQUEST['active_tab']) && $_REQUEST['active_tab'] != '') { ?>
1967 1967
             jQuery('.geodir_option_tabs').removeClass('gd-tab-active');
1968
-            jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').addClass('gd-tab-active');
1968
+            jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').addClass('gd-tab-active');
1969 1969
             jQuery('.gd-content-heading').hide();
1970
-            jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').show();
1970
+            jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').show();
1971 1971
             <?php } ?>
1972 1972
         });
1973 1973
     </script>
@@ -2053,7 +2053,7 @@  discard block
 block discarded – undo
2053 2053
     wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename');
2054 2054
 
2055 2055
     if (geodir_get_featured_image($post_id, 'thumbnail')) {
2056
-        echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>';
2056
+        echo '<h4>'.__('Featured Image', 'geodirectory').'</h4>';
2057 2057
         geodir_show_featured_image($post_id, 'thumbnail');
2058 2058
     }
2059 2059
 
@@ -2064,13 +2064,13 @@  discard block
 block discarded – undo
2064 2064
 
2065 2065
     <h5 class="form_title">
2066 2066
         <?php if ($image_limit != 0 && $image_limit == 1) {
2067
-            echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2067
+            echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2068 2068
         } ?>
2069 2069
         <?php if ($image_limit != 0 && $image_limit > 1) {
2070
-            echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2070
+            echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2071 2071
         } ?>
2072 2072
         <?php if ($image_limit == 0) {
2073
-            echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2073
+            echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2074 2074
         } ?>
2075 2075
     </h5>
2076 2076
 
@@ -2109,10 +2109,10 @@  discard block
 block discarded – undo
2109 2109
         <div
2110 2110
             class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2111 2111
             id="<?php echo $id; ?>plupload-upload-ui">
2112
-            <h4><?php _e('Drop files to upload', 'geodirectory');?></h4>
2112
+            <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4>
2113 2113
             <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2114 2114
                    value="<?php _e('Select Files', 'geodirectory'); ?>" class="button"/>
2115
-            <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2115
+            <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2116 2116
             <?php if ($width && $height): ?>
2117 2117
                 <span class="plupload-resize"></span>
2118 2118
                 <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2124,7 +2124,7 @@  discard block
 block discarded – undo
2124 2124
              id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2125 2125
         </div>
2126 2126
         <span
2127
-            id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2127
+            id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2128 2128
         <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2129 2129
     </div>
2130 2130
 
@@ -2334,9 +2334,9 @@  discard block
 block discarded – undo
2334 2334
     $plugin = 'avada-nag';
2335 2335
     $timestamp = 'avada-nag1234';
2336 2336
     $message = __('Welcome to GeoDirectory, please have a look <a href="https://docs.wpgeodirectory.com/category/getting-started/" target="_blank">here</a> to get started. :)', 'geodirectory');
2337
-    echo '<div id="' . $timestamp . '"  class="error">';
2338
-    echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\'' . $plugin . '\',\'' . $timestamp . '\');" ><i class="fa fa-times"></i></span>';
2339
-    echo "<img class='gd-icon-noti' src='" . plugin_dir_url('') . "geodirectory/geodirectory-assets/images/favicon.ico' > ";
2337
+    echo '<div id="'.$timestamp.'"  class="error">';
2338
+    echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\''.$plugin.'\',\''.$timestamp.'\');" ><i class="fa fa-times"></i></span>';
2339
+    echo "<img class='gd-icon-noti' src='".plugin_dir_url('')."geodirectory/geodirectory-assets/images/favicon.ico' > ";
2340 2340
     echo "<p>$message</p>";
2341 2341
     echo "</div>";
2342 2342
 
@@ -2469,7 +2469,7 @@  discard block
 block discarded – undo
2469 2469
 		
2470 2470
 		// Don't allow same slug url for listing and location
2471 2471
 		if (geodir_strtolower($listing_prefix) == geodir_strtolower($location_prefix)) {
2472
-			$redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab . '&msg=fail&gderr=21');
2472
+			$redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab.'&msg=fail&gderr=21');
2473 2473
         	wp_redirect($redirect_url);
2474 2474
 			exit;
2475 2475
 		}
@@ -2481,7 +2481,7 @@  discard block
 block discarded – undo
2481 2481
 			$default_language = $sitepress->get_default_language();
2482 2482
 			
2483 2483
 			if ($current_language != 'all' && $current_language != $default_language) {
2484
-				$redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab);
2484
+				$redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab);
2485 2485
 				wp_redirect($redirect_url);
2486 2486
 				exit;
2487 2487
 			}
@@ -2502,11 +2502,11 @@  discard block
 block discarded – undo
2502 2502
 function geodir_hide_admin_preview_button() {
2503 2503
     global $post_type;
2504 2504
     $post_types = geodir_get_posttypes();
2505
-    if(in_array($post_type, $post_types))
2505
+    if (in_array($post_type, $post_types))
2506 2506
         echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
2507 2507
 }
2508
-add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' );
2509
-add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' );
2508
+add_action('admin_head-post-new.php', 'geodir_hide_admin_preview_button');
2509
+add_action('admin_head-post.php', 'geodir_hide_admin_preview_button');
2510 2510
 
2511 2511
 /**
2512 2512
  * Add the tab in left sidebar menu fro import & export page.
@@ -2516,8 +2516,8 @@  discard block
 block discarded – undo
2516 2516
  *
2517 2517
  * @return array Array of tab data.
2518 2518
  */
2519
-function geodir_import_export_tab( $tabs ) {
2520
-	$tabs['import_export'] = array( 'label' => __( 'Import & Export', 'geodirectory' ) );
2519
+function geodir_import_export_tab($tabs) {
2520
+	$tabs['import_export'] = array('label' => __('Import & Export', 'geodirectory'));
2521 2521
     return $tabs;
2522 2522
 }
2523 2523
 
@@ -2531,8 +2531,8 @@  discard block
 block discarded – undo
2531 2531
  * @return string Html content.
2532 2532
  */
2533 2533
 function geodir_import_export_page() {
2534
-	$nonce = wp_create_nonce( 'geodir_import_export_nonce' );
2535
-	$gd_cats_sample_csv = geodir_plugin_url() . '/geodirectory-assets/gd_sample_categories.csv';
2534
+	$nonce = wp_create_nonce('geodir_import_export_nonce');
2535
+	$gd_cats_sample_csv = geodir_plugin_url().'/geodirectory-assets/gd_sample_categories.csv';
2536 2536
     /**
2537 2537
      * Filter sample category data csv file url.
2538 2538
      *
@@ -2541,9 +2541,9 @@  discard block
 block discarded – undo
2541 2541
      *
2542 2542
      * @param string $gd_cats_sample_csv Sample category data csv file url.
2543 2543
      */
2544
-	$gd_cats_sample_csv = apply_filters( 'geodir_export_cats_sample_csv', $gd_cats_sample_csv );
2544
+	$gd_cats_sample_csv = apply_filters('geodir_export_cats_sample_csv', $gd_cats_sample_csv);
2545 2545
 	
2546
-	$gd_posts_sample_csv = geodir_plugin_url() . '/geodirectory-assets/place_listing.csv';
2546
+	$gd_posts_sample_csv = geodir_plugin_url().'/geodirectory-assets/place_listing.csv';
2547 2547
     /**
2548 2548
      * Filter sample post data csv file url.
2549 2549
      *
@@ -2552,15 +2552,15 @@  discard block
 block discarded – undo
2552 2552
      *
2553 2553
      * @param string $gd_posts_sample_csv Sample post data csv file url.
2554 2554
      */
2555
-    $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv );
2555
+    $gd_posts_sample_csv = apply_filters('geodir_export_posts_sample_csv', $gd_posts_sample_csv);
2556 2556
 	
2557
-	$gd_posttypes = geodir_get_posttypes( 'array' );
2557
+	$gd_posttypes = geodir_get_posttypes('array');
2558 2558
 	
2559 2559
 	$gd_posttypes_option = '';
2560
-	foreach ( $gd_posttypes as $gd_posttype => $row ) {
2561
-		$gd_posttypes_option .= '<option value="' . $gd_posttype . '" data-cats="' . (int)geodir_get_terms_count( $gd_posttype ) . '" data-posts="' . (int)geodir_get_posts_count( $gd_posttype ) . '">' . __( $row['labels']['name'], 'geodirectory' ) . '</option>';
2560
+	foreach ($gd_posttypes as $gd_posttype => $row) {
2561
+		$gd_posttypes_option .= '<option value="'.$gd_posttype.'" data-cats="'.(int) geodir_get_terms_count($gd_posttype).'" data-posts="'.(int) geodir_get_posts_count($gd_posttype).'">'.__($row['labels']['name'], 'geodirectory').'</option>';
2562 2562
 	}
2563
-	wp_enqueue_script( 'jquery-ui-progressbar' );
2563
+	wp_enqueue_script('jquery-ui-progressbar');
2564 2564
 	
2565 2565
 	$gd_chunksize_options = array();
2566 2566
 	$gd_chunksize_options[100] = 100;
@@ -2582,49 +2582,49 @@  discard block
 block discarded – undo
2582 2582
      *
2583 2583
      * @param string $gd_chunksize_options Entries options.
2584 2584
      */
2585
-    $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options );
2585
+    $gd_chunksize_options = apply_filters('geodir_export_csv_chunksize_options', $gd_chunksize_options);
2586 2586
 	
2587 2587
 	$gd_chunksize_option = '';
2588 2588
 	foreach ($gd_chunksize_options as $value => $title) {
2589
-		$gd_chunksize_option .= '<option value="' . $value . '" ' . selected($value, 5000, false) . '>' . $title . '</option>';
2589
+		$gd_chunksize_option .= '<option value="'.$value.'" '.selected($value, 5000, false).'>'.$title.'</option>';
2590 2590
 	}
2591 2591
 	
2592 2592
 	$uploads = wp_upload_dir();
2593 2593
 ?>
2594 2594
 </form>
2595 2595
 <div class="inner_content_tab_main gd-import-export">
2596
-  <h3><?php _e( 'GD Import & Export CSV', 'geodirectory' ) ;?></h3>
2597
-  <span class="description"><?php _e( 'Import & export csv for GD listings & categories.', 'geodirectory' ) ;?></span>
2596
+  <h3><?php _e('GD Import & Export CSV', 'geodirectory'); ?></h3>
2597
+  <span class="description"><?php _e('Import & export csv for GD listings & categories.', 'geodirectory'); ?></span>
2598 2598
   <div class="gd-content-heading">
2599 2599
 
2600 2600
   <?php
2601 2601
     ini_set('max_execution_time', 999999);
2602
-    $ini_max_execution_time_check = @ini_get( 'max_execution_time' );
2602
+    $ini_max_execution_time_check = @ini_get('max_execution_time');
2603 2603
     ini_restore('max_execution_time');
2604 2604
 
2605
-    if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting
2605
+    if ($ini_max_execution_time_check != 999999) { // only show these setting to the user if we can't change the ini setting
2606 2606
         ?>
2607 2607
 	<div id="gd_ie_reqs" class="metabox-holder">
2608 2608
       <div class="meta-box-sortables ui-sortable">
2609 2609
         <div class="postbox">
2610
-          <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'PHP Requirements for GD Import & Export CSV', 'geodirectory' );?></span></h3>
2610
+          <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('PHP Requirements for GD Import & Export CSV', 'geodirectory'); ?></span></h3>
2611 2611
           <div class="inside">
2612
-            <span class="description"><?php echo __( 'Note: In case GD import & export csv not working for larger data then please check and configure following php settings.', 'geodirectory' );?></span>
2612
+            <span class="description"><?php echo __('Note: In case GD import & export csv not working for larger data then please check and configure following php settings.', 'geodirectory'); ?></span>
2613 2613
 			<table class="form-table">
2614 2614
 				<thead>
2615 2615
 				  <tr>
2616
-				  	<th><?php _e( 'PHP Settings', 'geodirectory' );?></th><th><?php _e( 'Current Value', 'geodirectory' );?></th><th><?php _e( 'Recommended Value', 'geodirectory' );?></th>
2616
+				  	<th><?php _e('PHP Settings', 'geodirectory'); ?></th><th><?php _e('Current Value', 'geodirectory'); ?></th><th><?php _e('Recommended Value', 'geodirectory'); ?></th>
2617 2617
 				  </tr>
2618 2618
 				</thead>
2619 2619
 				<tbody>
2620 2620
 				  <tr>
2621
-				  	<td>max_input_time</td><td><?php echo @ini_get( 'max_input_time' );?></td><td>3000</td>
2621
+				  	<td>max_input_time</td><td><?php echo @ini_get('max_input_time'); ?></td><td>3000</td>
2622 2622
 				  </tr>
2623 2623
 				  <tr>
2624
-				  	<td>max_execution_time</td><td><?php  echo @ini_get( 'max_execution_time' );?></td><td>3000</td>
2624
+				  	<td>max_execution_time</td><td><?php  echo @ini_get('max_execution_time'); ?></td><td>3000</td>
2625 2625
 				  </tr>
2626 2626
 				  <tr>
2627
-				  	<td>memory_limit</td><td><?php echo @ini_get( 'memory_limit' );?></td><td>256M</td>
2627
+				  	<td>memory_limit</td><td><?php echo @ini_get('memory_limit'); ?></td><td>256M</td>
2628 2628
 				  </tr>
2629 2629
 				</tbody>
2630 2630
 		    </table>
@@ -2636,21 +2636,21 @@  discard block
 block discarded – undo
2636 2636
 	<div id="gd_ie_imposts" class="metabox-holder">
2637 2637
       <div class="meta-box-sortables ui-sortable">
2638 2638
         <div id="gd_ie_im_posts" class="postbox gd-hndle-pbox">
2639
-          <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Listings: Import CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2640
-          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Import CSV', 'geodirectory' );?></span></h3>
2639
+          <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Listings: Import CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2640
+          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Import CSV', 'geodirectory'); ?></span></h3>
2641 2641
           <div class="inside">
2642 2642
             <table class="form-table">
2643 2643
 				<tbody>
2644 2644
 				  <tr>
2645 2645
 					<td class="gd-imex-box">
2646 2646
 						<div class="gd-im-choices">
2647
-						<p><input type="radio" value="update" name="gd_im_choicepost" id="gd_im_pchoice_u" /><label for="gd_im_pchoice_u"><?php _e( 'Update listing if post with post_id already exists.', 'geodirectory' );?></label></p>
2648
-						<p><input type="radio" checked="checked" value="skip" name="gd_im_choicepost" id="gd_im_pchoice_s" /><label for="gd_im_pchoice_s"><?php _e( 'Ignore listing if post with post_id already exists.', 'geodirectory' );?></label></p>
2647
+						<p><input type="radio" value="update" name="gd_im_choicepost" id="gd_im_pchoice_u" /><label for="gd_im_pchoice_u"><?php _e('Update listing if post with post_id already exists.', 'geodirectory'); ?></label></p>
2648
+						<p><input type="radio" checked="checked" value="skip" name="gd_im_choicepost" id="gd_im_pchoice_s" /><label for="gd_im_pchoice_s"><?php _e('Ignore listing if post with post_id already exists.', 'geodirectory'); ?></label></p>
2649 2649
 						</div>
2650 2650
 						<div class="plupload-upload-uic hide-if-no-js" id="gd_im_postplupload-upload-ui">
2651 2651
 							<input type="text" readonly="readonly" name="gd_im_post_file" class="gd-imex-file gd_im_post_file" id="gd_im_post" onclick="jQuery('#gd_im_postplupload-browse-button').trigger('click');" />
2652
-							<input id="gd_im_postplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-pupload button-primary" /><input type="button" value="<?php echo esc_attr( __( 'Download Sample CSV', 'geodirectory' ) );?>" class="button-secondary" name="gd_ie_imposts_sample" id="gd_ie_imposts_sample">
2653
-						<input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv;?>" />
2652
+							<input id="gd_im_postplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-pupload button-primary" /><input type="button" value="<?php echo esc_attr(__('Download Sample CSV', 'geodirectory')); ?>" class="button-secondary" name="gd_ie_imposts_sample" id="gd_ie_imposts_sample">
2653
+						<input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv; ?>" />
2654 2654
 							<?php
2655 2655
 							/**
2656 2656
 							 * Called just after the sample CSV download link.
@@ -2659,7 +2659,7 @@  discard block
 block discarded – undo
2659 2659
 							 */
2660 2660
 							do_action('geodir_sample_csv_download_link');
2661 2661
 							?>
2662
-							<span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_postpluploadan' ); ?>"></span>
2662
+							<span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_postpluploadan'); ?>"></span>
2663 2663
 							<div class="filelist"></div>
2664 2664
 						</div>
2665 2665
 						<span id="gd_im_catupload-error" style="display:none"></span>
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
 							<input type="hidden" id="gd_terminateaction" value="continue"/>
2678 2678
 						</div>
2679 2679
 						<div class="gd-import-progress" id="gd-import-progress" style="display:none">
2680
-							<div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font
2680
+							<div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font
2681 2681
 									id="gd-import-done">0</font> / <font id="gd-import-total">0</font>&nbsp;( <font
2682 2682
 									id="gd-import-perc">0%</font> )
2683 2683
 								<div class="gd-fileprogress"></div>
@@ -2689,10 +2689,10 @@  discard block
 block discarded – undo
2689 2689
                     	<div class="gd-imex-btns" style="display:none;">
2690 2690
                         	<input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/>
2691 2691
                         	<input onclick="gd_imex_PrepareImport(this, 'post')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" />
2692
-                        	<input onclick="gd_imex_ContinueImport(this, 'post')" type="button" value="<?php _e( "Continue Import Data", 'geodirectory' );?>" id="gd_continue_data" class="button-primary" style="display:none"/>
2693
-                        	<input type="button" value="<?php _e("Terminate Import Data", 'geodirectory');?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'post')"/>
2692
+                        	<input onclick="gd_imex_ContinueImport(this, 'post')" type="button" value="<?php _e("Continue Import Data", 'geodirectory'); ?>" id="gd_continue_data" class="button-primary" style="display:none"/>
2693
+                        	<input type="button" value="<?php _e("Terminate Import Data", 'geodirectory'); ?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'post')"/>
2694 2694
 							<div id="gd_process_data" style="display:none">
2695
-								<span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?>
2695
+								<span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?>
2696 2696
 							</div>
2697 2697
 						</div>
2698 2698
 					</td>
@@ -2706,26 +2706,26 @@  discard block
 block discarded – undo
2706 2706
 	<div id="gd_ie_excategs" class="metabox-holder">
2707 2707
 	  <div class="meta-box-sortables ui-sortable">
2708 2708
 		<div id="gd_ie_ex_posts" class="postbox gd-hndle-pbox">
2709
-		  <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - Listings: Export CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2710
-          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Export CSV', 'geodirectory' );?></span></h3>
2709
+		  <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - Listings: Export CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2710
+          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Export CSV', 'geodirectory'); ?></span></h3>
2711 2711
 		  <div class="inside">
2712 2712
 			<table class="form-table">
2713 2713
 			  <tbody>
2714 2714
 				<tr>
2715 2715
 				  <td class="fld"><label for="gd_post_type">
2716
-					<?php _e( 'Post Type:', 'geodirectory' );?>
2716
+					<?php _e('Post Type:', 'geodirectory'); ?>
2717 2717
 					</label></td>
2718 2718
 				  <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px">
2719
-					  <?php echo $gd_posttypes_option;?>
2719
+					  <?php echo $gd_posttypes_option; ?>
2720 2720
 					</select></td>
2721 2721
 				</tr>
2722 2722
 				<tr>
2723
-					<td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td>
2724
-					<td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option;?></select><span class="description"><?php _e( 'Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory' );?></span></td>
2723
+					<td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td>
2724
+					<td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option; ?></select><span class="description"><?php _e('Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory'); ?></span></td>
2725 2725
 				  </tr>
2726 2726
 				<tr>
2727 2727
 				  <td class="fld" style="vertical-align:top"><label>
2728
-					<?php _e( 'Progress:', 'geodirectory' );?>
2728
+					<?php _e('Progress:', 'geodirectory'); ?>
2729 2729
 					</label></td>
2730 2730
 				  <td><div id='gd_progressbar_box'>
2731 2731
 					  <div id="gd_progressbar" class="gd_progressbar">
@@ -2733,13 +2733,13 @@  discard block
 block discarded – undo
2733 2733
 					  </div>
2734 2734
 					</div>
2735 2735
 					<p style="display:inline-block">
2736
-					  <?php _e( 'Elapsed Time:', 'geodirectory' );?>
2736
+					  <?php _e('Elapsed Time:', 'geodirectory'); ?>
2737 2737
 					</p>
2738 2738
 					  
2739 2739
 					<p id="gd_timer" class="gd_timer">00:00:00</p></td>
2740 2740
 				</tr>
2741 2741
 				<tr class="gd-ie-actions">
2742
-				  <td style="vertical-align:top"><input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_exposts_submit" id="gd_ie_exposts_submit">
2742
+				  <td style="vertical-align:top"><input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_exposts_submit" id="gd_ie_exposts_submit">
2743 2743
 				  </td>
2744 2744
 				  <td id="gd_ie_ex_files" class="gd-ie-files"></td>
2745 2745
 				</tr>
@@ -2752,21 +2752,21 @@  discard block
 block discarded – undo
2752 2752
 	<div id="gd_ie_imcategs" class="metabox-holder">
2753 2753
       <div class="meta-box-sortables ui-sortable">
2754 2754
         <div id="gd_ie_imcats" class="postbox gd-hndle-pbox">
2755
-          <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Categories: Import CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2756
-          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Import CSV', 'geodirectory' );?></span></h3>
2755
+          <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Categories: Import CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2756
+          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Import CSV', 'geodirectory'); ?></span></h3>
2757 2757
           <div class="inside">
2758 2758
             <table class="form-table">
2759 2759
 				<tbody>
2760 2760
 				  <tr>
2761 2761
 					<td class="gd-imex-box">
2762 2762
 						<div class="gd-im-choices">
2763
-						<p><input type="radio" value="update" name="gd_im_choicecat" id="gd_im_cchoice_u" /><label for="gd_im_cchoice_u"><?php _e( 'Update item if item with cat_id/cat_slug already exists.', 'geodirectory' );?></label></p>
2764
-						<p><input type="radio" checked="checked" value="skip" name="gd_im_choicecat" id="gd_im_cchoice_s" /><label for="gd_im_cchoice_s"><?php _e( 'Ignore item if item with cat_id/cat_slug already exists.', 'geodirectory' );?></label></p>
2763
+						<p><input type="radio" value="update" name="gd_im_choicecat" id="gd_im_cchoice_u" /><label for="gd_im_cchoice_u"><?php _e('Update item if item with cat_id/cat_slug already exists.', 'geodirectory'); ?></label></p>
2764
+						<p><input type="radio" checked="checked" value="skip" name="gd_im_choicecat" id="gd_im_cchoice_s" /><label for="gd_im_cchoice_s"><?php _e('Ignore item if item with cat_id/cat_slug already exists.', 'geodirectory'); ?></label></p>
2765 2765
 						</div>
2766 2766
 						<div class="plupload-upload-uic hide-if-no-js" id="gd_im_catplupload-upload-ui">
2767 2767
 							<input type="text" readonly="readonly" name="gd_im_cat_file" class="gd-imex-file gd_im_cat_file" id="gd_im_cat" onclick="jQuery('#gd_im_catplupload-browse-button').trigger('click');" />
2768
-							<input id="gd_im_catplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-cupload button-primary" /><input type="button" value="<?php echo esc_attr( __( 'Download Sample CSV', 'geodirectory' ) );?>" class="button-secondary" name="gd_ie_imcats_sample" id="gd_ie_imcats_sample">
2769
-						<input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv;?>" />
2768
+							<input id="gd_im_catplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-cupload button-primary" /><input type="button" value="<?php echo esc_attr(__('Download Sample CSV', 'geodirectory')); ?>" class="button-secondary" name="gd_ie_imcats_sample" id="gd_ie_imcats_sample">
2769
+						<input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv; ?>" />
2770 2770
 						<?php
2771 2771
 						/**
2772 2772
 						 * Called just after the sample CSV download link.
@@ -2776,7 +2776,7 @@  discard block
 block discarded – undo
2776 2776
 						 */
2777 2777
 						do_action('geodir_sample_cats_csv_download_link');
2778 2778
 						?>
2779
-							<span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_catpluploadan' ); ?>"></span>
2779
+							<span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_catpluploadan'); ?>"></span>
2780 2780
 							<div class="filelist"></div>
2781 2781
 						</div>
2782 2782
 						<span id="gd_im_catupload-error" style="display:none"></span>
@@ -2793,7 +2793,7 @@  discard block
 block discarded – undo
2793 2793
 							<input type="hidden" id="gd_terminateaction" value="continue"/>
2794 2794
 						</div>
2795 2795
 						<div class="gd-import-progress" id="gd-import-progress" style="display:none">
2796
-							<div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font
2796
+							<div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font
2797 2797
 									id="gd-import-done">0</font> / <font id="gd-import-total">0</font>&nbsp;( <font
2798 2798
 									id="gd-import-perc">0%</font> )
2799 2799
 								<div class="gd-fileprogress"></div>
@@ -2805,10 +2805,10 @@  discard block
 block discarded – undo
2805 2805
                     	<div class="gd-imex-btns" style="display:none;">
2806 2806
                         	<input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/>
2807 2807
                         	<input onclick="gd_imex_PrepareImport(this, 'cat')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" />
2808
-                        	<input onclick="gd_imex_ContinueImport(this, 'cat')" type="button" value="<?php _e( "Continue Import Data", 'geodirectory' );?>" id="gd_continue_data" class="button-primary" style="display:none"/>
2809
-                        	<input type="button" value="<?php _e("Terminate Import Data", 'geodirectory');?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'cat')"/>
2808
+                        	<input onclick="gd_imex_ContinueImport(this, 'cat')" type="button" value="<?php _e("Continue Import Data", 'geodirectory'); ?>" id="gd_continue_data" class="button-primary" style="display:none"/>
2809
+                        	<input type="button" value="<?php _e("Terminate Import Data", 'geodirectory'); ?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'cat')"/>
2810 2810
 							<div id="gd_process_data" style="display:none">
2811
-								<span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?>
2811
+								<span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?>
2812 2812
 							</div>
2813 2813
 						</div>
2814 2814
 					</td>
@@ -2822,26 +2822,26 @@  discard block
 block discarded – undo
2822 2822
 	<div id="gd_ie_excategs" class="metabox-holder">
2823 2823
       <div class="meta-box-sortables ui-sortable">
2824 2824
         <div id="gd_ie_ex_cats" class="postbox gd-hndle-pbox">
2825
-          <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Categories: Export CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2826
-          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Export CSV', 'geodirectory' );?></span></h3>
2825
+          <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Categories: Export CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button>
2826
+          <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Export CSV', 'geodirectory'); ?></span></h3>
2827 2827
           <div class="inside">
2828 2828
             <table class="form-table">
2829 2829
 				<tbody>
2830 2830
 				  <tr>
2831
-					<td class="fld"><label for="gd_post_type"><?php _e( 'Post Type:', 'geodirectory' );?></label></td>
2832
-					<td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option;?></select></td>
2831
+					<td class="fld"><label for="gd_post_type"><?php _e('Post Type:', 'geodirectory'); ?></label></td>
2832
+					<td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option; ?></select></td>
2833 2833
 				  </tr>
2834 2834
 				   <tr>
2835
-					<td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td>
2836
-					<td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option;?></select><span class="description"><?php _e( 'Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory' );?></span></td>
2835
+					<td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td>
2836
+					<td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option; ?></select><span class="description"><?php _e('Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory'); ?></span></td>
2837 2837
 				  </tr>
2838 2838
 				  <tr>
2839
-					<td class="fld" style="vertical-align:top"><label><?php _e( 'Progress:', 'geodirectory' );?></label></td>
2840
-					<td><div id='gd_progressbar_box'><div id="gd_progressbar" class="gd_progressbar"><div class="gd-progress-label"></div></div></div><p style="display:inline-block"><?php _e( 'Elapsed Time:', 'geodirectory' );?></p>&nbsp;&nbsp;<p id="gd_timer" class="gd_timer">00:00:00</p></td>
2839
+					<td class="fld" style="vertical-align:top"><label><?php _e('Progress:', 'geodirectory'); ?></label></td>
2840
+					<td><div id='gd_progressbar_box'><div id="gd_progressbar" class="gd_progressbar"><div class="gd-progress-label"></div></div></div><p style="display:inline-block"><?php _e('Elapsed Time:', 'geodirectory'); ?></p>&nbsp;&nbsp;<p id="gd_timer" class="gd_timer">00:00:00</p></td>
2841 2841
 				  </tr>
2842 2842
 				  <tr class="gd-ie-actions">
2843 2843
 					<td style="vertical-align:top">
2844
-						<input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit">
2844
+						<input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit">
2845 2845
 					</td>
2846 2846
 					<td id="gd_ie_ex_files" class="gd-ie-files"></td>
2847 2847
 				  </tr>
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
      * @param array $gd_chunksize_options File chunk size options.
2864 2864
      * @param string $nonce Wordpress security token for GD import & export.
2865 2865
 	 */
2866
-	do_action( 'geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce );
2866
+	do_action('geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce);
2867 2867
 	?>
2868 2868
   </div>
2869 2869
 </div>
@@ -2882,7 +2882,7 @@  discard block
 block discarded – undo
2882 2882
         jQuery.ajax({
2883 2883
             url: ajaxurl,
2884 2884
             type: "POST",
2885
-            data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce;?>',
2885
+            data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce; ?>',
2886 2886
             dataType: 'json',
2887 2887
             cache: false,
2888 2888
             success: function(data) {
@@ -2934,7 +2934,7 @@  discard block
 block discarded – undo
2934 2934
 
2935 2935
         jQuery(cont).find('.filelist .file').remove();
2936 2936
         
2937
-        jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr( PLZ_SELECT_CSV_FILE );?></p>");
2937
+        jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr(PLZ_SELECT_CSV_FILE); ?></p>");
2938 2938
         jQuery('#gd-import-msg', cont).show();
2939 2939
         
2940 2940
         return false;
@@ -2993,7 +2993,7 @@  discard block
 block discarded – undo
2993 2993
     jQuery.ajax({
2994 2994
         url: ajaxurl,
2995 2995
         type: "POST",
2996
-        data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce;?>',
2996
+        data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce; ?>',
2997 2997
         dataType : 'json',
2998 2998
         cache: false,
2999 2999
         success: function (data) {
@@ -3182,27 +3182,27 @@  discard block
 block discarded – undo
3182 3182
 
3183 3183
     var gdMsg = '<p></p>';
3184 3184
     if ( processed > 0 ) {
3185
-        var msgParse = '<p><?php echo addslashes( sprintf( __( 'Total %s item(s) found.', 'geodirectory' ), '%s' ) );?></p>';
3185
+        var msgParse = '<p><?php echo addslashes(sprintf(__('Total %s item(s) found.', 'geodirectory'), '%s')); ?></p>';
3186 3186
         msgParse = msgParse.replace("%s", processed);
3187 3187
         gdMsg += msgParse;
3188 3188
     }
3189 3189
 
3190 3190
     if ( updated > 0 ) {
3191
-        var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) updated.', 'geodirectory' ), '%s', '%d' ) );?></p>';
3191
+        var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) updated.', 'geodirectory'), '%s', '%d')); ?></p>';
3192 3192
         msgParse = msgParse.replace("%s", updated);
3193 3193
         msgParse = msgParse.replace("%d", processed);
3194 3194
         gdMsg += msgParse;
3195 3195
     }
3196 3196
 
3197 3197
     if ( created > 0 ) {
3198
-        var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) added.', 'geodirectory' ), '%s', '%d' ) );?></p>';
3198
+        var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) added.', 'geodirectory'), '%s', '%d')); ?></p>';
3199 3199
         msgParse = msgParse.replace("%s", created);
3200 3200
         msgParse = msgParse.replace("%d", processed);
3201 3201
         gdMsg += msgParse;
3202 3202
     }
3203 3203
 
3204 3204
     if ( skipped > 0 ) {
3205
-        var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) ignored due to already exists.', 'geodirectory' ), '%s', '%d' ) );?></p>';
3205
+        var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) ignored due to already exists.', 'geodirectory'), '%s', '%d')); ?></p>';
3206 3206
         msgParse = msgParse.replace("%s", skipped);
3207 3207
         msgParse = msgParse.replace("%d", processed);
3208 3208
         gdMsg += msgParse;
@@ -3212,17 +3212,17 @@  discard block
 block discarded – undo
3212 3212
         if (type=='loc') {
3213 3213
             invalid_addr = invalid;
3214 3214
         }
3215
-        var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ), '%s', '%d' ) );?></p>';
3215
+        var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory'), '%s', '%d')); ?></p>';
3216 3216
         msgParse = msgParse.replace("%s", invalid_addr);
3217 3217
         msgParse = msgParse.replace("%d", total);
3218 3218
         gdMsg += msgParse;
3219 3219
     }
3220 3220
 
3221 3221
     if (invalid > 0 && type!='loc') {
3222
-        var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to blank title/invalid post type/invalid characters used in data.', 'geodirectory' ), '%s', '%d' ) );?></p>';
3222
+        var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to blank title/invalid post type/invalid characters used in data.', 'geodirectory'), '%s', '%d')); ?></p>';
3223 3223
         
3224 3224
         if (type=='hood') {
3225
-            msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' ), '%s', '%d' ) );?></p>';
3225
+            msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory'), '%s', '%d')); ?></p>';
3226 3226
         }
3227 3227
         msgParse = msgParse.replace("%s", invalid);
3228 3228
         msgParse = msgParse.replace("%d", total);
@@ -3230,7 +3230,7 @@  discard block
 block discarded – undo
3230 3230
     }
3231 3231
 
3232 3232
     if (images > 0) {
3233
-        gdMsg += '<p><?php echo addslashes( sprintf( CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'] ) );?></p>';
3233
+        gdMsg += '<p><?php echo addslashes(sprintf(CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'])); ?></p>';
3234 3234
     }
3235 3235
     gdMsg += '<p></p>';
3236 3236
     jQuery('#gd-import-msg', cont).find('#message').removeClass('error').addClass('updated').html(gdMsg);
@@ -3387,7 +3387,7 @@  discard block
 block discarded – undo
3387 3387
         
3388 3388
     function gd_process_export_posts(el, post_type, total_posts, chunk_size, pages, page) {
3389 3389
         if (page < 2) {
3390
-            gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>');
3390
+            gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
3391 3391
             jQuery(el).find('#gd_timer').text('00:00:01');
3392 3392
             jQuery('#gd_ie_ex_files', el).html('');
3393 3393
         }
@@ -3395,7 +3395,7 @@  discard block
 block discarded – undo
3395 3395
         jQuery.ajax({
3396 3396
             url: ajaxurl,
3397 3397
             type: "POST",
3398
-            data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page,
3398
+            data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page,
3399 3399
             dataType : 'json',
3400 3400
             cache: false,
3401 3401
             beforeSend: function (jqXHR, settings) {},
@@ -3409,11 +3409,11 @@  discard block
 block discarded – undo
3409 3409
                     } else {
3410 3410
                         if (pages < page || pages == page) {
3411 3411
                             window.clearInterval(timer_posts);
3412
-                            gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>');
3412
+                            gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>');
3413 3413
                         } else {
3414 3414
                             var percentage = Math.round(((page * chunk_size) / total_posts) * 100);
3415 3415
                             percentage = percentage > 100 ? 100 : percentage;
3416
-                            gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>');
3416
+                            gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
3417 3417
                         }
3418 3418
                         if (typeof data.files != 'undefined' && jQuery(data.files).length ) {
3419 3419
                             var obj_files = data.files;
@@ -3443,7 +3443,7 @@  discard block
 block discarded – undo
3443 3443
 
3444 3444
     function gd_process_export_cats(el, post_type, total_cats, chunk_size, pages, page) {
3445 3445
         if (page < 2) {
3446
-            gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>');
3446
+            gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
3447 3447
             jQuery(el).find('#gd_timer').text('00:00:01');
3448 3448
             jQuery('#gd_ie_ex_files', el).html('');
3449 3449
         }
@@ -3451,7 +3451,7 @@  discard block
 block discarded – undo
3451 3451
         jQuery.ajax({
3452 3452
             url: ajaxurl,
3453 3453
             type: "POST",
3454
-            data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page,
3454
+            data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page,
3455 3455
             dataType : 'json',
3456 3456
             cache: false,
3457 3457
             beforeSend: function (jqXHR, settings) {},
@@ -3465,11 +3465,11 @@  discard block
 block discarded – undo
3465 3465
                     } else {
3466 3466
                         if (pages < page || pages == page) {
3467 3467
                             window.clearInterval(timer_cats);
3468
-                            gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>');
3468
+                            gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>');
3469 3469
                         } else {
3470 3470
                             var percentage = Math.round(((page * chunk_size) / total_cats) * 100);
3471 3471
                             percentage = percentage > 100 ? 100 : percentage;
3472
-                            gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e( 'Exporting...', 'geodirectory' );?>');
3472
+                            gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e('Exporting...', 'geodirectory'); ?>');
3473 3473
                         }
3474 3474
                         if (typeof data.files != 'undefined' && jQuery(data.files).length ) {
3475 3475
                             var obj_files = data.files;
@@ -3526,13 +3526,13 @@  discard block
 block discarded – undo
3526 3526
 function geodir_init_filesystem()
3527 3527
 {
3528 3528
 
3529
-    if(!function_exists('get_filesystem_method')){
3529
+    if (!function_exists('get_filesystem_method')) {
3530 3530
         require_once(ABSPATH."/wp-admin/includes/file.php");
3531 3531
     }
3532 3532
     $access_type = get_filesystem_method();
3533 3533
     if ($access_type === 'direct') {
3534 3534
         /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */
3535
-        $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array());
3535
+        $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array());
3536 3536
 
3537 3537
         /* initialize the API */
3538 3538
         if (!WP_Filesystem($creds)) {
@@ -3545,7 +3545,7 @@  discard block
 block discarded – undo
3545 3545
         return $wp_filesystem;
3546 3546
         /* do our file manipulations below */
3547 3547
     } elseif (defined('FTP_USER')) {
3548
-        $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array());
3548
+        $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array());
3549 3549
 
3550 3550
         /* initialize the API */
3551 3551
         if (!WP_Filesystem($creds)) {
@@ -3580,7 +3580,7 @@  discard block
 block discarded – undo
3580 3580
  * @package GeoDirectory
3581 3581
  */
3582 3582
 function geodir_filesystem_notice()
3583
-{   if ( defined( 'DOING_AJAX' ) ){return;}
3583
+{   if (defined('DOING_AJAX')) {return; }
3584 3584
     $access_type = get_filesystem_method();
3585 3585
     if ($access_type === 'direct') {
3586 3586
     } elseif (!defined('FTP_USER')) {
@@ -3617,64 +3617,64 @@  discard block
 block discarded – undo
3617 3617
     // try to set higher limits for import
3618 3618
     $max_input_time = ini_get('max_input_time');
3619 3619
     $max_execution_time = ini_get('max_execution_time');
3620
-    $memory_limit= ini_get('memory_limit');
3620
+    $memory_limit = ini_get('memory_limit');
3621 3621
 
3622
-    if(!$max_input_time || $max_input_time<3000){
3622
+    if (!$max_input_time || $max_input_time < 3000) {
3623 3623
         ini_set('max_input_time', 3000);
3624 3624
     }
3625 3625
 
3626
-    if(!$max_execution_time || $max_execution_time<3000){
3626
+    if (!$max_execution_time || $max_execution_time < 3000) {
3627 3627
         ini_set('max_execution_time', 3000);
3628 3628
     }
3629 3629
 
3630
-    if($memory_limit && str_replace('M','',$memory_limit)){
3631
-        if(str_replace('M','',$memory_limit)<256){
3630
+    if ($memory_limit && str_replace('M', '', $memory_limit)) {
3631
+        if (str_replace('M', '', $memory_limit) < 256) {
3632 3632
             ini_set('memory_limit', '256M');
3633 3633
         }
3634 3634
     }
3635 3635
 
3636 3636
     $json = array();
3637 3637
 
3638
-    if ( !current_user_can( 'manage_options' ) ) {
3639
-        wp_send_json( $json );
3638
+    if (!current_user_can('manage_options')) {
3639
+        wp_send_json($json);
3640 3640
     }
3641 3641
 
3642
-    $task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL;
3643
-    $nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL;
3644
-    $stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false;
3642
+    $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : NULL;
3643
+    $nonce = isset($_REQUEST['_nonce']) ? $_REQUEST['_nonce'] : NULL;
3644
+    $stat = isset($_REQUEST['_st']) ? $_REQUEST['_st'] : false;
3645 3645
 
3646
-    if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) {
3647
-        wp_send_json( $json );
3646
+    if (!wp_verify_nonce($nonce, 'geodir_import_export_nonce')) {
3647
+        wp_send_json($json);
3648 3648
     }
3649 3649
 
3650
-    $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL;
3651
-    $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL;
3650
+    $post_type = isset($_REQUEST['_pt']) ? $_REQUEST['_pt'] : NULL;
3651
+    $chunk_per_page = isset($_REQUEST['_n']) ? absint($_REQUEST['_n']) : NULL;
3652 3652
     $chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page;
3653
-    $chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1;
3653
+    $chunk_page_no = isset($_REQUEST['_p']) ? absint($_REQUEST['_p']) : 1;
3654 3654
 
3655 3655
     $wp_filesystem = geodir_init_filesystem();
3656 3656
     if (!$wp_filesystem) {
3657
-        $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' );
3658
-        wp_send_json( $json );
3657
+        $json['error'] = __('Filesystem ERROR: Could not access filesystem.', 'geodirectory');
3658
+        wp_send_json($json);
3659 3659
     }
3660 3660
 
3661 3661
     if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
3662
-        $json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' );
3663
-        wp_send_json( $json );
3662
+        $json['error'] = __('Filesystem ERROR: '.$wp_filesystem->errors->get_error_message(), 'geodirectory');
3663
+        wp_send_json($json);
3664 3664
     }
3665 3665
 
3666
-    $csv_file_dir = geodir_path_import_export( false );
3667
-    if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) {
3668
-        if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) {
3669
-            $json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' );
3670
-            wp_send_json( $json );
3666
+    $csv_file_dir = geodir_path_import_export(false);
3667
+    if (!$wp_filesystem->is_dir($csv_file_dir)) {
3668
+        if (!$wp_filesystem->mkdir($csv_file_dir, FS_CHMOD_DIR)) {
3669
+            $json['error'] = __('ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory');
3670
+            wp_send_json($json);
3671 3671
         }
3672 3672
     }
3673 3673
     
3674 3674
     $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
3675 3675
     $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
3676 3676
 
3677
-    switch ( $task ) {
3677
+    switch ($task) {
3678 3678
         case 'export_posts': {
3679 3679
             // WPML
3680 3680
             $is_wpml = geodir_is_wpml();
@@ -3685,22 +3685,22 @@  discard block
 block discarded – undo
3685 3685
                 $sitepress->switch_lang('all', true);
3686 3686
             }
3687 3687
             // WPML
3688
-            if ( $post_type == 'gd_event' ) {
3689
-                add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 );
3688
+            if ($post_type == 'gd_event') {
3689
+                add_filter('geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2);
3690 3690
             }
3691
-            $file_name = $post_type . '_' . date( 'dmyHi' );
3692
-            $posts_count = geodir_get_posts_count( $post_type );
3693
-            $file_url_base = geodir_path_import_export() . '/';
3694
-            $file_url = $file_url_base . $file_name . '.csv';
3695
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3696
-            $file_path_temp = $csv_file_dir . '/' . $post_type . '_' . $nonce . '.csv';
3691
+            $file_name = $post_type.'_'.date('dmyHi');
3692
+            $posts_count = geodir_get_posts_count($post_type);
3693
+            $file_url_base = geodir_path_import_export().'/';
3694
+            $file_url = $file_url_base.$file_name.'.csv';
3695
+            $file_path = $csv_file_dir.'/'.$file_name.'.csv';
3696
+            $file_path_temp = $csv_file_dir.'/'.$post_type.'_'.$nonce.'.csv';
3697 3697
             
3698 3698
             $chunk_file_paths = array();
3699 3699
 
3700
-            if ( isset( $_REQUEST['_st'] ) ) {
3701
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3702
-                $percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0;
3703
-                $percentage = min( $percentage, 100 );
3700
+            if (isset($_REQUEST['_st'])) {
3701
+                $line_count = (int) geodir_import_export_line_count($file_path_temp);
3702
+                $percentage = count($posts_count) > 0 && $line_count > 0 ? ceil($line_count / $posts_count) * 100 : 0;
3703
+                $percentage = min($percentage, 100);
3704 3704
                 
3705 3705
                 $json['percentage'] = $percentage;
3706 3706
                 // WPML
@@ -3708,45 +3708,45 @@  discard block
 block discarded – undo
3708 3708
                     $sitepress->switch_lang($active_lang, true);
3709 3709
                 }
3710 3710
                 // WPML
3711
-                wp_send_json( $json );
3711
+                wp_send_json($json);
3712 3712
                 gd_die();
3713 3713
             } else {
3714
-                if ( !$posts_count > 0 ) {
3715
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3714
+                if (!$posts_count > 0) {
3715
+                    $json['error'] = __('No records to export.', 'geodirectory');
3716 3716
                 } else {
3717 3717
                     $total_posts = $posts_count;
3718 3718
                     if ($chunk_per_page > $total_posts) {
3719 3719
                         $chunk_per_page = $total_posts;
3720 3720
                     }
3721
-                    $chunk_total_pages = ceil( $total_posts / $chunk_per_page );
3721
+                    $chunk_total_pages = ceil($total_posts / $chunk_per_page);
3722 3722
                     
3723 3723
                     $j = $chunk_page_no;
3724
-                    $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j );
3724
+                    $chunk_save_posts = geodir_imex_get_posts($post_type, $chunk_per_page, $j);
3725 3725
                     
3726 3726
                     $per_page = 500;
3727 3727
                     if ($per_page > $chunk_per_page) {
3728 3728
                         $per_page = $chunk_per_page;
3729 3729
                     }
3730
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3730
+                    $total_pages = ceil($chunk_per_page / $per_page);
3731 3731
                     
3732
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3733
-                        $save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page );
3732
+                    for ($i = 0; $i <= $total_pages; $i++) {
3733
+                        $save_posts = array_slice($chunk_save_posts, ($i * $per_page), $per_page);
3734 3734
                         
3735 3735
                         $clear = $i == 0 ? true : false;
3736
-                        geodir_save_csv_data( $file_path_temp, $save_posts, $clear );
3736
+                        geodir_save_csv_data($file_path_temp, $save_posts, $clear);
3737 3737
                     }
3738 3738
                         
3739
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3740
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3741
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3742
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3743
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3739
+                    if ($wp_filesystem->exists($file_path_temp)) {
3740
+                        $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : '';
3741
+                        $chunk_file_name = $file_name.$chunk_page_no.'.csv';
3742
+                        $file_path = $csv_file_dir.'/'.$chunk_file_name;
3743
+                        $wp_filesystem->move($file_path_temp, $file_path, true);
3744 3744
                         
3745
-                        $file_url = $file_url_base . $chunk_file_name;
3746
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3745
+                        $file_url = $file_url_base.$chunk_file_name;
3746
+                        $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3747 3747
                     }
3748 3748
                     
3749
-                    if ( !empty($chunk_file_paths) ) {
3749
+                    if (!empty($chunk_file_paths)) {
3750 3750
                         $json['total'] = $posts_count;
3751 3751
                         $json['files'] = $chunk_file_paths;
3752 3752
                     } else {
@@ -3754,7 +3754,7 @@  discard block
 block discarded – undo
3754 3754
                             $json['total'] = $posts_count;
3755 3755
                             $json['files'] = array();
3756 3756
                         } else {
3757
-                            $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' );
3757
+                            $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory');
3758 3758
                         }
3759 3759
                     }
3760 3760
                 }
@@ -3763,7 +3763,7 @@  discard block
 block discarded – undo
3763 3763
                     $sitepress->switch_lang($active_lang, true);
3764 3764
                 }
3765 3765
                 // WPML
3766
-                wp_send_json( $json );
3766
+                wp_send_json($json);
3767 3767
             }
3768 3768
         }
3769 3769
         break;
@@ -3777,20 +3777,20 @@  discard block
 block discarded – undo
3777 3777
                 $sitepress->switch_lang('all', true);
3778 3778
             }
3779 3779
             // WPML
3780
-            $file_name = $post_type . 'category_' . date( 'dmyHi' );
3780
+            $file_name = $post_type.'category_'.date('dmyHi');
3781 3781
             
3782
-            $terms_count = geodir_get_terms_count( $post_type );
3783
-            $file_url_base = geodir_path_import_export() . '/';
3784
-            $file_url = $file_url_base . $file_name . '.csv';
3785
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3786
-            $file_path_temp = $csv_file_dir . '/' . $post_type . 'category_' . $nonce . '.csv';
3782
+            $terms_count = geodir_get_terms_count($post_type);
3783
+            $file_url_base = geodir_path_import_export().'/';
3784
+            $file_url = $file_url_base.$file_name.'.csv';
3785
+            $file_path = $csv_file_dir.'/'.$file_name.'.csv';
3786
+            $file_path_temp = $csv_file_dir.'/'.$post_type.'category_'.$nonce.'.csv';
3787 3787
             
3788 3788
             $chunk_file_paths = array();
3789 3789
             
3790
-            if ( isset( $_REQUEST['_st'] ) ) {
3791
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3792
-                $percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0;
3793
-                $percentage = min( $percentage, 100 );
3790
+            if (isset($_REQUEST['_st'])) {
3791
+                $line_count = (int) geodir_import_export_line_count($file_path_temp);
3792
+                $percentage = count($terms_count) > 0 && $line_count > 0 ? ceil($line_count / $terms_count) * 100 : 0;
3793
+                $percentage = min($percentage, 100);
3794 3794
                 
3795 3795
                 $json['percentage'] = $percentage;
3796 3796
                 // WPML
@@ -3798,48 +3798,48 @@  discard block
 block discarded – undo
3798 3798
                     $sitepress->switch_lang($active_lang, true);
3799 3799
                 }
3800 3800
                 // WPML
3801
-                wp_send_json( $json );
3801
+                wp_send_json($json);
3802 3802
             } else {
3803
-                if ( !$terms_count > 0 ) {
3804
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3803
+                if (!$terms_count > 0) {
3804
+                    $json['error'] = __('No records to export.', 'geodirectory');
3805 3805
                 } else {
3806 3806
                     $total_terms = $terms_count;
3807 3807
                     if ($chunk_per_page > $terms_count) {
3808 3808
                         $chunk_per_page = $terms_count;
3809 3809
                     }
3810
-                    $chunk_total_pages = ceil( $total_terms / $chunk_per_page );
3810
+                    $chunk_total_pages = ceil($total_terms / $chunk_per_page);
3811 3811
                     
3812 3812
                     $j = $chunk_page_no;
3813
-                    $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j );
3813
+                    $chunk_save_terms = geodir_imex_get_terms($post_type, $chunk_per_page, $j);
3814 3814
                     
3815 3815
                     $per_page = 500;
3816 3816
                     if ($per_page > $chunk_per_page) {
3817 3817
                         $per_page = $chunk_per_page;
3818 3818
                     }
3819
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3819
+                    $total_pages = ceil($chunk_per_page / $per_page);
3820 3820
                     
3821
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3822
-                        $save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page );
3821
+                    for ($i = 0; $i <= $total_pages; $i++) {
3822
+                        $save_terms = array_slice($chunk_save_terms, ($i * $per_page), $per_page);
3823 3823
                         
3824 3824
                         $clear = $i == 0 ? true : false;
3825
-                        geodir_save_csv_data( $file_path_temp, $save_terms, $clear );
3825
+                        geodir_save_csv_data($file_path_temp, $save_terms, $clear);
3826 3826
                     }
3827 3827
                     
3828
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3829
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3830
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3831
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3832
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3828
+                    if ($wp_filesystem->exists($file_path_temp)) {
3829
+                        $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : '';
3830
+                        $chunk_file_name = $file_name.$chunk_page_no.'.csv';
3831
+                        $file_path = $csv_file_dir.'/'.$chunk_file_name;
3832
+                        $wp_filesystem->move($file_path_temp, $file_path, true);
3833 3833
                         
3834
-                        $file_url = $file_url_base . $chunk_file_name;
3835
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3834
+                        $file_url = $file_url_base.$chunk_file_name;
3835
+                        $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3836 3836
                     }
3837 3837
                     
3838
-                    if ( !empty($chunk_file_paths) ) {
3838
+                    if (!empty($chunk_file_paths)) {
3839 3839
                         $json['total'] = $terms_count;
3840 3840
                         $json['files'] = $chunk_file_paths;
3841 3841
                     } else {
3842
-                        $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' );
3842
+                        $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory');
3843 3843
                     }
3844 3844
                 }
3845 3845
                 // WPML
@@ -3847,127 +3847,127 @@  discard block
 block discarded – undo
3847 3847
                     $sitepress->switch_lang($active_lang, true);
3848 3848
                 }
3849 3849
                 // WPML
3850
-                wp_send_json( $json );
3850
+                wp_send_json($json);
3851 3851
             }
3852 3852
         }
3853 3853
         break;
3854 3854
         case 'export_locations': {
3855
-            $file_url_base = geodir_path_import_export() . '/';
3856
-            $file_name = 'gd_locations_' . date( 'dmyHi' );
3857
-            $file_url = $file_url_base . $file_name . '.csv';
3858
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3859
-            $file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv';
3855
+            $file_url_base = geodir_path_import_export().'/';
3856
+            $file_name = 'gd_locations_'.date('dmyHi');
3857
+            $file_url = $file_url_base.$file_name.'.csv';
3858
+            $file_path = $csv_file_dir.'/'.$file_name.'.csv';
3859
+            $file_path_temp = $csv_file_dir.'/gd_locations_'.$nonce.'.csv';
3860 3860
             
3861
-            $items_count = (int)geodir_location_imex_count_locations();
3861
+            $items_count = (int) geodir_location_imex_count_locations();
3862 3862
             
3863
-            if ( isset( $_REQUEST['_st'] ) ) {
3864
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3865
-                $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0;
3866
-                $percentage = min( $percentage, 100 );
3863
+            if (isset($_REQUEST['_st'])) {
3864
+                $line_count = (int) geodir_import_export_line_count($file_path_temp);
3865
+                $percentage = count($items_count) > 0 && $line_count > 0 ? ceil($line_count / $items_count) * 100 : 0;
3866
+                $percentage = min($percentage, 100);
3867 3867
                 
3868 3868
                 $json['percentage'] = $percentage;
3869
-                wp_send_json( $json );
3869
+                wp_send_json($json);
3870 3870
             } else {
3871 3871
                 $chunk_file_paths = array();
3872 3872
                 
3873
-                if ( !$items_count > 0 ) {
3874
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3873
+                if (!$items_count > 0) {
3874
+                    $json['error'] = __('No records to export.', 'geodirectory');
3875 3875
                 } else {
3876
-                    $chunk_per_page = min( $chunk_per_page, $items_count );
3877
-                    $chunk_total_pages = ceil( $items_count / $chunk_per_page );
3876
+                    $chunk_per_page = min($chunk_per_page, $items_count);
3877
+                    $chunk_total_pages = ceil($items_count / $chunk_per_page);
3878 3878
                     
3879 3879
                     $j = $chunk_page_no;
3880
-                    $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j );
3880
+                    $chunk_save_items = geodir_location_imex_locations_data($chunk_per_page, $j);
3881 3881
                     
3882 3882
                     $per_page = 500;
3883
-                    $per_page = min( $per_page, $chunk_per_page );
3884
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3883
+                    $per_page = min($per_page, $chunk_per_page);
3884
+                    $total_pages = ceil($chunk_per_page / $per_page);
3885 3885
                     
3886
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3887
-                        $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page );
3886
+                    for ($i = 0; $i <= $total_pages; $i++) {
3887
+                        $save_items = array_slice($chunk_save_items, ($i * $per_page), $per_page);
3888 3888
                         
3889 3889
                         $clear = $i == 0 ? true : false;
3890
-                        geodir_save_csv_data( $file_path_temp, $save_items, $clear );
3890
+                        geodir_save_csv_data($file_path_temp, $save_items, $clear);
3891 3891
                     }
3892 3892
                     
3893
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3894
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3895
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3896
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3897
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3893
+                    if ($wp_filesystem->exists($file_path_temp)) {
3894
+                        $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : '';
3895
+                        $chunk_file_name = $file_name.$chunk_page_no.'.csv';
3896
+                        $file_path = $csv_file_dir.'/'.$chunk_file_name;
3897
+                        $wp_filesystem->move($file_path_temp, $file_path, true);
3898 3898
                         
3899
-                        $file_url = $file_url_base . $chunk_file_name;
3900
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3899
+                        $file_url = $file_url_base.$chunk_file_name;
3900
+                        $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3901 3901
                     }
3902 3902
                     
3903
-                    if ( !empty($chunk_file_paths) ) {
3903
+                    if (!empty($chunk_file_paths)) {
3904 3904
                         $json['total'] = $items_count;
3905 3905
                         $json['files'] = $chunk_file_paths;
3906 3906
                     } else {
3907
-                        $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' );
3907
+                        $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory');
3908 3908
                     }
3909 3909
                 }
3910
-                wp_send_json( $json );
3910
+                wp_send_json($json);
3911 3911
             }
3912 3912
         }
3913 3913
         break;
3914 3914
         case 'export_hoods': {
3915
-            $file_url_base = geodir_path_import_export() . '/';
3916
-            $file_name = 'gd_neighbourhoods_' . date( 'dmyHi' );
3917
-            $file_url = $file_url_base . $file_name . '.csv';
3918
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3919
-            $file_path_temp = $csv_file_dir . '/gd_neighbourhoods_' . $nonce . '.csv';
3915
+            $file_url_base = geodir_path_import_export().'/';
3916
+            $file_name = 'gd_neighbourhoods_'.date('dmyHi');
3917
+            $file_url = $file_url_base.$file_name.'.csv';
3918
+            $file_path = $csv_file_dir.'/'.$file_name.'.csv';
3919
+            $file_path_temp = $csv_file_dir.'/gd_neighbourhoods_'.$nonce.'.csv';
3920 3920
             
3921
-            $items_count = (int)geodir_location_imex_count_neighbourhoods();
3921
+            $items_count = (int) geodir_location_imex_count_neighbourhoods();
3922 3922
             
3923
-            if ( isset( $_REQUEST['_st'] ) ) {
3924
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3925
-                $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0;
3926
-                $percentage = min( $percentage, 100 );
3923
+            if (isset($_REQUEST['_st'])) {
3924
+                $line_count = (int) geodir_import_export_line_count($file_path_temp);
3925
+                $percentage = count($items_count) > 0 && $line_count > 0 ? ceil($line_count / $items_count) * 100 : 0;
3926
+                $percentage = min($percentage, 100);
3927 3927
                 
3928 3928
                 $json['percentage'] = $percentage;
3929
-                wp_send_json( $json );
3929
+                wp_send_json($json);
3930 3930
             } else {
3931 3931
                 $chunk_file_paths = array();
3932 3932
                 
3933
-                if ( !$items_count > 0 ) {
3934
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3933
+                if (!$items_count > 0) {
3934
+                    $json['error'] = __('No records to export.', 'geodirectory');
3935 3935
                 } else {
3936
-                    $chunk_per_page = min( $chunk_per_page, $items_count );
3937
-                    $chunk_total_pages = ceil( $items_count / $chunk_per_page );
3936
+                    $chunk_per_page = min($chunk_per_page, $items_count);
3937
+                    $chunk_total_pages = ceil($items_count / $chunk_per_page);
3938 3938
                     
3939 3939
                     $j = $chunk_page_no;
3940
-                    $chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j );
3940
+                    $chunk_save_items = geodir_location_imex_neighbourhoods_data($chunk_per_page, $j);
3941 3941
                     
3942 3942
                     $per_page = 500;
3943
-                    $per_page = min( $per_page, $chunk_per_page );
3944
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3943
+                    $per_page = min($per_page, $chunk_per_page);
3944
+                    $total_pages = ceil($chunk_per_page / $per_page);
3945 3945
                     
3946
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3947
-                        $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page );
3946
+                    for ($i = 0; $i <= $total_pages; $i++) {
3947
+                        $save_items = array_slice($chunk_save_items, ($i * $per_page), $per_page);
3948 3948
                         
3949 3949
                         $clear = $i == 0 ? true : false;
3950
-                        geodir_save_csv_data( $file_path_temp, $save_items, $clear );
3950
+                        geodir_save_csv_data($file_path_temp, $save_items, $clear);
3951 3951
                     }
3952 3952
                     
3953
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3954
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3955
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3956
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3957
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3953
+                    if ($wp_filesystem->exists($file_path_temp)) {
3954
+                        $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : '';
3955
+                        $chunk_file_name = $file_name.$chunk_page_no.'.csv';
3956
+                        $file_path = $csv_file_dir.'/'.$chunk_file_name;
3957
+                        $wp_filesystem->move($file_path_temp, $file_path, true);
3958 3958
                         
3959
-                        $file_url = $file_url_base . $chunk_file_name;
3960
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3959
+                        $file_url = $file_url_base.$chunk_file_name;
3960
+                        $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3961 3961
                     }
3962 3962
                     
3963
-                    if ( !empty($chunk_file_paths) ) {
3963
+                    if (!empty($chunk_file_paths)) {
3964 3964
                         $json['total'] = $items_count;
3965 3965
                         $json['files'] = $chunk_file_paths;
3966 3966
                     } else {
3967
-                        $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' );
3967
+                        $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory');
3968 3968
                     }
3969 3969
                 }
3970
-                wp_send_json( $json );
3970
+                wp_send_json($json);
3971 3971
             }
3972 3972
         }
3973 3973
         break;
@@ -3984,33 +3984,33 @@  discard block
 block discarded – undo
3984 3984
             }
3985 3985
             // WPML
3986 3986
             
3987
-            ini_set( 'auto_detect_line_endings', true );
3987
+            ini_set('auto_detect_line_endings', true);
3988 3988
             
3989 3989
             $uploads = wp_upload_dir();
3990 3990
             $uploads_dir = $uploads['path'];
3991 3991
             $uploads_subdir = $uploads['subdir'];
3992 3992
             
3993
-            $csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL;
3994
-            $import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip';
3993
+            $csv_file = isset($_POST['_file']) ? $_POST['_file'] : NULL;
3994
+            $import_choice = isset($_REQUEST['_ch']) ? $_REQUEST['_ch'] : 'skip';
3995 3995
             
3996
-            $csv_file_arr = explode( '/', $csv_file );
3997
-            $csv_filename = end( $csv_file_arr );
3998
-            $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename;
3996
+            $csv_file_arr = explode('/', $csv_file);
3997
+            $csv_filename = end($csv_file_arr);
3998
+            $target_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$csv_filename;
3999 3999
             
4000 4000
             $json['file'] = $csv_file;
4001
-            $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' );
4001
+            $json['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory');
4002 4002
             $file = array();
4003 4003
 
4004
-            if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) {
4005
-                $wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename );
4004
+            if ($csv_file && $wp_filesystem->is_file($target_path) && $wp_filesystem->exists($target_path)) {
4005
+                $wp_filetype = wp_check_filetype_and_ext($target_path, $csv_filename);
4006 4006
                 
4007 4007
                 if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
4008 4008
                     $json['error'] = NULL;
4009 4009
                     $json['rows'] = 0;
4010 4010
                     
4011
-                    if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) {
4012
-                        while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) {
4013
-                            if ( !empty( $data ) ) {
4011
+                    if (($handle = fopen($target_path, "r")) !== FALSE) {
4012
+                        while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) {
4013
+                            if (!empty($data)) {
4014 4014
                                 $file[] = $data;
4015 4015
                             }
4016 4016
                         }
@@ -4023,19 +4023,19 @@  discard block
 block discarded – undo
4023 4023
                         $json['error'] = __('No data found in csv file.', 'geodirectory');
4024 4024
                     }
4025 4025
                 } else {
4026
-                    wp_send_json( $json );
4026
+                    wp_send_json($json);
4027 4027
                 }
4028 4028
             } else {
4029
-                wp_send_json( $json );
4029
+                wp_send_json($json);
4030 4030
             }
4031 4031
             
4032
-            if ( $task == 'prepare_import' || !empty( $json['error'] ) ) {
4033
-                wp_send_json( $json );
4032
+            if ($task == 'prepare_import' || !empty($json['error'])) {
4033
+                wp_send_json($json);
4034 4034
             }
4035 4035
             
4036 4036
             $total = $json['rows'];
4037
-            $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1;
4038
-            $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0;
4037
+            $limit = isset($_POST['limit']) ? (int) $_POST['limit'] : 1;
4038
+            $processed = isset($_POST['processed']) ? (int) $_POST['processed'] : 0;
4039 4039
             
4040 4040
             $count = $limit;
4041 4041
             
@@ -4060,13 +4060,13 @@  discard block
 block discarded – undo
4060 4060
             
4061 4061
             $post_types = geodir_get_posttypes();
4062 4062
 
4063
-            if ( $task == 'import_cat' ) {
4063
+            if ($task == 'import_cat') {
4064 4064
                 if (!empty($file)) {
4065 4065
                     $columns = isset($file[0]) ? $file[0] : NULL;
4066 4066
                     
4067 4067
                     if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4068 4068
                         $json['error'] = CSV_INVAILD_FILE;
4069
-                        wp_send_json( $json );
4069
+                        wp_send_json($json);
4070 4070
                         exit;
4071 4071
                     }
4072 4072
                     
@@ -4077,7 +4077,7 @@  discard block
 block discarded – undo
4077 4077
                         
4078 4078
                         if (isset($file[$index])) {
4079 4079
                             $row = $file[$index];
4080
-                            $row = array_map( 'trim', $row );
4080
+                            $row = array_map('trim', $row);
4081 4081
                             //$row = array_map( 'utf8_encode', $row );
4082 4082
                             
4083 4083
                             $cat_id = '';
@@ -4094,42 +4094,42 @@  discard block
 block discarded – undo
4094 4094
                             $cat_id_original = '';
4095 4095
                             
4096 4096
                             $c = 0;
4097
-                            foreach ($columns as $column ) {
4098
-                                if ( $column == 'cat_id' ) {
4099
-                                    $cat_id = (int)$row[$c];
4100
-                                } else if ( $column == 'cat_name' ) {
4097
+                            foreach ($columns as $column) {
4098
+                                if ($column == 'cat_id') {
4099
+                                    $cat_id = (int) $row[$c];
4100
+                                } else if ($column == 'cat_name') {
4101 4101
                                     $cat_name = $row[$c];
4102
-                                } else if ( $column == 'cat_slug' ) {
4102
+                                } else if ($column == 'cat_slug') {
4103 4103
                                     $cat_slug = $row[$c];
4104
-                                } else if ( $column == 'cat_posttype' ) {
4104
+                                } else if ($column == 'cat_posttype') {
4105 4105
                                     $cat_posttype = $row[$c];
4106
-                                } else if ( $column == 'cat_parent' ) {
4106
+                                } else if ($column == 'cat_parent') {
4107 4107
                                     $cat_parent = trim($row[$c]);
4108
-                                } else if ( $column == 'cat_schema' && $row[$c] != '' ) {
4108
+                                } else if ($column == 'cat_schema' && $row[$c] != '') {
4109 4109
                                     $cat_schema = $row[$c];
4110
-                                } else if ( $column == 'cat_description' ) {
4110
+                                } else if ($column == 'cat_description') {
4111 4111
                                     $cat_description = $row[$c];
4112
-                                } else if ( $column == 'cat_top_description' ) {
4112
+                                } else if ($column == 'cat_top_description') {
4113 4113
                                     $cat_top_description = $row[$c];
4114
-                                } else if ( $column == 'cat_image' ) {
4114
+                                } else if ($column == 'cat_image') {
4115 4115
                                     $cat_image = $row[$c];
4116
-                                } else if ( $column == 'cat_icon' ) {
4116
+                                } else if ($column == 'cat_icon') {
4117 4117
                                     $cat_icon = $row[$c];
4118 4118
                                 }
4119 4119
                                 // WPML
4120
-                                if ( $is_wpml ) {
4121
-                                    if ( $column == 'cat_language' ) {
4122
-                                        $cat_language = geodir_strtolower( trim( $row[$c] ) );
4123
-                                    } else if ( $column == 'cat_id_original' ) {
4124
-                                        $cat_id_original = (int)$row[$c];
4120
+                                if ($is_wpml) {
4121
+                                    if ($column == 'cat_language') {
4122
+                                        $cat_language = geodir_strtolower(trim($row[$c]));
4123
+                                    } else if ($column == 'cat_id_original') {
4124
+                                        $cat_id_original = (int) $row[$c];
4125 4125
                                     }
4126 4126
                                 }
4127 4127
                                 // WPML
4128 4128
                                 $c++;
4129 4129
                             }
4130 4130
                             
4131
-                            if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) {
4132
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) );
4131
+                            if ($cat_name == '' || !in_array($cat_posttype, $post_types)) {
4132
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank title/invalid post type', 'geodirectory'));
4133 4133
                                 
4134 4134
                                 $invalid++;
4135 4135
                                 continue;
@@ -4147,24 +4147,24 @@  discard block
 block discarded – undo
4147 4147
                             $term_data['description'] = $cat_description;
4148 4148
                             $term_data['cat_schema'] = $cat_schema;
4149 4149
                             $term_data['top_description'] = $cat_top_description;
4150
-                            $term_data['image'] = $cat_image != '' ? basename( $cat_image ) : '';
4151
-                            $term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : '';
4150
+                            $term_data['image'] = $cat_image != '' ? basename($cat_image) : '';
4151
+                            $term_data['icon'] = $cat_icon != '' ? basename($cat_icon) : '';
4152 4152
                             
4153 4153
                             //$term_data = array_map( 'utf8_encode', $term_data );
4154 4154
                             
4155
-                            $taxonomy = $cat_posttype . 'category';
4155
+                            $taxonomy = $cat_posttype.'category';
4156 4156
                             
4157 4157
                             $term_data['taxonomy'] = $taxonomy;
4158 4158
 
4159 4159
                             $term_parent_id = 0;
4160
-                            if ($cat_parent != "" || (int)$cat_parent > 0) {
4160
+                            if ($cat_parent != "" || (int) $cat_parent > 0) {
4161 4161
                                 $term_parent = '';
4162 4162
                                 
4163
-                                if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) {
4163
+                                if ($term_parent = get_term_by('name', $cat_parent, $taxonomy)) {
4164 4164
                                     //
4165
-                                } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) {
4165
+                                } else if ($term_parent = get_term_by('slug', $cat_parent, $taxonomy)) {
4166 4166
                                     //
4167
-                                } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) {
4167
+                                } else if ($term_parent = get_term_by('id', $cat_parent, $taxonomy)) {
4168 4168
                                     //
4169 4169
                                 } else {
4170 4170
                                     $term_parent_data = array();
@@ -4172,104 +4172,104 @@  discard block
 block discarded – undo
4172 4172
                                     //$term_parent_data = array_map( 'utf8_encode', $term_parent_data );
4173 4173
                                     $term_parent_data['taxonomy'] = $taxonomy;
4174 4174
                                     
4175
-                                    $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data );
4175
+                                    $term_parent_id = (int) geodir_imex_insert_term($taxonomy, $term_parent_data);
4176 4176
                                 }
4177 4177
                                 
4178
-                                if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) {
4179
-                                    $term_parent_id = (int)$term_parent->term_id;
4178
+                                if (!empty($term_parent) && !is_wp_error($term_parent)) {
4179
+                                    $term_parent_id = (int) $term_parent->term_id;
4180 4180
                                 }
4181 4181
                             }
4182
-                            $term_data['parent'] = (int)$term_parent_id;
4182
+                            $term_data['parent'] = (int) $term_parent_id;
4183 4183
 
4184 4184
                             $term_id = NULL;
4185
-                            if ( $import_choice == 'update' ) {
4186
-                                if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
4185
+                            if ($import_choice == 'update') {
4186
+                                if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) {
4187 4187
                                     $term_data['term_id'] = $term['term_id'];
4188 4188
                                     
4189
-                                    if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
4189
+                                    if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) {
4190 4190
                                         $updated++;
4191 4191
                                     } else {
4192 4192
                                         $invalid++;
4193
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4193
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory'));
4194 4194
                                     }
4195
-                                } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
4195
+                                } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) {
4196 4196
                                     $term_data['term_id'] = $term['term_id'];
4197 4197
                                     
4198
-                                    if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
4198
+                                    if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) {
4199 4199
                                         $updated++;
4200 4200
                                     } else {
4201 4201
                                         $invalid++;
4202
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4202
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory'));
4203 4203
                                     }
4204 4204
                                 } else {
4205
-                                    if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
4205
+                                    if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) {
4206 4206
                                         $created++;
4207 4207
                                     } else {
4208 4208
                                         $invalid++;
4209
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4209
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory'));
4210 4210
                                     }
4211 4211
                                 }
4212
-                            } else if ( $import_choice == 'skip' ) {
4213
-                                if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
4212
+                            } else if ($import_choice == 'skip') {
4213
+                                if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) {
4214 4214
                                     $skipped++;
4215
-                                } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
4215
+                                } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) {
4216 4216
                                     $skipped++;
4217 4217
                                 } else {
4218
-                                    if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
4218
+                                    if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) {
4219 4219
                                         $created++;
4220 4220
                                     } else {
4221 4221
                                         $invalid++;
4222
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4222
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory'));
4223 4223
                                     }
4224 4224
                                 }
4225 4225
                             } else {
4226 4226
                                 $invalid++;
4227
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4227
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory'));
4228 4228
                             }
4229 4229
                             
4230
-                            if ( $term_id ) {
4230
+                            if ($term_id) {
4231 4231
                                 // WPML
4232 4232
                                 if ($is_wpml && $cat_id_original > 0 && $cat_language != '') {
4233
-                                    $wpml_element_type = 'tax_' . $taxonomy;
4234
-                                    $source_language = geodir_get_language_for_element( $cat_id_original, $wpml_element_type );
4233
+                                    $wpml_element_type = 'tax_'.$taxonomy;
4234
+                                    $source_language = geodir_get_language_for_element($cat_id_original, $wpml_element_type);
4235 4235
                                     $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language();
4236 4236
 
4237
-                                    $trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type );
4237
+                                    $trid = $sitepress->get_element_trid($cat_id_original, $wpml_element_type);
4238 4238
                                     
4239
-                                    $sitepress->set_element_language_details( $term_id, $wpml_element_type, $trid, $cat_language, $source_language );
4239
+                                    $sitepress->set_element_language_details($term_id, $wpml_element_type, $trid, $cat_language, $source_language);
4240 4240
                                 }
4241 4241
                                 // WPML
4242 4242
                                 
4243
-                                if ( isset( $term_data['top_description'] ) ) {
4244
-                                    update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype );
4243
+                                if (isset($term_data['top_description'])) {
4244
+                                    update_tax_meta($term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype);
4245 4245
                                 }
4246 4246
                                 
4247
-                                if ( isset( $term_data['cat_schema'] ) ) {
4248
-                                    update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype );
4247
+                                if (isset($term_data['cat_schema'])) {
4248
+                                    update_tax_meta($term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype);
4249 4249
                                 }
4250 4250
             
4251 4251
                                 $attachment = false;
4252
-                                if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) {
4253
-                                    $cat_image = geodir_get_default_catimage( $term_id, $cat_posttype );
4254
-                                    $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : '';
4252
+                                if (isset($term_data['image']) && $term_data['image'] != '') {
4253
+                                    $cat_image = geodir_get_default_catimage($term_id, $cat_posttype);
4254
+                                    $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : '';
4255 4255
                                     
4256
-                                    if ( basename($cat_image) != $term_data['image'] ) {
4256
+                                    if (basename($cat_image) != $term_data['image']) {
4257 4257
                                         $attachment = true;
4258
-                                        update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype );
4258
+                                        update_tax_meta($term_id, 'ct_cat_default_img', array('id' => 'image', 'src' => $uploads['url'].'/'.$term_data['image']), $cat_posttype);
4259 4259
                                     }
4260 4260
                                 }
4261 4261
                                 
4262
-                                if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) {
4263
-                                    $cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype );
4264
-                                    $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : '';
4262
+                                if (isset($term_data['icon']) && $term_data['icon'] != '') {
4263
+                                    $cat_icon = get_tax_meta($term_id, 'ct_cat_icon', false, $cat_posttype);
4264
+                                    $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : '';
4265 4265
                                         
4266
-                                    if ( basename($cat_icon) != $term_data['icon'] ) {
4266
+                                    if (basename($cat_icon) != $term_data['icon']) {
4267 4267
                                         $attachment = true;
4268
-                                        update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype );
4268
+                                        update_tax_meta($term_id, 'ct_cat_icon', array('id' => 'icon', 'src' => $uploads['url'].'/'.$term_data['icon']), $cat_posttype);
4269 4269
                                     }
4270 4270
                                 }
4271 4271
                                 
4272
-                                if ( $attachment ) {
4272
+                                if ($attachment) {
4273 4273
                                     $images++;
4274 4274
                                 }
4275 4275
                             }
@@ -4291,13 +4291,13 @@  discard block
 block discarded – undo
4291 4291
                 $json['invalid'] = $invalid;
4292 4292
                 $json['images'] = $images;
4293 4293
                 
4294
-                wp_send_json( $json );
4294
+                wp_send_json($json);
4295 4295
                 exit;
4296
-            } else if ( $task == 'import_post' ) {
4296
+            } else if ($task == 'import_post') {
4297 4297
                 //run some stuff to make the import quicker
4298
-                wp_defer_term_counting( true );
4299
-                wp_defer_comment_counting( true );
4300
-                $wpdb->query( 'SET autocommit = 0;' );
4298
+                wp_defer_term_counting(true);
4299
+                wp_defer_comment_counting(true);
4300
+                $wpdb->query('SET autocommit = 0;');
4301 4301
 
4302 4302
                 //remove_all_actions('publish_post');
4303 4303
                 //remove_all_actions('transition_post_status');
@@ -4306,18 +4306,18 @@  discard block
 block discarded – undo
4306 4306
                 if (!empty($file)) {
4307 4307
                     $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses.
4308 4308
                     $default_status = 'publish';
4309
-                    $current_date = date_i18n( 'Y-m-d', time() );
4309
+                    $current_date = date_i18n('Y-m-d', time());
4310 4310
                     
4311 4311
                     $columns = isset($file[0]) ? $file[0] : NULL;
4312 4312
                     
4313 4313
                     if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4314 4314
                         $json['error'] = CSV_INVAILD_FILE;
4315
-                        wp_send_json( $json );
4315
+                        wp_send_json($json);
4316 4316
                         exit;
4317 4317
                     }
4318 4318
 
4319 4319
                     $gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory');
4320
-                    $wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' );
4320
+                    $wp_chars_error = __('(check & remove if any invalid characters used in data)', 'geodirectory');
4321 4321
                     $processed_actual = 0;
4322 4322
                     for ($i = 1; $i <= $limit; $i++) {
4323 4323
                         $index = $processed + $i;
@@ -4326,9 +4326,9 @@  discard block
 block discarded – undo
4326 4326
                         if (isset($file[$index])) {
4327 4327
                             $processed_actual++;
4328 4328
                             $row = $file[$index];
4329
-                            $row = array_map( 'trim', $row );
4329
+                            $row = array_map('trim', $row);
4330 4330
                             //$row = array_map( 'utf8_encode', $row );
4331
-                            $row = array_map( 'addslashes_gpc', $row );
4331
+                            $row = array_map('addslashes_gpc', $row);
4332 4332
                             
4333 4333
                             $post_id = '';
4334 4334
                             $post_title = '';
@@ -4365,78 +4365,78 @@  discard block
 block discarded – undo
4365 4365
                             $original_post_id = '';
4366 4366
                                                         
4367 4367
                             $c = 0;
4368
-                            foreach ($columns as $column ) {
4368
+                            foreach ($columns as $column) {
4369 4369
                                 $gd_post[$column] = $row[$c];
4370 4370
                                 
4371
-                                if ( $column == 'post_id' ) {
4371
+                                if ($column == 'post_id') {
4372 4372
                                     $post_id = $row[$c];
4373
-                                } else if ( $column == 'post_title' ) {
4373
+                                } else if ($column == 'post_title') {
4374 4374
                                     $post_title = sanitize_text_field($row[$c]);
4375
-                                } else if ( $column == 'post_author' ) {
4375
+                                } else if ($column == 'post_author') {
4376 4376
                                     $post_author = $row[$c];
4377
-                                } else if ( $column == 'post_content' ) {
4377
+                                } else if ($column == 'post_content') {
4378 4378
                                     $post_content = $row[$c];
4379
-                                } else if ( $column == 'post_category' && $row[$c] != '' ) {
4380
-                                    $post_category_arr = explode( ',', $row[$c] );
4381
-                                } else if ( $column == 'default_category' ) {
4379
+                                } else if ($column == 'post_category' && $row[$c] != '') {
4380
+                                    $post_category_arr = explode(',', $row[$c]);
4381
+                                } else if ($column == 'default_category') {
4382 4382
                                     $default_category = wp_kses_normalize_entities($row[$c]);
4383
-                                } else if ( $column == 'post_tags' && $row[$c] != '' ) {
4384
-                                    $post_tags = explode( ',', sanitize_text_field($row[$c]) );
4385
-                                } else if ( $column == 'post_type' ) {
4383
+                                } else if ($column == 'post_tags' && $row[$c] != '') {
4384
+                                    $post_tags = explode(',', sanitize_text_field($row[$c]));
4385
+                                } else if ($column == 'post_type') {
4386 4386
                                     $post_type = $row[$c];
4387
-                                } else if ( $column == 'post_status' ) {
4388
-                                    $post_status = sanitize_key( $row[$c] );
4389
-                                } else if ( $column == 'is_featured' ) {
4390
-                                    $is_featured = (int)$row[$c];
4391
-                                } else if ( $column == 'geodir_video' ) {
4387
+                                } else if ($column == 'post_status') {
4388
+                                    $post_status = sanitize_key($row[$c]);
4389
+                                } else if ($column == 'is_featured') {
4390
+                                    $is_featured = (int) $row[$c];
4391
+                                } else if ($column == 'geodir_video') {
4392 4392
                                     $geodir_video = $row[$c];
4393
-                                } else if ( $column == 'post_address' ) {
4393
+                                } else if ($column == 'post_address') {
4394 4394
                                     $post_address = sanitize_text_field($row[$c]);
4395
-                                } else if ( $column == 'post_city' ) {
4395
+                                } else if ($column == 'post_city') {
4396 4396
                                     $post_city = sanitize_text_field($row[$c]);
4397
-                                } else if ( $column == 'post_region' ) {
4397
+                                } else if ($column == 'post_region') {
4398 4398
                                     $post_region = sanitize_text_field($row[$c]);
4399
-                                } else if ( $column == 'post_country' ) {
4399
+                                } else if ($column == 'post_country') {
4400 4400
                                     $post_country = sanitize_text_field($row[$c]);
4401
-                                } else if ( $column == 'post_zip' ) {
4401
+                                } else if ($column == 'post_zip') {
4402 4402
                                     $post_zip = sanitize_text_field($row[$c]);
4403
-                                } else if ( $column == 'post_latitude' ) {
4403
+                                } else if ($column == 'post_latitude') {
4404 4404
                                     $post_latitude = sanitize_text_field($row[$c]);
4405
-                                } else if ( $column == 'post_longitude' ) {
4405
+                                } else if ($column == 'post_longitude') {
4406 4406
                                     $post_longitude = sanitize_text_field($row[$c]);
4407
-                                } else if ( $column == 'post_neighbourhood' ) {
4407
+                                } else if ($column == 'post_neighbourhood') {
4408 4408
                                     $post_neighbourhood = sanitize_text_field($row[$c]);
4409 4409
                                     unset($gd_post[$column]);
4410
-                                } else if ( $column == 'neighbourhood_latitude' ) {
4410
+                                } else if ($column == 'neighbourhood_latitude') {
4411 4411
                                     $neighbourhood_latitude = sanitize_text_field($row[$c]);
4412
-                                } else if ( $column == 'neighbourhood_longitude' ) {
4412
+                                } else if ($column == 'neighbourhood_longitude') {
4413 4413
                                     $neighbourhood_longitude = sanitize_text_field($row[$c]);
4414
-                                } else if ( $column == 'geodir_timing' ) {
4414
+                                } else if ($column == 'geodir_timing') {
4415 4415
                                     $geodir_timing = sanitize_text_field($row[$c]);
4416
-                                } else if ( $column == 'geodir_contact' ) {
4416
+                                } else if ($column == 'geodir_contact') {
4417 4417
                                     $geodir_contact = sanitize_text_field($row[$c]);
4418
-                                } else if ( $column == 'geodir_email' ) {
4418
+                                } else if ($column == 'geodir_email') {
4419 4419
                                     $geodir_email = sanitize_email($row[$c]);
4420
-                                } else if ( $column == 'geodir_website' ) {
4420
+                                } else if ($column == 'geodir_website') {
4421 4421
                                     $geodir_website = sanitize_text_field($row[$c]);
4422
-                                } else if ( $column == 'geodir_twitter' ) {
4422
+                                } else if ($column == 'geodir_twitter') {
4423 4423
                                     $geodir_twitter = sanitize_text_field($row[$c]);
4424
-                                } else if ( $column == 'geodir_facebook' ) {
4424
+                                } else if ($column == 'geodir_facebook') {
4425 4425
                                     $geodir_facebook = sanitize_text_field($row[$c]);
4426
-                                } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) {
4426
+                                } else if ($column == 'IMAGE' && !empty($row[$c]) && $row[$c] != '') {
4427 4427
                                     $post_images[] = $row[$c];
4428
-                                } else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) {
4429
-                                    $expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) );
4430
-                                } else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) {
4428
+                                } else if ($column == 'alive_days' && (int) $row[$c] > 0) {
4429
+                                    $expire_date = date_i18n('Y-m-d', strtotime($current_date.'+'.(int) $row[$c].' days'));
4430
+                                } else if ($column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never') {
4431 4431
                                     $row[$c] = str_replace('/', '-', $row[$c]);
4432
-                                    $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) );
4432
+                                    $expire_date = date_i18n('Y-m-d', strtotime($row[$c]));
4433 4433
                                 }
4434 4434
                                 // WPML
4435 4435
                                 if ($is_wpml) {
4436 4436
                                     if ($column == 'language') {
4437 4437
                                         $language = geodir_strtolower(trim($row[$c]));
4438 4438
                                     } else if ($column == 'original_post_id') {
4439
-                                        $original_post_id = (int)$row[$c];
4439
+                                        $original_post_id = (int) $row[$c];
4440 4440
                                     }
4441 4441
                                 }
4442 4442
                                 // WPML
@@ -4451,43 +4451,43 @@  discard block
 block discarded – undo
4451 4451
 
4452 4452
                             $gd_post['IMAGE'] = $post_images;
4453 4453
                             
4454
-                            $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status;
4455
-                            $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status;
4454
+                            $post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status;
4455
+                            $post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status;
4456 4456
                                                                                                                 
4457 4457
                             $valid = true;
4458 4458
                             
4459
-                            if ( $post_title == '' || !in_array( $post_type, $post_types ) ) {
4459
+                            if ($post_title == '' || !in_array($post_type, $post_types)) {
4460 4460
                                 $invalid++;
4461 4461
                                 $valid = false;
4462
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) );
4462
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank title/invalid post type', 'geodirectory'));
4463 4463
                             }
4464 4464
                             
4465
-                            $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true;
4466
-                            if ( $location_allowed ) {
4465
+                            $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true;
4466
+                            if ($location_allowed) {
4467 4467
                                 $location_result = geodir_get_default_location();
4468
-                                if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) {
4468
+                                if ($post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '') {
4469 4469
                                     $invalid_addr++;
4470 4470
                                     $valid = false;
4471
-                                    geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) );
4472
-                                } else if ( !empty( $location_result ) && $location_result->location_id == 0 ) {
4473
-                                    if ( ( geodir_strtolower( $post_city ) != geodir_strtolower( $location_result->city ) ) || ( geodir_strtolower( $post_region ) != geodir_strtolower( $location_result->region ) ) || (geodir_strtolower( $post_country ) != geodir_strtolower( $location_result->country ) ) ) {
4471
+                                    geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory'));
4472
+                                } else if (!empty($location_result) && $location_result->location_id == 0) {
4473
+                                    if ((geodir_strtolower($post_city) != geodir_strtolower($location_result->city)) || (geodir_strtolower($post_region) != geodir_strtolower($location_result->region)) || (geodir_strtolower($post_country) != geodir_strtolower($location_result->country))) {
4474 4474
                                         $invalid_addr++;
4475 4475
                                         $valid = false;
4476
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) );
4476
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory'));
4477 4477
                                     } else {
4478 4478
                                         if (!$location_manager) {
4479
-                                            $gd_post['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // Set the default location when location manager not activated.
4479
+                                            $gd_post['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // Set the default location when location manager not activated.
4480 4480
                                         }
4481 4481
                                     }
4482 4482
                                 }
4483 4483
                             }
4484 4484
                             
4485
-                            if ( !$valid ) {
4485
+                            if (!$valid) {
4486 4486
                                 continue;
4487 4487
                             }
4488 4488
 
4489
-                            $cat_taxonomy = $post_type . 'category';
4490
-                            $tags_taxonomy = $post_type . '_tags';
4489
+                            $cat_taxonomy = $post_type.'category';
4490
+                            $tags_taxonomy = $post_type.'_tags';
4491 4491
                             
4492 4492
                             if ($default_category != '' && !in_array($default_category, $post_category_arr)) {
4493 4493
                                 $post_category_arr = array_merge(array($default_category), $post_category_arr);
@@ -4495,29 +4495,29 @@  discard block
 block discarded – undo
4495 4495
 
4496 4496
                             $post_category = array();
4497 4497
                             $default_category_id = NULL;
4498
-                            if ( !empty( $post_category_arr ) ) {
4499
-                                foreach ( $post_category_arr as $value ) {
4500
-                                    $category_name = wp_kses_normalize_entities( trim( $value ) );
4498
+                            if (!empty($post_category_arr)) {
4499
+                                foreach ($post_category_arr as $value) {
4500
+                                    $category_name = wp_kses_normalize_entities(trim($value));
4501 4501
                                     
4502
-                                    if ( $category_name != '' ) {
4502
+                                    if ($category_name != '') {
4503 4503
                                         $term_category = array();
4504 4504
                                         
4505
-                                        if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) {
4505
+                                        if ($term = get_term_by('name', $category_name, $cat_taxonomy)) {
4506 4506
                                             $term_category = $term;
4507
-                                        } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) {
4507
+                                        } else if ($term = get_term_by('slug', $category_name, $cat_taxonomy)) {
4508 4508
                                             $term_category = $term;
4509 4509
                                         } else {
4510 4510
                                             $term_data = array();
4511 4511
                                             $term_data['name'] = $category_name;
4512 4512
                                             $term_data['taxonomy'] = $cat_taxonomy;
4513 4513
                                             
4514
-                                            $term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data );
4515
-                                            if ( $term_id ) {
4516
-                                                $term_category = get_term( $term_id, $cat_taxonomy );
4514
+                                            $term_id = geodir_imex_insert_term($cat_taxonomy, $term_data);
4515
+                                            if ($term_id) {
4516
+                                                $term_category = get_term($term_id, $cat_taxonomy);
4517 4517
                                             }
4518 4518
                                         }
4519 4519
                                         
4520
-                                        if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) {
4520
+                                        if (!empty($term_category) && !is_wp_error($term_category)) {
4521 4521
                                             $post_category[] = intval($term_category->term_id);
4522 4522
                                             
4523 4523
                                             if ($category_name == $default_category) {
@@ -4538,15 +4538,15 @@  discard block
 block discarded – undo
4538 4538
                             $save_post['post_tags'] = $post_tags;
4539 4539
 
4540 4540
                             $saved_post_id = NULL;
4541
-                            if ( $import_choice == 'update' ) {
4542
-                                $gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' );
4541
+                            if ($import_choice == 'update') {
4542
+                                $gd_wp_error = __('Unable to add listing, please check the listing data.', 'geodirectory');
4543 4543
                                 
4544
-                                if ( $post_id > 0 && get_post( $post_id ) ) {
4544
+                                if ($post_id > 0 && get_post($post_id)) {
4545 4545
                                     $save_post['ID'] = $post_id;
4546 4546
                                     
4547
-                                    if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
4548
-                                        if ( is_wp_error( $saved_post_id ) ) {
4549
-                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4547
+                                    if ($saved_post_id = wp_update_post($save_post, true)) {
4548
+                                        if (is_wp_error($saved_post_id)) {
4549
+                                            $gd_wp_error = $saved_post_id->get_error_message().' '.$wp_chars_error;
4550 4550
                                             $saved_post_id = 0;
4551 4551
                                         } else {
4552 4552
                                             $saved_post_id = $post_id;
@@ -4554,9 +4554,9 @@  discard block
 block discarded – undo
4554 4554
                                         }
4555 4555
                                     }
4556 4556
                                 } else {
4557
-                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4558
-                                        if ( is_wp_error( $saved_post_id ) ) {
4559
-                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4557
+                                    if ($saved_post_id = wp_insert_post($save_post, true)) {
4558
+                                        if (is_wp_error($saved_post_id)) {
4559
+                                            $gd_wp_error = $saved_post_id->get_error_message().' '.$wp_chars_error;
4560 4560
                                             $saved_post_id = 0;
4561 4561
                                         } else {
4562 4562
                                             $created++;
@@ -4564,19 +4564,19 @@  discard block
 block discarded – undo
4564 4564
                                     }
4565 4565
                                 }
4566 4566
                                 
4567
-                                if ( !$saved_post_id > 0 ) {
4567
+                                if (!$saved_post_id > 0) {
4568 4568
                                     $invalid++;
4569
-                                    geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error );
4569
+                                    geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_wp_error);
4570 4570
                                 }
4571
-                            } else if ( $import_choice == 'skip' ) {
4572
-                                if ( $post_id > 0 && get_post( $post_id ) ) {
4571
+                            } else if ($import_choice == 'skip') {
4572
+                                if ($post_id > 0 && get_post($post_id)) {
4573 4573
                                     $skipped++;	
4574 4574
                                 } else {
4575
-                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4576
-                                        if ( is_wp_error( $saved_post_id ) ) {
4575
+                                    if ($saved_post_id = wp_insert_post($save_post, true)) {
4576
+                                        if (is_wp_error($saved_post_id)) {
4577 4577
                                             $invalid++;
4578 4578
                                             
4579
-                                            geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error );
4579
+                                            geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$saved_post_id->get_error_message().' '.$wp_chars_error);
4580 4580
                                             $saved_post_id = 0;
4581 4581
                                         } else {
4582 4582
                                             $created++;
@@ -4584,28 +4584,28 @@  discard block
 block discarded – undo
4584 4584
                                     } else {
4585 4585
                                         $invalid++;
4586 4586
                                         
4587
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error );
4587
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error);
4588 4588
                                     }
4589 4589
                                 }
4590 4590
                             } else {
4591 4591
                                 $invalid++;
4592 4592
                                 
4593
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error );
4593
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error);
4594 4594
                             }
4595 4595
 
4596
-                            if ( (int)$saved_post_id > 0 ) {
4596
+                            if ((int) $saved_post_id > 0) {
4597 4597
                                 // WPML
4598 4598
                                 if ($is_wpml && $original_post_id > 0 && $language != '') {
4599
-                                    $wpml_post_type = 'post_' . $post_type;
4600
-                                    $source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type );
4599
+                                    $wpml_post_type = 'post_'.$post_type;
4600
+                                    $source_language = geodir_get_language_for_element($original_post_id, $wpml_post_type);
4601 4601
                                     $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language();
4602 4602
 
4603
-                                    $trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type );
4603
+                                    $trid = $sitepress->get_element_trid($original_post_id, $wpml_post_type);
4604 4604
                                     
4605
-                                    $sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language );
4605
+                                    $sitepress->set_element_language_details($saved_post_id, $wpml_post_type, $trid, $language, $source_language);
4606 4606
                                 }
4607 4607
                                 // WPML
4608
-                                $gd_post_info = geodir_get_post_info( $saved_post_id );
4608
+                                $gd_post_info = geodir_get_post_info($saved_post_id);
4609 4609
                                 
4610 4610
                                 $gd_post['post_id'] = $saved_post_id;
4611 4611
                                 $gd_post['ID'] = $saved_post_id;
@@ -4617,7 +4617,7 @@  discard block
 block discarded – undo
4617 4617
                                                     
4618 4618
                                 // post location
4619 4619
                                 $post_location_id = 0;
4620
-                                if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) {
4620
+                                if ($location_allowed && !empty($location_result) && $location_result->location_id > 0) {
4621 4621
                                     $gd_post['post_neighbourhood'] = '';
4622 4622
                                     
4623 4623
                                     $post_location_info = array(
@@ -4627,7 +4627,7 @@  discard block
 block discarded – undo
4627 4627
                                                                 'geo_lat' => $post_latitude,
4628 4628
                                                                 'geo_lng' => $post_longitude
4629 4629
                                                             );
4630
-                                    if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) {
4630
+                                    if ($location_id = (int) geodir_add_new_location($post_location_info)) {
4631 4631
                                         $post_location_id = $location_id;
4632 4632
                                     }
4633 4633
                                     
@@ -4665,14 +4665,14 @@  discard block
 block discarded – undo
4665 4665
                                 $gd_post['post_location_id'] = $post_location_id;
4666 4666
                                 
4667 4667
                                 // post package info
4668
-                                $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0;
4668
+                                $package_id = isset($gd_post['package_id']) && !empty($gd_post['package_id']) ? (int) $gd_post['package_id'] : 0;
4669 4669
                                 if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) {
4670 4670
                                     $package_id = $gd_post_info->package_id;
4671 4671
                                 }
4672 4672
                                 
4673 4673
                                 $package_info = array();
4674 4674
                                 if ($package_id && function_exists('geodir_get_package_info_by_id')) {
4675
-                                    $package_info = (array)geodir_get_package_info_by_id($package_id);
4675
+                                    $package_info = (array) geodir_get_package_info_by_id($package_id);
4676 4676
                                     
4677 4677
                                     if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) {
4678 4678
                                         $package_info = array();
@@ -4680,18 +4680,18 @@  discard block
 block discarded – undo
4680 4680
                                 }
4681 4681
                                 
4682 4682
                                 if (empty($package_info)) {
4683
-                                    $package_info = (array)geodir_post_package_info( array(), '', $post_type );
4683
+                                    $package_info = (array) geodir_post_package_info(array(), '', $post_type);
4684 4684
                                 }
4685 4685
                                  
4686
-                                if (!empty($package_info))	 {
4686
+                                if (!empty($package_info)) {
4687 4687
                                     $package_id = $package_info['pid'];
4688 4688
                                     
4689 4689
                                     if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) {
4690 4690
                                         $gd_post['expire_date'] = $expire_date;
4691 4691
                                     } else {
4692
-                                        if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) {
4693
-                                            $gd_post['alive_days'] = (int)$package_info['days'];
4694
-                                            $gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) );
4692
+                                        if (isset($package_info['days']) && (int) $package_info['days'] > 0) {
4693
+                                            $gd_post['alive_days'] = (int) $package_info['days'];
4694
+                                            $gd_post['expire_date'] = date_i18n('Y-m-d', strtotime($current_date.'+'.(int) $package_info['days'].' days'));
4695 4695
                                         } else {
4696 4696
                                             $gd_post['expire_date'] = 'Never';
4697 4697
                                         }
@@ -4700,7 +4700,7 @@  discard block
 block discarded – undo
4700 4700
                                     $gd_post['package_id'] = $package_id;
4701 4701
                                 }
4702 4702
 
4703
-                                $table = $plugin_prefix . $post_type . '_detail';
4703
+                                $table = $plugin_prefix.$post_type.'_detail';
4704 4704
                                 
4705 4705
                                 if ($post_type == 'gd_event') {
4706 4706
                                     $gd_post = geodir_imex_process_event_data($gd_post);
@@ -4711,28 +4711,28 @@  discard block
 block discarded – undo
4711 4711
                                 }
4712 4712
 
4713 4713
                                 // Export franchise fields
4714
-                                $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false;
4714
+                                $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false;
4715 4715
                                 if ($is_franchise_active) {
4716
-                                    if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) {
4716
+                                    if (isset($gd_post['gd_is_franchise']) && (int) $gd_post['gd_is_franchise'] == 1) {
4717 4717
                                         $gd_franchise_lock = array();
4718 4718
                                         
4719
-                                        if ( isset( $gd_post['gd_franchise_lock'] ) ) {
4720
-                                            $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] );
4721
-                                            $gd_franchise_lock = trim( $gd_franchise_lock );
4722
-                                            $gd_franchise_lock = explode( ",", $gd_franchise_lock );
4719
+                                        if (isset($gd_post['gd_franchise_lock'])) {
4720
+                                            $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock']);
4721
+                                            $gd_franchise_lock = trim($gd_franchise_lock);
4722
+                                            $gd_franchise_lock = explode(",", $gd_franchise_lock);
4723 4723
                                         }
4724 4724
                                         
4725
-                                        update_post_meta( $saved_post_id, 'gd_is_franchise', 1 );
4726
-                                        update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock );
4725
+                                        update_post_meta($saved_post_id, 'gd_is_franchise', 1);
4726
+                                        update_post_meta($saved_post_id, 'gd_franchise_lock', $gd_franchise_lock);
4727 4727
                                     } else {
4728
-                                        if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) {
4729
-                                            geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] );
4728
+                                        if (isset($gd_post['franchise']) && (int) $gd_post['franchise'] > 0 && geodir_franchise_check((int) $gd_post['franchise'])) {
4729
+                                            geodir_save_post_meta($saved_post_id, 'franchise', (int) $gd_post['franchise']);
4730 4730
                                         }
4731 4731
                                     }
4732 4732
                                 }
4733 4733
                                 
4734 4734
                                 if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) {
4735
-                                    $save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) );
4735
+                                    $save_post['post_category'] = array_unique(array_map('intval', $save_post['post_category']));
4736 4736
                                     if ($default_category_id) {
4737 4737
                                         $save_post['post_default_category'] = $default_category_id;
4738 4738
                                         $gd_post['default_category'] = $default_category_id;
@@ -4741,34 +4741,34 @@  discard block
 block discarded – undo
4741 4741
                                 }
4742 4742
                                 
4743 4743
                                 // Save post info
4744
-                                geodir_save_post_info( $saved_post_id, $gd_post );
4744
+                                geodir_save_post_info($saved_post_id, $gd_post);
4745 4745
                                 // post taxonomies
4746
-                                if ( !empty( $save_post['post_category'] ) ) {
4747
-                                    wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy );
4746
+                                if (!empty($save_post['post_category'])) {
4747
+                                    wp_set_object_terms($saved_post_id, $save_post['post_category'], $cat_taxonomy);
4748 4748
                                     
4749
-                                    $post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : '';
4749
+                                    $post_default_category = isset($save_post['post_default_category']) ? $save_post['post_default_category'] : '';
4750 4750
                                     if ($default_category_id) {
4751 4751
                                         $post_default_category = $default_category_id;
4752 4752
                                     }
4753 4753
                                     $post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy);
4754 4754
                                     $save_post['post_category'] = !empty($post_cat_ids) ? explode(",", trim($post_cat_ids, ",")) : $save_post['post_category'];
4755
-                                    $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']) . ',y:' : '';
4755
+                                    $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']).',y:' : '';
4756 4756
                                     
4757 4757
                                     if ($post_category_str != '' && $post_default_category) {
4758
-                                        $post_category_str = str_replace($post_default_category . ',y:', $post_default_category . ',y,d:', $post_category_str);
4758
+                                        $post_category_str = str_replace($post_default_category.',y:', $post_default_category.',y,d:', $post_category_str);
4759 4759
                                     }
4760 4760
                                     
4761 4761
                                     $post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : '';
4762 4762
                                     
4763
-                                    geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str );
4763
+                                    geodir_set_postcat_structure($saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str);
4764 4764
                                 }
4765 4765
 
4766
-                                if ( !empty( $save_post['post_tags'] ) ) {
4767
-                                    wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy );
4766
+                                if (!empty($save_post['post_tags'])) {
4767
+                                    wp_set_object_terms($saved_post_id, $save_post['post_tags'], $tags_taxonomy);
4768 4768
                                 }
4769 4769
 
4770 4770
                                 // Post images
4771
-                                if ( !empty( $post_images ) ) {
4771
+                                if (!empty($post_images)) {
4772 4772
                                     $post_images = array_unique($post_images);
4773 4773
                                     
4774 4774
                                     $old_post_images_arr = array();
@@ -4776,82 +4776,82 @@  discard block
 block discarded – undo
4776 4776
                                     
4777 4777
                                     $order = 1;
4778 4778
                                     
4779
-                                    $old_post_images = geodir_get_images( $saved_post_id );
4779
+                                    $old_post_images = geodir_get_images($saved_post_id);
4780 4780
                                     if (!empty($old_post_images)) {
4781
-                                        foreach( $old_post_images as $old_post_image ) {
4781
+                                        foreach ($old_post_images as $old_post_image) {
4782 4782
                                             if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') {
4783 4783
                                                 $old_post_images_arr[] = $old_post_image->file;
4784 4784
                                             }
4785 4785
                                         }
4786 4786
                                     }
4787 4787
                                     
4788
-                                    foreach ( $post_images as $post_image ) {
4789
-                                        $image_name = basename( $post_image );
4788
+                                    foreach ($post_images as $post_image) {
4789
+                                        $image_name = basename($post_image);
4790 4790
                                         $saved_post_images_arr[] = $image_name;
4791 4791
                                         
4792
-                                        if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) {
4792
+                                        if (!empty($old_post_images_arr) && in_array($image_name, $old_post_images_arr)) {
4793 4793
                                             continue; // Skip if image already exists.
4794 4794
                                         }
4795 4795
                                         
4796
-                                        $image_name_parts = explode( '.', $image_name );
4797
-                                        array_pop( $image_name_parts );
4798
-                                        $proper_image_name = implode( '.', $image_name_parts );
4796
+                                        $image_name_parts = explode('.', $image_name);
4797
+                                        array_pop($image_name_parts);
4798
+                                        $proper_image_name = implode('.', $image_name_parts);
4799 4799
                                         
4800
-                                        $arr_file_type = wp_check_filetype( $image_name );
4800
+                                        $arr_file_type = wp_check_filetype($image_name);
4801 4801
                                         
4802
-                                        if ( !empty( $arr_file_type ) ) {
4802
+                                        if (!empty($arr_file_type)) {
4803 4803
                                             $uploaded_file_type = $arr_file_type['type'];
4804 4804
                                             
4805 4805
                                             $attachment = array();
4806 4806
                                             $attachment['post_id'] = $saved_post_id;
4807 4807
                                             $attachment['title'] = $proper_image_name;
4808 4808
                                             $attachment['content'] = '';
4809
-                                            $attachment['file'] = $uploads_subdir . '/' . $image_name;
4809
+                                            $attachment['file'] = $uploads_subdir.'/'.$image_name;
4810 4810
                                             $attachment['mime_type'] = $uploaded_file_type;
4811 4811
                                             $attachment['menu_order'] = $order;
4812 4812
                                             $attachment['is_featured'] = 0;
4813 4813
 
4814 4814
                                             $attachment_set = '';
4815
-                                            foreach ( $attachment as $key => $val ) {
4816
-                                                if ( $val != '' ) {
4817
-                                                    $attachment_set .= $key . " = '" . $val . "', ";
4815
+                                            foreach ($attachment as $key => $val) {
4816
+                                                if ($val != '') {
4817
+                                                    $attachment_set .= $key." = '".$val."', ";
4818 4818
                                                 }
4819 4819
                                             }
4820
-                                            $attachment_set = trim( $attachment_set, ", " );
4820
+                                            $attachment_set = trim($attachment_set, ", ");
4821 4821
                                                                                         
4822 4822
                                             // Add new attachment
4823
-                                            $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set );
4823
+                                            $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
4824 4824
                                                                                         
4825 4825
                                             $order++;
4826 4826
                                         }
4827 4827
                                     }
4828 4828
 
4829
-                                    $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/",  $saved_post_images_arr) . "' )" : '';
4829
+                                    $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/".implode("' AND file NOT LIKE '%/", $saved_post_images_arr)."' )" : '';
4830 4830
                                     // Remove previous attachment
4831
-                                    $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql );
4831
+                                    $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = ".(int) $saved_post_id." ".$saved_post_images_sql);
4832 4832
                                     
4833
-                                    if ( !empty( $saved_post_images_arr ) ) {
4833
+                                    if (!empty($saved_post_images_arr)) {
4834 4834
                                         $menu_order = 1;
4835 4835
                                         
4836
-                                        foreach ( $saved_post_images_arr as $img_name ) {
4837
-                                            $wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array( $menu_order, $saved_post_id, '%/' . $img_name ) ) );
4836
+                                        foreach ($saved_post_images_arr as $img_name) {
4837
+                                            $wpdb->query($wpdb->prepare("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array($menu_order, $saved_post_id, '%/'.$img_name)));
4838 4838
                                             
4839
-                                            if( $menu_order == 1 ) {
4840
-                                                if ( $featured_image = $wpdb->get_var( $wpdb->prepare( "SELECT file FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =%d AND file LIKE %s", array( $saved_post_id, '%/' . $img_name ) ) ) ) {
4841
-                                                    $wpdb->query( $wpdb->prepare( "UPDATE " . $table . " SET featured_image = %s WHERE post_id =%d", array( $featured_image, $saved_post_id ) ) );
4839
+                                            if ($menu_order == 1) {
4840
+                                                if ($featured_image = $wpdb->get_var($wpdb->prepare("SELECT file FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =%d AND file LIKE %s", array($saved_post_id, '%/'.$img_name)))) {
4841
+                                                    $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s WHERE post_id =%d", array($featured_image, $saved_post_id)));
4842 4842
                                                 }
4843 4843
                                             }
4844 4844
                                             $menu_order++;
4845 4845
                                         }
4846 4846
                                     }
4847 4847
                                     
4848
-                                    if ( $order > 1 ) {
4848
+                                    if ($order > 1) {
4849 4849
                                         $images++;
4850 4850
                                     }
4851 4851
                                 }
4852 4852
 
4853 4853
                                 /** This action is documented in geodirectory-functions/post-functions.php */
4854
-                                do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post );
4854
+                                do_action('geodir_after_save_listing', $saved_post_id, $gd_post);
4855 4855
                                 
4856 4856
                                 if (isset($is_featured)) {
4857 4857
                                     geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured);
@@ -4871,10 +4871,10 @@  discard block
 block discarded – undo
4871 4871
                 }
4872 4872
 
4873 4873
                 //undo some stuff to make the import quicker
4874
-                wp_defer_term_counting( false );
4875
-                wp_defer_comment_counting( false );
4876
-                $wpdb->query( 'COMMIT;' );
4877
-                $wpdb->query( 'SET autocommit = 1;' );
4874
+                wp_defer_term_counting(false);
4875
+                wp_defer_comment_counting(false);
4876
+                $wpdb->query('COMMIT;');
4877
+                $wpdb->query('SET autocommit = 1;');
4878 4878
 
4879 4879
                 $json = array();
4880 4880
                 $json['processed'] = $processed_actual;
@@ -4885,9 +4885,9 @@  discard block
 block discarded – undo
4885 4885
                 $json['invalid_addr'] = $invalid_addr;
4886 4886
                 $json['images'] = $images;
4887 4887
                 
4888
-                wp_send_json( $json );
4888
+                wp_send_json($json);
4889 4889
                 exit;
4890
-            } else if ( $task == 'import_loc' ) {
4890
+            } else if ($task == 'import_loc') {
4891 4891
                 global $gd_post_types;
4892 4892
                 $gd_post_types = $post_types;
4893 4893
                 
@@ -4896,82 +4896,82 @@  discard block
 block discarded – undo
4896 4896
                     
4897 4897
                     if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4898 4898
                         $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
4899
-                        wp_send_json( $json );
4899
+                        wp_send_json($json);
4900 4900
                     }
4901 4901
                     
4902 4902
                     $gd_error_log = __('GD IMPORT LOCATIONS [ROW %d]:', 'geodirectory');
4903
-                    $gd_error_location = __( 'Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory' );
4903
+                    $gd_error_location = __('Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory');
4904 4904
                     for ($i = 1; $i <= $limit; $i++) {
4905 4905
                         $index = $processed + $i;
4906 4906
                         
4907 4907
                         if (isset($file[$index])) {
4908 4908
                             $row = $file[$index];
4909
-                            $row = array_map( 'trim', $row );
4909
+                            $row = array_map('trim', $row);
4910 4910
                             $data = array();
4911 4911
                             
4912
-                            foreach ($columns as $c => $column ) {
4912
+                            foreach ($columns as $c => $column) {
4913 4913
                                 if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta', 'city_desc', 'region_meta', 'region_desc', 'country_meta', 'country_desc'))) {
4914 4914
                                     $data[$column] = $row[$c];
4915 4915
                                 }
4916 4916
                             }
4917 4917
 
4918
-                            if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) {
4918
+                            if (empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude'])) {
4919 4919
                                 $invalid++;
4920
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4920
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location);
4921 4921
                                 continue;
4922 4922
                             }
4923 4923
                             
4924 4924
                             $data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0;
4925 4925
                             
4926
-                            if ( $import_choice == 'update' ) {
4927
-                                if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
4928
-                                    if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
4926
+                            if ($import_choice == 'update') {
4927
+                                if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) {
4928
+                                    if ($location_id = geodir_location_update_city($data, true, $location)) {
4929 4929
                                         $updated++;
4930 4930
                                     } else {
4931 4931
                                         $invalid++;
4932
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4932
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location);
4933 4933
                                     }
4934
-                                } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
4935
-                                    $data['location_id'] = (int)$location->location_id;
4934
+                                } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) {
4935
+                                    $data['location_id'] = (int) $location->location_id;
4936 4936
                                     
4937
-                                    if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) {
4938
-                                        $data['location_id'] = (int)$location->location_id;
4939
-                                    } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) {
4940
-                                        $data['location_id'] = (int)$location->location_id;
4941
-                                    } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) {
4942
-                                        $data['location_id'] = (int)$location->location_id;
4937
+                                    if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region']))) {
4938
+                                        $data['location_id'] = (int) $location->location_id;
4939
+                                    } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'region' => $data['region']))) {
4940
+                                        $data['location_id'] = (int) $location->location_id;
4941
+                                    } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country']))) {
4942
+                                        $data['location_id'] = (int) $location->location_id;
4943 4943
                                     }
4944 4944
                                     
4945
-                                    if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
4945
+                                    if ($location_id = geodir_location_update_city($data, true, $location)) {
4946 4946
                                         $updated++;
4947 4947
                                     } else {
4948 4948
                                         $invalid++;
4949
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4949
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location);
4950 4950
                                     }
4951 4951
                                 } else {
4952
-                                    if ( $location_id = geodir_location_insert_city( $data, true ) ) {
4952
+                                    if ($location_id = geodir_location_insert_city($data, true)) {
4953 4953
                                         $created++;
4954 4954
                                     } else {
4955 4955
                                         $invalid++;
4956
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4956
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location);
4957 4957
                                     }
4958 4958
                                 }
4959
-                            } elseif ( $import_choice == 'skip' ) {
4960
-                                if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
4959
+                            } elseif ($import_choice == 'skip') {
4960
+                                if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) {
4961 4961
                                     $skipped++;
4962
-                                } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
4962
+                                } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) {
4963 4963
                                     $skipped++;
4964 4964
                                 } else {
4965
-                                    if ( $location_id = geodir_location_insert_city( $data, true ) ) {
4965
+                                    if ($location_id = geodir_location_insert_city($data, true)) {
4966 4966
                                         $created++;
4967 4967
                                     } else {
4968 4968
                                         $invalid++;
4969
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4969
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location);
4970 4970
                                     }
4971 4971
                                 }
4972 4972
                             } else {
4973 4973
                                 $invalid++;
4974
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4974
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location);
4975 4975
                             }
4976 4976
                         }
4977 4977
                     }
@@ -4985,24 +4985,24 @@  discard block
 block discarded – undo
4985 4985
                 $json['invalid'] = $invalid;
4986 4986
                 $json['images'] = $images;
4987 4987
                 
4988
-                wp_send_json( $json );
4989
-            } else if ( $task == 'import_hood' ) {               
4988
+                wp_send_json($json);
4989
+            } else if ($task == 'import_hood') {               
4990 4990
                 if (!empty($file)) {
4991 4991
                     $columns = isset($file[0]) ? $file[0] : NULL;
4992 4992
                     
4993 4993
                     if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4994 4994
                         $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
4995
-                        wp_send_json( $json );
4995
+                        wp_send_json($json);
4996 4996
                     }
4997 4997
                     
4998 4998
                     $gd_error_log = __('GD IMPORT NEIGHBOURHOODS [ROW %d]:', 'geodirectory');
4999
-                    $gd_error_hood = __( 'Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' );
4999
+                    $gd_error_hood = __('Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory');
5000 5000
                     for ($i = 1; $i <= $limit; $i++) {
5001 5001
                         $index = $processed + $i;
5002 5002
                         
5003 5003
                         if (isset($file[$index])) {
5004 5004
                             $row = $file[$index];
5005
-                            $row = array_map( 'trim', $row );
5005
+                            $row = array_map('trim', $row);
5006 5006
                             $data = array();
5007 5007
                             
5008 5008
                             foreach ($columns as $c => $column) {
@@ -5013,20 +5013,20 @@  discard block
 block discarded – undo
5013 5013
 
5014 5014
                             if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) {
5015 5015
                                 $invalid++;
5016
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5016
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood);
5017 5017
                                 continue;
5018 5018
                             }
5019 5019
                             
5020 5020
                             $location_info = array();
5021
-                            if (!empty($data['location_id']) && (int)$data['location_id'] > 0) {
5022
-                                $location_info = geodir_get_location_by_id('', (int)$data['location_id']);
5021
+                            if (!empty($data['location_id']) && (int) $data['location_id'] > 0) {
5022
+                                $location_info = geodir_get_location_by_id('', (int) $data['location_id']);
5023 5023
                             } else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) {
5024 5024
                                 $location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region']));
5025 5025
                             }
5026 5026
 
5027 5027
                             if (empty($location_info)) {
5028 5028
                                 $invalid++;
5029
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5029
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood);
5030 5030
                                 continue;
5031 5031
                             }
5032 5032
                             
@@ -5041,35 +5041,35 @@  discard block
 block discarded – undo
5041 5041
                             $hood_data['hood_longitude'] = $data['longitude'];
5042 5042
                             $hood_data['hood_location_id'] = $location_id;
5043 5043
                                     
5044
-                            if ( $import_choice == 'update' ) {
5045
-                                if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
5046
-                                    $hood_data['hood_id'] = (int)$data['neighbourhood_id'];
5044
+                            if ($import_choice == 'update') {
5045
+                                if ((int) $data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int) $data['neighbourhood_id']))) {
5046
+                                    $hood_data['hood_id'] = (int) $data['neighbourhood_id'];
5047 5047
                                     
5048 5048
                                     if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5049 5049
                                         $updated++;
5050 5050
                                     } else {
5051 5051
                                         $invalid++;
5052
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5052
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood);
5053 5053
                                     }
5054 5054
                                 } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
5055
-                                    $hood_data['hood_id'] = (int)$neighbourhood->hood_id;
5055
+                                    $hood_data['hood_id'] = (int) $neighbourhood->hood_id;
5056 5056
                                     
5057 5057
                                     if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5058 5058
                                         $updated++;
5059 5059
                                     } else {
5060 5060
                                         $invalid++;
5061
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5061
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood);
5062 5062
                                     }
5063 5063
                                 } else {
5064 5064
                                     if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5065 5065
                                         $created++;
5066 5066
                                     } else {
5067 5067
                                         $invalid++;
5068
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5068
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood);
5069 5069
                                     }
5070 5070
                                 }
5071
-                            } elseif ( $import_choice == 'skip' ) {
5072
-                                if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
5071
+                            } elseif ($import_choice == 'skip') {
5072
+                                if ((int) $data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int) $data['neighbourhood_id']))) {
5073 5073
                                     $skipped++;
5074 5074
                                 } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
5075 5075
                                     $skipped++;
@@ -5079,12 +5079,12 @@  discard block
 block discarded – undo
5079 5079
                                         $created++;
5080 5080
                                     } else {
5081 5081
                                         $invalid++;
5082
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5082
+                                        geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood);
5083 5083
                                     }
5084 5084
                                 }
5085 5085
                             } else {
5086 5086
                                 $invalid++;
5087
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5087
+                                geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood);
5088 5088
                             }
5089 5089
                         }
5090 5090
                     }
@@ -5098,7 +5098,7 @@  discard block
 block discarded – undo
5098 5098
                 $json['invalid'] = $invalid;
5099 5099
                 $json['images'] = $images;
5100 5100
                 
5101
-                wp_send_json( $json );
5101
+                wp_send_json($json);
5102 5102
             }
5103 5103
         }
5104 5104
         break;
@@ -5142,29 +5142,29 @@  discard block
 block discarded – undo
5142 5142
  * }
5143 5143
  * @return int|bool Term id when success, false when fail.
5144 5144
  */
5145
-function geodir_imex_insert_term( $taxonomy, $term_data ) {
5146
-	if ( empty( $taxonomy ) || empty( $term_data ) ) {
5145
+function geodir_imex_insert_term($taxonomy, $term_data) {
5146
+	if (empty($taxonomy) || empty($term_data)) {
5147 5147
 		return false;
5148 5148
 	}
5149 5149
 	
5150
-	$term = isset( $term_data['name'] ) && !empty( $term_data['name'] ) ? $term_data['name'] : '';
5150
+	$term = isset($term_data['name']) && !empty($term_data['name']) ? $term_data['name'] : '';
5151 5151
 	$args = array();
5152
-	$args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : '';
5153
-	$args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : '';
5154
-	$args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : '';
5152
+	$args['description'] = isset($term_data['description']) ? $term_data['description'] : '';
5153
+	$args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : '';
5154
+	$args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : '';
5155 5155
 	
5156
-	if ( ( !empty( $args['slug'] ) && term_exists( $args['slug'], $taxonomy ) ) || empty( $args['slug'] ) ) {
5157
-		$term_args = array_merge( $term_data, $args );
5158
-		$defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
5159
-		$term_args = wp_parse_args( $term_args, $defaults );
5160
-		$term_args = sanitize_term( $term_args, $taxonomy, 'db' );
5161
-		$args['slug'] = wp_unique_term_slug( $args['slug'], (object)$term_args );
5156
+	if ((!empty($args['slug']) && term_exists($args['slug'], $taxonomy)) || empty($args['slug'])) {
5157
+		$term_args = array_merge($term_data, $args);
5158
+		$defaults = array('alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
5159
+		$term_args = wp_parse_args($term_args, $defaults);
5160
+		$term_args = sanitize_term($term_args, $taxonomy, 'db');
5161
+		$args['slug'] = wp_unique_term_slug($args['slug'], (object) $term_args);
5162 5162
 	}
5163 5163
 	
5164
-    if( !empty( $term ) ) {
5165
-		$result = wp_insert_term( $term, $taxonomy, $args );
5166
-        if( !is_wp_error( $result ) ) {
5167
-            return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5164
+    if (!empty($term)) {
5165
+		$result = wp_insert_term($term, $taxonomy, $args);
5166
+        if (!is_wp_error($result)) {
5167
+            return isset($result['term_id']) ? $result['term_id'] : 0;
5168 5168
         }
5169 5169
     }
5170 5170
 	
@@ -5194,36 +5194,36 @@  discard block
 block discarded – undo
5194 5194
  * }
5195 5195
  * @return int|bool Term id when success, false when fail.
5196 5196
  */
5197
-function geodir_imex_update_term( $taxonomy, $term_data ) {
5198
-	if ( empty( $taxonomy ) || empty( $term_data ) ) {
5197
+function geodir_imex_update_term($taxonomy, $term_data) {
5198
+	if (empty($taxonomy) || empty($term_data)) {
5199 5199
 		return false;
5200 5200
 	}
5201 5201
 	
5202
-	$term_id = isset( $term_data['term_id'] ) && !empty( $term_data['term_id'] ) ? $term_data['term_id'] : 0;
5202
+	$term_id = isset($term_data['term_id']) && !empty($term_data['term_id']) ? $term_data['term_id'] : 0;
5203 5203
 	
5204 5204
 	$args = array();
5205
-	$args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : '';
5206
-	$args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : '';
5207
-	$args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : '';
5205
+	$args['description'] = isset($term_data['description']) ? $term_data['description'] : '';
5206
+	$args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : '';
5207
+	$args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : '';
5208 5208
 	
5209
-	if ( $term_id > 0 && $term_info = (array)get_term( $term_id, $taxonomy ) ) {
5209
+	if ($term_id > 0 && $term_info = (array) get_term($term_id, $taxonomy)) {
5210 5210
 		$term_data['term_id'] = $term_info['term_id'];
5211 5211
 		
5212
-		$result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data );
5212
+		$result = wp_update_term($term_data['term_id'], $taxonomy, $term_data);
5213 5213
 		
5214
-		if( !is_wp_error( $result ) ) {
5215
-            return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5214
+		if (!is_wp_error($result)) {
5215
+            return isset($result['term_id']) ? $result['term_id'] : 0;
5216 5216
         }
5217
-	} else if ( $term_data['slug'] != '' && $term_info = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
5217
+	} else if ($term_data['slug'] != '' && $term_info = (array) term_exists($term_data['slug'], $taxonomy)) {
5218 5218
 		$term_data['term_id'] = $term_info['term_id'];
5219 5219
 		
5220
-		$result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data );
5220
+		$result = wp_update_term($term_data['term_id'], $taxonomy, $term_data);
5221 5221
 		
5222
-		if( !is_wp_error( $result ) ) {
5223
-            return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5222
+		if (!is_wp_error($result)) {
5223
+            return isset($result['term_id']) ? $result['term_id'] : 0;
5224 5224
         }
5225 5225
 	} else {
5226
-		return geodir_imex_insert_term( $taxonomy, $term_data );
5226
+		return geodir_imex_insert_term($taxonomy, $term_data);
5227 5227
 	}
5228 5228
 	
5229 5229
 	return false;
@@ -5241,25 +5241,25 @@  discard block
 block discarded – undo
5241 5241
  * @param string $post_type Post type.
5242 5242
  * @return int Posts count.
5243 5243
  */
5244
-function geodir_get_posts_count( $post_type ) {
5244
+function geodir_get_posts_count($post_type) {
5245 5245
     global $wpdb, $plugin_prefix;
5246 5246
 
5247
-    if ( !post_type_exists( $post_type ) ) {
5247
+    if (!post_type_exists($post_type)) {
5248 5248
         return 0;
5249 5249
     }
5250 5250
         
5251
-    $table = $plugin_prefix . $post_type . '_detail';
5251
+    $table = $plugin_prefix.$post_type.'_detail';
5252 5252
 
5253 5253
     // Skip listing with statuses trash, auto-draft etc...
5254 5254
     $skip_statuses = geodir_imex_export_skip_statuses();
5255 5255
     $where_statuses = '';
5256
-    if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5257
-        $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5256
+    if (!empty($skip_statuses) && is_array($skip_statuses)) {
5257
+        $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')";
5258 5258
     }
5259 5259
 
5260
-    $query = $wpdb->prepare( "SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses, $post_type );
5260
+    $query = $wpdb->prepare("SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s ".$where_statuses, $post_type);
5261 5261
 
5262
-    $posts_count = (int)$wpdb->get_var( $query );
5262
+    $posts_count = (int) $wpdb->get_var($query);
5263 5263
     
5264 5264
     /**
5265 5265
      * Modify returned post counts for the current post type.
@@ -5270,7 +5270,7 @@  discard block
 block discarded – undo
5270 5270
      * @param int $posts_count Post counts.
5271 5271
      * @param string $post_type Post type.
5272 5272
      */
5273
-    $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type );
5273
+    $posts_count = apply_filters('geodir_imex_count_posts', $posts_count, $post_type);
5274 5274
 
5275 5275
     return $posts_count;
5276 5276
 }
@@ -5291,17 +5291,17 @@  discard block
 block discarded – undo
5291 5291
  * @param int $page_no Page number. Default 0.
5292 5292
  * @return array Array of posts data.
5293 5293
  */
5294
-function geodir_imex_get_posts( $post_type, $per_page = 0, $page_no = 0 ) {	
5294
+function geodir_imex_get_posts($post_type, $per_page = 0, $page_no = 0) {	
5295 5295
 	global $wp_filesystem;
5296 5296
 
5297
-	$posts = geodir_get_export_posts( $post_type, $per_page, $page_no );
5297
+	$posts = geodir_get_export_posts($post_type, $per_page, $page_no);
5298 5298
 
5299 5299
 	$csv_rows = array();
5300 5300
 	
5301
-	if ( !empty( $posts ) ) {
5302
-		$is_payment_plugin = is_plugin_active( 'geodir_payment_manager/geodir_payment_manager.php' );
5301
+	if (!empty($posts)) {
5302
+		$is_payment_plugin = is_plugin_active('geodir_payment_manager/geodir_payment_manager.php');
5303 5303
         $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
5304
-        $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true;
5304
+        $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true;
5305 5305
         $neighbourhood_active = $location_manager && $location_allowed && get_option('location_neighbourhoods') ? true : false;
5306 5306
 		
5307 5307
 		$csv_row = array();
@@ -5313,7 +5313,7 @@  discard block
 block discarded – undo
5313 5313
 		$csv_row[] = 'default_category';
5314 5314
 		$csv_row[] = 'post_tags';
5315 5315
 		$csv_row[] = 'post_type';
5316
-		if ( $post_type == 'gd_event' ) {
5316
+		if ($post_type == 'gd_event') {
5317 5317
 			$csv_row[] = 'event_date';
5318 5318
 			$csv_row[] = 'event_enddate';
5319 5319
 			$csv_row[] = 'starttime';
@@ -5367,15 +5367,15 @@  discard block
 block discarded – undo
5367 5367
 		}
5368 5368
 		// WPML
5369 5369
 
5370
-		$custom_fields = geodir_imex_get_custom_fields( $post_type );
5371
-		if ( !empty( $custom_fields ) ) {
5372
-			foreach ( $custom_fields as $custom_field ) {
5370
+		$custom_fields = geodir_imex_get_custom_fields($post_type);
5371
+		if (!empty($custom_fields)) {
5372
+			foreach ($custom_fields as $custom_field) {
5373 5373
 				$csv_row[] = $custom_field->htmlvar_name;
5374 5374
 			}
5375 5375
 		}
5376 5376
 
5377 5377
 		// Export franchise fields
5378
-		$is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false;
5378
+		$is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false;
5379 5379
 		if ($is_franchise_active) {
5380 5380
 			$csv_row[] = 'gd_is_franchise';
5381 5381
 			$csv_row[] = 'gd_franchise_lock';
@@ -5385,28 +5385,28 @@  discard block
 block discarded – undo
5385 5385
 		$csv_rows[] = $csv_row;
5386 5386
 
5387 5387
 		$images_count = 5;
5388
-        $xx=0;
5389
-		foreach ( $posts as $post ) {$xx++;
5388
+        $xx = 0;
5389
+		foreach ($posts as $post) {$xx++;
5390 5390
 			$post_id = $post['ID'];
5391 5391
 			
5392
-			$gd_post_info = geodir_get_post_info( $post_id );
5393
-			$post_info = (array)$gd_post_info;
5392
+			$gd_post_info = geodir_get_post_info($post_id);
5393
+			$post_info = (array) $gd_post_info;
5394 5394
 						
5395
-			$taxonomy_category = $post_type . 'category';
5396
-			$taxonomy_tags = $post_type . '_tags';
5395
+			$taxonomy_category = $post_type.'category';
5396
+			$taxonomy_tags = $post_type.'_tags';
5397 5397
 			
5398 5398
 			$post_category = '';
5399 5399
 			$default_category_id = $gd_post_info->default_category;
5400 5400
 			$default_category = '';
5401 5401
 			$post_tags = '';
5402
-			$terms = wp_get_post_terms( $post_id, array( $taxonomy_category, $taxonomy_tags ) );
5402
+			$terms = wp_get_post_terms($post_id, array($taxonomy_category, $taxonomy_tags));
5403 5403
 			
5404
-			if ( !empty( $terms ) && !is_wp_error( $terms ) ) {
5404
+			if (!empty($terms) && !is_wp_error($terms)) {
5405 5405
 				$post_category = array();
5406 5406
 				$post_tags = array();
5407 5407
 			
5408
-				foreach ( $terms as $term ) {
5409
-					if ( $term->taxonomy == $taxonomy_category ) {
5408
+				foreach ($terms as $term) {
5409
+					if ($term->taxonomy == $taxonomy_category) {
5410 5410
 						$post_category[] = $term->name;
5411 5411
 						
5412 5412
 						if ($default_category_id == $term->term_id) {
@@ -5414,7 +5414,7 @@  discard block
 block discarded – undo
5414 5414
 						}
5415 5415
 					}
5416 5416
 					
5417
-					if ( $term->taxonomy == $taxonomy_tags ) {
5417
+					if ($term->taxonomy == $taxonomy_tags) {
5418 5418
 						$post_tags[] = $term->name;
5419 5419
 					}
5420 5420
 				}
@@ -5422,47 +5422,47 @@  discard block
 block discarded – undo
5422 5422
 				if (empty($default_category) && !empty($post_category)) {
5423 5423
 					$default_category = $post_category[0]; // Set first one as default category.
5424 5424
 				}
5425
-				$post_category = !empty( $post_category ) ? implode( ',', $post_category ) : '';
5426
-				$post_tags = !empty( $post_tags ) ? implode( ',', $post_tags ) : '';
5425
+				$post_category = !empty($post_category) ? implode(',', $post_category) : '';
5426
+				$post_tags = !empty($post_tags) ? implode(',', $post_tags) : '';
5427 5427
 			}
5428 5428
 
5429 5429
 			// Franchise data
5430
-			if ($is_franchise_active && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 && geodir_franchise_check((int)$post_info['franchise'])) {
5430
+			if ($is_franchise_active && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 && geodir_franchise_check((int) $post_info['franchise'])) {
5431 5431
 				$franchise_id = $post_info['franchise'];
5432 5432
 				$gd_franchise_info = geodir_get_post_info($franchise_id);
5433 5433
 
5434 5434
 				if (geodir_franchise_pkg_is_active($gd_franchise_info)) {
5435
-					$franchise_info = (array)$gd_franchise_info;
5435
+					$franchise_info = (array) $gd_franchise_info;
5436 5436
 					$locked_fields = geodir_franchise_get_locked_fields($franchise_id, true);
5437 5437
 					
5438 5438
 					if (!empty($locked_fields)) {
5439
-						foreach( $locked_fields as $locked_field) {
5439
+						foreach ($locked_fields as $locked_field) {
5440 5440
 							if (isset($post_info[$locked_field]) && isset($franchise_info[$locked_field])) {
5441 5441
 								$post_info[$locked_field] = $franchise_info[$locked_field];
5442 5442
 							}
5443 5443
 							
5444 5444
 							if (in_array($taxonomy_category, $locked_fields) || in_array('post_tags', $locked_fields)) {
5445
-								$franchise_terms = wp_get_post_terms( $franchise_id, array( $taxonomy_category, $taxonomy_tags ) );
5445
+								$franchise_terms = wp_get_post_terms($franchise_id, array($taxonomy_category, $taxonomy_tags));
5446 5446
 			
5447
-								if ( !empty( $franchise_terms ) && !is_wp_error( $franchise_terms ) ) {
5447
+								if (!empty($franchise_terms) && !is_wp_error($franchise_terms)) {
5448 5448
 									$franchise_post_category = array();
5449 5449
 									$franchise_post_tags = array();
5450 5450
 								
5451
-									foreach ( $franchise_terms as $franchise_term ) {
5452
-										if ( $franchise_term->taxonomy == $taxonomy_category ) {
5451
+									foreach ($franchise_terms as $franchise_term) {
5452
+										if ($franchise_term->taxonomy == $taxonomy_category) {
5453 5453
 											$franchise_post_category[] = $franchise_term->name;
5454 5454
 										}
5455 5455
 										
5456
-										if ( $franchise_term->taxonomy == $taxonomy_tags ) {
5456
+										if ($franchise_term->taxonomy == $taxonomy_tags) {
5457 5457
 											$franchise_post_tags[] = $franchise_term->name;
5458 5458
 										}
5459 5459
 									}
5460 5460
 									
5461 5461
 									if (in_array($taxonomy_category, $locked_fields)) {
5462
-										$post_category = !empty( $franchise_post_category ) ? implode( ',', $franchise_post_category ) : '';
5462
+										$post_category = !empty($franchise_post_category) ? implode(',', $franchise_post_category) : '';
5463 5463
 									}
5464 5464
 									if (in_array('post_tags', $locked_fields)) {
5465
-										$post_tags = !empty( $franchise_post_tags ) ? implode( ',', $franchise_post_tags ) : '';
5465
+										$post_tags = !empty($franchise_post_tags) ? implode(',', $franchise_post_tags) : '';
5466 5466
 									}
5467 5467
 								}
5468 5468
 							}
@@ -5471,18 +5471,18 @@  discard block
 block discarded – undo
5471 5471
 				}
5472 5472
 			}
5473 5473
 						
5474
-			$post_images = geodir_get_images( $post_id );
5474
+			$post_images = geodir_get_images($post_id);
5475 5475
 			$current_images = array();
5476
-			if ( !empty( $post_images ) ) {
5477
-				foreach ( $post_images as $post_image ) {
5478
-					$post_image = (array)$post_image;
5479
-					$image = !empty( $post_image ) && isset( $post_image['path'] ) && $wp_filesystem->is_file( $post_image['path'] ) && $wp_filesystem->exists( $post_image['path'] ) ? $post_image['src'] : '';
5480
-					if ( $image ) {
5476
+			if (!empty($post_images)) {
5477
+				foreach ($post_images as $post_image) {
5478
+					$post_image = (array) $post_image;
5479
+					$image = !empty($post_image) && isset($post_image['path']) && $wp_filesystem->is_file($post_image['path']) && $wp_filesystem->exists($post_image['path']) ? $post_image['src'] : '';
5480
+					if ($image) {
5481 5481
 						$current_images[] = $image;
5482 5482
 					}
5483 5483
 				}
5484 5484
 				
5485
-				$images_count = max( $images_count, count( $current_images ) );
5485
+				$images_count = max($images_count, count($current_images));
5486 5486
 			}
5487 5487
 
5488 5488
 			$csv_row = array();
@@ -5494,7 +5494,7 @@  discard block
 block discarded – undo
5494 5494
 			$csv_row[] = $default_category; // default_category
5495 5495
 			$csv_row[] = $post_tags; // post_tags
5496 5496
 			$csv_row[] = $post_type; // post_type
5497
-			if ( $post_type == 'gd_event' ) {
5497
+			if ($post_type == 'gd_event') {
5498 5498
 				$event_data = geodir_imex_get_event_data($post, $gd_post_info);
5499 5499
 				$csv_row[] = $event_data['event_date']; // event_date
5500 5500
 				$csv_row[] = $event_data['event_enddate']; // enddate
@@ -5515,9 +5515,9 @@  discard block
 block discarded – undo
5515 5515
 				$csv_row[] = $event_data['recurring_end_date']; // repeat_end
5516 5516
 			}
5517 5517
 			$csv_row[] = $post_info['post_status']; // post_status
5518
-			$csv_row[] = (int)$post_info['is_featured'] == 1 ? 1 : ''; // is_featured
5518
+			$csv_row[] = (int) $post_info['is_featured'] == 1 ? 1 : ''; // is_featured
5519 5519
 			if ($is_payment_plugin) {
5520
-				$csv_row[] = (int)$post_info['package_id']; // package_id
5520
+				$csv_row[] = (int) $post_info['package_id']; // package_id
5521 5521
 				$csv_row[] = $post_info['expire_date'] != '' && geodir_strtolower($post_info['expire_date']) != 'never' ? date_i18n('Y-m-d', strtotime($post_info['expire_date'])) : 'Never'; // expire_date
5522 5522
 			}
5523 5523
 			$csv_row[] = $post_info['geodir_video']; // geodir_video
@@ -5553,14 +5553,14 @@  discard block
 block discarded – undo
5553 5553
 			$csv_row[] = $post_info['geodir_special_offers']; // geodir_special_offers
5554 5554
 			// WPML
5555 5555
 			if ($is_wpml) {
5556
-				$csv_row[] = geodir_get_language_for_element( $post_id, 'post_' . $post_type );
5557
-				$csv_row[] = geodir_imex_original_post_id( $post_id, 'post_' . $post_type );
5556
+				$csv_row[] = geodir_get_language_for_element($post_id, 'post_'.$post_type);
5557
+				$csv_row[] = geodir_imex_original_post_id($post_id, 'post_'.$post_type);
5558 5558
 			}
5559 5559
 			// WPML
5560 5560
 			
5561
-			if ( !empty( $custom_fields ) ) {
5562
-				foreach ( $custom_fields as $custom_field ) {
5563
-					$csv_row[] = isset( $post_info[$custom_field->htmlvar_name] ) ? $post_info[$custom_field->htmlvar_name] : '';
5561
+			if (!empty($custom_fields)) {
5562
+				foreach ($custom_fields as $custom_field) {
5563
+					$csv_row[] = isset($post_info[$custom_field->htmlvar_name]) ? $post_info[$custom_field->htmlvar_name] : '';
5564 5564
 				}
5565 5565
 			}
5566 5566
 			
@@ -5571,26 +5571,26 @@  discard block
 block discarded – undo
5571 5571
 				$franchise = '';
5572 5572
 					
5573 5573
 				if (geodir_franchise_pkg_is_active($gd_post_info)) {
5574
-					$gd_is_franchise = (int)get_post_meta( $post_id, 'gd_is_franchise', true );
5575
-					$locaked_fields = $gd_is_franchise ? get_post_meta( $post_id, 'gd_franchise_lock', true ) : '';
5574
+					$gd_is_franchise = (int) get_post_meta($post_id, 'gd_is_franchise', true);
5575
+					$locaked_fields = $gd_is_franchise ? get_post_meta($post_id, 'gd_franchise_lock', true) : '';
5576 5576
 					$locaked_fields = (is_array($locaked_fields) && !empty($locaked_fields) ? implode(",", $locaked_fields) : '');
5577
-					$franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 ? (int)$post_info['franchise'] : 0; // franchise id
5577
+					$franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 ? (int) $post_info['franchise'] : 0; // franchise id
5578 5578
 				}
5579 5579
 				
5580
-				$csv_row[] = (int)$gd_is_franchise; // gd_is_franchise
5580
+				$csv_row[] = (int) $gd_is_franchise; // gd_is_franchise
5581 5581
 				$csv_row[] = $locaked_fields; // gd_franchise_lock fields
5582
-				$csv_row[] = (int)$franchise; // franchise id
5582
+				$csv_row[] = (int) $franchise; // franchise id
5583 5583
 			}
5584 5584
 			
5585
-			for ( $c = 0; $c < $images_count; $c++ ) {
5586
-				$csv_row[] = isset( $current_images[$c] ) ? $current_images[$c] : ''; // IMAGE
5585
+			for ($c = 0; $c < $images_count; $c++) {
5586
+				$csv_row[] = isset($current_images[$c]) ? $current_images[$c] : ''; // IMAGE
5587 5587
 			}
5588 5588
 			
5589 5589
 			$csv_rows[] = $csv_row;
5590 5590
 
5591 5591
 		}
5592 5592
 
5593
-		for ( $c = 0; $c < $images_count; $c++ ) {
5593
+		for ($c = 0; $c < $images_count; $c++) {
5594 5594
 			$csv_rows[0][] = 'IMAGE';
5595 5595
 		}
5596 5596
 	}
@@ -5612,33 +5612,33 @@  discard block
 block discarded – undo
5612 5612
  * @param int $page_no Page number. Default 0.
5613 5613
  * @return array Array of posts data.
5614 5614
  */
5615
-function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) {
5615
+function geodir_get_export_posts($post_type, $per_page = 0, $page_no = 0) {
5616 5616
     global $wpdb, $plugin_prefix;
5617 5617
 
5618
-    if ( ! post_type_exists( $post_type ) )
5618
+    if (!post_type_exists($post_type))
5619 5619
         return new stdClass;
5620 5620
         
5621
-    $table = $plugin_prefix . $post_type . '_detail';
5621
+    $table = $plugin_prefix.$post_type.'_detail';
5622 5622
 
5623 5623
     $limit = '';
5624
-    if ( $per_page > 0 && $page_no > 0 ) {
5625
-        $offset = ( $page_no - 1 ) * $per_page;
5624
+    if ($per_page > 0 && $page_no > 0) {
5625
+        $offset = ($page_no - 1) * $per_page;
5626 5626
         
5627
-        if ( $offset > 0 ) {
5628
-            $limit = " LIMIT " . $offset . "," . $per_page;
5627
+        if ($offset > 0) {
5628
+            $limit = " LIMIT ".$offset.",".$per_page;
5629 5629
         } else {
5630
-            $limit = " LIMIT " . $per_page;
5630
+            $limit = " LIMIT ".$per_page;
5631 5631
         }
5632 5632
     }
5633 5633
 
5634 5634
     // Skip listing with statuses trash, auto-draft etc...
5635 5635
     $skip_statuses = geodir_imex_export_skip_statuses();
5636 5636
     $where_statuses = '';
5637
-    if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5638
-        $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5637
+    if (!empty($skip_statuses) && is_array($skip_statuses)) {
5638
+        $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')";
5639 5639
     }
5640 5640
 
5641
-    $query = "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " ORDER BY {$wpdb->posts}.ID ASC" . $limit;
5641
+    $query = "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s ".$where_statuses." ORDER BY {$wpdb->posts}.ID ASC".$limit;
5642 5642
     /**
5643 5643
      * Modify returned posts SQL query for the current post type.
5644 5644
      *
@@ -5648,9 +5648,9 @@  discard block
 block discarded – undo
5648 5648
      * @param int $query The SQL query.
5649 5649
      * @param string $post_type Post type.
5650 5650
      */
5651
-    $query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type );
5651
+    $query = apply_filters('geodir_imex_export_posts_query', $query, $post_type);
5652 5652
 
5653
-    $results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A );
5653
+    $results = (array) $wpdb->get_results($wpdb->prepare($query, $post_type), ARRAY_A);
5654 5654
 
5655 5655
     /**
5656 5656
      * Modify returned post results for the current post type.
@@ -5661,7 +5661,7 @@  discard block
 block discarded – undo
5661 5661
      * @param object $results An object containing all post ids.
5662 5662
      * @param string $post_type Post type.
5663 5663
      */
5664
-    return apply_filters( 'geodir_export_posts', $results, $post_type );
5664
+    return apply_filters('geodir_export_posts', $results, $post_type);
5665 5665
 }
5666 5666
 
5667 5667
 /**
@@ -5678,21 +5678,21 @@  discard block
 block discarded – undo
5678 5678
  * @param string $post_type Post type.
5679 5679
  * @return string The SQL query.
5680 5680
  */
5681
-function geodir_imex_get_events_query( $query, $post_type ) {
5682
-    if ( $post_type == 'gd_event' ) {
5681
+function geodir_imex_get_events_query($query, $post_type) {
5682
+    if ($post_type == 'gd_event') {
5683 5683
         global $wpdb, $plugin_prefix;
5684 5684
         
5685
-        $table = $plugin_prefix . $post_type . '_detail';
5685
+        $table = $plugin_prefix.$post_type.'_detail';
5686 5686
         $schedule_table = EVENT_SCHEDULE;
5687 5687
         
5688 5688
         // Skip listing with statuses trash, auto-draft etc...
5689 5689
         $skip_statuses = geodir_imex_export_skip_statuses();
5690 5690
         $where_statuses = '';
5691
-        if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5692
-            $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5691
+        if (!empty($skip_statuses) && is_array($skip_statuses)) {
5692
+            $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')";
5693 5693
         }
5694 5694
 
5695
-        $query = "SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime FROM {$wpdb->posts} INNER JOIN {$table} ON ({$table}.post_id = {$wpdb->posts}.ID) INNER JOIN {$schedule_table} ON ({$schedule_table}.event_id = {$wpdb->posts}.ID) WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC";
5695
+        $query = "SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime FROM {$wpdb->posts} INNER JOIN {$table} ON ({$table}.post_id = {$wpdb->posts}.ID) INNER JOIN {$schedule_table} ON ({$schedule_table}.event_id = {$wpdb->posts}.ID) WHERE {$wpdb->posts}.post_type = %s ".$where_statuses." GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC";
5696 5696
     }
5697 5697
 
5698 5698
     return $query;
@@ -5716,35 +5716,35 @@  discard block
 block discarded – undo
5716 5716
  * @param  string $post_type Post type.
5717 5717
  * @return int Total terms count.
5718 5718
  */
5719
-function geodir_get_terms_count( $post_type ) {
5720
-    $args = array( 'hide_empty' => 0 );
5719
+function geodir_get_terms_count($post_type) {
5720
+    $args = array('hide_empty' => 0);
5721 5721
 
5722
-    remove_all_filters( 'get_terms' );
5722
+    remove_all_filters('get_terms');
5723 5723
 
5724
-    $taxonomy = $post_type . 'category';
5724
+    $taxonomy = $post_type.'category';
5725 5725
 
5726 5726
     // WPML
5727 5727
     $is_wpml = geodir_is_wpml();
5728 5728
     $active_lang = 'all';
5729
-    if ( $is_wpml ) {
5729
+    if ($is_wpml) {
5730 5730
         global $sitepress;
5731 5731
         $active_lang = $sitepress->get_current_language();
5732 5732
         
5733
-        if ( $active_lang != 'all' ) {
5734
-            $sitepress->switch_lang( 'all', true );
5733
+        if ($active_lang != 'all') {
5734
+            $sitepress->switch_lang('all', true);
5735 5735
         }
5736 5736
     }
5737 5737
     // WPML
5738 5738
             
5739
-    $count_terms = wp_count_terms( $taxonomy, $args );
5739
+    $count_terms = wp_count_terms($taxonomy, $args);
5740 5740
 
5741 5741
     // WPML
5742
-    if ( $is_wpml && $active_lang !== 'all' ) {
5742
+    if ($is_wpml && $active_lang !== 'all') {
5743 5743
         global $sitepress;
5744
-        $sitepress->switch_lang( $active_lang, true );
5744
+        $sitepress->switch_lang($active_lang, true);
5745 5745
     }
5746 5746
     // WPML
5747
-    $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0;
5747
+    $count_terms = !is_wp_error($count_terms) ? $count_terms : 0;
5748 5748
      
5749 5749
     return $count_terms;
5750 5750
 }
@@ -5761,23 +5761,23 @@  discard block
 block discarded – undo
5761 5761
  * @param int $page_no Page number. Default 0.
5762 5762
  * @return array Array of terms data.
5763 5763
  */
5764
-function geodir_imex_get_terms( $post_type, $per_page = 0, $page_no = 0 ) {
5765
-	$args = array( 'hide_empty' => 0, 'orderby' => 'id' );
5764
+function geodir_imex_get_terms($post_type, $per_page = 0, $page_no = 0) {
5765
+	$args = array('hide_empty' => 0, 'orderby' => 'id');
5766 5766
 	
5767
-	remove_all_filters( 'get_terms' );
5767
+	remove_all_filters('get_terms');
5768 5768
 	
5769
-	$taxonomy = $post_type . 'category';
5769
+	$taxonomy = $post_type.'category';
5770 5770
 	
5771
-	if ( $per_page > 0 && $page_no > 0 ) {
5772
-		$args['offset'] = ( $page_no - 1 ) * $per_page;
5771
+	if ($per_page > 0 && $page_no > 0) {
5772
+		$args['offset'] = ($page_no - 1) * $per_page;
5773 5773
 		$args['number'] = $per_page;
5774 5774
 	}
5775 5775
 	
5776
-	$terms = get_terms( $taxonomy, $args );
5776
+	$terms = get_terms($taxonomy, $args);
5777 5777
 
5778 5778
 	$csv_rows = array();
5779 5779
 	
5780
-	if ( !empty( $terms ) ) {
5780
+	if (!empty($terms)) {
5781 5781
 		$csv_row = array();
5782 5782
 		$csv_row[] = 'cat_id';
5783 5783
 		$csv_row[] = 'cat_name';
@@ -5799,16 +5799,16 @@  discard block
 block discarded – undo
5799 5799
 		
5800 5800
 		$csv_rows[] = $csv_row;
5801 5801
 		
5802
-		foreach ( $terms as $term ) {
5803
-			$cat_icon = get_tax_meta( $term->term_id, 'ct_cat_icon', false, $post_type );
5804
-			$cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : '';
5802
+		foreach ($terms as $term) {
5803
+			$cat_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $post_type);
5804
+			$cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : '';
5805 5805
 			
5806
-			$cat_image = geodir_get_default_catimage( $term->term_id, $post_type );
5807
-			$cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; 
5806
+			$cat_image = geodir_get_default_catimage($term->term_id, $post_type);
5807
+			$cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; 
5808 5808
 			
5809 5809
 			$cat_parent = '';
5810
-			if (isset($term->parent) && (int)$term->parent > 0 && term_exists((int)$term->parent, $taxonomy)) {
5811
-				$parent_term = (array)get_term_by( 'id', (int)$term->parent, $taxonomy );
5810
+			if (isset($term->parent) && (int) $term->parent > 0 && term_exists((int) $term->parent, $taxonomy)) {
5811
+				$parent_term = (array) get_term_by('id', (int) $term->parent, $taxonomy);
5812 5812
 				$cat_parent = !empty($parent_term) && isset($parent_term['name']) ? $parent_term['name'] : '';
5813 5813
 			}
5814 5814
 			
@@ -5818,15 +5818,15 @@  discard block
 block discarded – undo
5818 5818
 			$csv_row[] = $term->slug;
5819 5819
 			$csv_row[] = $post_type;
5820 5820
 			$csv_row[] = $cat_parent;
5821
-			$csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_schema', false, $post_type );
5821
+			$csv_row[] = get_tax_meta($term->term_id, 'ct_cat_schema', false, $post_type);
5822 5822
             // WPML
5823 5823
 			if ($is_wpml) {
5824
-				$csv_row[] = geodir_get_language_for_element( $term->term_id, 'tax_' . $taxonomy );
5825
-                $csv_row[] = geodir_imex_original_post_id( $term->term_id, 'tax_' . $taxonomy );
5824
+				$csv_row[] = geodir_get_language_for_element($term->term_id, 'tax_'.$taxonomy);
5825
+                $csv_row[] = geodir_imex_original_post_id($term->term_id, 'tax_'.$taxonomy);
5826 5826
 			}
5827 5827
 			// WPML
5828 5828
 			$csv_row[] = $term->description;
5829
-			$csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_top_desc', false, $post_type );
5829
+			$csv_row[] = get_tax_meta($term->term_id, 'ct_cat_top_desc', false, $post_type);
5830 5830
 			$csv_row[] = $cat_image;
5831 5831
 			$csv_row[] = $cat_icon;
5832 5832
 			
@@ -5845,10 +5845,10 @@  discard block
 block discarded – undo
5845 5845
  * @param  bool $relative True for relative path & False for absolute path.
5846 5846
  * @return string Path to the cache directory.
5847 5847
  */
5848
-function geodir_path_import_export( $relative = true ) {
5848
+function geodir_path_import_export($relative = true) {
5849 5849
 	$upload_dir = wp_upload_dir();
5850 5850
 	
5851
-	return $relative ? $upload_dir['baseurl'] . '/cache' : $upload_dir['basedir'] . '/cache';
5851
+	return $relative ? $upload_dir['baseurl'].'/cache' : $upload_dir['basedir'].'/cache';
5852 5852
 }
5853 5853
 
5854 5854
 /**
@@ -5864,8 +5864,8 @@  discard block
 block discarded – undo
5864 5864
  * @param  bool $clear If true then it overwrite data otherwise add rows at the end of file.
5865 5865
  * @return bool true if success otherwise false.
5866 5866
  */
5867
-function geodir_save_csv_data( $file_path, $csv_data = array(), $clear = true ) {
5868
-	if ( empty( $csv_data ) ) {
5867
+function geodir_save_csv_data($file_path, $csv_data = array(), $clear = true) {
5868
+	if (empty($csv_data)) {
5869 5869
 		return false;
5870 5870
 	}
5871 5871
 	
@@ -5873,17 +5873,17 @@  discard block
 block discarded – undo
5873 5873
 	
5874 5874
 	$mode = $clear ? 'w+' : 'a+';
5875 5875
 	
5876
-	if ( function_exists( 'fputcsv' ) ) {
5877
-		$file = fopen( $file_path, $mode );
5878
-		foreach( $csv_data as $csv_row ) {
5876
+	if (function_exists('fputcsv')) {
5877
+		$file = fopen($file_path, $mode);
5878
+		foreach ($csv_data as $csv_row) {
5879 5879
 			//$csv_row = array_map( 'utf8_decode', $csv_row );
5880
-			$write_successful = fputcsv( $file, $csv_row, ",", $enclosure = '"' );
5880
+			$write_successful = fputcsv($file, $csv_row, ",", $enclosure = '"');
5881 5881
 		}
5882
-		fclose( $file );
5882
+		fclose($file);
5883 5883
 	} else {
5884
-		foreach( $csv_data as $csv_row ) {
5884
+		foreach ($csv_data as $csv_row) {
5885 5885
 			//$csv_row = array_map( 'utf8_decode', $csv_row );
5886
-			$wp_filesystem->put_contents( $file_path, $csv_row );
5886
+			$wp_filesystem->put_contents($file_path, $csv_row);
5887 5887
 		}
5888 5888
 	}
5889 5889
 		
@@ -5901,14 +5901,14 @@  discard block
 block discarded – undo
5901 5901
  * @param  string $file Full path to file.
5902 5902
  * @return int No of file rows.
5903 5903
  */
5904
-function geodir_import_export_line_count( $file ) {
5904
+function geodir_import_export_line_count($file) {
5905 5905
 	global $wp_filesystem;
5906 5906
 	
5907
-	if ( $wp_filesystem->is_file( $file ) && $wp_filesystem->exists( $file ) ) {
5908
-		$contents = $wp_filesystem->get_contents_array( $file );
5907
+	if ($wp_filesystem->is_file($file) && $wp_filesystem->exists($file)) {
5908
+		$contents = $wp_filesystem->get_contents_array($file);
5909 5909
 		
5910
-		if ( !empty( $contents ) && is_array( $contents ) ) {
5911
-			return count( $contents ) - 1;
5910
+		if (!empty($contents) && is_array($contents)) {
5911
+			return count($contents) - 1;
5912 5912
 		}
5913 5913
 	}
5914 5914
 	
@@ -5925,11 +5925,11 @@  discard block
 block discarded – undo
5925 5925
  * @param string $post_type The post type.
5926 5926
  * @return object Queried object.
5927 5927
  */
5928
-function geodir_imex_get_custom_fields( $post_type ) {
5928
+function geodir_imex_get_custom_fields($post_type) {
5929 5929
 	global $wpdb;
5930 5930
 	 
5931
-	$sql = $wpdb->prepare("SELECT htmlvar_name FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1' AND is_admin!='1' AND field_type != 'fieldset' AND htmlvar_name != '' ORDER BY id ASC", array( $post_type ) );
5932
-	$rows = $wpdb->get_results( $sql );
5931
+	$sql = $wpdb->prepare("SELECT htmlvar_name FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1' AND is_admin!='1' AND field_type != 'fieldset' AND htmlvar_name != '' ORDER BY id ASC", array($post_type));
5932
+	$rows = $wpdb->get_results($sql);
5933 5933
 	 
5934 5934
 	return $rows;
5935 5935
 }
@@ -6008,14 +6008,14 @@  discard block
 block discarded – undo
6008 6008
 	global $wpdb, $plugin_prefix;
6009 6009
 	
6010 6010
 	$post_type = get_post_type($master_post_id);
6011
-	$post_table = $plugin_prefix . $post_type . '_detail';
6011
+	$post_table = $plugin_prefix.$post_type.'_detail';
6012 6012
 	
6013
-	$query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id));
6014
-	$data = (array)$wpdb->get_row($query);
6013
+	$query = $wpdb->prepare("SELECT * FROM ".$post_table." WHERE post_id = %d", array($master_post_id));
6014
+	$data = (array) $wpdb->get_row($query);
6015 6015
 	
6016
-	if ( !empty( $data ) ) {
6016
+	if (!empty($data)) {
6017 6017
 		$data['post_id'] = $tr_post_id;
6018
-		unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']);
6018
+		unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type.'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']);
6019 6019
 		
6020 6020
 		$wpdb->update($post_table, $data, array('post_id' => $tr_post_id));		
6021 6021
 		return true;
@@ -6041,7 +6041,7 @@  discard block
 block discarded – undo
6041 6041
 	global $sitepress, $wpdb;
6042 6042
 	$post_type = get_post_type($master_post_id);
6043 6043
 	
6044
-	remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language
6044
+	remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language
6045 6045
 
6046 6046
 	$taxonomies = get_object_taxonomies($post_type);
6047 6047
 	foreach ($taxonomies as $taxonomy) {
@@ -6050,9 +6050,9 @@  discard block
 block discarded – undo
6050 6050
 		
6051 6051
 		if ($terms) {
6052 6052
 			foreach ($terms as $term) {
6053
-				$tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang);
6053
+				$tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang);
6054 6054
 				
6055
-				if (!is_null($tr_id)){
6055
+				if (!is_null($tr_id)) {
6056 6056
 					// not using get_term - unfiltered get_term
6057 6057
 					$translated_term = $wpdb->get_row($wpdb->prepare("
6058 6058
 						SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $taxonomy));
@@ -6061,14 +6061,14 @@  discard block
 block discarded – undo
6061 6061
 				}
6062 6062
 			}
6063 6063
 
6064
-			if (!is_taxonomy_hierarchical($taxonomy)){
6065
-				$terms_array = array_unique( array_map( 'intval', $terms_array ) );
6064
+			if (!is_taxonomy_hierarchical($taxonomy)) {
6065
+				$terms_array = array_unique(array_map('intval', $terms_array));
6066 6066
 			}
6067 6067
 
6068 6068
 			wp_set_post_terms($tr_post_id, $terms_array, $taxonomy);
6069 6069
 			
6070
-			if ($taxonomy == $post_type . 'category') {
6071
-				geodir_set_postcat_structure($tr_post_id, $post_type . 'category');
6070
+			if ($taxonomy == $post_type.'category') {
6071
+				geodir_set_postcat_structure($tr_post_id, $post_type.'category');
6072 6072
 			}
6073 6073
 		}
6074 6074
 	}
@@ -6089,15 +6089,15 @@  discard block
 block discarded – undo
6089 6089
 function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) {
6090 6090
 	global $wpdb;
6091 6091
 	
6092
-	$query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
6092
+	$query = $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
6093 6093
 	$wpdb->query($query);
6094 6094
 	
6095
-	$query = $wpdb->prepare("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id));
6095
+	$query = $wpdb->prepare("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id));
6096 6096
 	$post_images = $wpdb->get_results($query);
6097 6097
 	
6098
-	if ( !empty( $post_images ) ) {
6099
-		foreach ( $post_images as $post_image) {
6100
-			$image_data = (array)$post_image;
6098
+	if (!empty($post_images)) {
6099
+		foreach ($post_images as $post_image) {
6100
+			$image_data = (array) $post_image;
6101 6101
 			unset($image_data['ID']);
6102 6102
 			$image_data['post_id'] = $tr_post_id;
6103 6103
 			
@@ -6123,10 +6123,10 @@  discard block
 block discarded – undo
6123 6123
  * @return array Event data array.
6124 6124
  */
6125 6125
 function geodir_imex_get_event_data($post, $gd_post_info) {
6126
-	$event_date = isset( $post['event_date'] ) && $post['event_date'] != '' && $post['event_date'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $post['event_date'] ) ) : '';
6126
+	$event_date = isset($post['event_date']) && $post['event_date'] != '' && $post['event_date'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($post['event_date'])) : '';
6127 6127
 	$event_enddate = $event_date;
6128
-	$starttime = isset( $post['starttime'] ) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['starttime'] ) ) : '';
6129
-	$endtime = isset( $post['endtime'] ) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['endtime'] ) ) : '';
6128
+	$starttime = isset($post['starttime']) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['starttime'])) : '';
6129
+	$endtime = isset($post['endtime']) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['endtime'])) : '';
6130 6130
 	
6131 6131
 	$is_recurring_event = '';
6132 6132
 	$event_duration_days = '';
@@ -6143,15 +6143,15 @@  discard block
 block discarded – undo
6143 6143
 		
6144 6144
 	$recurring_data = isset($gd_post_info->recurring_dates) ? maybe_unserialize($gd_post_info->recurring_dates) : array();
6145 6145
 	if (!empty($recurring_data)) {
6146
-		$event_date = isset( $recurring_data['event_start'] ) && $recurring_data['event_start'] != '' && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['event_start'] ) ) : $event_date;
6147
-		$event_enddate = isset( $recurring_data['event_end'] ) && $recurring_data['event_end'] != '' && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['event_end'] ) ) : $event_date;
6148
-		$starttime = isset( $recurring_data['starttime'] ) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['starttime'] ) ) : $starttime;
6149
-		$endtime = isset( $recurring_data['endtime'] ) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['endtime'] ) ) : $endtime;
6146
+		$event_date = isset($recurring_data['event_start']) && $recurring_data['event_start'] != '' && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['event_start'])) : $event_date;
6147
+		$event_enddate = isset($recurring_data['event_end']) && $recurring_data['event_end'] != '' && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['event_end'])) : $event_date;
6148
+		$starttime = isset($recurring_data['starttime']) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['starttime'])) : $starttime;
6149
+		$endtime = isset($recurring_data['endtime']) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['endtime'])) : $endtime;
6150 6150
 		$is_whole_day_event = !empty($recurring_data['all_day']) ? 1 : '';
6151 6151
 		$different_times = !empty($recurring_data['different_times']) ? true : false;
6152 6152
 	
6153
-		$recurring_pkg = geodir_event_recurring_pkg( $gd_post_info );
6154
-		$is_recurring = isset( $gd_post_info->is_recurring ) && (int)$gd_post_info->is_recurring == 0 ? false : true;
6153
+		$recurring_pkg = geodir_event_recurring_pkg($gd_post_info);
6154
+		$is_recurring = isset($gd_post_info->is_recurring) && (int) $gd_post_info->is_recurring == 0 ? false : true;
6155 6155
 			
6156 6156
 		if ($recurring_pkg && $is_recurring) {
6157 6157
 			$recurring_dates = $event_date;
@@ -6161,13 +6161,13 @@  discard block
 block discarded – undo
6161 6161
 			$recurring_type = !empty($recurring_data['repeat_type']) && in_array($recurring_data['repeat_type'], array('day', 'week', 'month', 'year', 'custom')) ? $recurring_data['repeat_type'] : 'custom';
6162 6162
 			
6163 6163
 			if (!empty($recurring_data['event_recurring_dates'])) {
6164
-				$event_recurring_dates = explode( ',', $recurring_data['event_recurring_dates'] );
6164
+				$event_recurring_dates = explode(',', $recurring_data['event_recurring_dates']);
6165 6165
 				
6166 6166
 				if (!empty($event_recurring_dates)) {
6167 6167
 					$recurring_dates = array();
6168 6168
 					
6169 6169
 					foreach ($event_recurring_dates as $date) {
6170
-						$recurring_dates[] = date_i18n( 'd/m/Y', strtotime( $date ) );
6170
+						$recurring_dates[] = date_i18n('d/m/Y', strtotime($date));
6171 6171
 					}
6172 6172
 					
6173 6173
 					$recurring_dates = implode(",", $recurring_dates);
@@ -6183,7 +6183,7 @@  discard block
 block discarded – undo
6183 6183
 						$times = array();
6184 6184
 						
6185 6185
 						foreach ($recurring_data['starttimes'] as $time) {
6186
-							$times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00';
6186
+							$times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00';
6187 6187
 						}
6188 6188
 						
6189 6189
 						$event_starttimes = implode(",", $times);
@@ -6193,7 +6193,7 @@  discard block
 block discarded – undo
6193 6193
 						$times = array();
6194 6194
 						
6195 6195
 						foreach ($recurring_data['endtimes'] as $time) {
6196
-							$times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00';
6196
+							$times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00';
6197 6197
 						}
6198 6198
 						
6199 6199
 						$event_endtimes = implode(",", $times);
@@ -6205,8 +6205,8 @@  discard block
 block discarded – undo
6205 6205
 					}
6206 6206
 				}
6207 6207
 			} else {
6208
-				$event_duration_days = isset($recurring_data['duration_x']) ? (int)$recurring_data['duration_x'] : 1;
6209
-				$recurring_interval = !empty($recurring_data['repeat_x']) && (int)$recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1;
6208
+				$event_duration_days = isset($recurring_data['duration_x']) ? (int) $recurring_data['duration_x'] : 1;
6209
+				$recurring_interval = !empty($recurring_data['repeat_x']) && (int) $recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1;
6210 6210
 				
6211 6211
 				if (($recurring_type == 'week' || $recurring_type == 'month') && !empty($recurring_data['repeat_days'])) {
6212 6212
 					$week_days = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
@@ -6222,11 +6222,11 @@  discard block
 block discarded – undo
6222 6222
 				}
6223 6223
 				
6224 6224
 				$recurring_week_nos = $recurring_type == 'month' && !empty($recurring_data['repeat_weeks']) ? implode(",", $recurring_data['repeat_weeks']) : $recurring_week_nos;
6225
-				if (!empty($recurring_data['repeat_end_type']) && (int)$recurring_data['repeat_end_type'] == 1) {
6226
-					$recurring_end_date = isset($recurring_data['repeat_end']) && $recurring_data['repeat_end'] != '' && $recurring_data['repeat_end'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['repeat_end'] ) ) : '';
6225
+				if (!empty($recurring_data['repeat_end_type']) && (int) $recurring_data['repeat_end_type'] == 1) {
6226
+					$recurring_end_date = isset($recurring_data['repeat_end']) && $recurring_data['repeat_end'] != '' && $recurring_data['repeat_end'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['repeat_end'])) : '';
6227 6227
 					$max_recurring_count = empty($recurring_end_date) ? 1 : '';
6228 6228
 				} else {
6229
-					$max_recurring_count = (!empty($recurring_data['max_repeat']) && (int)$recurring_data['max_repeat'] > 0 ? (int)$recurring_data['max_repeat'] : 1);
6229
+					$max_recurring_count = (!empty($recurring_data['max_repeat']) && (int) $recurring_data['max_repeat'] > 0 ? (int) $recurring_data['max_repeat'] : 1);
6230 6230
 				}
6231 6231
 			}
6232 6232
 		}
@@ -6290,9 +6290,9 @@  discard block
 block discarded – undo
6290 6290
  * @return array Event data array.
6291 6291
  */
6292 6292
 function geodir_imex_process_event_data($gd_post) {
6293
-	$recurring_pkg = geodir_event_recurring_pkg( (object)$gd_post );
6293
+	$recurring_pkg = geodir_event_recurring_pkg((object) $gd_post);
6294 6294
 
6295
-	$is_recurring = isset( $gd_post['is_recurring_event'] ) && (int)$gd_post['is_recurring_event'] == 0 ? false : true;
6295
+	$is_recurring = isset($gd_post['is_recurring_event']) && (int) $gd_post['is_recurring_event'] == 0 ? false : true;
6296 6296
 	$event_date = isset($gd_post['event_date']) && $gd_post['event_date'] != '' ? geodir_imex_get_date_ymd($gd_post['event_date']) : '';
6297 6297
 	$event_enddate = isset($gd_post['event_enddate']) && $gd_post['event_enddate'] != '' ? geodir_imex_get_date_ymd($gd_post['event_enddate']) : $event_date;
6298 6298
 	$all_day = isset($gd_post['is_whole_day_event']) && !empty($gd_post['is_whole_day_event']) ? true : false;
@@ -6339,17 +6339,17 @@  discard block
 block discarded – undo
6339 6339
 				$event_recurring_dates = implode(",", $event_recurring_dates);
6340 6340
 			}
6341 6341
 		} else {
6342
-			$duration_x = !empty( $gd_post['event_duration_days'] ) ? (int)$gd_post['event_duration_days'] : 1;
6343
-			$repeat_x = !empty( $gd_post['recurring_interval'] ) ? (int)$gd_post['recurring_interval'] : 1;
6344
-			$max_repeat = !empty( $gd_post['max_recurring_count'] ) ? (int)$gd_post['max_recurring_count'] : 1;
6345
-			$repeat_end = !empty( $gd_post['recurring_end_date'] ) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : '';
6342
+			$duration_x = !empty($gd_post['event_duration_days']) ? (int) $gd_post['event_duration_days'] : 1;
6343
+			$repeat_x = !empty($gd_post['recurring_interval']) ? (int) $gd_post['recurring_interval'] : 1;
6344
+			$max_repeat = !empty($gd_post['max_recurring_count']) ? (int) $gd_post['max_recurring_count'] : 1;
6345
+			$repeat_end = !empty($gd_post['recurring_end_date']) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : '';
6346 6346
 			
6347 6347
 			$repeat_end_type = $repeat_end != '' ? 1 : 0;
6348 6348
 			$max_repeat = $repeat_end != '' ? '' : $max_repeat;
6349 6349
 			
6350 6350
 			$week_days = array_flip(array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'));
6351 6351
 			
6352
-			$a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days'])!='' ? explode(',', trim($gd_post['recurring_week_days'])) : array();
6352
+			$a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days']) != '' ? explode(',', trim($gd_post['recurring_week_days'])) : array();
6353 6353
 			$repeat_days = array();
6354 6354
 			if (!empty($a_repeat_days)) {
6355 6355
 				foreach ($a_repeat_days as $repeat_day) {
@@ -6367,7 +6367,7 @@  discard block
 block discarded – undo
6367 6367
 			$repeat_weeks = array();
6368 6368
 			if (!empty($a_repeat_weeks)) {
6369 6369
 				foreach ($a_repeat_weeks as $repeat_week) {
6370
-					$repeat_weeks[] = (int)$repeat_week;
6370
+					$repeat_weeks[] = (int) $repeat_week;
6371 6371
 				}
6372 6372
 				
6373 6373
 				$repeat_weeks = array_unique($repeat_weeks);
@@ -6431,7 +6431,7 @@  discard block
 block discarded – undo
6431 6431
 
6432 6432
     $page_found = $wpdb->get_var(
6433 6433
         $wpdb->prepare(
6434
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
6434
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s LIMIT 1;",
6435 6435
             array($slug)
6436 6436
         )
6437 6437
     );
@@ -6486,7 +6486,7 @@  discard block
 block discarded – undo
6486 6486
  */
6487 6487
 function geodir_admin_upgrade_notice() {
6488 6488
     $class = "error";
6489
-    $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory");
6489
+    $message = __("Please update core GeoDirectory or some addons may not function correctly.", "geodirectory");
6490 6490
     echo"<div class=\"$class\"> <p>$message</p></div>";
6491 6491
 }
6492 6492
 
@@ -6498,7 +6498,7 @@  discard block
 block discarded – undo
6498 6498
  * @param (object) $r
6499 6499
  * @return (string) $output
6500 6500
  */
6501
-function geodire_admin_upgrade_notice( $plugin_data, $r )
6501
+function geodire_admin_upgrade_notice($plugin_data, $r)
6502 6502
 {
6503 6503
     // readme contents
6504 6504
     $args = array(
@@ -6506,7 +6506,7 @@  discard block
 block discarded – undo
6506 6506
         'redirection' => 5
6507 6507
     );
6508 6508
     $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt";
6509
-    $data       = wp_remote_get( $url, $args );
6509
+    $data = wp_remote_get($url, $args);
6510 6510
 
6511 6511
     if (!is_wp_error($data) && $data['response']['code'] == 200) {
6512 6512
 
@@ -6521,20 +6521,20 @@  discard block
 block discarded – undo
6521 6521
 function geodir_in_plugin_update_message($content) {
6522 6522
     // Output Upgrade Notice
6523 6523
     $matches        = null;
6524
-    $regexp         = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis';
6524
+    $regexp         = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*'.preg_quote(GEODIRECTORY_VERSION).'\s*=|$)~Uis';
6525 6525
     $upgrade_notice = '';
6526
-    if ( preg_match( $regexp, $content, $matches ) ) {
6527
-        if(empty($matches)){return;}
6526
+    if (preg_match($regexp, $content, $matches)) {
6527
+        if (empty($matches)) {return; }
6528 6528
 
6529
-        $version = trim( $matches[1] );
6530
-        if($version && $version>GEODIRECTORY_VERSION){
6529
+        $version = trim($matches[1]);
6530
+        if ($version && $version > GEODIRECTORY_VERSION) {
6531 6531
 
6532 6532
 
6533
-        $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) );
6534
-        if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) {
6533
+        $notices = (array) preg_split('~[\r\n]+~', trim($matches[2]));
6534
+        if (version_compare(GEODIRECTORY_VERSION, $version, '<')) {
6535 6535
             $upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">';
6536
-            foreach ( $notices as $index => $line ) {
6537
-                $upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) );
6536
+            foreach ($notices as $index => $line) {
6537
+                $upgrade_notice .= wp_kses_post(preg_replace('~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line));
6538 6538
             }
6539 6539
             $upgrade_notice .= '</div> ';
6540 6540
         }
@@ -6558,7 +6558,7 @@  discard block
 block discarded – undo
6558 6558
 		$default_language = $sitepress->get_default_language();
6559 6559
 		if ($current_language != 'all' && $current_language != $default_language) {
6560 6560
 	?>
6561
-	<div class="updated error notice-success" id="message"><p style="color:red"><strong><?php _e('Saving GeoDirectory pages settings on a different language breaks pages settings. Try to save after switching to default language.', 'geodirectory');?></strong></p></div>
6561
+	<div class="updated error notice-success" id="message"><p style="color:red"><strong><?php _e('Saving GeoDirectory pages settings on a different language breaks pages settings. Try to save after switching to default language.', 'geodirectory'); ?></strong></p></div>
6562 6562
 	<?php
6563 6563
 		}
6564 6564
 	}
@@ -6573,7 +6573,7 @@  discard block
 block discarded – undo
6573 6573
  * @param array Listing statuses to be skipped.
6574 6574
  */
6575 6575
 function geodir_imex_export_skip_statuses() {
6576
-    $statuses = array( 'trash', 'auto-draft' );
6576
+    $statuses = array('trash', 'auto-draft');
6577 6577
     
6578 6578
     /**
6579 6579
      * Filter the statuses to skip during GD export listings.
@@ -6583,7 +6583,7 @@  discard block
 block discarded – undo
6583 6583
      *
6584 6584
      * @param array $statuses Listing statuses to be skipped.
6585 6585
      */
6586
-    $statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses );
6586
+    $statuses = apply_filters('geodir_imex_export_skip_statuses', $statuses);
6587 6587
      
6588 6588
     return $statuses;
6589 6589
 }
Please login to merge, or discard this patch.
geodirectory-admin/admin_template_tags.php 1 patch
Spacing   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                          * @param array $tabs The array of tabs to display.
53 53
                          */
54 54
                         $tabs = apply_filters('geodir_settings_tabs_array', $tabs);
55
-                        update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown
55
+                        update_option('geodir_tabs', $tabs); // Important to show settings menu dropdown
56 56
 
57 57
                         foreach ($tabs as $name => $args) :
58 58
                             $label = $args['label'];
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
 
64 64
                                 $subtabs = $args['subtabs'];
65 65
 
66
-                                $query_string = '&subtab=' . $subtabs[0]['subtab'];
66
+                                $query_string = '&subtab='.$subtabs[0]['subtab'];
67 67
 
68 68
                             endif;
69 69
 
70 70
 
71
-                            $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string);
71
+                            $tab_link = admin_url('admin.php?page=geodirectory&tab='.$name.$query_string);
72 72
 
73 73
                             if (isset($args['url']) && $args['url'] != '') {
74 74
                                 $tab_link = $args['url'];
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                                 $tab_link = geodir_getlink($tab_link, $args['request']);
79 79
 
80 80
                             if (isset($args['target']) && $args['target'] != '') {
81
-                                $tab_target = " target='" . sanitize_text_field($args['target']) . "' ";
81
+                                $tab_target = " target='".sanitize_text_field($args['target'])."' ";
82 82
                             } else
83 83
                                 $tab_target = '';
84 84
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                              * @see 'geodir_after_settings_tabs'
94 94
                              */
95 95
                             do_action('geodir_before_settings_tabs', $name);
96
-                            echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '"  ' . $tab_target . ' >' . $label . '</a></li>';
96
+                            echo '<li '.$tab_active.' ><a href="'.esc_url($tab_link).'"  '.$tab_target.' >'.$label.'</a></li>';
97 97
                             /**
98 98
                              * Called after the individual settings tabs are output.
99 99
                              *
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
                                         $form_action = isset($sub['form_action']) ? $sub['form_action'] : '';
138 138
                                     }
139 139
 
140
-                                    $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab'];
140
+                                    $sub_tabs_link = admin_url().'admin.php?page=geodirectory&tab='.$current_tab.'&subtab='.$sub['subtab'];
141 141
                                     if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) {
142 142
                                         $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']);
143 143
                                     }
144
-                                    echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>';
144
+                                    echo '<dd '.$subtab_active.' id="claim_listing"><a href="'.esc_url($sub_tabs_link).'" >'.sanitize_text_field($sub['label']).'</a></dd>';
145 145
                                 }
146 146
                                 ?>
147 147
                             </dl>
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                             echo "inner_contet_tabs";
152 152
                         } ?>">
153 153
                             <form method="post" id="mainform"
154
-                                  class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) {
154
+                                  class="geodir_optionform <?php echo $current_tab.' '; ?><?php if (isset($sub['subtab'])) {
155 155
                                       echo sanitize_text_field($sub['subtab']);
156 156
                                   } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data">
157 157
                                 <input type="hidden" class="active_tab" name="active_tab"
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                                            echo sanitize_text_field($_REQUEST['active_tab']);
160 160
                                        } ?>"/>
161 161
                                 <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?>
162
-                                <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?>
162
+                                <?php wp_nonce_field('geodir-settings-'.$current_tab, '_wpnonce-'.$current_tab, true, true); ?>
163 163
                                 <?php
164 164
                                 /**
165 165
                                  * Used to call the content of each GD settings tab page.
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                      jQuery('#last_tab').val( jQuery(this).attr('href') );
190 190
                      return false;*/
191 191
                 });
192
-                <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; ?>
192
+                <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#'.sanitize_text_field($_GET['subtab']).'"]\').click();'; ?>
193 193
                 // Countries
194 194
                 jQuery('select#geodirectory_allowed_countries').change(function () {
195 195
                     if (jQuery(this).val() == "specific") {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                     jQuery('.geodirectory-nav-tab-wrapper a').click(function () {
223 223
                         if (changed) {
224 224
                             window.onbeforeunload = function () {
225
-                                return '<?php echo __( 'The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>';
225
+                                return '<?php echo __('The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>';
226 226
                             }
227 227
                         } else {
228 228
                             window.onbeforeunload = '';
@@ -285,14 +285,14 @@  discard block
 block discarded – undo
285 285
 
286 286
     //echo $tab_name.'_array.php' ;
287 287
     global $geodir_settings, $is_default, $mapzoom;
288
-    if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) {
288
+    if (file_exists(dirname(__FILE__).'/option-pages/'.$tab_name.'_array.php')) {
289 289
         /**
290 290
          * Contains settings array for given tab.
291 291
          *
292 292
          * @since 1.0.0
293 293
          * @package GeoDirectory
294 294
          */
295
-        include_once('option-pages/' . $tab_name . '_array.php');
295
+        include_once('option-pages/'.$tab_name.'_array.php');
296 296
     }
297 297
 
298 298
     $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : '';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
             ?>
328 328
 
329 329
             <p class="submit">
330
-            <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
330
+            <input <?php echo $hide_save_button; ?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
331 331
             <input type="hidden" name="subtab" id="last_tab" />
332 332
             </p>
333 333
             
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 
397 397
                     ?>
398 398
 
399
-                    <h3><?php _e('Set Default Location', 'geodirectory');?></h3>
399
+                    <h3><?php _e('Set Default Location', 'geodirectory'); ?></h3>
400 400
 
401 401
                     <input type="hidden" name="add_location" value="location">
402 402
 
@@ -404,16 +404,16 @@  discard block
 block discarded – undo
404 404
                         echo $location_result->location_id;
405 405
                     } ?>">
406 406
 
407
-                    <input type="hidden" name="address" id="<?php echo $prefix;?>address" value="">
407
+                    <input type="hidden" name="address" id="<?php echo $prefix; ?>address" value="">
408 408
 
409 409
                     <table class="form-table default_location_form">
410 410
                         <tbody>
411 411
                         <tr valign="top" class="single_select_page">
412
-                            <th class="titledesc" scope="row"><?php _e('City', 'geodirectory');?></th>
412
+                            <th class="titledesc" scope="row"><?php _e('City', 'geodirectory'); ?></th>
413 413
                             <td class="forminp">
414 414
                                 <div class="gtd-formfeild required">
415 415
                                     <input class="require" type="text" size="80" style="width:440px"
416
-                                           id="<?php echo $prefix;?>city" name="city"
416
+                                           id="<?php echo $prefix; ?>city" name="city"
417 417
                                            value="<?php if (isset($location_result->city)) {
418 418
                                                echo $location_result->city;
419 419
                                            } ?>"/>
@@ -425,11 +425,11 @@  discard block
 block discarded – undo
425 425
                             </td>
426 426
                         </tr>
427 427
                         <tr valign="top" class="single_select_page">
428
-                            <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory');?></th>
428
+                            <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory'); ?></th>
429 429
                             <td class="forminp">
430 430
                                 <div class="gtd-formfeild required">
431 431
                                     <input class="require" type="text" size="80" style="width:440px"
432
-                                           id="<?php echo $prefix;?>region" name="region"
432
+                                           id="<?php echo $prefix; ?>region" name="region"
433 433
                                            value="<?php if (isset($location_result->region)) {
434 434
                                                echo $location_result->region;
435 435
                                            } ?>"/>
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
                             </td>
442 442
                         </tr>
443 443
                         <tr valign="top" class="single_select_page">
444
-                            <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory');?></th>
444
+                            <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory'); ?></th>
445 445
                             <td class="forminp">
446 446
                                 <div class="gtd-formfeild required" style="padding-top:10px;">
447 447
                                     <?php
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                                     ?>
451 451
                                     <select id="<?php echo $prefix ?>country" class="chosen_select"
452 452
                                             data-location_type="country" name="<?php echo $prefix ?>country"
453
-                                            data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>"
453
+                                            data-placeholder="<?php _e('Choose a country.', 'geodirectory'); ?>"
454 454
                                             data-addsearchtermonnorecord="1" data-ajaxchosen="0" data-autoredirect="0"
455 455
                                             data-showeverywhere="0">
456 456
                                         <?php geodir_get_country_dl($country, $prefix); ?>
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                         </tr>
468 468
                         <tr valign="top" class="single_select_page gd-add-location-map">
469 469
                             <th class="titledesc"
470
-                                scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th>
470
+                                scope="row"><?php _e('Set Location on Map', 'geodirectory'); ?></th>
471 471
                             <td class="forminp">
472 472
                                 <?php
473 473
                                 /**
@@ -475,15 +475,15 @@  discard block
 block discarded – undo
475 475
                                  *
476 476
                                  * @since 1.0.0
477 477
                                  */
478
-                                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?>
478
+                                include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php"); ?>
479 479
                             </td>
480 480
                         </tr>
481 481
                         <tr valign="top" class="single_select_page">
482
-                            <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory');?></th>
482
+                            <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory'); ?></th>
483 483
                             <td class="forminp">
484 484
                                 <div class="gtd-formfeild required" style="padding-top:10px;">
485 485
                                     <input type="text" class="require" size="80" style="width:440px"
486
-                                           id="<?php echo $prefix;?>latitude" name="latitude"
486
+                                           id="<?php echo $prefix; ?>latitude" name="latitude"
487 487
                                            value="<?php if (isset($location_result->city_latitude)) {
488 488
                                                echo $location_result->city_latitude;
489 489
                                            } ?>"/>
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
                         </tr>
497 497
                         <tr valign="top" class="single_select_page">
498 498
                             <th class="titledesc"
499
-                                scope="row"><?php _e('City Longitude', 'geodirectory');?></th>
499
+                                scope="row"><?php _e('City Longitude', 'geodirectory'); ?></th>
500 500
                             <td class="forminp">
501 501
                                 <div class="gtd-formfeild required" style="padding-top:10px;">
502 502
                                     <input type="text" class="require" size="80" style="width:440px"
503
-                                           id="<?php echo $prefix;?>longitude" name="longitude"
503
+                                           id="<?php echo $prefix; ?>longitude" name="longitude"
504 504
                                            value="<?php if (isset($location_result->city_longitude)) {
505 505
                                                echo $location_result->city_longitude;
506 506
                                            } ?>"/>
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
                 </div>
536 536
             </div>
537 537
             <?php break;
538
-        case $listing_type . '_fields_settings' :
538
+        case $listing_type.'_fields_settings' :
539 539
 
540 540
             geodir_custom_post_type_form();
541 541
 
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
     }
688 688
 
689 689
 
690
-    $theme_name = $theme_name . "_custom";
690
+    $theme_name = $theme_name."_custom";
691 691
     $theme_arr = get_option('gd_theme_compats');
692 692
     update_option('gd_theme_compat', $theme_name);
693 693
     /**
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
         <div class="gd-content-heading">
777 777
 
778 778
 
779
-            <h3><?php _e('Theme Compatibility Settings', 'geodirectory');?></h3>
779
+            <h3><?php _e('Theme Compatibility Settings', 'geodirectory'); ?></h3>
780 780
             <style>
781 781
                 .gd-theme-compat-table {
782 782
                     width: 100%;
@@ -807,11 +807,11 @@  discard block
 block discarded – undo
807 807
                 </div>
808 808
             <?php }?>
809 809
 
810
-            <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory');?></h4>
810
+            <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory'); ?></h4>
811 811
 
812 812
             <select name="gd_theme_compat" id="gd_theme_compat">
813
-                <option value=""><?php _e('Select Theme', 'geodirectory');?></option>
814
-                <option value="custom"><?php _e('Custom', 'geodirectory');?></option>
813
+                <option value=""><?php _e('Select Theme', 'geodirectory'); ?></option>
814
+                <option value="custom"><?php _e('Custom', 'geodirectory'); ?></option>
815 815
                 <?php
816 816
                 $theme_arr = get_option('gd_theme_compats');
817 817
                 $theme_active = get_option('gd_theme_compat');
@@ -830,20 +830,20 @@  discard block
 block discarded – undo
830 830
                 ?>
831 831
             </select>
832 832
             <button onclick="gd_comp_export();" type="button"
833
-                    class="button-primary"><?php _e('Export', 'geodirectory');?></button>
833
+                    class="button-primary"><?php _e('Export', 'geodirectory'); ?></button>
834 834
             <button onclick="gd_comp_import();" type="button"
835
-                    class="button-primary"><?php _e('Import', 'geodirectory');?></button>
835
+                    class="button-primary"><?php _e('Import', 'geodirectory'); ?></button>
836 836
 
837 837
             <div class="gd-comp-import-export">
838 838
                 <textarea id="gd-import-export-theme-comp"
839
-                          placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory');?>"></textarea>
839
+                          placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory'); ?>"></textarea>
840 840
             </div>
841 841
             <script>
842 842
 
843 843
                 function gd_comp_export() {
844 844
                     theme = jQuery('#gd_theme_compat').val();
845 845
                     if (theme == '' || theme == 'custom') {
846
-                        alert("<?php _e('Please select a theme to export','geodirectory');?>");
846
+                        alert("<?php _e('Please select a theme to export', 'geodirectory'); ?>");
847 847
                         return false;
848 848
                     }
849 849
                     jQuery('.gd-comp-import-export').show();
@@ -877,9 +877,9 @@  discard block
 block discarded – undo
877 877
 
878 878
                     jQuery.post(ajaxurl, data, function (response) {
879 879
                         if (response == '0') {
880
-                            alert("<?php _e('Something went wrong','geodirectory');?>");
880
+                            alert("<?php _e('Something went wrong', 'geodirectory'); ?>");
881 881
                         } else {
882
-                            alert("<?php _e('Theme Compatibility Imported','geodirectory');?>");
882
+                            alert("<?php _e('Theme Compatibility Imported', 'geodirectory'); ?>");
883 883
                             jQuery('#gd-import-export-theme-comp').val('');
884 884
                             jQuery('.gd-comp-import-export').hide();
885 885
                             jQuery('#gd_theme_compat').append(new Option(response, response));
@@ -920,14 +920,14 @@  discard block
 block discarded – undo
920 920
 
921 921
             </script>
922 922
 
923
-            <h4><?php _e('Main Wrapper Actions', 'geodirectory');?></h4>
923
+            <h4><?php _e('Main Wrapper Actions', 'geodirectory'); ?></h4>
924 924
 
925 925
             <table class="form-table gd-theme-compat-table">
926 926
                 <tbody>
927 927
                 <tr>
928
-                    <td><strong><?php _e('Hook', 'geodirectory');?></strong></td>
929
-                    <td><strong><?php _e('ID', 'geodirectory');?></strong></td>
930
-                    <td><strong><?php _e('Class', 'geodirectory');?></strong></td>
928
+                    <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td>
929
+                    <td><strong><?php _e('ID', 'geodirectory'); ?></strong></td>
930
+                    <td><strong><?php _e('Class', 'geodirectory'); ?></strong></td>
931 931
                 </tr>
932 932
 
933 933
 
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 
946 946
                 <tr class="gd-theme-comp-out">
947 947
                     <td colspan="3">
948
-                        <span><?php _e('Output:', 'geodirectory');?></span>
948
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
949 949
                         <textarea name="geodir_wrapper_open_replace"
950 950
                                   placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) {
951 951
                                 echo $tc['geodir_wrapper_open_replace'];
@@ -959,14 +959,14 @@  discard block
 block discarded – undo
959 959
                         <small>geodir_wrapper_close</small>
960 960
                     </td>
961 961
                     <td><input disabled="disabled" type="text" name="geodir_wrapper_open_id"
962
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
962
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
963 963
                     <td><input disabled="disabled" type="text" name="geodir_wrapper_open_class"
964
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
964
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
965 965
                 </tr>
966 966
 
967 967
                 <tr class="gd-theme-comp-out">
968 968
                     <td colspan="3">
969
-                        <span><?php _e('Output:', 'geodirectory');?></span>
969
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
970 970
                         <textarea name="geodir_wrapper_close_replace"
971 971
                                   placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) {
972 972
                                 echo $tc['geodir_wrapper_close_replace'];
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 
991 991
                 <tr class="gd-theme-comp-out">
992 992
                     <td colspan="3">
993
-                        <span><?php _e('Output:', 'geodirectory');?></span>
993
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
994 994
                         <textarea name="geodir_wrapper_content_open_replace"
995 995
                                   placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) {
996 996
                                 echo $tc['geodir_wrapper_content_open_replace'];
@@ -1004,14 +1004,14 @@  discard block
 block discarded – undo
1004 1004
                         <small>geodir_wrapper_content_close</small>
1005 1005
                     </td>
1006 1006
                     <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_id"
1007
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1007
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1008 1008
                     <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_class"
1009
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1009
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1010 1010
                 </tr>
1011 1011
 
1012 1012
                 <tr class="gd-theme-comp-out">
1013 1013
                     <td colspan="3">
1014
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1014
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1015 1015
                         <textarea name="geodir_wrapper_content_close_replace"
1016 1016
                                   placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) {
1017 1017
                                 echo $tc['geodir_wrapper_content_close_replace'];
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
                 <tr class="gd-theme-comp-out">
1035 1035
                     <td colspan="3">
1036
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1036
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1037 1037
                         <textarea name="geodir_article_open_replace"
1038 1038
                                   placeholder='<article  id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) {
1039 1039
                                 echo $tc['geodir_article_open_replace'];
@@ -1046,14 +1046,14 @@  discard block
 block discarded – undo
1046 1046
                         <small>geodir_article_close</small>
1047 1047
                     </td>
1048 1048
                     <td><input disabled="disabled" type="text" name="geodir_article_close_id"
1049
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1049
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1050 1050
                     <td><input disabled="disabled" type="text" name="geodir_article_close_class"
1051
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1051
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1052 1052
                 </tr>
1053 1053
 
1054 1054
                 <tr class="gd-theme-comp-out">
1055 1055
                     <td colspan="3">
1056
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1056
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1057 1057
                         <textarea name="geodir_article_close_replace"
1058 1058
                                   placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) {
1059 1059
                                 echo $tc['geodir_article_close_replace'];
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 
1077 1077
                 <tr class="gd-theme-comp-out">
1078 1078
                     <td colspan="3">
1079
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1079
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1080 1080
                         <textarea name="geodir_sidebar_right_open_replace"
1081 1081
                                   placeholder='<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) {
1082 1082
                                 echo $tc['geodir_sidebar_right_open_replace'];
@@ -1089,14 +1089,14 @@  discard block
 block discarded – undo
1089 1089
                         <small>geodir_sidebar_right_close</small>
1090 1090
                     </td>
1091 1091
                     <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_id"
1092
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1092
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1093 1093
                     <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_class"
1094
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1094
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1095 1095
                 </tr>
1096 1096
 
1097 1097
                 <tr class="gd-theme-comp-out">
1098 1098
                     <td colspan="3">
1099
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1099
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1100 1100
                         <textarea name="geodir_sidebar_right_close_replace"
1101 1101
                                   placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) {
1102 1102
                                 echo $tc['geodir_sidebar_right_close_replace'];
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
 
1121 1121
                 <tr class="gd-theme-comp-out">
1122 1122
                     <td colspan="3">
1123
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1123
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1124 1124
                         <textarea name="geodir_sidebar_left_open_replace"
1125 1125
                                   placeholder='<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) {
1126 1126
                                 echo $tc['geodir_sidebar_left_open_replace'];
@@ -1133,14 +1133,14 @@  discard block
 block discarded – undo
1133 1133
                         <small>geodir_sidebar_left_close</small>
1134 1134
                     </td>
1135 1135
                     <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_id"
1136
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1136
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1137 1137
                     <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_class"
1138
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1138
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1139 1139
                 </tr>
1140 1140
 
1141 1141
                 <tr class="gd-theme-comp-out">
1142 1142
                     <td colspan="3">
1143
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1143
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1144 1144
                         <textarea name="geodir_sidebar_left_close_replace"
1145 1145
                                   placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) {
1146 1146
                                 echo $tc['geodir_sidebar_left_close_replace'];
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
 
1163 1163
                 <tr class="gd-theme-comp-out">
1164 1164
                     <td colspan="3">
1165
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1165
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1166 1166
                         <textarea name="geodir_main_content_open_replace"
1167 1167
                                   placeholder='<main  id="[id]" class="[class]"  role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) {
1168 1168
                                 echo $tc['geodir_main_content_open_replace'];
@@ -1175,14 +1175,14 @@  discard block
 block discarded – undo
1175 1175
                         <small>geodir_main_content_close</small>
1176 1176
                     </td>
1177 1177
                     <td><input disabled="disabled" type="text" name="geodir_main_content_close_id"
1178
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1178
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1179 1179
                     <td><input disabled="disabled" type="text" name="geodir_main_content_close_class"
1180
-                               placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
1180
+                               placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
1181 1181
                 </tr>
1182 1182
 
1183 1183
                 <tr class="gd-theme-comp-out">
1184 1184
                     <td colspan="3">
1185
-                        <span><?php _e('Output:', 'geodirectory');?></span>
1185
+                        <span><?php _e('Output:', 'geodirectory'); ?></span>
1186 1186
                         <textarea name="geodir_main_content_close_replace"
1187 1187
                                   placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) {
1188 1188
                                 echo $tc['geodir_main_content_close_replace'];
@@ -1194,13 +1194,13 @@  discard block
 block discarded – undo
1194 1194
                 </tbody>
1195 1195
             </table>
1196 1196
 
1197
-            <h4><?php _e('Other Actions', 'geodirectory');?></h4>
1197
+            <h4><?php _e('Other Actions', 'geodirectory'); ?></h4>
1198 1198
 
1199 1199
             <table class="form-table gd-theme-compat-table">
1200 1200
                 <tbody>
1201 1201
                 <tr>
1202
-                    <td><strong><?php _e('Hook', 'geodirectory');?></strong></td>
1203
-                    <td><strong><?php _e('Content', 'geodirectory');?></strong></td>
1202
+                    <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td>
1203
+                    <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td>
1204 1204
                 </tr>
1205 1205
 
1206 1206
 
@@ -1229,13 +1229,13 @@  discard block
 block discarded – undo
1229 1229
             </table>
1230 1230
 
1231 1231
 
1232
-            <h4><?php _e('Other Filters', 'geodirectory');?></h4>
1232
+            <h4><?php _e('Other Filters', 'geodirectory'); ?></h4>
1233 1233
 
1234 1234
             <table class="form-table gd-theme-compat-table">
1235 1235
                 <tbody>
1236 1236
                 <tr>
1237
-                    <td><strong><?php _e('Filter', 'geodirectory');?></strong></td>
1238
-                    <td><strong><?php _e('Content', 'geodirectory');?></strong></td>
1237
+                    <td><strong><?php _e('Filter', 'geodirectory'); ?></strong></td>
1238
+                    <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td>
1239 1239
                 </tr>
1240 1240
 
1241 1241
                 <tr>
@@ -1389,13 +1389,13 @@  discard block
 block discarded – undo
1389 1389
                  *
1390 1390
                  * @since 1.4.0
1391 1391
                  */
1392
-                do_action('gd_compat_other_filters');?>
1392
+                do_action('gd_compat_other_filters'); ?>
1393 1393
 
1394 1394
                 </tbody>
1395 1395
             </table>
1396 1396
 
1397 1397
 
1398
-            <h4><?php _e('Required CSS', 'geodirectory');?></h4>
1398
+            <h4><?php _e('Required CSS', 'geodirectory'); ?></h4>
1399 1399
 
1400 1400
             <table class="form-table gd-theme-compat-table">
1401 1401
                 <tbody>
@@ -1410,7 +1410,7 @@  discard block
 block discarded – undo
1410 1410
                 </tbody>
1411 1411
             </table>
1412 1412
 
1413
-            <h4><?php _e('Required JS', 'geodirectory');?></h4>
1413
+            <h4><?php _e('Required JS', 'geodirectory'); ?></h4>
1414 1414
 
1415 1415
             <table class="form-table gd-theme-compat-table">
1416 1416
                 <tbody>
@@ -1428,7 +1428,7 @@  discard block
 block discarded – undo
1428 1428
 
1429 1429
             <p class="submit">
1430 1430
                 <input name="save" class="button-primary" type="submit"
1431
-                       value="<?php _e('Save changes', 'geodirectory');?>">
1431
+                       value="<?php _e('Save changes', 'geodirectory'); ?>">
1432 1432
             </p>
1433 1433
 
1434 1434
         </div>
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
          * @param string $listing_type Post type.
1463 1463
          */
1464 1464
         ?>
1465
-        <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3>
1465
+        <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type); ?></h3>
1466 1466
     </div>
1467 1467
     <div id="container_general" class="clearfix">
1468 1468
         <div class="general-form-builder-frame">
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
                  * @param string $listing_type Post type.
1478 1478
                  */
1479 1479
                 ?>
1480
-                <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?>
1480
+                <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type); ?>
1481 1481
 							</span></h3>
1482 1482
                 <?php
1483 1483
                 /**
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
                  * @param string $listing_type Post type.
1489 1489
                  */
1490 1490
                 ?>
1491
-                <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p>
1491
+                <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type); ?></p>
1492 1492
 
1493 1493
                 <div class="inside">
1494 1494
 
@@ -1522,7 +1522,7 @@  discard block
 block discarded – undo
1522 1522
                      * @param string $listing_type Post type.
1523 1523
                      */
1524 1524
                     ?>
1525
-                    <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span>
1525
+                    <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type); ?></span>
1526 1526
                 </h3>
1527 1527
                 <?php
1528 1528
                 /**
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
                  * @param string $listing_type Post type.
1534 1534
                  */
1535 1535
                 ?>
1536
-                <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p>
1536
+                <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type); ?></p>
1537 1537
 
1538 1538
                 <div class="inside">
1539 1539
 
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
         <div class="gd-content-heading">
1575 1575
 
1576 1576
 
1577
-            <h3><?php _e('GD Diagnostic Tools', 'geodirectory');?></h3>
1577
+            <h3><?php _e('GD Diagnostic Tools', 'geodirectory'); ?></h3>
1578 1578
             <style>
1579 1579
                 .gd-tools-table {
1580 1580
                     width: 100%;
@@ -1593,81 +1593,81 @@  discard block
 block discarded – undo
1593 1593
             <table class="form-table gd-tools-table">
1594 1594
                 <tbody>
1595 1595
                 <tr>
1596
-                    <td><strong><?php _e('Tool', 'geodirectory');?></strong></td>
1597
-                    <td><strong><?php _e('Description', 'geodirectory');?></strong></td>
1598
-                    <td><strong><?php _e('Action', 'geodirectory');?></strong></td>
1596
+                    <td><strong><?php _e('Tool', 'geodirectory'); ?></strong></td>
1597
+                    <td><strong><?php _e('Description', 'geodirectory'); ?></strong></td>
1598
+                    <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td>
1599 1599
                 </tr>
1600 1600
 
1601 1601
 
1602 1602
                 <tr>
1603
-                    <td><?php _e('GD pages check', 'geodirectory');?></td>
1603
+                    <td><?php _e('GD pages check', 'geodirectory'); ?></td>
1604 1604
                     <td>
1605
-                        <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory');?></small>
1605
+                        <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory'); ?></small>
1606 1606
                     </td>
1607 1607
                     <td>
1608
-                        <input type="button" value="<?php _e('Run', 'geodirectory');?>"
1608
+                        <input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1609 1609
                                class="button-primary geodir_diagnosis_button" data-diagnose="default_pages"/>
1610 1610
                     </td>
1611 1611
                 </tr>
1612 1612
 
1613 1613
 
1614 1614
                 <tr>
1615
-                    <td><?php _e('Multisite DB conversion check', 'geodirectory');?></td>
1615
+                    <td><?php _e('Multisite DB conversion check', 'geodirectory'); ?></td>
1616 1616
                     <td>
1617
-                        <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory');?></small>
1617
+                        <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory'); ?></small>
1618 1618
                     </td>
1619
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1619
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1620 1620
                                class="button-primary geodir_diagnosis_button" data-diagnose="multisite_conversion"/>
1621 1621
                     </td>
1622 1622
                 </tr>
1623 1623
 
1624 1624
                 <tr>
1625
-                    <td><?php _e('Ratings check', 'geodirectory');?></td>
1625
+                    <td><?php _e('Ratings check', 'geodirectory'); ?></td>
1626 1626
                     <td>
1627
-                        <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory');?></small>
1627
+                        <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory'); ?></small>
1628 1628
                     </td>
1629
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1629
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1630 1630
                                class="button-primary geodir_diagnosis_button" data-diagnose="ratings"/>
1631 1631
                     </td>
1632 1632
                 </tr>
1633 1633
 
1634 1634
                 <tr>
1635
-                    <td><?php _e('Sync GD tags', 'geodirectory');?></td>
1635
+                    <td><?php _e('Sync GD tags', 'geodirectory'); ?></td>
1636 1636
                     <td>
1637
-                        <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory');?></small>
1637
+                        <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory'); ?></small>
1638 1638
                     </td>
1639
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1639
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1640 1640
                                class="button-primary geodir_diagnosis_button" data-diagnose="tags_sync"/>
1641 1641
                     </td>
1642 1642
                 </tr>
1643 1643
 
1644 1644
                 <tr>
1645
-                    <td><?php _e('Sync GD Categories', 'geodirectory');?></td>
1645
+                    <td><?php _e('Sync GD Categories', 'geodirectory'); ?></td>
1646 1646
                     <td>
1647
-                        <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory');?></small>
1647
+                        <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory'); ?></small>
1648 1648
                     </td>
1649
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1649
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1650 1650
                                class="button-primary geodir_diagnosis_button" data-diagnose="cats_sync"/>
1651 1651
                     </td>
1652 1652
                 </tr>
1653 1653
 
1654 1654
 
1655 1655
                 <tr>
1656
-                    <td><?php _e('Clear all GD version numbers', 'geodirectory');?></td>
1656
+                    <td><?php _e('Clear all GD version numbers', 'geodirectory'); ?></td>
1657 1657
                     <td>
1658
-                        <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory');?></small>
1658
+                        <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory'); ?></small>
1659 1659
                     </td>
1660
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1660
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1661 1661
                                class="button-primary geodir_diagnosis_button" data-diagnose="version_clear"/>
1662 1662
                     </td>
1663 1663
                 </tr>
1664 1664
 				<tr>
1665
-					<td><?php _e('Load custom fields translation', 'geodirectory');?></td>
1665
+					<td><?php _e('Load custom fields translation', 'geodirectory'); ?></td>
1666 1666
 					<td>
1667
-						<small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory');?></small>
1667
+						<small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory'); ?></small>
1668 1668
 					</td>
1669 1669
 					<td>
1670
-						<input type="button" value="<?php _e('Run', 'geodirectory');?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
1670
+						<input type="button" value="<?php _e('Run', 'geodirectory'); ?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
1671 1671
 					</td>
1672 1672
 				</tr>
1673 1673
                 <?php
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
                  * Called after the last setting on the GD>Tools page.
1678 1678
                  * @since 1.0.0
1679 1679
                  */
1680
-                do_action('geodir_diagnostic_tool');?>
1680
+                do_action('geodir_diagnostic_tool'); ?>
1681 1681
 
1682 1682
                 </tbody>
1683 1683
             </table>
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 1 patch
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 ////////////////////////
178 178
 
179 179
 add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
180
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
180
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
181 181
 add_action('created_term', 'geodir_term_review_count_force_update', 100);
182 182
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
  */
222 222
 function geodir_unset_prev_theme_nav_location($newname)
223 223
 {
224
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
224
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
225 225
     if ($geodir_theme_location) {
226 226
         update_option('geodir_theme_location_nav', $geodir_theme_location);
227 227
     } else {
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
 
320 320
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
321 321
 
322
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
323
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
322
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
323
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
324 324
 
325 325
 // Detail page sidebar content 
326 326
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
     do_action('geodir_after_social_sharing_buttons');
422 422
     $content_html = ob_get_clean();
423 423
     if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
424
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
425
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
426 426
         /**
427 427
          * Filter the geodir_social_sharing_buttons() function content.
428 428
          *
@@ -468,8 +468,8 @@  discard block
 block discarded – undo
468 468
     do_action('geodir_after_share_this_button');
469 469
     $content_html = ob_get_clean();
470 470
     if (trim($content_html) != '')
471
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
471
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>';
472
+    if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
473 473
         /**
474 474
          * Filter the geodir_share_this_button() function content.
475 475
          *
@@ -508,12 +508,12 @@  discard block
 block discarded – undo
508 508
             $post_id = $post->ID;
509 509
             
510 510
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
511
-                $post_id = (int)$_REQUEST['pid'];
511
+                $post_id = (int) $_REQUEST['pid'];
512 512
             }
513 513
 
514 514
             $postlink = get_permalink(geodir_add_listing_page_id());
515 515
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
516
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
516
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
517 517
         }
518 518
     }// end of if, if its a preview or not
519 519
     /**
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
     do_action('geodir_after_edit_post_link');
525 525
     $content_html = ob_get_clean();
526 526
     if (trim($content_html) != '')
527
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
528
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
527
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
528
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
529 529
         /**
530 530
          * Filter the geodir_edit_post_link() function content.
531 531
          *
@@ -578,14 +578,14 @@  discard block
 block discarded – undo
578 578
     $hide_refresh = get_option('geodir_ga_auto_refresh');
579 579
     
580 580
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
581
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
581
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
582 582
         $page_url = urlencode($_SERVER['REQUEST_URI']);
583 583
         ?>
584 584
         <script type="text/javascript">
585 585
             var gd_gaTimeOut;
586
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
587
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
588
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
586
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
587
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
588
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
589 589
             ga_data1 = false;
590 590
             ga_data2 = false;
591 591
             ga_data3 = false;
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
             }
727 727
 
728 728
             function gdga_noResults() {
729
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
729
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
730 730
                 jQuery('#gdga-legend-container').html('');
731 731
             }
732 732
 
@@ -758,18 +758,18 @@  discard block
 block discarded – undo
758 758
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
759 759
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
760 760
 
761
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
762
-                        '<?php _e('Feb', 'geodirectory');?>',
763
-                        '<?php _e('Mar', 'geodirectory');?>',
764
-                        '<?php _e('Apr', 'geodirectory');?>',
765
-                        '<?php _e('May', 'geodirectory');?>',
766
-                        '<?php _e('Jun', 'geodirectory');?>',
767
-                        '<?php _e('Jul', 'geodirectory');?>',
768
-                        '<?php _e('Aug', 'geodirectory');?>',
769
-                        '<?php _e('Sep', 'geodirectory');?>',
770
-                        '<?php _e('Oct', 'geodirectory');?>',
771
-                        '<?php _e('Nov', 'geodirectory');?>',
772
-                        '<?php _e('Dec', 'geodirectory');?>'];
761
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
762
+                        '<?php _e('Feb', 'geodirectory'); ?>',
763
+                        '<?php _e('Mar', 'geodirectory'); ?>',
764
+                        '<?php _e('Apr', 'geodirectory'); ?>',
765
+                        '<?php _e('May', 'geodirectory'); ?>',
766
+                        '<?php _e('Jun', 'geodirectory'); ?>',
767
+                        '<?php _e('Jul', 'geodirectory'); ?>',
768
+                        '<?php _e('Aug', 'geodirectory'); ?>',
769
+                        '<?php _e('Sep', 'geodirectory'); ?>',
770
+                        '<?php _e('Oct', 'geodirectory'); ?>',
771
+                        '<?php _e('Nov', 'geodirectory'); ?>',
772
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
773 773
 
774 774
                     // Ensure the data arrays are at least as long as the labels array.
775 775
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -782,13 +782,13 @@  discard block
 block discarded – undo
782 782
                         labels : labels,
783 783
                         datasets : [
784 784
                             {
785
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
785
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
786 786
                                 fillColor : "rgba(220,220,220,0.5)",
787 787
                                 strokeColor : "rgba(220,220,220,1)",
788 788
                                 data : data2
789 789
                             },
790 790
                             {
791
-                                label: '<?php _e('This Year', 'geodirectory');?>',
791
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
792 792
                                 fillColor : "rgba(151,187,205,0.5)",
793 793
                                 strokeColor : "rgba(151,187,205,1)",
794 794
                                 data : data1
@@ -833,30 +833,30 @@  discard block
 block discarded – undo
833 833
 
834 834
                     <?php
835 835
                     // Here we list the shorthand days of the week so it can be used in translation.
836
-                    __("Mon",'geodirectory');
837
-                    __("Tue",'geodirectory');
838
-                    __("Wed",'geodirectory');
839
-                    __("Thu",'geodirectory');
840
-                    __("Fri",'geodirectory');
841
-                    __("Sat",'geodirectory');
842
-                    __("Sun",'geodirectory');
836
+                    __("Mon", 'geodirectory');
837
+                    __("Tue", 'geodirectory');
838
+                    __("Wed", 'geodirectory');
839
+                    __("Thu", 'geodirectory');
840
+                    __("Fri", 'geodirectory');
841
+                    __("Sat", 'geodirectory');
842
+                    __("Sun", 'geodirectory');
843 843
                     ?>
844 844
 
845 845
                     labels = [
846
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
847
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
848
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
849
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
850
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
851
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
852
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
846
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
847
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
848
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
849
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
850
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
851
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
852
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
853 853
                     ];
854 854
 
855 855
                     var data = {
856 856
                         labels : labels,
857 857
                         datasets : [
858 858
                             {
859
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
859
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
860 860
                                 fillColor : "rgba(220,220,220,0.5)",
861 861
                                 strokeColor : "rgba(220,220,220,1)",
862 862
                                 pointColor : "rgba(220,220,220,1)",
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
                                 data : data2
865 865
                             },
866 866
                             {
867
-                                label: '<?php _e('This Week', 'geodirectory');?>',
867
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
868 868
                                 fillColor : "rgba(151,187,205,0.5)",
869 869
                                 strokeColor : "rgba(151,187,205,1)",
870 870
                                 pointColor : "rgba(151,187,205,1)",
@@ -1071,18 +1071,18 @@  discard block
 block discarded – undo
1071 1071
         </style>
1072 1072
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1073 1073
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1074
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1074
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1075 1075
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1076
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1076
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1077 1077
             <div id="gd-active-users-container">
1078
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1078
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1079 1079
                     <b class="gd-ActiveUsers-value">0</b>
1080 1080
                 </div>
1081 1081
             </div>
1082 1082
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1083
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1084
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1085
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1083
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1084
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1085
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1086 1086
             </select>
1087 1087
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1088 1088
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1098,8 +1098,8 @@  discard block
 block discarded – undo
1098 1098
     do_action('geodir_after_google_analytics');
1099 1099
     $content_html = ob_get_clean();
1100 1100
     if (trim($content_html) != '')
1101
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1102
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1101
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1102
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1103 1103
         /**
1104 1104
          * Filter the geodir_edit_post_link() function content.
1105 1105
          *
@@ -1153,10 +1153,10 @@  discard block
 block discarded – undo
1153 1153
        
1154 1154
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1155 1155
 	   
1156
-	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1156
+	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
1157 1157
 
1158 1158
         $html .= '<span class="item">';
1159
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1159
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1160 1160
 
1161 1161
         if ($post_images) {
1162 1162
             foreach ($post_images as $img) {
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
         }
1167 1167
 
1168 1168
         if (isset($post_img) && $post_img) {
1169
-            $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />';
1169
+            $html .= '<br /><img src="'.$post_img.'" class="photo hreview-img" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo hreview-img" />';
1170 1170
         }
1171 1171
 
1172 1172
         $html .= '</span>';
@@ -1193,9 +1193,9 @@  discard block
 block discarded – undo
1193 1193
     do_action('geodir_after_detail_page_review_rating');
1194 1194
     $content_html = ob_get_clean();
1195 1195
     if (trim($content_html) != '') {
1196
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1196
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1197 1197
     }
1198
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1198
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1199 1199
         /**
1200 1200
          * Filter the geodir_detail_page_review_rating() function content.
1201 1201
          *
@@ -1234,8 +1234,8 @@  discard block
 block discarded – undo
1234 1234
 
1235 1235
     $content_html = ob_get_clean();
1236 1236
     if (trim($content_html) != '')
1237
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1238
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1237
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1238
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1239 1239
         /**
1240 1240
          * Filter the output html for function geodir_detail_page_more_info().
1241 1241
          *
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1334 1334
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1335 1335
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1336
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1336
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1337 1337
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1338 1338
         'geodir_map_name' => geodir_map_name(),
1339 1339
     );
@@ -1351,10 +1351,10 @@  discard block
 block discarded – undo
1351 1351
     foreach ($arr_alert_msg as $key => $value) {
1352 1352
         if (!is_scalar($value))
1353 1353
             continue;
1354
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1354
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1355 1355
     }
1356 1356
 
1357
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1357
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1358 1358
     echo '<script>';
1359 1359
     echo $script;
1360 1360
     echo '</script>';
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
         global $post;
1528 1528
         $term_condition = '';
1529 1529
         if (isset($_REQUEST['backandedit'])) {
1530
-            $post = (object)$gd_session->get('listing');
1530
+            $post = (object) $gd_session->get('listing');
1531 1531
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1532 1532
         }
1533 1533
 
@@ -1541,7 +1541,7 @@  discard block
 block discarded – undo
1541 1541
                     echo 'checked="checked"';
1542 1542
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1543 1543
                        class="geodir_textfield" value="1"
1544
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1544
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1545 1545
 				</span>
1546 1546
             </div>
1547 1547
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1581,7 +1581,7 @@  discard block
 block discarded – undo
1581 1581
         /** This action is documented in geodirectory_template_actions.php */
1582 1582
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1583 1583
         
1584
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1584
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1585 1585
             $is_display = false;
1586 1586
         }
1587 1587
     }
@@ -1629,16 +1629,16 @@  discard block
 block discarded – undo
1629 1629
     global $wpdb, $plugin_prefix;
1630 1630
 	
1631 1631
 	// Remove unused virtual page
1632
-	$listings_page_id = (int)get_option('geodir_listing_page');
1632
+	$listings_page_id = (int) get_option('geodir_listing_page');
1633 1633
 	if ($listings_page_id) {
1634
-		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1634
+		$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1635 1635
         delete_option('geodir_listing_page');
1636 1636
 	}
1637 1637
 
1638 1638
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1639 1639
         $wpdb->query(
1640 1640
             $wpdb->prepare(
1641
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1641
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1642 1642
                 array('1', '1', 'admin')
1643 1643
             )
1644 1644
         );
@@ -1646,9 +1646,9 @@  discard block
 block discarded – undo
1646 1646
 
1647 1647
         /* --- terms meta value set --- */
1648 1648
 
1649
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1649
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1650 1650
 
1651
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1651
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1652 1652
 
1653 1653
         if (!empty($options_data)) {
1654 1654
 
@@ -1656,7 +1656,7 @@  discard block
 block discarded – undo
1656 1656
 
1657 1657
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1658 1658
 
1659
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1659
+                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1660 1660
 
1661 1661
                 if (!empty($taxonomies_data)) {
1662 1662
 
@@ -1665,17 +1665,17 @@  discard block
 block discarded – undo
1665 1665
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1666 1666
                         $post_type = $taxObject->object_type[0];
1667 1667
 
1668
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1668
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1669 1669
 
1670
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1670
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1671 1671
 
1672 1672
                         if ($duplicate_data) {
1673 1673
 
1674
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1674
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1675 1675
 
1676 1676
                         } else {
1677 1677
 
1678
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1678
+                            $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1679 1679
 
1680 1680
                         }
1681 1681
 
@@ -1709,14 +1709,14 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
     global $wpdb, $table_prefix;
1711 1711
 
1712
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1712
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1713 1713
 
1714 1714
     if ($slug_exists) {
1715 1715
 
1716 1716
         $suffix = 1;
1717 1717
         do {
1718
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1719
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1718
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1719
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1720 1720
             $suffix++;
1721 1721
         } while ($location_slug_check && $suffix < 100);
1722 1722
 
@@ -1770,7 +1770,7 @@  discard block
 block discarded – undo
1770 1770
 
1771 1771
         $suffix = 1;
1772 1772
         do {
1773
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1773
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1774 1774
 
1775 1775
             /** This action is documented in geodirectory_hooks_actions.php */
1776 1776
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1782,7 +1782,7 @@  discard block
 block discarded – undo
1782 1782
 
1783 1783
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1784 1784
 
1785
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1785
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1786 1786
 
1787 1787
     }
1788 1788
 	
@@ -1791,18 +1791,18 @@  discard block
 block discarded – undo
1791 1791
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1792 1792
 	
1793 1793
 	$post_types = geodir_get_posttypes();
1794
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1795
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1794
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1795
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1796 1796
 		
1797 1797
 		if (!empty($posts_obj)) {
1798 1798
 			foreach ($posts_obj as $post_obj) {
1799 1799
 				$post_id = $post_obj->object_id;
1800 1800
 				
1801
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1801
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1802 1802
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1803 1803
 				
1804
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1805
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1804
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1805
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1806 1806
 			}
1807 1807
 		}
1808 1808
 	}
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1837 1837
         return $slug_exists = true;
1838 1838
 
1839
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1839
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1840 1840
         return $slug_exists = true;
1841 1841
 
1842 1842
     return $slug_exists;
@@ -1876,43 +1876,43 @@  discard block
 block discarded – undo
1876 1876
 
1877 1877
 
1878 1878
     $gd_page = '';
1879
-    if(geodir_is_page('home')){
1879
+    if (geodir_is_page('home')) {
1880 1880
         $gd_page = 'home';
1881 1881
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1882 1882
     }
1883
-    elseif(geodir_is_page('detail')){
1883
+    elseif (geodir_is_page('detail')) {
1884 1884
         $gd_page = 'detail';
1885 1885
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1886 1886
     }
1887
-    elseif(geodir_is_page('pt')){
1887
+    elseif (geodir_is_page('pt')) {
1888 1888
         $gd_page = 'pt';
1889 1889
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1890 1890
     }
1891
-    elseif(geodir_is_page('listing')){
1891
+    elseif (geodir_is_page('listing')) {
1892 1892
         $gd_page = 'listing';
1893 1893
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1894 1894
     }
1895
-    elseif(geodir_is_page('location')){
1895
+    elseif (geodir_is_page('location')) {
1896 1896
         $gd_page = 'location';
1897 1897
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1898 1898
     }
1899
-    elseif(geodir_is_page('search')){
1899
+    elseif (geodir_is_page('search')) {
1900 1900
         $gd_page = 'search';
1901 1901
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1902 1902
     }
1903
-    elseif(geodir_is_page('add-listing')){
1903
+    elseif (geodir_is_page('add-listing')) {
1904 1904
         $gd_page = 'add-listing';
1905 1905
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1906 1906
     }
1907
-    elseif(geodir_is_page('author')){
1907
+    elseif (geodir_is_page('author')) {
1908 1908
         $gd_page = 'author';
1909 1909
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1910 1910
     }
1911
-    elseif(geodir_is_page('login')){
1911
+    elseif (geodir_is_page('login')) {
1912 1912
         $gd_page = 'login';
1913 1913
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1914 1914
     }
1915
-    elseif(geodir_is_page('listing-success')){
1915
+    elseif (geodir_is_page('listing-success')) {
1916 1916
         $gd_page = 'listing-success';
1917 1917
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1918 1918
     }
@@ -1944,8 +1944,8 @@  discard block
 block discarded – undo
1944 1944
 
1945 1945
     if (!get_option('geodir_set_post_attachments')) {
1946 1946
 
1947
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1948
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1947
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1948
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1949 1949
 
1950 1950
         $all_postypes = geodir_get_posttypes();
1951 1951
 
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
 
2147 2147
         if (array_key_exists('post_video', $tabs_arr)) {
2148 2148
 
2149
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2149
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2150 2150
 
2151 2151
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2152 2152
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
 
2155 2155
         if (array_key_exists('special_offers', $tabs_arr)) {
2156 2156
 
2157
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2157
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2158 2158
 
2159 2159
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2160 2160
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2175,7 +2175,7 @@  discard block
 block discarded – undo
2175 2175
  */
2176 2176
 function geodir_remove_template_redirect_actions()
2177 2177
 {
2178
-    if (geodir_is_page('login')){
2178
+    if (geodir_is_page('login')) {
2179 2179
         remove_all_actions('template_redirect');
2180 2180
         remove_action('init', 'avia_modify_front', 10);
2181 2181
     }
@@ -2222,25 +2222,25 @@  discard block
 block discarded – undo
2222 2222
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2223 2223
 
2224 2224
         $wpdb->query(
2225
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2225
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2226 2226
                 array($post_id, $split_img_file_path)
2227 2227
             )
2228 2228
         );
2229 2229
 
2230 2230
         $attachment_data = $wpdb->get_row(
2231
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2231
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2232 2232
                 array($post_id)
2233 2233
             )
2234 2234
         );
2235 2235
 
2236 2236
         if (!empty($attachment_data)) {
2237
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2237
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2238 2238
         }
2239 2239
 
2240 2240
 
2241
-        $table_name = $plugin_prefix . $post_type . '_detail';
2241
+        $table_name = $plugin_prefix.$post_type.'_detail';
2242 2242
 
2243
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2243
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2244 2244
 
2245 2245
         geodir_set_wp_featured_image($post_id);
2246 2246
 
@@ -2268,9 +2268,9 @@  discard block
 block discarded – undo
2268 2268
 
2269 2269
     foreach ($all_postypes as $posttype) {
2270 2270
 
2271
-        $tablename = $plugin_prefix . $posttype . '_detail';
2271
+        $tablename = $plugin_prefix.$posttype.'_detail';
2272 2272
 
2273
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2273
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2274 2274
 
2275 2275
         if (!empty($get_post_data)) {
2276 2276
 
@@ -2278,7 +2278,7 @@  discard block
 block discarded – undo
2278 2278
 
2279 2279
                 $post_id = $data->post_id;
2280 2280
 
2281
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2281
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2282 2282
 
2283 2283
                 if (!empty($attachment_data)) {
2284 2284
 
@@ -2295,22 +2295,22 @@  discard block
 block discarded – undo
2295 2295
 
2296 2296
                         $file_name = $file_info['basename'];
2297 2297
 
2298
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2298
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2299 2299
 
2300 2300
                         if (!file_exists($img_arr['path'])) {
2301 2301
 
2302
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2302
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2303 2303
 
2304 2304
                         }
2305 2305
 
2306 2306
                     }
2307 2307
 
2308
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2308
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2309 2309
 
2310 2310
                     if (!empty($attachment_data)) {
2311 2311
 
2312 2312
                         if ($attachment_data->ID)
2313
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2313
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2314 2314
 
2315 2315
                     } else {
2316 2316
 
@@ -2324,7 +2324,7 @@  discard block
 block discarded – undo
2324 2324
 
2325 2325
                     }
2326 2326
 
2327
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2327
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2328 2328
 
2329 2329
                     geodir_set_wp_featured_image($post_id);
2330 2330
 
@@ -2353,7 +2353,7 @@  discard block
 block discarded – undo
2353 2353
 {
2354 2354
 
2355 2355
     if (!get_option('geodir_default_rating_star_icon')) {
2356
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2356
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2357 2357
     }
2358 2358
 
2359 2359
 }
@@ -2370,10 +2370,10 @@  discard block
 block discarded – undo
2370 2370
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2371 2371
  * @return array User listing count for each post type.
2372 2372
  */
2373
-function geodir_user_post_listing_count($user_id=null)
2373
+function geodir_user_post_listing_count($user_id = null)
2374 2374
 {
2375 2375
     global $wpdb, $plugin_prefix, $current_user;
2376
-    if(!$user_id){
2376
+    if (!$user_id) {
2377 2377
         $user_id = $current_user->ID;
2378 2378
     }
2379 2379
 
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
     $user_listing = array();
2385 2385
     if (is_array($all_posts) && !empty($all_posts)) {
2386 2386
         foreach ($all_posts as $ptype) {
2387
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2387
+            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2388 2388
 
2389 2389
             if ($total_posts > 0) {
2390 2390
                 $user_listing[$ptype] = $total_posts;
@@ -2485,9 +2485,9 @@  discard block
 block discarded – undo
2485 2485
                     }
2486 2486
 
2487 2487
                     if (strpos($type['field_icon'], 'http') !== false) {
2488
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2488
+                        $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2489 2489
                     } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2490
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2490
+                        $field_icon = '<i class="'.$type['field_icon'].'"></i>';
2491 2491
                     }
2492 2492
 
2493 2493
                     switch ($type['type']) {
@@ -2495,7 +2495,7 @@  discard block
 block discarded – undo
2495 2495
                             $i = 0;
2496 2496
                             $fieldset_count++;
2497 2497
                             $field_set_start = 1;
2498
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2498
+                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2499 2499
                             $fieldset_arr[$fieldset_count]['label'] = $label;
2500 2500
                         }
2501 2501
                             break;
@@ -2528,7 +2528,7 @@  discard block
 block discarded – undo
2528 2528
                             // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2529 2529
                             $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2530 2530
 
2531
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2531
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.' <a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.
2532 2532
                                 /**
2533 2533
                                  * Filer the custom field website name.
2534 2534
                                  *
@@ -2537,7 +2537,7 @@  discard block
 block discarded – undo
2537 2537
                                  * @param string $website The website address.
2538 2538
                                  * @param int $post->ID The post ID.
2539 2539
                                  */
2540
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2540
+                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
2541 2541
                         }
2542 2542
                             break;
2543 2543
                         case 'phone': {
@@ -2552,11 +2552,11 @@  discard block
 block discarded – undo
2552 2552
 
2553 2553
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2554 2554
 
2555
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2555
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af;
2556 2556
                             if ($field_set_start == 1 && $site_title != '') {
2557
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2557
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2558 2558
                             }
2559
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2559
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2560 2560
                         }
2561 2561
                             break;
2562 2562
                         case 'time': {
@@ -2575,11 +2575,11 @@  discard block
 block discarded – undo
2575 2575
 
2576 2576
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2577 2577
 
2578
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2578
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
2579 2579
                             if ($field_set_start == 1 && $site_title != '') {
2580
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2580
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2581 2581
                             }
2582
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2582
+                            $html .= ' </span>'.stripslashes($value).'</div>';
2583 2583
                         }
2584 2584
                             break;
2585 2585
                         case 'datepicker': {
@@ -2589,8 +2589,8 @@  discard block
 block discarded – undo
2589 2589
                                 $date_format = $date_format['date_format'];
2590 2590
                             }
2591 2591
 
2592
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2593
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2592
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
2593
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
2594 2594
 
2595 2595
                             $date_format = str_replace($search, $replace, $date_format);
2596 2596
 
@@ -2611,11 +2611,11 @@  discard block
 block discarded – undo
2611 2611
 
2612 2612
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2613 2613
 
2614
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2614
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
2615 2615
                             if ($field_set_start == 1 && $site_title != '') {
2616
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2616
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2617 2617
                             }
2618
-                            $html .= ' </span>' . $value . '</div>';
2618
+                            $html .= ' </span>'.$value.'</div>';
2619 2619
                         }
2620 2620
                             break;
2621 2621
                         case 'text': {
@@ -2630,11 +2630,11 @@  discard block
 block discarded – undo
2630 2630
 
2631 2631
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2632 2632
 
2633
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2633
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2634 2634
                             if ($field_set_start == 1 && $site_title != '') {
2635
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2635
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2636 2636
                             }
2637
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2637
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2638 2638
                         }
2639 2639
                             break;
2640 2640
                         case 'radio': {
@@ -2671,13 +2671,13 @@  discard block
 block discarded – undo
2671 2671
 
2672 2672
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2673 2673
 
2674
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2674
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
2675 2675
 
2676 2676
                                 if ($field_set_start == 1 && $site_title != '') {
2677
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2677
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2678 2678
                                 }
2679 2679
 
2680
-                                $html .= ' </span>' . $html_val . '</div>';
2680
+                                $html .= ' </span>'.$html_val.'</div>';
2681 2681
                             }
2682 2682
                         }
2683 2683
                             break;
@@ -2685,7 +2685,7 @@  discard block
 block discarded – undo
2685 2685
                             $html_var = $type['htmlvar_name'];
2686 2686
                             $html_val = $type['htmlvar_name'];
2687 2687
 
2688
-                            if ((int)$post->{$html_var} == 1) {
2688
+                            if ((int) $post->{$html_var} == 1) {
2689 2689
 
2690 2690
                                 if ($post->{$type['htmlvar_name']} == '1') {
2691 2691
                                     $html_val = __('Yes', 'geodirectory');
@@ -2704,13 +2704,13 @@  discard block
 block discarded – undo
2704 2704
 
2705 2705
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2706 2706
 
2707
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2707
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
2708 2708
 
2709 2709
                                 if ($field_set_start == 1 && $site_title != '') {
2710
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2710
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2711 2711
                                 }
2712 2712
 
2713
-                                $html .= ' </span>' . $html_val . '</div>';
2713
+                                $html .= ' </span>'.$html_val.'</div>';
2714 2714
                             }
2715 2715
                         }
2716 2716
                             break;
@@ -2740,11 +2740,11 @@  discard block
 block discarded – undo
2740 2740
 
2741 2741
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2742 2742
 
2743
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2743
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2744 2744
                             if ($field_set_start == 1 && $site_title != '') {
2745
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2745
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2746 2746
                             }
2747
-                            $html .= ' </span>' . $field_value . '</div>';
2747
+                            $html .= ' </span>'.$field_value.'</div>';
2748 2748
                         }
2749 2749
                             break;
2750 2750
                         case 'multiselect': {
@@ -2778,16 +2778,16 @@  discard block
 block discarded – undo
2778 2778
 
2779 2779
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2780 2780
 
2781
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2781
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2782 2782
                             if ($field_set_start == 1 && $site_title != '') {
2783
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2783
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2784 2784
                             }
2785 2785
                             $html .= ' </span>';
2786 2786
 
2787 2787
                             if (count($option_values) > 1) {
2788 2788
                                 $html .= '<ul>';
2789 2789
                                 foreach ($option_values as $val) {
2790
-                                    $html .= '<li>' . $val . '</li>';
2790
+                                    $html .= '<li>'.$val.'</li>';
2791 2791
                                 }
2792 2792
                                 $html .= '</ul>';
2793 2793
                             } else {
@@ -2808,11 +2808,11 @@  discard block
 block discarded – undo
2808 2808
 
2809 2809
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2810 2810
 
2811
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2811
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
2812 2812
                             if ($field_set_start == 1 && $site_title != '') {
2813
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2813
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2814 2814
                             }
2815
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2815
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2816 2816
                         }
2817 2817
                             break;
2818 2818
                         case 'textarea': {
@@ -2827,11 +2827,11 @@  discard block
 block discarded – undo
2827 2827
 
2828 2828
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829 2829
 
2830
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2830
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2831 2831
                             if ($field_set_start == 1 && $site_title != '') {
2832
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2832
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2833 2833
                             }
2834
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2834
+                            $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2835 2835
                         }
2836 2836
                             break;
2837 2837
                         case 'html': {
@@ -2846,11 +2846,11 @@  discard block
 block discarded – undo
2846 2846
 
2847 2847
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848 2848
 
2849
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2849
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2850 2850
                             if ($field_set_start == 1 && $site_title != '') {
2851
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2851
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2852 2852
                             }
2853
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2853
+                            $html .= ' </span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2854 2854
                         }
2855 2855
                         break;
2856 2856
                         case 'file': {
@@ -2861,7 +2861,7 @@  discard block
 block discarded – undo
2861 2861
 
2862 2862
                                 if (!empty($files)) {
2863 2863
                                     $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2864
-                                    $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'] : '';
2864
+                                    $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'] : '';
2865 2865
                                
2866 2866
                                     $file_paths = '';
2867 2867
                                     foreach ($files as $file) {
@@ -2890,9 +2890,9 @@  discard block
 block discarded – undo
2890 2890
                                                 $file_paths .= '</a>';
2891 2891
                                                 $file_paths .= '</div>';
2892 2892
                                             } else {
2893
-                                                $ext_path = '_' . $html_var . '_';
2893
+                                                $ext_path = '_'.$html_var.'_';
2894 2894
                                                 $filename = explode($ext_path, $filename);
2895
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2895
+                                                $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
2896 2896
                                             }
2897 2897
                                         }
2898 2898
                                     }
@@ -2909,13 +2909,13 @@  discard block
 block discarded – undo
2909 2909
                                     $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2910 2910
 
2911 2911
 
2912
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2912
+                                    $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;'.$field_icon.'">'.$field_icon_af;
2913 2913
 
2914 2914
                                     if ($field_set_start == 1 && $site_title != '') {
2915
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2915
+                                        $html .= ' '.__($site_title, 'geodirectory').': ';
2916 2916
                                     }
2917 2917
 
2918
-                                    $html .= ' </span>' . $file_paths . '</div>';
2918
+                                    $html .= ' </span>'.$file_paths.'</div>';
2919 2919
                                 }
2920 2920
                             }
2921 2921
                         }
@@ -2966,7 +2966,7 @@  discard block
 block discarded – undo
2966 2966
                                  * @param string $htmlvar_name The field HTML var name.
2967 2967
                                  */
2968 2968
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2969
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2969
+                                'tab_content' => '<div class="geodir-company_info field-group">'.$fieldset_html.'</html>'
2970 2970
                             );
2971 2971
                         }
2972 2972
                     } else {
@@ -3026,7 +3026,7 @@  discard block
 block discarded – undo
3026 3026
             }
3027 3027
             $status .= ")</strong>";
3028 3028
 
3029
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3029
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
3030 3030
         }
3031 3031
     }
3032 3032
 
@@ -3106,7 +3106,7 @@  discard block
 block discarded – undo
3106 3106
 function geodir_no_rating_comment_text($content, $comment = '')
3107 3107
 {
3108 3108
     if (!is_admin()) {
3109
-        return '<div class="description">' . $content . '</div>';
3109
+        return '<div class="description">'.$content.'</div>';
3110 3110
     } else {
3111 3111
         return $content;
3112 3112
     }
@@ -3184,7 +3184,7 @@  discard block
 block discarded – undo
3184 3184
         $classes[] = 'gd-no-rating';
3185 3185
     }
3186 3186
     
3187
-    $classes[] = 'gd-map-' . geodir_map_name();
3187
+    $classes[] = 'gd-map-'.geodir_map_name();
3188 3188
 
3189 3189
     return $classes;
3190 3190
 }
@@ -3204,7 +3204,7 @@  discard block
 block discarded – undo
3204 3204
         $class .= ' gd-no-rating';
3205 3205
     }
3206 3206
     
3207
-    $class .= ' gd-map-' . geodir_map_name();
3207
+    $class .= ' gd-map-'.geodir_map_name();
3208 3208
 
3209 3209
     return $class;
3210 3210
 }
@@ -3239,7 +3239,7 @@  discard block
 block discarded – undo
3239 3239
  * @return array Translation texts.
3240 3240
  */
3241 3241
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3242
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3242
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
3243 3243
 
3244 3244
     $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3245 3245
 
Please login to merge, or discard this patch.