Test Failed
Pull Request — master (#327)
by Kiran
16:29
created
geodirectory-templates/listing-filter-form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
17 17
 }
18 18
 
19
-if (defined('ICL_LANGUAGE_CODE') && defined('DOING_AJAX') && DOING_AJAX){
19
+if (defined('ICL_LANGUAGE_CODE') && defined('DOING_AJAX') && DOING_AJAX) {
20 20
     $search_url = icl_get_home_url();
21 21
 } else {
22 22
     $search_url = get_home_url();
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $new_style = get_option('geodir_show_search_old_search_from') ? false : true;
32 32
 $form_class = 'geodir-listing-search';
33 33
 
34
-if($new_style){
34
+if ($new_style) {
35 35
     $form_class .= ' gd-search-bar-style';
36 36
 }
37 37
 ?>
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 1 patch
Spacing   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 /* WP REVIEW COUNT ACTIONS */
177 177
 ////////////////////////
178 178
 
179
-add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
179
+add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
180 180
 //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
181
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
181
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
182 182
 //add_action('created_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
184 184
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
226 226
     if ($geodir_theme_location) {
227 227
         update_option('geodir_theme_location_nav', $geodir_theme_location);
228 228
     } else {
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
322 322
 
323
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
324
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
323
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
324
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
325 325
 
326 326
 // Detail page sidebar content 
327 327
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
     do_action('geodir_after_social_sharing_buttons');
422 422
     $content_html = ob_get_clean();
423 423
     if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
424
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
425
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
426 426
         /**
427 427
          * Filter the geodir_social_sharing_buttons() function content.
428 428
          *
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
             $post_id = $post->ID;
463 463
             
464 464
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
465
-                $post_id = (int)$_REQUEST['pid'];
465
+                $post_id = (int) $_REQUEST['pid'];
466 466
             }
467 467
 
468 468
             $postlink = get_permalink(geodir_add_listing_page_id());
469 469
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
470
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
470
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
471 471
         }
472 472
     }// end of if, if its a preview or not
473 473
     /**
@@ -478,8 +478,8 @@  discard block
 block discarded – undo
478 478
     do_action('geodir_after_edit_post_link');
479 479
     $content_html = ob_get_clean();
480 480
     if (trim($content_html) != '')
481
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
481
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
482
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
483 483
         /**
484 484
          * Filter the geodir_edit_post_link() function content.
485 485
          *
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
  */
501 501
 function geodir_detail_page_google_analytics()
502 502
 {
503
-    global $post,$preview;
504
-    if($preview){return '';}
503
+    global $post, $preview;
504
+    if ($preview) {return ''; }
505 505
     $package_info = array();
506 506
     $package_info = geodir_post_package_info($package_info, $post);
507 507
 
@@ -533,14 +533,14 @@  discard block
 block discarded – undo
533 533
     $hide_refresh = get_option('geodir_ga_auto_refresh');
534 534
     
535 535
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
536
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
536
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
537 537
         $page_url = urlencode($_SERVER['REQUEST_URI']);
538 538
         ?>
539 539
         <script type="text/javascript">
540 540
             var gd_gaTimeOut;
541
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
542
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
543
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
541
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
542
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
543
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
544 544
             ga_data1 = false;
545 545
             ga_data2 = false;
546 546
             ga_data3 = false;
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
             }
682 682
 
683 683
             function gdga_noResults() {
684
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
684
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
685 685
                 jQuery('#gdga-legend-container').html('');
686 686
             }
687 687
 
@@ -713,18 +713,18 @@  discard block
 block discarded – undo
713 713
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
714 714
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
715 715
 
716
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
717
-                        '<?php _e('Feb', 'geodirectory');?>',
718
-                        '<?php _e('Mar', 'geodirectory');?>',
719
-                        '<?php _e('Apr', 'geodirectory');?>',
720
-                        '<?php _e('May', 'geodirectory');?>',
721
-                        '<?php _e('Jun', 'geodirectory');?>',
722
-                        '<?php _e('Jul', 'geodirectory');?>',
723
-                        '<?php _e('Aug', 'geodirectory');?>',
724
-                        '<?php _e('Sep', 'geodirectory');?>',
725
-                        '<?php _e('Oct', 'geodirectory');?>',
726
-                        '<?php _e('Nov', 'geodirectory');?>',
727
-                        '<?php _e('Dec', 'geodirectory');?>'];
716
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
717
+                        '<?php _e('Feb', 'geodirectory'); ?>',
718
+                        '<?php _e('Mar', 'geodirectory'); ?>',
719
+                        '<?php _e('Apr', 'geodirectory'); ?>',
720
+                        '<?php _e('May', 'geodirectory'); ?>',
721
+                        '<?php _e('Jun', 'geodirectory'); ?>',
722
+                        '<?php _e('Jul', 'geodirectory'); ?>',
723
+                        '<?php _e('Aug', 'geodirectory'); ?>',
724
+                        '<?php _e('Sep', 'geodirectory'); ?>',
725
+                        '<?php _e('Oct', 'geodirectory'); ?>',
726
+                        '<?php _e('Nov', 'geodirectory'); ?>',
727
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
728 728
 
729 729
                     // Ensure the data arrays are at least as long as the labels array.
730 730
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -737,13 +737,13 @@  discard block
 block discarded – undo
737 737
                         labels : labels,
738 738
                         datasets : [
739 739
                             {
740
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
740
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
741 741
                                 fillColor : "rgba(220,220,220,0.5)",
742 742
                                 strokeColor : "rgba(220,220,220,1)",
743 743
                                 data : data2
744 744
                             },
745 745
                             {
746
-                                label: '<?php _e('This Year', 'geodirectory');?>',
746
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
747 747
                                 fillColor : "rgba(151,187,205,0.5)",
748 748
                                 strokeColor : "rgba(151,187,205,1)",
749 749
                                 data : data1
@@ -788,30 +788,30 @@  discard block
 block discarded – undo
788 788
 
789 789
                     <?php
790 790
                     // Here we list the shorthand days of the week so it can be used in translation.
791
-                    __("Mon",'geodirectory');
792
-                    __("Tue",'geodirectory');
793
-                    __("Wed",'geodirectory');
794
-                    __("Thu",'geodirectory');
795
-                    __("Fri",'geodirectory');
796
-                    __("Sat",'geodirectory');
797
-                    __("Sun",'geodirectory');
791
+                    __("Mon", 'geodirectory');
792
+                    __("Tue", 'geodirectory');
793
+                    __("Wed", 'geodirectory');
794
+                    __("Thu", 'geodirectory');
795
+                    __("Fri", 'geodirectory');
796
+                    __("Sat", 'geodirectory');
797
+                    __("Sun", 'geodirectory');
798 798
                     ?>
799 799
 
800 800
                     labels = [
801
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
802
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
803
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
804
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
805
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
806
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
807
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
801
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
802
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
803
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
804
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
805
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
806
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
807
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
808 808
                     ];
809 809
 
810 810
                     var data = {
811 811
                         labels : labels,
812 812
                         datasets : [
813 813
                             {
814
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
814
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
815 815
                                 fillColor : "rgba(220,220,220,0.5)",
816 816
                                 strokeColor : "rgba(220,220,220,1)",
817 817
                                 pointColor : "rgba(220,220,220,1)",
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
                                 data : data2
820 820
                             },
821 821
                             {
822
-                                label: '<?php _e('This Week', 'geodirectory');?>',
822
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
823 823
                                 fillColor : "rgba(151,187,205,0.5)",
824 824
                                 strokeColor : "rgba(151,187,205,1)",
825 825
                                 pointColor : "rgba(151,187,205,1)",
@@ -1026,18 +1026,18 @@  discard block
 block discarded – undo
1026 1026
         </style>
1027 1027
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1028 1028
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1029
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1029
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1030 1030
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1031
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1031
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1032 1032
             <div id="gd-active-users-container">
1033
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1033
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1034 1034
                     <b class="gd-ActiveUsers-value">0</b>
1035 1035
                 </div>
1036 1036
             </div>
1037 1037
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1038
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1039
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1040
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1038
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1039
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1040
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1041 1041
             </select>
1042 1042
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1043 1043
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1053,8 +1053,8 @@  discard block
 block discarded – undo
1053 1053
     do_action('geodir_after_google_analytics');
1054 1054
     $content_html = ob_get_clean();
1055 1055
     if (trim($content_html) != '')
1056
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1057
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1056
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1057
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1058 1058
         /**
1059 1059
          * Filter the geodir_edit_post_link() function content.
1060 1060
          *
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
 {
1081 1081
     global $post, $preview, $post_images;
1082 1082
     
1083
-    if (!empty($post->ID) && geodir_cpt_has_rating_disabled((int)$post->ID)) {
1083
+    if (!empty($post->ID) && geodir_cpt_has_rating_disabled((int) $post->ID)) {
1084 1084
         return;
1085 1085
     }
1086 1086
     ob_start(); // Start  buffering;
@@ -1115,10 +1115,10 @@  discard block
 block discarded – undo
1115 1115
        
1116 1116
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1117 1117
 	   
1118
-	   $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 />';
1118
+	   $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 />';
1119 1119
 
1120 1120
         $html .= '<span class="item">';
1121
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1121
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1122 1122
 
1123 1123
         if ($post_images) {
1124 1124
             foreach ($post_images as $img) {
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
         }
1129 1129
 
1130 1130
         if (isset($post_img) && $post_img) {
1131
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1131
+            $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />';
1132 1132
         }
1133 1133
 
1134 1134
         $html .= '</span>';
@@ -1155,9 +1155,9 @@  discard block
 block discarded – undo
1155 1155
     do_action('geodir_after_detail_page_review_rating');
1156 1156
     $content_html = ob_get_clean();
1157 1157
     if (trim($content_html) != '') {
1158
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1158
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1159 1159
     }
1160
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1160
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1161 1161
         /**
1162 1162
          * Filter the geodir_detail_page_review_rating() function content.
1163 1163
          *
@@ -1196,8 +1196,8 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
     $content_html = ob_get_clean();
1198 1198
     if (trim($content_html) != '')
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1200
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1199
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1200
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1201 1201
         /**
1202 1202
          * Filter the output html for function geodir_detail_page_more_info().
1203 1203
          *
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1297 1297
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1298 1298
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1299
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1299
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1300 1300
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1301 1301
         'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1302 1302
         'geodir_map_name' => geodir_map_name(),
@@ -1325,10 +1325,10 @@  discard block
 block discarded – undo
1325 1325
     foreach ($arr_alert_msg as $key => $value) {
1326 1326
         if (!is_scalar($value))
1327 1327
             continue;
1328
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1328
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1329 1329
     }
1330 1330
 
1331
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1331
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1332 1332
     echo '<script>';
1333 1333
     echo $script;
1334 1334
     echo '</script>';
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
         $geodir_old_sidebars = get_option('geodir_sidebars');
1419 1419
         if (is_array($geodir_old_sidebars)) {
1420 1420
             foreach ($geodir_old_sidebars as $key => $val) {
1421
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1421
+                if (0 === strpos($key, 'geodir_'))// if gd widget
1422 1422
                 {
1423 1423
                     $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1424 1424
                 }
@@ -1497,7 +1497,7 @@  discard block
 block discarded – undo
1497 1497
         global $post;
1498 1498
         $term_condition = '';
1499 1499
         if (isset($_REQUEST['backandedit'])) {
1500
-            $post = (object)$gd_session->get('listing');
1500
+            $post = (object) $gd_session->get('listing');
1501 1501
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1502 1502
         }
1503 1503
 
@@ -1511,7 +1511,7 @@  discard block
 block discarded – undo
1511 1511
                     echo 'checked="checked"';
1512 1512
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1513 1513
                        class="geodir_textfield" value="1"
1514
-                       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>
1514
+                       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>
1515 1515
 				</span>
1516 1516
             </div>
1517 1517
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
         /** This action is documented in geodirectory_template_actions.php */
1552 1552
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1553 1553
         
1554
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1554
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1555 1555
             $is_display = false;
1556 1556
         }
1557 1557
     }
@@ -1599,16 +1599,16 @@  discard block
 block discarded – undo
1599 1599
     global $wpdb, $plugin_prefix;
1600 1600
 	
1601 1601
 	// Remove unused virtual page
1602
-	$listings_page_id = (int)get_option('geodir_listing_page');
1602
+	$listings_page_id = (int) get_option('geodir_listing_page');
1603 1603
 	if ($listings_page_id) {
1604
-		$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')));
1604
+		$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')));
1605 1605
         delete_option('geodir_listing_page');
1606 1606
 	}
1607 1607
 
1608 1608
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1609 1609
         $wpdb->query(
1610 1610
             $wpdb->prepare(
1611
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1611
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1612 1612
                 array('1', '1', 'admin')
1613 1613
             )
1614 1614
         );
@@ -1616,9 +1616,9 @@  discard block
 block discarded – undo
1616 1616
 
1617 1617
         /* --- terms meta value set --- */
1618 1618
 
1619
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1619
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1620 1620
 
1621
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1621
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1622 1622
 
1623 1623
         if (!empty($options_data)) {
1624 1624
 
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
 
1627 1627
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1628 1628
 
1629
-                $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)));
1629
+                $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)));
1630 1630
 
1631 1631
                 if (!empty($taxonomies_data)) {
1632 1632
 
@@ -1635,17 +1635,17 @@  discard block
 block discarded – undo
1635 1635
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1636 1636
                         $post_type = $taxObject->object_type[0];
1637 1637
 
1638
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1638
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1639 1639
 
1640
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1640
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1641 1641
 
1642 1642
                         if ($duplicate_data) {
1643 1643
 
1644
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1644
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1645 1645
 
1646 1646
                         } else {
1647 1647
 
1648
-                            $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)));
1648
+                            $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)));
1649 1649
 
1650 1650
                         }
1651 1651
 
@@ -1679,14 +1679,14 @@  discard block
 block discarded – undo
1679 1679
 
1680 1680
     global $wpdb, $table_prefix;
1681 1681
 
1682
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1682
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1683 1683
 
1684 1684
     if ($slug_exists) {
1685 1685
 
1686 1686
         $suffix = 1;
1687 1687
         do {
1688
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1689
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1688
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1689
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1690 1690
             $suffix++;
1691 1691
         } while ($location_slug_check && $suffix < 100);
1692 1692
 
@@ -1740,7 +1740,7 @@  discard block
 block discarded – undo
1740 1740
 
1741 1741
         $suffix = 1;
1742 1742
         do {
1743
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1743
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1744 1744
 
1745 1745
             /** This action is documented in geodirectory_hooks_actions.php */
1746 1746
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 
1753 1753
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1754 1754
 
1755
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1755
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1756 1756
 
1757 1757
     }
1758 1758
 	
@@ -1761,18 +1761,18 @@  discard block
 block discarded – undo
1761 1761
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1762 1762
 	
1763 1763
 	$post_types = geodir_get_posttypes();
1764
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1765
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1764
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1765
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1766 1766
 		
1767 1767
 		if (!empty($posts_obj)) {
1768 1768
 			foreach ($posts_obj as $post_obj) {
1769 1769
 				$post_id = $post_obj->object_id;
1770 1770
 				
1771
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1771
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1772 1772
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1773 1773
 				
1774
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1775
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1774
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1775
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1776 1776
 			}
1777 1777
 		}
1778 1778
 	}
@@ -1806,7 +1806,7 @@  discard block
 block discarded – undo
1806 1806
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1807 1807
         return $slug_exists = true;
1808 1808
 
1809
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1809
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1810 1810
         return $slug_exists = true;
1811 1811
 
1812 1812
     return $slug_exists;
@@ -1846,43 +1846,43 @@  discard block
 block discarded – undo
1846 1846
 
1847 1847
 
1848 1848
     $gd_page = '';
1849
-    if(geodir_is_page('home')){
1849
+    if (geodir_is_page('home')) {
1850 1850
         $gd_page = 'home';
1851 1851
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1852 1852
     }
1853
-    elseif(geodir_is_page('detail')){
1853
+    elseif (geodir_is_page('detail')) {
1854 1854
         $gd_page = 'detail';
1855 1855
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1856 1856
     }
1857
-    elseif(geodir_is_page('pt')){
1857
+    elseif (geodir_is_page('pt')) {
1858 1858
         $gd_page = 'pt';
1859 1859
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1860 1860
     }
1861
-    elseif(geodir_is_page('listing')){
1861
+    elseif (geodir_is_page('listing')) {
1862 1862
         $gd_page = 'listing';
1863 1863
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1864 1864
     }
1865
-    elseif(geodir_is_page('location')){
1865
+    elseif (geodir_is_page('location')) {
1866 1866
         $gd_page = 'location';
1867 1867
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1868 1868
     }
1869
-    elseif(geodir_is_page('search')){
1869
+    elseif (geodir_is_page('search')) {
1870 1870
         $gd_page = 'search';
1871 1871
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1872 1872
     }
1873
-    elseif(geodir_is_page('add-listing')){
1873
+    elseif (geodir_is_page('add-listing')) {
1874 1874
         $gd_page = 'add-listing';
1875 1875
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1876 1876
     }
1877
-    elseif(geodir_is_page('author')){
1877
+    elseif (geodir_is_page('author')) {
1878 1878
         $gd_page = 'author';
1879 1879
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1880 1880
     }
1881
-    elseif(geodir_is_page('login')){
1881
+    elseif (geodir_is_page('login')) {
1882 1882
         $gd_page = 'login';
1883 1883
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1884 1884
     }
1885
-    elseif(geodir_is_page('listing-success')){
1885
+    elseif (geodir_is_page('listing-success')) {
1886 1886
         $gd_page = 'listing-success';
1887 1887
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1888 1888
     }
@@ -1914,12 +1914,12 @@  discard block
 block discarded – undo
1914 1914
 
1915 1915
     if (!get_option('geodir_set_post_attachments')) {
1916 1916
 
1917
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1918
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1917
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1918
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1919 1919
 
1920 1920
         $all_postypes = geodir_get_posttypes();
1921 1921
 
1922
-        foreach($all_postypes as $post_type){
1922
+        foreach ($all_postypes as $post_type) {
1923 1923
             $args = array(
1924 1924
                 'posts_per_page' => -1,
1925 1925
                 'post_type' => $post_type,
@@ -2013,7 +2013,7 @@  discard block
 block discarded – undo
2013 2013
 {
2014 2014
     $user_id = get_current_user_id();
2015 2015
 
2016
-    if(!$user_id){return $post;}
2016
+    if (!$user_id) {return $post; }
2017 2017
 
2018 2018
     $gd_post_types = geodir_get_posttypes();
2019 2019
 
@@ -2122,7 +2122,7 @@  discard block
 block discarded – undo
2122 2122
 
2123 2123
         if (array_key_exists('post_video', $tabs_arr)) {
2124 2124
 
2125
-            $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)));
2125
+            $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)));
2126 2126
 
2127 2127
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2128 2128
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
 
2131 2131
         if (array_key_exists('special_offers', $tabs_arr)) {
2132 2132
 
2133
-            $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)));
2133
+            $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)));
2134 2134
 
2135 2135
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2136 2136
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2151,7 +2151,7 @@  discard block
 block discarded – undo
2151 2151
  */
2152 2152
 function geodir_remove_template_redirect_actions()
2153 2153
 {
2154
-    if (geodir_is_page('login')){
2154
+    if (geodir_is_page('login')) {
2155 2155
         remove_all_actions('template_redirect');
2156 2156
         remove_action('init', 'avia_modify_front', 10);
2157 2157
     }
@@ -2198,25 +2198,25 @@  discard block
 block discarded – undo
2198 2198
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2199 2199
 
2200 2200
         $wpdb->query(
2201
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2201
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2202 2202
                 array($post_id, $split_img_file_path)
2203 2203
             )
2204 2204
         );
2205 2205
 
2206 2206
         $attachment_data = $wpdb->get_row(
2207
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2207
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2208 2208
                 array($post_id)
2209 2209
             )
2210 2210
         );
2211 2211
 
2212 2212
         if (!empty($attachment_data)) {
2213
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2213
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2214 2214
         }
2215 2215
 
2216 2216
 
2217
-        $table_name = $plugin_prefix . $post_type . '_detail';
2217
+        $table_name = $plugin_prefix.$post_type.'_detail';
2218 2218
 
2219
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2219
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2220 2220
 
2221 2221
         geodir_set_wp_featured_image($post_id);
2222 2222
 
@@ -2244,9 +2244,9 @@  discard block
 block discarded – undo
2244 2244
 
2245 2245
     foreach ($all_postypes as $posttype) {
2246 2246
 
2247
-        $tablename = $plugin_prefix . $posttype . '_detail';
2247
+        $tablename = $plugin_prefix.$posttype.'_detail';
2248 2248
 
2249
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2249
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2250 2250
 
2251 2251
         if (!empty($get_post_data)) {
2252 2252
 
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
 
2255 2255
                 $post_id = $data->post_id;
2256 2256
 
2257
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2257
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2258 2258
 
2259 2259
                 if (!empty($attachment_data)) {
2260 2260
 
@@ -2271,22 +2271,22 @@  discard block
 block discarded – undo
2271 2271
 
2272 2272
                         $file_name = $file_info['basename'];
2273 2273
 
2274
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2274
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2275 2275
 
2276 2276
                         if (!file_exists($img_arr['path'])) {
2277 2277
 
2278
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2278
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2279 2279
 
2280 2280
                         }
2281 2281
 
2282 2282
                     }
2283 2283
 
2284
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2284
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2285 2285
 
2286 2286
                     if (!empty($attachment_data)) {
2287 2287
 
2288 2288
                         if ($attachment_data->ID)
2289
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2289
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2290 2290
 
2291 2291
                     } else {
2292 2292
 
@@ -2300,7 +2300,7 @@  discard block
 block discarded – undo
2300 2300
 
2301 2301
                     }
2302 2302
 
2303
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2303
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2304 2304
 
2305 2305
                     geodir_set_wp_featured_image($post_id);
2306 2306
 
@@ -2329,7 +2329,7 @@  discard block
 block discarded – undo
2329 2329
 {
2330 2330
 
2331 2331
     if (!get_option('geodir_default_rating_star_icon')) {
2332
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2332
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2333 2333
     }
2334 2334
 
2335 2335
 }
@@ -2346,10 +2346,10 @@  discard block
 block discarded – undo
2346 2346
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2347 2347
  * @return array User listing count for each post type.
2348 2348
  */
2349
-function geodir_user_post_listing_count($user_id=null)
2349
+function geodir_user_post_listing_count($user_id = null)
2350 2350
 {
2351 2351
     global $wpdb, $plugin_prefix, $current_user;
2352
-    if(!$user_id){
2352
+    if (!$user_id) {
2353 2353
         $user_id = $current_user->ID;
2354 2354
     }
2355 2355
 
@@ -2360,7 +2360,7 @@  discard block
 block discarded – undo
2360 2360
     $user_listing = array();
2361 2361
     if (is_array($all_posts) && !empty($all_posts)) {
2362 2362
         foreach ($all_posts as $ptype) {
2363
-            $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' )");
2363
+            $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' )");
2364 2364
 
2365 2365
             if ($total_posts > 0) {
2366 2366
                 $user_listing[$ptype] = $total_posts;
@@ -2401,19 +2401,19 @@  discard block
 block discarded – undo
2401 2401
 
2402 2402
         $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2403 2403
         //remove video and special offers if it is already set to show
2404
-        if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2404
+        if (isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']) {
2405 2405
             $unset_video = true;
2406 2406
         }
2407 2407
 
2408
-        if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2408
+        if (isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']) {
2409 2409
             $unset_special_offers = true;
2410 2410
         }
2411
-        if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2412
-            foreach($custom_fields as $key => $custom_field){
2413
-                if($custom_field['name']=='geodir_video' && isset($unset_video)){
2411
+        if (isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)) {
2412
+            foreach ($custom_fields as $key => $custom_field) {
2413
+                if ($custom_field['name'] == 'geodir_video' && isset($unset_video)) {
2414 2414
                     unset($custom_fields[$key]);
2415 2415
                 }
2416
-                if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2416
+                if ($custom_field['name'] == 'geodir_special_offers' && isset($unset_special_offers)) {
2417 2417
                     unset($custom_fields[$key]);
2418 2418
                 }
2419 2419
             }
@@ -2430,7 +2430,7 @@  discard block
 block discarded – undo
2430 2430
                     $post->{$field_name} = $_REQUEST[$field_name];
2431 2431
                 }
2432 2432
 
2433
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2433
+                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
2434 2434
                     if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2435 2435
                         continue;
2436 2436
                     }
@@ -2463,7 +2463,7 @@  discard block
 block discarded – undo
2463 2463
                     $post->{$field_name} = $_REQUEST[$field_name];
2464 2464
                 }
2465 2465
 
2466
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
2466
+                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
2467 2467
                     $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2468 2468
                     $site_title = trim($field['site_title']);
2469 2469
                     $type = $field;
@@ -2479,21 +2479,21 @@  discard block
 block discarded – undo
2479 2479
                         $variables_array['label'] = __($type['site_title'], 'geodirectory');
2480 2480
                         $variables_array['value'] = '';
2481 2481
                         $variables_array['value'] = $post->{$type['htmlvar_name']};
2482
-                    }else{
2482
+                    } else {
2483 2483
                         $i = 0;
2484 2484
                         $fieldset_count++;
2485 2485
                         $field_set_start = 1;
2486
-                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2486
+                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2487 2487
                         $fieldset_arr[$fieldset_count]['label'] = $label;
2488 2488
                     }
2489 2489
 
2490 2490
 
2491
-                    if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2491
+                    if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
2492 2492
                     $type = stripslashes_deep($type); // strip slashes
2493
-                    if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2493
+                    if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
2494 2494
                     $html = '';
2495 2495
                     $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2496
-                    if($html_var=='post'){$html_var='post_address';}
2496
+                    if ($html_var == 'post') {$html_var = 'post_address'; }
2497 2497
                     $field_icon = geodir_field_icon_proccess($type);
2498 2498
                     $filed_type = $type['type'];
2499 2499
 
@@ -2506,7 +2506,7 @@  discard block
 block discarded – undo
2506 2506
                      * @param string $fields_location The location the field is to be show.
2507 2507
                      * @param array $type The array of field values.
2508 2508
                      */
2509
-                    $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2509
+                    $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
2510 2510
 
2511 2511
 
2512 2512
                     /**
@@ -2552,7 +2552,7 @@  discard block
 block discarded – undo
2552 2552
                                  * @param string $htmlvar_name The field HTML var name.
2553 2553
                                  */
2554 2554
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2555
-                                'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2555
+                                'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>'
2556 2556
                             );
2557 2557
                         }
2558 2558
                     } else {
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
             }
2615 2615
             $status .= ")</strong>";
2616 2616
 
2617
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2617
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
2618 2618
         }
2619 2619
     }
2620 2620
 
@@ -2683,7 +2683,7 @@  discard block
 block discarded – undo
2683 2683
  * @return array Modified class array.
2684 2684
  */
2685 2685
 function geodir_body_class_active_map($classes = array()) {
2686
-    $classes[] = 'gd-map-' . geodir_map_name();
2686
+    $classes[] = 'gd-map-'.geodir_map_name();
2687 2687
 
2688 2688
     return $classes;
2689 2689
 }
@@ -2698,7 +2698,7 @@  discard block
 block discarded – undo
2698 2698
  * @return string Modified class string.
2699 2699
  */
2700 2700
 function geodir_admin_body_class_active_map($class = '') {    
2701
-    $class .= ' gd-map-' . geodir_map_name();
2701
+    $class .= ' gd-map-'.geodir_map_name();
2702 2702
 
2703 2703
     return $class;
2704 2704
 }
@@ -2718,7 +2718,7 @@  discard block
 block discarded – undo
2718 2718
  * @return array Translation texts.
2719 2719
  */
2720 2720
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
2721
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2721
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
2722 2722
 
2723 2723
     $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');
2724 2724
 
@@ -2784,17 +2784,17 @@  discard block
 block discarded – undo
2784 2784
  * @param array $args The array of menu arguments.
2785 2785
  * @return array The modified arguments.
2786 2786
  */
2787
-function geodir_add_nav_menu_class( $args )
2787
+function geodir_add_nav_menu_class($args)
2788 2788
 {
2789 2789
 
2790
-        if(isset($args['menu_class'])){
2790
+        if (isset($args['menu_class'])) {
2791 2791
             $args['menu_class'] = $args['menu_class']." gd-menu-z";
2792 2792
         }
2793 2793
     
2794 2794
     return $args;
2795 2795
 }
2796 2796
 
2797
-add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
2797
+add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class');
2798 2798
 
2799 2799
 /**
2800 2800
  * Filters WordPress locale ID.
@@ -2861,7 +2861,7 @@  discard block
 block discarded – undo
2861 2861
         }        
2862 2862
         
2863 2863
         if (!empty($keep_vars)) {
2864
-            foreach ( $languages as $code => $url) {
2864
+            foreach ($languages as $code => $url) {
2865 2865
                 $filter_url = $url['url'];
2866 2866
                 
2867 2867
                 foreach ($keep_vars as $var) {
@@ -2880,4 +2880,4 @@  discard block
 block discarded – undo
2880 2880
 
2881 2881
     return $languages;
2882 2882
 }
2883
-add_filter( 'icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1 );
2884 2883
\ No newline at end of file
2884
+add_filter('icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1);
2885 2885
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/post_functions.php 1 patch
Spacing   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 
27 27
     if (!isset($default_cat) || empty($default_cat)) {
28 28
         $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : '';
29
-    }else{
30
-        if(!is_int($default_cat)){
29
+    } else {
30
+        if (!is_int($default_cat)) {
31 31
             $category = get_term_by('name', $default_cat, $taxonomy);
32
-            if(isset($category->term_id)){
33
-                $default_cat =  $category->term_id;
32
+            if (isset($category->term_id)) {
33
+                $default_cat = $category->term_id;
34 34
             }
35 35
         }
36 36
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     if ($default_pos === false) {
60 60
 
61
-        $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str);
61
+        $change_cat_str = str_replace($default_cat.',y:', $default_cat.',y,d:', $change_cat_str);
62 62
 
63 63
     }
64 64
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             
145 145
             $gd_post = $post;
146 146
             if (!empty($gd_post) && is_array($gd_post)) {
147
-                $gd_post = (object)$post;
147
+                $gd_post = (object) $post;
148 148
                 
149 149
                 // Fix WPML duplicate.
150 150
                 if (geodir_is_wpml() && !empty($request_info['action']) && $request_info['action'] == 'editpost' && !empty($request_info['icl_trid']) && !isset($post['post_date'])) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         $send_post_submit_mail = false;
239 239
 
240 240
         // unhook this function so it doesn't loop infinitely
241
-        remove_action('save_post', 'geodir_post_information_save',10,2);
241
+        remove_action('save_post', 'geodir_post_information_save', 10, 2);
242 242
 
243 243
         if (isset($request_info['pid']) && $request_info['pid'] != '') {
244 244
             $post['ID'] = $request_info['pid'];
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
         }
263 263
 
264 264
         // re-hook this function
265
-        add_action('save_post', 'geodir_post_information_save',10,2);
265
+        add_action('save_post', 'geodir_post_information_save', 10, 2);
266 266
 
267 267
         $post_tags = '';
268 268
         if (!isset($request_info['post_tags'])) {
269 269
 
270 270
             $post_type = $request_info['listing_type'];
271
-            $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names')));
271
+            $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type.'_tags', array('fields' => 'names')));
272 272
 
273 273
         }
274 274
 
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
         $payment_info = array();
287 287
         $package_info = array();
288 288
 
289
-        $package_info = (array)geodir_post_package_info($package_info, $post);
289
+        $package_info = (array) geodir_post_package_info($package_info, $post);
290 290
 
291 291
         $post_package_id = geodir_get_post_meta($last_post_id, 'package_id');
292 292
 
293 293
         if (!empty($package_info) && !$post_package_id) {
294 294
             if (isset($package_info['days']) && $package_info['days'] != 0) {
295
-                $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days"));
295
+                $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['days']." days"));
296 296
             } else {
297 297
                 $payment_info['expire_date'] = 'Never';
298 298
             }
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
             $extrafields = $val['extra_fields'];
314 314
 
315 315
             if (trim($type) == 'address') {
316
-                $prefix = $name . '_';
317
-                $address = $prefix . 'address';
316
+                $prefix = $name.'_';
317
+                $address = $prefix.'address';
318 318
 
319 319
                 if (isset($request_info[$address]) && $request_info[$address] != '') {
320 320
                     $gd_post_info[$address] = wp_slash($request_info[$address]);
@@ -324,59 +324,59 @@  discard block
 block discarded – undo
324 324
                     $extrafields = unserialize($extrafields);
325 325
 
326 326
 
327
-                    if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') {
327
+                    if (!isset($request_info[$prefix.'city']) || $request_info[$prefix.'city'] == '') {
328 328
 
329 329
                         $location_result = geodir_get_default_location();
330 330
 
331
-                        $gd_post_info[$prefix . 'city'] = $location_result->city;
332
-                        $gd_post_info[$prefix . 'region'] = $location_result->region;
333
-                        $gd_post_info[$prefix . 'country'] = $location_result->country;
331
+                        $gd_post_info[$prefix.'city'] = $location_result->city;
332
+                        $gd_post_info[$prefix.'region'] = $location_result->region;
333
+                        $gd_post_info[$prefix.'country'] = $location_result->country;
334 334
 
335
-                        $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location
335
+                        $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location
336 336
 
337 337
                     } else {
338 338
 
339
-                        $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city'];
340
-                        $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region'];
341
-                        $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country'];
339
+                        $gd_post_info[$prefix.'city'] = $request_info[$prefix.'city'];
340
+                        $gd_post_info[$prefix.'region'] = $request_info[$prefix.'region'];
341
+                        $gd_post_info[$prefix.'country'] = $request_info[$prefix.'country'];
342 342
 
343 343
                         //----------set post locations when import dummy data-------
344 344
                         $location_result = geodir_get_default_location();
345 345
 
346
-                        $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location
346
+                        $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location
347 347
                         //-----------------------------------------------------------------
348 348
 
349 349
                     }
350 350
 
351 351
 
352
-                    if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) {
353
-                        $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip'];
352
+                    if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix.'zip'])) {
353
+                        $gd_post_info[$prefix.'zip'] = $request_info[$prefix.'zip'];
354 354
                     }
355 355
 
356 356
 
357 357
                     if (isset($extrafields['show_map']) && $extrafields['show_map']) {
358 358
 
359
-                        if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') {
360
-                            $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude'];
359
+                        if (isset($request_info[$prefix.'latitude']) && $request_info[$prefix.'latitude'] != '') {
360
+                            $gd_post_info[$prefix.'latitude'] = $request_info[$prefix.'latitude'];
361 361
                         }
362 362
 
363
-                        if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') {
364
-                            $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude'];
363
+                        if (isset($request_info[$prefix.'longitude']) && $request_info[$prefix.'longitude'] != '') {
364
+                            $gd_post_info[$prefix.'longitude'] = $request_info[$prefix.'longitude'];
365 365
                         }
366 366
 
367
-                        if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') {
368
-                            $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview'];
367
+                        if (isset($request_info[$prefix.'mapview']) && $request_info[$prefix.'mapview'] != '') {
368
+                            $gd_post_info[$prefix.'mapview'] = $request_info[$prefix.'mapview'];
369 369
                         }
370 370
 
371
-                        if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') {
372
-                            $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom'];
371
+                        if (isset($request_info[$prefix.'mapzoom']) && $request_info[$prefix.'mapzoom'] != '') {
372
+                            $gd_post_info[$prefix.'mapzoom'] = $request_info[$prefix.'mapzoom'];
373 373
                         }
374 374
 
375 375
                     }
376 376
 
377 377
                     // show lat lng
378
-                    if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) {
379
-                        $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng'];
378
+                    if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix.'latlng'])) {
379
+                        $gd_post_info[$prefix.'latlng'] = $request_info[$prefix.'latlng'];
380 380
                     }
381 381
                 }
382 382
 
@@ -401,16 +401,16 @@  discard block
 block discarded – undo
401 401
 
402 402
                     // check if we need to change the format or not
403 403
                     $date_format_len = strlen(str_replace(' ', '', $date_format));
404
-                    if($date_format_len>5){// if greater then 5 then it's the old style format.
404
+                    if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
405 405
 
406
-                        $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
407
-                        $replace = array('d','j','l','m','n','F','Y');//PHP date format
406
+                        $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
407
+                        $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
408 408
 
409 409
                         $date_format = str_replace($search, $replace, $date_format);
410 410
 
411 411
                         $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $request_info[$name]) : $request_info[$name];
412 412
 
413
-                    }else{
413
+                    } else {
414 414
                         $post_htmlvar_value = $request_info[$name];
415 415
                     }
416 416
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
                 if (isset($request_info[$name])) {
426 426
                     $gd_post_info[$name] = $request_info[$name];
427 427
                 } else {
428
-                    if (isset($request_info['gd_field_' . $name])) {
428
+                    if (isset($request_info['gd_field_'.$name])) {
429 429
                         $gd_post_info[$name] = ''; /* fix de-select for multiselect */
430 430
                     }
431 431
                 }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         }
486 486
 
487 487
         if (is_array($post_tags)) {
488
-            $taxonomy = $request_info['listing_type'] . '_tags';
488
+            $taxonomy = $request_info['listing_type'].'_tags';
489 489
             wp_set_object_terms($last_post_id, $post_tags, $taxonomy);
490 490
         }
491 491
 
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                 $tmpimgArr = trim($request_info['post_images'], ",");
498 498
                 $tmpimgArr = explode(",", $tmpimgArr);
499 499
                 geodir_save_post_images($last_post_id, $tmpimgArr, $dummy);
500
-            } else{
500
+            } else {
501 501
                 geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy);
502 502
             }
503 503
 
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
     if (!in_array($post_type, $all_postypes))
579 579
         return false;
580 580
 
581
-    $table = $plugin_prefix . $post_type . '_detail';
581
+    $table = $plugin_prefix.$post_type.'_detail';
582 582
 
583 583
     /**
584 584
      * Apply Filter to change Post info
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
      * @since 1.0.0
589 589
      * @package GeoDirectory
590 590
      */
591
-    $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd
591
+    $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM ".$wpdb->posts." p,".$table." pd
592 592
 			  WHERE p.ID = pd.post_id
593 593
 			  AND post_id = " . $post_id);
594 594
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 
652 652
         $post_type = get_post_type($post_id);
653 653
 
654
-        $table = $plugin_prefix . $post_type . '_detail';
654
+        $table = $plugin_prefix.$post_type.'_detail';
655 655
 
656 656
         /**
657 657
          * Filter to change Post info
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 
673 673
             $columns = $wpdb->get_col("show columns from $table");
674 674
             foreach ($postmeta as $mkey => $mval) {
675
-                if(in_array($mkey,$columns)) {
675
+                if (in_array($mkey, $columns)) {
676 676
                     if (is_array($mval)) {
677 677
                         $mval = implode(",", $mval);
678 678
                     }
@@ -701,12 +701,12 @@  discard block
 block discarded – undo
701 701
              */
702 702
             do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id);
703 703
 
704
-            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
704
+            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
705 705
 
706 706
                 $query_string_array[] = $post_id;
707 707
                 $wpdb->query(
708 708
                     $wpdb->prepare(
709
-                        "UPDATE " . $table . " SET " . $query_string_escaped . " where post_id =%d",
709
+                        "UPDATE ".$table." SET ".$query_string_escaped." where post_id =%d",
710 710
                         $query_string_array
711 711
                     )
712 712
                 );
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
                 array_unshift($query_string_array, $post_id);
718 718
                 $wpdb->query(
719 719
                     $wpdb->prepare(
720
-                        "INSERT INTO " . $table . " SET post_id = %d," . $query_string_escaped,
720
+                        "INSERT INTO ".$table." SET post_id = %d,".$query_string_escaped,
721 721
                         $query_string_array
722 722
                     )
723 723
                 );
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 
764 764
         $post_type = get_post_type($post_id);
765 765
 
766
-        $table = $plugin_prefix . $post_type . '_detail';
766
+        $table = $plugin_prefix.$post_type.'_detail';
767 767
 
768 768
         if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) {
769 769
 
@@ -771,11 +771,11 @@  discard block
 block discarded – undo
771 771
                 $meta_value = implode(",", $meta_value);
772 772
             }
773 773
 
774
-            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
774
+            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
775 775
 
776 776
                 $wpdb->query(
777 777
                     $wpdb->prepare(
778
-                        "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d",
778
+                        "UPDATE ".$table." SET ".$postmeta." = '".$meta_value."' where post_id =%d",
779 779
                         array($post_id)
780 780
                     )
781 781
                 );
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 
785 785
                 $wpdb->query(
786 786
                     $wpdb->prepare(
787
-                        "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'",
787
+                        "INSERT INTO ".$table." SET post_id = %d, ".$postmeta." = '".$meta_value."'",
788 788
                         array($post_id)
789 789
                     )
790 790
                 );
@@ -817,14 +817,14 @@  discard block
 block discarded – undo
817 817
 
818 818
         $post_type = get_post_type($post_id);
819 819
 
820
-        $table = $plugin_prefix . $post_type . '_detail';
820
+        $table = $plugin_prefix.$post_type.'_detail';
821 821
 
822 822
         if (is_array($postmeta) && !empty($postmeta) && $post_id) {
823 823
             $post_meta_set_query = '';
824 824
 
825 825
             foreach ($postmeta as $mkey) {
826 826
                 if ($mval != '')
827
-                    $post_meta_set_query .= $mkey . " = '', ";
827
+                    $post_meta_set_query .= $mkey." = '', ";
828 828
             }
829 829
 
830 830
             $post_meta_set_query = trim($post_meta_set_query, ", ");
@@ -833,11 +833,11 @@  discard block
 block discarded – undo
833 833
                 return false;
834 834
             }
835 835
 
836
-            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
836
+            if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
837 837
 
838 838
                 $wpdb->query(
839 839
                     $wpdb->prepare(
840
-                        "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d",
840
+                        "UPDATE ".$table." SET ".$post_meta_set_query." where post_id = %d",
841 841
                         array($post_id)
842 842
                     )
843 843
                 );
@@ -846,11 +846,11 @@  discard block
 block discarded – undo
846 846
             }
847 847
 
848 848
         } elseif ($postmeta != '' && $post_id) {
849
-            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
849
+            if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
850 850
 
851 851
                 $wpdb->query(
852 852
                     $wpdb->prepare(
853
-                        "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d",
853
+                        "UPDATE ".$table." SET ".$postmeta."= '' where post_id = %d",
854 854
                         array($post_id)
855 855
                     )
856 856
                 );
@@ -892,10 +892,10 @@  discard block
 block discarded – undo
892 892
         if (!in_array($post_type, $all_postypes))
893 893
             return false;
894 894
 
895
-        $table = $plugin_prefix . $post_type . '_detail';
895
+        $table = $plugin_prefix.$post_type.'_detail';
896 896
 
897
-        if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') {
898
-            $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)));
897
+        if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$meta_key."'") != '') {
898
+            $meta_value = $wpdb->get_var($wpdb->prepare("SELECT ".$meta_key." from ".$table." where post_id = %d", array($post_id)));
899 899
             if ($meta_value && $meta_value !== '') {
900 900
                 return maybe_serialize($meta_value);
901 901
             } else
@@ -928,13 +928,13 @@  discard block
 block discarded – undo
928 928
 
929 929
         $post_type = get_post_type($post_id);
930 930
 
931
-        $table = $plugin_prefix . $post_type . '_detail';
931
+        $table = $plugin_prefix.$post_type.'_detail';
932 932
 
933 933
         $post_images = geodir_get_images($post_id);
934 934
 
935 935
         $wpdb->query(
936 936
             $wpdb->prepare(
937
-                "UPDATE " . $table . " SET featured_image = '' where post_id =%d",
937
+                "UPDATE ".$table." SET featured_image = '' where post_id =%d",
938 938
                 array($post_id)
939 939
             )
940 940
         );
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
                 $file_path = '';
965 965
                 /* --------- start ------- */
966 966
 
967
-                $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
967
+                $split_img_path = explode(str_replace(array('http://', 'https://'), '', $uploads['baseurl']), str_replace(array('http://', 'https://'), '', $post_image[$m]));
968 968
 
969 969
                 $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
970 970
 
971 971
 
972
-                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
972
+                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM ".GEODIR_ATTACHMENT_TABLE." WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
973 973
 
974 974
                     /* --------- end ------- */
975 975
                     $curr_img_url = $post_image[$m];
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
                     // If the uploaded file is the right format
1014 1014
                     if (in_array($uploaded_file_type, $allowed_file_types)) {
1015 1015
                         if (!function_exists('wp_handle_upload')) {
1016
-                            require_once(ABSPATH . 'wp-admin/includes/file.php');
1016
+                            require_once(ABSPATH.'wp-admin/includes/file.php');
1017 1017
                         }
1018 1018
 
1019 1019
                         if (!is_dir($geodir_uploadpath)) {
@@ -1021,41 +1021,41 @@  discard block
 block discarded – undo
1021 1021
                         }
1022 1022
 
1023 1023
                         $external_img = false;
1024
-                        if (strpos( str_replace( array('http://','https://'),'',$curr_img_url ), str_replace(array('http://','https://'),'',$uploads['baseurl'] ) ) !== false) {
1024
+                        if (strpos(str_replace(array('http://', 'https://'), '', $curr_img_url), str_replace(array('http://', 'https://'), '', $uploads['baseurl'])) !== false) {
1025 1025
                         } else {
1026 1026
                             $external_img = true;
1027 1027
                         }
1028 1028
 
1029 1029
                         if ($dummy || $external_img) {
1030 1030
                             $uploaded_file = array();
1031
-                            $uploaded = (array)fetch_remote_file($curr_img_url);
1031
+                            $uploaded = (array) fetch_remote_file($curr_img_url);
1032 1032
 
1033 1033
                             if (isset($uploaded['error']) && empty($uploaded['error'])) {
1034 1034
                                 $new_name = basename($uploaded['file']);
1035 1035
                                 $uploaded_file = $uploaded;
1036
-                            }else{
1037
-                                print_r($uploaded);exit;
1036
+                            } else {
1037
+                                print_r($uploaded); exit;
1038 1038
                             }
1039 1039
                             $external_img = false;
1040 1040
                         } else {
1041
-                            $new_name = $post_id . '_' . $file_name;
1041
+                            $new_name = $post_id.'_'.$file_name;
1042 1042
 
1043 1043
                             if ($curr_img_dir == $sub_dir) {
1044
-                                $img_path = $geodir_uploadpath . '/' . $filename;
1045
-                                $img_url = $geodir_uploadurl . '/' . $filename;
1044
+                                $img_path = $geodir_uploadpath.'/'.$filename;
1045
+                                $img_url = $geodir_uploadurl.'/'.$filename;
1046 1046
                             } else {
1047
-                                $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1048
-                                $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1047
+                                $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1048
+                                $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1049 1049
                             }
1050 1050
 
1051 1051
                             $uploaded_file = '';
1052 1052
 
1053 1053
                             if (file_exists($img_path)) {
1054
-                                $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1054
+                                $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1055 1055
                                 $file_path = '';
1056
-                            } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) {
1056
+                            } else if (file_exists($uploads['basedir'].$curr_img_dir.$filename)) {
1057 1057
                                 $uploaded_file = true;
1058
-                                $file_path = $curr_img_dir . '/' . $filename;
1058
+                                $file_path = $curr_img_dir.'/'.$filename;
1059 1059
                             }
1060 1060
 
1061 1061
                             if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path))
@@ -1064,14 +1064,14 @@  discard block
 block discarded – undo
1064 1064
 
1065 1065
                         if (!empty($uploaded_file)) {
1066 1066
                             if (!isset($file_path) || !$file_path) {
1067
-                                $file_path = $sub_dir . '/' . $new_name;
1067
+                                $file_path = $sub_dir.'/'.$new_name;
1068 1068
                             }
1069 1069
 
1070
-                            $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
1070
+                            $postcurr_images[] = str_replace(array('http://', 'https://'), '', $uploads['baseurl'].$file_path);
1071 1071
 
1072 1072
                             if ($menu_order == 1) {
1073 1073
 
1074
-                                $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
1074
+                                $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
1075 1075
 
1076 1076
                             }
1077 1077
 
@@ -1089,12 +1089,12 @@  discard block
 block discarded – undo
1089 1089
 
1090 1090
                             foreach ($attachment as $key => $val) {
1091 1091
                                 if ($val != '')
1092
-                                    $attachment_set .= $key . " = '" . $val . "', ";
1092
+                                    $attachment_set .= $key." = '".$val."', ";
1093 1093
                             }
1094 1094
 
1095 1095
                             $attachment_set = trim($attachment_set, ", ");
1096 1096
 
1097
-                            $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
1097
+                            $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
1098 1098
 
1099 1099
                             $valid_file_ids[] = $wpdb->insert_id;
1100 1100
                         }
@@ -1105,17 +1105,17 @@  discard block
 block discarded – undo
1105 1105
                 } else {
1106 1106
                     $valid_file_ids[] = $find_image;
1107 1107
 
1108
-                    $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
1108
+                    $postcurr_images[] = str_replace(array('http://', 'https://'), '', $post_image[$m]);
1109 1109
 
1110 1110
                     $wpdb->query(
1111 1111
                         $wpdb->prepare(
1112
-                            "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d",
1112
+                            "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d where file =%s AND post_id =%d",
1113 1113
                             array($menu_order, $split_img_path[1], $post_id)
1114 1114
                         )
1115 1115
                     );
1116 1116
 
1117 1117
                     if ($menu_order == 1)
1118
-                        $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1118
+                        $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1119 1119
 
1120 1120
                 }
1121 1121
 
@@ -1139,9 +1139,9 @@  discard block
 block discarded – undo
1139 1139
 
1140 1140
                 foreach ($post_images as $img) {
1141 1141
 
1142
-                    if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
1142
+                    if (!in_array(str_replace(array('http://', 'https://'), '', $img->src), $postcurr_images)) {
1143 1143
 
1144
-                        $invalid_files[] = (object)array('src' => $img->src);
1144
+                        $invalid_files[] = (object) array('src' => $img->src);
1145 1145
 
1146 1146
                     }
1147 1147
 
@@ -1149,12 +1149,12 @@  discard block
 block discarded – undo
1149 1149
 
1150 1150
             }
1151 1151
 
1152
-            $invalid_files = (object)$invalid_files;
1152
+            $invalid_files = (object) $invalid_files;
1153 1153
         }
1154 1154
 
1155 1155
         $remove_files[] = $post_id;
1156 1156
 
1157
-        $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
1157
+        $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ".$valid_files_condition." post_id = %d", $remove_files));
1158 1158
 
1159 1159
         if (!empty($invalid_files))
1160 1160
             geodir_remove_attachments($invalid_files);
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 			rmdir($dirPath);
1195 1195
 	}	*/
1196 1196
 
1197
-    $dirname = $uploads_dir . '/temp_' . $current_user->ID;
1197
+    $dirname = $uploads_dir.'/temp_'.$current_user->ID;
1198 1198
     geodir_delete_directory($dirname);
1199 1199
 }
1200 1200
 
@@ -1216,10 +1216,10 @@  discard block
 block discarded – undo
1216 1216
         return false;
1217 1217
     while ($file = readdir($dir_handle)) {
1218 1218
         if ($file != "." && $file != "..") {
1219
-            if (!is_dir($dirname . "/" . $file))
1220
-                unlink($dirname . "/" . $file);
1219
+            if (!is_dir($dirname."/".$file))
1220
+                unlink($dirname."/".$file);
1221 1221
             else
1222
-                geodir_delete_directory($dirname . '/' . $file);
1222
+                geodir_delete_directory($dirname.'/'.$file);
1223 1223
         }
1224 1224
     }
1225 1225
     closedir($dir_handle);
@@ -1248,8 +1248,8 @@  discard block
 block discarded – undo
1248 1248
             foreach ($postcurr_images as $postimg) {
1249 1249
                 $image_name_arr = explode('/', $postimg->src);
1250 1250
                 $filename = end($image_name_arr);
1251
-                if (file_exists($uploads_dir . '/' . $filename))
1252
-                    unlink($uploads_dir . '/' . $filename);
1251
+                if (file_exists($uploads_dir.'/'.$filename))
1252
+                    unlink($uploads_dir.'/'.$filename);
1253 1253
             }
1254 1254
 
1255 1255
         } // endif
@@ -1290,16 +1290,16 @@  discard block
 block discarded – undo
1290 1290
         }
1291 1291
 
1292 1292
         if (!in_array($post_type, geodir_get_posttypes())) {
1293
-            return false;// if not a GD CPT return;
1293
+            return false; // if not a GD CPT return;
1294 1294
         }
1295 1295
 
1296
-        $table = $plugin_prefix . $post_type . '_detail';
1296
+        $table = $plugin_prefix.$post_type.'_detail';
1297 1297
 
1298 1298
         if (!$file) {
1299 1299
             if (isset($post->featured_image)) {
1300 1300
                 $file = $post->featured_image;
1301 1301
             } else {
1302
-                $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id)));
1302
+                $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM ".$table." WHERE post_id = %d", array($post_id)));
1303 1303
             }
1304 1304
         }
1305 1305
 
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 
1318 1318
             $file_name = $file_info['basename'];
1319 1319
 
1320
-            $uploads_url = $uploads_baseurl . $sub_dir;
1320
+            $uploads_url = $uploads_baseurl.$sub_dir;
1321 1321
             /*
1322 1322
              * Allows the filter of image src for such things as CDN change.
1323 1323
              *
@@ -1327,8 +1327,8 @@  discard block
 block discarded – undo
1327 1327
              * @param string $uploads_url The server upload directory url.
1328 1328
              * @param string $uploads_baseurl The uploads dir base url.
1329 1329
              */
1330
-            $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
1331
-            $img_arr['path'] = $uploads_path . '/' . $file_name;
1330
+            $img_arr['src'] = apply_filters('geodir_get_featured_image_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
1331
+            $img_arr['path'] = $uploads_path.'/'.$file_name;
1332 1332
             $width = 0;
1333 1333
             $height = 0;
1334 1334
             if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
                 $file_name = $file_info['basename'];
1372 1372
 
1373 1373
                 $img_arr['src'] = $default_img;
1374
-                $img_arr['path'] = $uploads_path . '/' . $file_name;
1374
+                $img_arr['path'] = $uploads_path.'/'.$file_name;
1375 1375
 
1376 1376
                 $width = 0;
1377 1377
                 $height = 0;
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
         }
1389 1389
 
1390 1390
         if (!empty($img_arr))
1391
-            return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path );
1391
+            return (object) $img_arr; //return (object)array( 'src' => $file_url, 'path' => $file_path );
1392 1392
         else
1393 1393
             return false;
1394 1394
     }
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
 
1452 1452
         $arrImages = $wpdb->get_results(
1453 1453
             $wpdb->prepare(
1454
-                "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ",
1454
+                "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d".$not_featured." ORDER BY menu_order ASC, ID DESC $limit_q ",
1455 1455
                 array('%image%', $post_id)
1456 1456
             )
1457 1457
         );
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
 
1478 1478
                 $file_name = $file_info['basename'];
1479 1479
 
1480
-                $uploads_url = $uploads_baseurl . $sub_dir;
1480
+                $uploads_url = $uploads_baseurl.$sub_dir;
1481 1481
                 /*
1482 1482
                 * Allows the filter of image src for such things as CDN change.
1483 1483
                 *
@@ -1487,8 +1487,8 @@  discard block
 block discarded – undo
1487 1487
                 * @param string $uploads_url The server upload directory url.
1488 1488
                 * @param string $uploads_baseurl The uploads dir base url.
1489 1489
                 */
1490
-                $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
1491
-                $img_arr['path'] = $uploads_path . '/' . $file_name;
1490
+                $img_arr['src'] = apply_filters('geodir_get_images_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
1491
+                $img_arr['path'] = $uploads_path.'/'.$file_name;
1492 1492
                 $width = 0;
1493 1493
                 $height = 0;
1494 1494
                 if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
@@ -1505,11 +1505,11 @@  discard block
 block discarded – undo
1505 1505
                 $img_arr['content'] = $attechment->content; // add the description to the array
1506 1506
                 $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1.
1507 1507
 
1508
-                $return_arr[] = (object)$img_arr;
1508
+                $return_arr[] = (object) $img_arr;
1509 1509
 
1510 1510
                 $counter++;
1511 1511
             }
1512
-            return (object)$return_arr;
1512
+            return (object) $return_arr;
1513 1513
         } else if ($no_images) {
1514 1514
             $default_img = '';
1515 1515
             $default_cat = geodir_get_post_meta($post_id, 'default_category', true);
@@ -1548,7 +1548,7 @@  discard block
 block discarded – undo
1548 1548
                 $img_arr['title'] = $file_info['filename']; // add the title to the array
1549 1549
                 $img_arr['content'] = $file_info['filename']; // add the description to the array
1550 1550
 
1551
-                $return_arr[] = (object)$img_arr;
1551
+                $return_arr[] = (object) $img_arr;
1552 1552
 
1553 1553
                 return $return_arr;
1554 1554
             } else
@@ -1575,8 +1575,8 @@  discard block
 block discarded – undo
1575 1575
 
1576 1576
         $html = '';
1577 1577
         if (!empty($request)) {
1578
-            if (!is_object($request)){
1579
-                $request = (object)$request;
1578
+            if (!is_object($request)) {
1579
+                $request = (object) $request;
1580 1580
             }
1581 1581
 
1582 1582
             if (isset($request->src) && !isset($request->path)) {
@@ -1590,7 +1590,7 @@  discard block
 block discarded – undo
1590 1590
             $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
1591 1591
             $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
1592 1592
             if (strpos($img_no_http, $upload_no_http) !== false) {
1593
-                $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path);
1593
+                $request->path = str_replace($img_no_http, $upload_dir['basedir'], $request->path);
1594 1594
             }
1595 1595
             
1596 1596
             $width = 0;
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
             $image->width = $width;
1606 1606
             $image->height = $height;
1607 1607
 
1608
-            $max_size = (object)geodir_get_imagesize($size);
1608
+            $max_size = (object) geodir_get_imagesize($size);
1609 1609
 
1610 1610
             if (!is_wp_error($max_size)) {
1611 1611
                 if ($image->width) {
@@ -1617,15 +1617,15 @@  discard block
 block discarded – undo
1617 1617
                         $width_per = 100;
1618 1618
                 }
1619 1619
 
1620
-                if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
1621
-                    $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '"  /></div>';
1620
+                if (is_admin() && !isset($_REQUEST['geodir_ajax'])) {
1621
+                    $html = '<div class="geodir_thumbnail"><img style="max-height:'.$max_size->h.'px;" alt="place image" src="'.$image->src.'"  /></div>';
1622 1622
                 } else {
1623
-                    if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
1624
-                        $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>';
1625
-                    }else{
1623
+                    if ($size == 'widget-thumb' || !get_option('geodir_lazy_load', 1)) {
1624
+                        $html = '<div class="geodir_thumbnail" style="background-image:url(\''.$image->src.'\');"></div>';
1625
+                    } else {
1626 1626
                         //$html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>';
1627 1627
                         //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>';
1628
-                        $html = '<div data-src="'.str_replace(' ','%20',$image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
1628
+                        $html = '<div data-src="'.str_replace(' ', '%20', $image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
1629 1629
 
1630 1630
                     }
1631 1631
 
@@ -1661,15 +1661,15 @@  discard block
 block discarded – undo
1661 1661
 
1662 1662
         $post_type = get_post_type($post_id);
1663 1663
 
1664
-        $table = $plugin_prefix . $post_type . '_detail';
1664
+        $table = $plugin_prefix.$post_type.'_detail';
1665 1665
 
1666 1666
         if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) {
1667 1667
 
1668
-            if ($taxonomy == $post_type . '_tags') {
1668
+            if ($taxonomy == $post_type.'_tags') {
1669 1669
                 if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
1670 1670
                     geodir_save_post_meta($post_id, 'post_tags', $terms);
1671 1671
                 }
1672
-            } elseif ($taxonomy == $post_type . 'category') {
1672
+            } elseif ($taxonomy == $post_type.'category') {
1673 1673
                 $srcharr = array('"', '\\');
1674 1674
                 $replarr = array("&quot;", '');
1675 1675
 
@@ -1691,7 +1691,7 @@  discard block
 block discarded – undo
1691 1691
 
1692 1692
                     $wpdb->get_var(
1693 1693
                         $wpdb->prepare(
1694
-                            "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ",
1694
+                            "DELETE from ".GEODIR_ICON_TABLE." WHERE cat_id NOT IN ($format) AND post_id = %d ",
1695 1695
                             $cat_ids_array_del
1696 1696
                         )
1697 1697
                     );
@@ -1699,7 +1699,7 @@  discard block
 block discarded – undo
1699 1699
 
1700 1700
                     $post_term = $wpdb->get_col(
1701 1701
                         $wpdb->prepare(
1702
-                            "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id",
1702
+                            "SELECT term_id FROM ".$wpdb->term_taxonomy." WHERE term_taxonomy_id IN($format) GROUP BY term_id",
1703 1703
                             $cat_ids_array
1704 1704
                         )
1705 1705
                     );
@@ -1721,16 +1721,16 @@  discard block
 block discarded – undo
1721 1721
                         $lat = geodir_get_post_meta($post_id, 'post_latitude', true);
1722 1722
                         $lng = geodir_get_post_meta($post_id, 'post_longitude', true);
1723 1723
 
1724
-                        $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
1725
-                        $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true);
1724
+                        $timing = ' - '.date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
1725
+                        $timing .= ' - '.geodir_get_post_meta($post_id, 'st_time', true);
1726 1726
 
1727 1727
                         $json = '{';
1728
-                        $json .= '"id":"' . $post_id . '",';
1729
-                        $json .= '"lat_pos": "' . $lat . '",';
1730
-                        $json .= '"long_pos": "' . $lng . '",';
1731
-                        $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",';
1732
-                        $json .= '"icon":"' . $term_icon . '",';
1733
-                        $json .= '"group":"catgroup' . $cat_id . '"';
1728
+                        $json .= '"id":"'.$post_id.'",';
1729
+                        $json .= '"lat_pos": "'.$lat.'",';
1730
+                        $json .= '"long_pos": "'.$lng.'",';
1731
+                        $json .= '"marker_id":"'.$post_id.'_'.$cat_id.'",';
1732
+                        $json .= '"icon":"'.$term_icon.'",';
1733
+                        $json .= '"group":"catgroup'.$cat_id.'"';
1734 1734
                         $json .= '}';
1735 1735
 
1736 1736
 
@@ -1738,9 +1738,9 @@  discard block
 block discarded – undo
1738 1738
                             $post_marker_json = $json;
1739 1739
 
1740 1740
 
1741
-                        if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
1741
+                        if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".GEODIR_ICON_TABLE." WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
1742 1742
 
1743
-                            $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET
1743
+                            $json_query = $wpdb->prepare("UPDATE ".GEODIR_ICON_TABLE." SET
1744 1744
 										post_title = %s,
1745 1745
 										json = %s
1746 1746
 										WHERE post_id = %d AND cat_id = %d ",
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
 
1749 1749
                         } else {
1750 1750
 
1751
-                            $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET
1751
+                            $json_query = $wpdb->prepare("INSERT INTO ".GEODIR_ICON_TABLE." SET
1752 1752
 										post_id = %d,
1753 1753
 										post_title = %s,
1754 1754
 										cat_id = %d,
@@ -1766,17 +1766,17 @@  discard block
 block discarded – undo
1766 1766
                 if (!empty($post_term) && is_array($post_term)) {
1767 1767
                     $categories = implode(',', $post_term);
1768 1768
 
1769
-                    if ($categories != '' && $categories != 0) $categories = ',' . $categories . ',';
1769
+                    if ($categories != '' && $categories != 0) $categories = ','.$categories.',';
1770 1770
 
1771 1771
                     if (empty($post_marker_json))
1772 1772
                         $post_marker_json = isset($json) ? $json : '';
1773 1773
 
1774
-                    if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
1774
+                    if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
1775 1775
 
1776 1776
                         $wpdb->query(
1777 1777
                             $wpdb->prepare(
1778
-                                "UPDATE " . $table . " SET
1779
-								" . $taxonomy . " = %s,
1778
+                                "UPDATE ".$table." SET
1779
+								" . $taxonomy." = %s,
1780 1780
 								marker_json = %s
1781 1781
 								where post_id = %d",
1782 1782
                                 array($categories, $post_marker_json, $post_id)
@@ -1797,7 +1797,7 @@  discard block
 block discarded – undo
1797 1797
 
1798 1798
                                     $wpdb->query(
1799 1799
                                         $wpdb->prepare(
1800
-                                            "UPDATE " . $table . " SET
1800
+                                            "UPDATE ".$table." SET
1801 1801
 											default_category = %s
1802 1802
 											where post_id = %d",
1803 1803
                                             array($categories[0], $post_id)
@@ -1822,9 +1822,9 @@  discard block
 block discarded – undo
1822 1822
 
1823 1823
                         $wpdb->query(
1824 1824
                             $wpdb->prepare(
1825
-                                "INSERT INTO " . $table . " SET
1825
+                                "INSERT INTO ".$table." SET
1826 1826
 								post_id = %d,
1827
-								" . $taxonomy . " = %s,
1827
+								" . $taxonomy." = %s,
1828 1828
 								marker_json = %s ",
1829 1829
 
1830 1830
                                 array($post_id, $categories, $post_marker_json)
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
                                     } ?>"><img alt="bubble image" style="max-height:50px;"
1951 1951
                                                src="<?php echo $post_images[0]; ?>"/></a></div>
1952 1952
                             <?php
1953
-                            }else{
1953
+                            } else {
1954 1954
                                 echo '<div class="geodir-bubble_image"></div>';
1955 1955
                             }
1956 1956
                         } else {
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
                                 ?>
1959 1959
                                 <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div>
1960 1960
                             <?php
1961
-                            }else{
1961
+                            } else {
1962 1962
                                 echo '<div class="geodir-bubble_image"></div>';
1963 1963
                             }
1964 1964
                         }
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
                              * @param object $postinfo_obj The posts info as an object.
1989 1989
                              * @param bool|string $post_preview True if currently in post preview page. Empty string if not.                           *
1990 1990
                              */
1991
-                            do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
1991
+                            do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
1992 1992
                             ?>
1993 1993
                         </div>
1994 1994
                         <?php
@@ -1998,9 +1998,9 @@  discard block
 block discarded – undo
1998 1998
                             <div class="geodir-bubble-meta-fade"></div>
1999 1999
                             <div class="geodir-bubble-meta-bottom">
2000 2000
                                 <?php if ($rating_star != '') { ?>
2001
-                                <span class="geodir-bubble-rating"><?php echo $rating_star;?></span>
2001
+                                <span class="geodir-bubble-rating"><?php echo $rating_star; ?></span>
2002 2002
                                 <?php } ?>
2003
-                                <span class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID);?></span>
2003
+                                <span class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID); ?></span>
2004 2004
                                 <span class="geodir-bubble-reviews">
2005 2005
                                     <a href="<?php echo get_comments_link($ID); ?>" class="geodir-pcomments"><i class="fa fa-comments"></i> <?php echo get_comments_number($ID); ?></a>
2006 2006
                                 </span>
@@ -2062,11 +2062,11 @@  discard block
 block discarded – undo
2062 2062
 
2063 2063
         $post_type = get_post_type($post_id);
2064 2064
 
2065
-        $table = $plugin_prefix . $post_type . '_detail';
2065
+        $table = $plugin_prefix.$post_type.'_detail';
2066 2066
 
2067 2067
         $wpdb->query(
2068 2068
             $wpdb->prepare(
2069
-                "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d",
2069
+                "UPDATE ".$table." SET post_status=%s WHERE post_id=%d",
2070 2070
                 array($status, $post_id)
2071 2071
             )
2072 2072
         );
@@ -2138,18 +2138,18 @@  discard block
 block discarded – undo
2138 2138
 
2139 2139
         $post_type = get_post_type($post_id);
2140 2140
 
2141
-        $table = $plugin_prefix . $post_type . '_detail';
2141
+        $table = $plugin_prefix.$post_type.'_detail';
2142 2142
 
2143 2143
         $wpdb->query(
2144 2144
             $wpdb->prepare(
2145
-                "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d",
2145
+                "UPDATE ".$table." SET `post_id` = %d WHERE `post_id` = %d",
2146 2146
                 array($updatingpost, $temppost)
2147 2147
             )
2148 2148
         );
2149 2149
 
2150 2150
         $wpdb->query(
2151 2151
             $wpdb->prepare(
2152
-                "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d",
2152
+                "UPDATE ".GEODIR_ICON_TABLE." SET `post_id` = %d WHERE `post_id` = %d",
2153 2153
                 array($updatingpost, $temppost)
2154 2154
             )
2155 2155
         );
@@ -2158,7 +2158,7 @@  discard block
 block discarded – undo
2158 2158
 
2159 2159
         $wpdb->query(
2160 2160
             $wpdb->prepare(
2161
-                "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d",
2161
+                "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET `post_id` = %d WHERE `post_id` = %d",
2162 2162
                 array($updatingpost, $temppost)
2163 2163
             )
2164 2164
         );
@@ -2196,12 +2196,12 @@  discard block
 block discarded – undo
2196 2196
         if (!in_array($post_type, $all_postypes))
2197 2197
             return false;
2198 2198
 
2199
-        $table = $plugin_prefix . $post_type . '_detail';
2199
+        $table = $plugin_prefix.$post_type.'_detail';
2200 2200
 
2201 2201
         /* Delete custom post meta*/
2202 2202
         $wpdb->query(
2203 2203
             $wpdb->prepare(
2204
-                "DELETE FROM " . $table . " WHERE `post_id` = %d",
2204
+                "DELETE FROM ".$table." WHERE `post_id` = %d",
2205 2205
                 array($deleted_postid)
2206 2206
             )
2207 2207
         );
@@ -2210,7 +2210,7 @@  discard block
 block discarded – undo
2210 2210
 
2211 2211
         $wpdb->query(
2212 2212
             $wpdb->prepare(
2213
-                "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d",
2213
+                "DELETE FROM ".GEODIR_ICON_TABLE." WHERE `post_id` = %d",
2214 2214
                 array($deleted_postid)
2215 2215
             )
2216 2216
         );
@@ -2220,7 +2220,7 @@  discard block
 block discarded – undo
2220 2220
 
2221 2221
         $wpdb->query(
2222 2222
             $wpdb->prepare(
2223
-                "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d",
2223
+                "DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE `post_id` = %d",
2224 2224
                 array($deleted_postid)
2225 2225
             )
2226 2226
         );
@@ -2292,7 +2292,7 @@  discard block
 block discarded – undo
2292 2292
          */
2293 2293
         do_action('geodir_before_add_from_favorite', $post_id);
2294 2294
 
2295
-        echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>';
2295
+        echo '<a href="javascript:void(0);" title="'.$remove_favourite_text.'" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'remove\');"><i class="'.$favourite_icon.'"></i> '.$unfavourite_text.'</a>';
2296 2296
 
2297 2297
         /**
2298 2298
          * Called after adding the post from favourites.
@@ -2371,7 +2371,7 @@  discard block
 block discarded – undo
2371 2371
          */
2372 2372
         do_action('geodir_before_remove_from_favorite', $post_id);
2373 2373
 
2374
-        echo '<a href="javascript:void(0);"  title="' . $add_favourite_text . '" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>';
2374
+        echo '<a href="javascript:void(0);"  title="'.$add_favourite_text.'" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'add\');"><i class="'.$favourite_icon.'"></i> '.$favourite_text.'</a>';
2375 2375
 
2376 2376
         /**
2377 2377
          * Called after removing the post from favourites.
@@ -2466,24 +2466,24 @@  discard block
 block discarded – undo
2466 2466
             $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true);
2467 2467
 
2468 2468
         if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
2469
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"  ><a
2469
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"  ><a
2470 2470
                 class="geodir-removetofav-icon" href="javascript:void(0);"
2471
-                onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');"
2472
-                title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?>
2471
+                onclick="javascript:addToFavourite(<?php echo $post_id; ?>,'remove');"
2472
+                title="<?php echo $remove_favourite_text; ?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text; ?>
2473 2473
             </a>   </span><?php
2474 2474
 
2475 2475
         } else {
2476 2476
 
2477 2477
             if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
2478
-                $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\'';
2478
+                $script_text = 'javascript:window.location.href=\''.geodir_login_url().'\'';
2479 2479
             } else
2480
-                $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
2480
+                $script_text = 'javascript:addToFavourite('.$post_id.',\'add\')';
2481 2481
 
2482
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon"
2482
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"><a class="geodir-addtofav-icon"
2483 2483
                                                                                         href="javascript:void(0);"
2484
-                                                                                        onclick="<?php echo $script_text;?>"
2485
-                                                                                        title="<?php echo $add_favourite_text;?>"><i
2486
-                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span>
2484
+                                                                                        onclick="<?php echo $script_text; ?>"
2485
+                                                                                        title="<?php echo $add_favourite_text; ?>"><i
2486
+                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text; ?></a></span>
2487 2487
         <?php }
2488 2488
     }
2489 2489
 }
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 
2514 2514
             $post_type = $taxonomy_obj->object_type[0];
2515 2515
 
2516
-            $table = $plugin_prefix . $post_type . '_detail';
2516
+            $table = $plugin_prefix.$post_type.'_detail';
2517 2517
 
2518 2518
             /**
2519 2519
              * Filter to modify the 'join' query
@@ -2536,8 +2536,8 @@  discard block
 block discarded – undo
2536 2536
             $where = apply_filters('geodir_cat_post_count_where', $where, $term);
2537 2537
 
2538 2538
             $count_query = "SELECT count(post_id) FROM
2539
-							" . $table . " as pd " . $join . "
2540
-							WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where;
2539
+							" . $table." as pd ".$join."
2540
+							WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id."',".$term->taxonomy.") ".$where;
2541 2541
 
2542 2542
             $cat_post_count = $wpdb->get_var($count_query);
2543 2543
             if (empty($cat_post_count) || is_wp_error($cat_post_count))
@@ -2620,7 +2620,7 @@  discard block
 block discarded – undo
2620 2620
     global $post;
2621 2621
     $all_postypes = geodir_get_posttypes();
2622 2622
     if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
2623
-        return ' <a href="' . get_permalink($post->ID) . '">' . READ_MORE_TXT . '</a>';
2623
+        return ' <a href="'.get_permalink($post->ID).'">'.READ_MORE_TXT.'</a>';
2624 2624
     }
2625 2625
 
2626 2626
     return $more;
@@ -2647,14 +2647,14 @@  discard block
 block discarded – undo
2647 2647
     if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) {
2648 2648
 
2649 2649
         $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy);
2650
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
2650
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
2651 2651
 
2652 2652
         $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']);
2653
-        $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png';
2653
+        $term_icon = $path_parts['dirname'].'/cat_icon_'.$term_id.'.png';
2654 2654
 
2655 2655
         $posts = $wpdb->get_results(
2656 2656
             $wpdb->prepare(
2657
-                "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ",
2657
+                "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM ".$table." WHERE FIND_IN_SET(%s,%1\$s ) ",
2658 2658
                 array($term_id, $taxonomy)
2659 2659
             )
2660 2660
         );
@@ -2666,19 +2666,19 @@  discard block
 block discarded – undo
2666 2666
                 $lng = $post_obj->post_longitude;
2667 2667
 
2668 2668
                 $json = '{';
2669
-                $json .= '"id":"' . $post_obj->post_id . '",';
2670
-                $json .= '"lat_pos": "' . $lat . '",';
2671
-                $json .= '"long_pos": "' . $lng . '",';
2672
-                $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",';
2673
-                $json .= '"icon":"' . $term_icon . '",';
2674
-                $json .= '"group":"catgroup' . $term_id . '"';
2669
+                $json .= '"id":"'.$post_obj->post_id.'",';
2670
+                $json .= '"lat_pos": "'.$lat.'",';
2671
+                $json .= '"long_pos": "'.$lng.'",';
2672
+                $json .= '"marker_id":"'.$post_obj->post_id.'_'.$term_id.'",';
2673
+                $json .= '"icon":"'.$term_icon.'",';
2674
+                $json .= '"group":"catgroup'.$term_id.'"';
2675 2675
                 $json .= '}';
2676 2676
 
2677 2677
                 if ($post_obj->default_category == $term_id) {
2678 2678
 
2679 2679
                     $wpdb->query(
2680 2680
                         $wpdb->prepare(
2681
-                            "UPDATE " . $table . " SET marker_json = %s where post_id = %d",
2681
+                            "UPDATE ".$table." SET marker_json = %s where post_id = %d",
2682 2682
                             array($json, $post_obj->post_id)
2683 2683
                         )
2684 2684
                     );
@@ -2686,7 +2686,7 @@  discard block
 block discarded – undo
2686 2686
 
2687 2687
                 $wpdb->query(
2688 2688
                     $wpdb->prepare(
2689
-                        "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d",
2689
+                        "UPDATE ".GEODIR_ICON_TABLE." SET json = %s WHERE post_id = %d AND cat_id = %d",
2690 2690
                         array($json, $post_obj->post_id, $term_id)
2691 2691
                     )
2692 2692
                 );
@@ -2810,7 +2810,7 @@  discard block
 block discarded – undo
2810 2810
 //	print_r($uploads ) ;
2811 2811
     $post_first_image = $wpdb->get_results(
2812 2812
         $wpdb->prepare(
2813
-            "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1  ", array($post_id)
2813
+            "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d and menu_order = 1  ", array($post_id)
2814 2814
         )
2815 2815
     );
2816 2816
 
@@ -2831,9 +2831,9 @@  discard block
 block discarded – undo
2831 2831
 
2832 2832
         $post_type = get_post_type($post_id);
2833 2833
 
2834
-        $table_name = $plugin_prefix . $post_type . '_detail';
2834
+        $table_name = $plugin_prefix.$post_type.'_detail';
2835 2835
 
2836
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id);
2836
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='".$post_first_image[0]->file."' WHERE post_id =".$post_id);
2837 2837
 
2838 2838
         $new_attachment_name = basename($post_first_image[0]->file);
2839 2839
 
@@ -2846,11 +2846,11 @@  discard block
 block discarded – undo
2846 2846
                 wp_delete_attachment($post_thumbnail_id);
2847 2847
 
2848 2848
             }
2849
-            $filename = $uploads['basedir'] . $post_first_image[0]->file;
2849
+            $filename = $uploads['basedir'].$post_first_image[0]->file;
2850 2850
 
2851 2851
             $attachment = array(
2852 2852
                 'post_mime_type' => $post_first_image[0]->mime_type,
2853
-                'guid' => $uploads['baseurl'] . $post_first_image[0]->file,
2853
+                'guid' => $uploads['baseurl'].$post_first_image[0]->file,
2854 2854
                 'post_parent' => $post_id,
2855 2855
                 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title),
2856 2856
                 'post_content' => ''
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
 
2864 2864
                 set_post_thumbnail($post_id, $id);
2865 2865
 
2866
-                require_once(ABSPATH . 'wp-admin/includes/image.php');
2866
+                require_once(ABSPATH.'wp-admin/includes/image.php');
2867 2867
                 wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
2868 2868
 
2869 2869
             }
@@ -2896,35 +2896,35 @@  discard block
 block discarded – undo
2896 2896
         $post_id = absint($_POST['post_id']);
2897 2897
         $upload_dir = wp_upload_dir();
2898 2898
         $post_type = get_post_type($_POST['post_id']);
2899
-        $table = $plugin_prefix . $post_type . '_detail';
2899
+        $table = $plugin_prefix.$post_type.'_detail';
2900 2900
 
2901 2901
         $post_arr = $wpdb->get_results($wpdb->prepare(
2902
-            "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1",
2902
+            "SELECT * FROM $wpdb->posts p JOIN ".$table." gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1",
2903 2903
             array($post_id)
2904 2904
         )
2905 2905
             , ARRAY_A);
2906 2906
 
2907 2907
         $arrImages = $wpdb->get_results(
2908 2908
             $wpdb->prepare(
2909
-                "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ",
2909
+                "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ",
2910 2910
                 array('%image%', $post_id)
2911 2911
             )
2912 2912
         );
2913 2913
         if ($arrImages) {
2914 2914
             $image_arr = array();
2915 2915
             foreach ($arrImages as $img) {
2916
-                $image_arr[] = $upload_dir['baseurl'] . $img->file;
2916
+                $image_arr[] = $upload_dir['baseurl'].$img->file;
2917 2917
             }
2918 2918
             $comma_separated = implode(",", $image_arr);
2919 2919
             $post_arr[0]['post_images'] = $comma_separated;
2920 2920
         }
2921 2921
 
2922 2922
 
2923
-        $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category'];
2923
+        $cats = $post_arr[0][$post_arr[0]['post_type'].'category'];
2924 2924
         $cat_arr = array_filter(explode(",", $cats));
2925 2925
         $trans_cat = array();
2926 2926
         foreach ($cat_arr as $cat) {
2927
-            $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'] . 'category', false);
2927
+            $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'].'category', false);
2928 2928
         }
2929 2929
 
2930 2930
 
@@ -2966,7 +2966,7 @@  discard block
 block discarded – undo
2966 2966
 
2967 2967
     $get_data = $wpdb->get_results(
2968 2968
         $wpdb->prepare(
2969
-            "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'",
2969
+            "SELECT htmlvar_name, field_type, extra_fields FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1'",
2970 2970
             array($listing_type)
2971 2971
         )
2972 2972
     );
@@ -2979,12 +2979,12 @@  discard block
 block discarded – undo
2979 2979
 
2980 2980
                 $extra_fields = unserialize($data->extra_fields);
2981 2981
 
2982
-                $prefix = $data->htmlvar_name . '_';
2982
+                $prefix = $data->htmlvar_name.'_';
2983 2983
 
2984
-                $fields_info[$prefix . 'address'] = $data->field_type;
2984
+                $fields_info[$prefix.'address'] = $data->field_type;
2985 2985
 
2986 2986
                 if (isset($extra_fields['show_zip']) && $extra_fields['show_zip'])
2987
-                    $fields_info[$prefix . 'zip'] = $data->field_type;
2987
+                    $fields_info[$prefix.'zip'] = $data->field_type;
2988 2988
 
2989 2989
             } else {
2990 2990
 
@@ -3082,13 +3082,13 @@  discard block
 block discarded – undo
3082 3082
  * @since 1.4.9
3083 3083
  * @package GeoDirectory
3084 3084
  */
3085
-function geodir_fb_like_thumbnail(){
3085
+function geodir_fb_like_thumbnail() {
3086 3086
 
3087 3087
     // return if not a single post
3088
-    if(!is_single()){return;}
3088
+    if (!is_single()) {return; }
3089 3089
 
3090 3090
     global $post;
3091
-    if(isset($post->featured_image) && $post->featured_image){
3091
+    if (isset($post->featured_image) && $post->featured_image) {
3092 3092
         $upload_dir = wp_upload_dir();
3093 3093
         $thumb = $upload_dir['baseurl'].$post->featured_image;
3094 3094
         echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n";
Please login to merge, or discard this patch.
geodirectory-functions/custom_functions.php 1 patch
Spacing   +668 added lines, -668 removed lines patch added patch discarded remove patch
@@ -52,31 +52,31 @@  discard block
 block discarded – undo
52 52
 				jQuery(listSel).children('li').switchClass('gridview_onehalf gridview_onethird gridview_onefourth', 'gridview_onefifth', 600);
53 53
 			}
54 54
 
55
-			jQuery.post("<?php echo geodir_get_ajax_url();?>&gd_listing_view=" + val, function (data) {
55
+			jQuery.post("<?php echo geodir_get_ajax_url(); ?>&gd_listing_view=" + val, function (data) {
56 56
 				//alert(data );
57 57
 			});
58 58
 		}
59 59
 	</script>
60 60
 	<div class="geodir-list-view-select">
61 61
 		<select name="gd_list_view" id="gd_list_view" onchange="geodir_list_view_select(this);">
62
-			<?php $listing_view = (int) $gd_session->get( 'gd_listing_view' ); ?>
63
-			<option value=""><?php _e( 'View:', 'geodirectory' ); ?></option>
62
+			<?php $listing_view = (int) $gd_session->get('gd_listing_view'); ?>
63
+			<option value=""><?php _e('View:', 'geodirectory'); ?></option>
64 64
 			<option
65
-				value="1" <?php selected( 1, $listing_view ); ?>><?php _e( 'View: List', 'geodirectory' ); ?></option>
65
+				value="1" <?php selected(1, $listing_view); ?>><?php _e('View: List', 'geodirectory'); ?></option>
66 66
 			<option
67
-				value="2" <?php selected( 2, $listing_view ); ?>><?php _e( 'View: Grid 2', 'geodirectory' ); ?></option>
67
+				value="2" <?php selected(2, $listing_view); ?>><?php _e('View: Grid 2', 'geodirectory'); ?></option>
68 68
 			<option
69
-				value="3" <?php selected( 3, $listing_view ); ?>><?php _e( 'View: Grid 3', 'geodirectory' ); ?></option>
69
+				value="3" <?php selected(3, $listing_view); ?>><?php _e('View: Grid 3', 'geodirectory'); ?></option>
70 70
 			<option
71
-				value="4" <?php selected( 4, $listing_view ); ?>><?php _e( 'View: Grid 4', 'geodirectory' ); ?></option>
71
+				value="4" <?php selected(4, $listing_view); ?>><?php _e('View: Grid 4', 'geodirectory'); ?></option>
72 72
 			<option
73
-				value="5" <?php selected( 5, $listing_view ); ?>><?php _e( 'View: Grid 5', 'geodirectory' ); ?></option>
73
+				value="5" <?php selected(5, $listing_view); ?>><?php _e('View: Grid 5', 'geodirectory'); ?></option>
74 74
 		</select>
75 75
 	</div>
76 76
 	<?php
77 77
 }
78 78
 
79
-add_action( 'geodir_before_listing', 'geodir_list_view_select', 100 );
79
+add_action('geodir_before_listing', 'geodir_list_view_select', 100);
80 80
 
81 81
 /**
82 82
  * Limit the listing excerpt.
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
  * @global object $post          The current post object.
92 92
  * @return string The modified excerpt.
93 93
  */
94
-function geodir_max_excerpt( $charlength ) {
94
+function geodir_max_excerpt($charlength) {
95 95
 	global $post;
96
-	if ( $charlength == '0' ) {
96
+	if ($charlength == '0') {
97 97
 		return;
98 98
 	}
99 99
 	$out = '';
@@ -101,46 +101,46 @@  discard block
 block discarded – undo
101 101
 	$temp_post = $post;
102 102
 	$excerpt   = get_the_excerpt();
103 103
 
104
-	$charlength ++;
105
-	$excerpt_more = function_exists( 'geodirf_excerpt_more' ) ? geodirf_excerpt_more( '' ) : geodir_excerpt_more( '' );
106
-	if ( mb_strlen( $excerpt ) > $charlength ) {
107
-		if ( mb_strlen( $excerpt_more ) > 0 && mb_strpos( $excerpt, $excerpt_more ) !== false ) {
108
-			$excut = - ( mb_strlen( $excerpt_more ) );
109
-			$subex = mb_substr( $excerpt, 0, $excut );
110
-			if ( $charlength > 0 && mb_strlen( $subex ) > $charlength ) {
111
-				$subex = mb_substr( $subex, 0, $charlength );
104
+	$charlength++;
105
+	$excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
106
+	if (mb_strlen($excerpt) > $charlength) {
107
+		if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
108
+			$excut = - (mb_strlen($excerpt_more));
109
+			$subex = mb_substr($excerpt, 0, $excut);
110
+			if ($charlength > 0 && mb_strlen($subex) > $charlength) {
111
+				$subex = mb_substr($subex, 0, $charlength);
112 112
 			}
113 113
 			$out .= $subex;
114 114
 		} else {
115
-			$subex   = mb_substr( $excerpt, 0, $charlength - 5 );
116
-			$exwords = explode( ' ', $subex );
117
-			$excut   = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) );
118
-			if ( $excut < 0 ) {
119
-				$out .= mb_substr( $subex, 0, $excut );
115
+			$subex   = mb_substr($excerpt, 0, $charlength - 5);
116
+			$exwords = explode(' ', $subex);
117
+			$excut   = - (mb_strlen($exwords[count($exwords) - 1]));
118
+			if ($excut < 0) {
119
+				$out .= mb_substr($subex, 0, $excut);
120 120
 			} else {
121 121
 				$out .= $subex;
122 122
 			}
123 123
 		}
124
-		$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
124
+		$out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
125 125
 		/**
126 126
 		 * Filter excerpt read more text.
127 127
 		 *
128 128
 		 * @since 1.0.0
129 129
 		 */
130
-		$out .= apply_filters( 'geodir_max_excerpt_end', __( 'Read more [...]', 'geodirectory' ) );
130
+		$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
131 131
 		$out .= '</a>';
132 132
 
133 133
 	} else {
134
-		if ( mb_strlen( $excerpt_more ) > 0 && mb_strpos( $excerpt, $excerpt_more ) !== false ) {
135
-			$excut = - ( mb_strlen( $excerpt_more ) );
136
-			$out .= mb_substr( $excerpt, 0, $excut );
137
-			$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
134
+		if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
135
+			$excut = - (mb_strlen($excerpt_more));
136
+			$out .= mb_substr($excerpt, 0, $excut);
137
+			$out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
138 138
 			/**
139 139
 			 * Filter excerpt read more text.
140 140
 			 *
141 141
 			 * @since 1.0.0
142 142
 			 */
143
-			$out .= apply_filters( 'geodir_max_excerpt_end', __( 'Read more [...]', 'geodirectory' ) );
143
+			$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
144 144
 			$out .= '</a>';
145 145
 		} else {
146 146
 			$out .= $excerpt;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
  *
164 164
  * @return object Returns filtered package info as an object.
165 165
  */
166
-function geodir_post_package_info( $package_info, $post = '', $post_type = '' ) {
166
+function geodir_post_package_info($package_info, $post = '', $post_type = '') {
167 167
 	$package_info['pid']              = 0;
168 168
 	$package_info['days']             = 0;
169 169
 	$package_info['amount']           = 0;
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 * @param object|string $post  The post object.
193 193
 	 * @param string $post_type    The post type.
194 194
 	 */
195
-	return (object) apply_filters( 'geodir_post_package_info', $package_info, $post, $post_type );
195
+	return (object) apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
196 196
 
197 197
 }
198 198
 
@@ -220,11 +220,11 @@  discard block
 block discarded – undo
220 220
  *
221 221
  * }
222 222
  */
223
-function geodir_send_inquiry( $request ) {
223
+function geodir_send_inquiry($request) {
224 224
 	global $wpdb;
225 225
 
226 226
 	// strip slashes from text
227
-	$request = ! empty( $request ) ? stripslashes_deep( $request ) : $request;
227
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
228 228
 
229 229
 	$yourname      = $request['inq_name'];
230 230
 	$youremail     = $request['inq_email'];
@@ -235,26 +235,26 @@  discard block
 block discarded – undo
235 235
 	$author_id  = '';
236 236
 	$post_title = '';
237 237
 
238
-	if ( $request['pid'] ) {
238
+	if ($request['pid']) {
239 239
 
240 240
 		$productinfosql = $wpdb->prepare(
241 241
 			"select ID,post_author,post_title from $wpdb->posts where ID =%d",
242
-			array( $request['pid'] )
242
+			array($request['pid'])
243 243
 		);
244
-		$productinfo    = $wpdb->get_row( $productinfosql );
244
+		$productinfo = $wpdb->get_row($productinfosql);
245 245
 
246 246
 		$author_id  = $productinfo->post_author;
247 247
 		$post_title = $productinfo->post_title;
248 248
 	}
249 249
 
250
-	$post_title = '<a href="' . get_permalink( $pid ) . '">' . $post_title . '</a>';
250
+	$post_title = '<a href="'.get_permalink($pid).'">'.$post_title.'</a>';
251 251
 
252
-	$user_info = get_userdata( $author_id );
253
-	$to_email  = geodir_get_post_meta( $pid, 'geodir_email', true );
254
-	$to_name   = geodir_get_client_name( $author_id );
252
+	$user_info = get_userdata($author_id);
253
+	$to_email  = geodir_get_post_meta($pid, 'geodir_email', true);
254
+	$to_name   = geodir_get_client_name($author_id);
255 255
 
256
-	if ( $to_email == '' ) {
257
-		$to_email = get_option( 'admin_email' );
256
+	if ($to_email == '') {
257
+		$to_email = get_option('admin_email');
258 258
 	}
259 259
 
260 260
 	/**
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
 	 * }
276 276
 	 * @param string $type     The form type, default: `Enquiry`.
277 277
 	 */
278
-	do_action( 'geodir_after_send_enquiry', $request, 'Enquiry' );
278
+	do_action('geodir_after_send_enquiry', $request, 'Enquiry');
279 279
 
280 280
 	$client_message = $frnd_comments;
281
-	$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>.';
281
+	$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>.';
282 282
 	/**
283 283
 	 * Filter client message text.
284 284
 	 *
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	 *
287 287
 	 * @param string $client_message Client message text.
288 288
 	 */
289
-	$client_message = apply_filters( 'geodir_inquiry_email_msg', $client_message );
289
+	$client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
290 290
 
291 291
 	/**
292 292
 	 * Called before the send enquiry email is sent.
@@ -305,12 +305,12 @@  discard block
 block discarded – undo
305 305
 	 *
306 306
 	 * }
307 307
 	 */
308
-	do_action( 'geodir_before_send_enquiry_email', $request );
309
-	if ( $to_email ) {
308
+	do_action('geodir_before_send_enquiry_email', $request);
309
+	if ($to_email) {
310 310
 		// strip slashes message
311
-		$client_message = stripslashes_deep( $client_message );
311
+		$client_message = stripslashes_deep($client_message);
312 312
 
313
-		geodir_sendEmail( $youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid'] );//To client email
313
+		geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']); //To client email
314 314
 	}
315 315
 
316 316
 	/**
@@ -330,12 +330,12 @@  discard block
 block discarded – undo
330 330
 	 *
331 331
 	 * }
332 332
 	 */
333
-	do_action( 'geodir_after_send_enquiry_email', $request );
334
-	$url = get_permalink( $pid );
335
-	if ( strstr( $url, '?' ) ) {
336
-		$url = $url . "&send_inquiry=success";
333
+	do_action('geodir_after_send_enquiry_email', $request);
334
+	$url = get_permalink($pid);
335
+	if (strstr($url, '?')) {
336
+		$url = $url."&send_inquiry=success";
337 337
 	} else {
338
-		$url = $url . "?send_inquiry=success";
338
+		$url = $url."?send_inquiry=success";
339 339
 	}
340 340
 	/**
341 341
 	 * Filter redirect url after the send enquiry email is sent.
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
 	 *
345 345
 	 * @param string $url Redirect url.
346 346
 	 */
347
-	$url = apply_filters( 'geodir_send_enquiry_after_submit_redirect', $url );
348
-	wp_redirect( $url );
347
+	$url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
348
+	wp_redirect($url);
349 349
 	gd_die();
350 350
 
351 351
 }
@@ -374,11 +374,11 @@  discard block
 block discarded – undo
374 374
  * }
375 375
  * @global object $wpdb        WordPress Database object.
376 376
  */
377
-function geodir_send_friend( $request ) {
377
+function geodir_send_friend($request) {
378 378
 	global $wpdb;
379 379
 
380 380
 	// strip slashes from text
381
-	$request = ! empty( $request ) ? stripslashes_deep( $request ) : $request;
381
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
382 382
 
383 383
 	$yourname      = $request['yourname'];
384 384
 	$youremail     = $request['youremail'];
@@ -387,13 +387,13 @@  discard block
 block discarded – undo
387 387
 	$pid           = $request['pid'];
388 388
 	$to_email      = $request['to_email'];
389 389
 	$to_name       = $request['to_name'];
390
-	if ( $request['pid'] ) {
390
+	if ($request['pid']) {
391 391
 		$productinfosql = $wpdb->prepare(
392 392
 			"select ID,post_title from $wpdb->posts where ID =%d",
393
-			array( $request['pid'] )
393
+			array($request['pid'])
394 394
 		);
395
-		$productinfo    = $wpdb->get_results( $productinfosql );
396
-		foreach ( $productinfo as $productinfoObj ) {
395
+		$productinfo = $wpdb->get_results($productinfosql);
396
+		foreach ($productinfo as $productinfoObj) {
397 397
 			$post_title = $productinfoObj->post_title;
398 398
 		}
399 399
 	}
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
 	 *
418 418
 	 * }
419 419
 	 */
420
-	do_action( 'geodir_before_send_to_friend_email', $request );
421
-	geodir_sendEmail( $youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid'] );//To client email
420
+	do_action('geodir_before_send_to_friend_email', $request);
421
+	geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']); //To client email
422 422
 
423 423
 	/**
424 424
 	 * Called after the send to friend email is sent.
@@ -439,13 +439,13 @@  discard block
 block discarded – undo
439 439
 	 *
440 440
 	 * }
441 441
 	 */
442
-	do_action( 'geodir_after_send_to_friend_email', $request );
442
+	do_action('geodir_after_send_to_friend_email', $request);
443 443
 
444
-	$url = get_permalink( $pid );
445
-	if ( strstr( $url, '?' ) ) {
446
-		$url = $url . "&sendtofrnd=success";
444
+	$url = get_permalink($pid);
445
+	if (strstr($url, '?')) {
446
+		$url = $url."&sendtofrnd=success";
447 447
 	} else {
448
-		$url = $url . "?sendtofrnd=success";
448
+		$url = $url."?sendtofrnd=success";
449 449
 	}
450 450
 	/**
451 451
 	 * Filter redirect url after the send to friend email is sent.
@@ -454,8 +454,8 @@  discard block
 block discarded – undo
454 454
 	 *
455 455
 	 * @param string $url Redirect url.
456 456
 	 */
457
-	$url = apply_filters( 'geodir_send_to_friend_after_submit_redirect', $url );
458
-	wp_redirect( $url );
457
+	$url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
458
+	wp_redirect($url);
459 459
 	gd_die();
460 460
 }
461 461
 
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
  *
470 470
  * @param string $hash_key
471 471
  */
472
-function geodir_before_tab_content( $hash_key ) {
473
-	switch ( $hash_key ) {
472
+function geodir_before_tab_content($hash_key) {
473
+	switch ($hash_key) {
474 474
 		case 'post_info' :
475 475
 			echo '<div class="geodir-company_info field-group">';
476 476
 			break;
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 			 *
481 481
 			 * @since 1.0.0
482 482
 			 */
483
-			echo ' <div id="' . apply_filters( 'geodir_post_gallery_id', 'geodir-post-gallery' ) . '" class="clearfix" >';
483
+			echo ' <div id="'.apply_filters('geodir_post_gallery_id', 'geodir-post-gallery').'" class="clearfix" >';
484 484
 			break;
485 485
 		case 'reviews' :
486 486
 			echo '<div id="reviews-wrap" class="clearfix"> ';
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
  *
505 505
  * @param string $hash_key
506 506
  */
507
-function geodir_after_tab_content( $hash_key ) {
508
-	switch ( $hash_key ) {
507
+function geodir_after_tab_content($hash_key) {
508
+	switch ($hash_key) {
509 509
 		case 'post_info' :
510 510
 			echo '</div>';
511 511
 			break;
@@ -536,25 +536,25 @@  discard block
 block discarded – undo
536 536
  * @global object $wpdb     WordPress Database object.
537 537
  * @return bool|null|string Returns default sort results, when the post type is valid. Otherwise returns false.
538 538
  */
539
-function geodir_get_posts_default_sort( $post_type ) {
539
+function geodir_get_posts_default_sort($post_type) {
540 540
 
541 541
 	global $wpdb;
542 542
 
543
-	if ( $post_type != '' ) {
543
+	if ($post_type != '') {
544 544
 
545 545
 		$all_postypes = geodir_get_posttypes();
546 546
 
547
-		if ( ! in_array( $post_type, $all_postypes ) ) {
547
+		if (!in_array($post_type, $all_postypes)) {
548 548
 			return false;
549 549
 		}
550 550
 
551
-		$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(
551
+		$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(
552 552
 			$post_type,
553 553
 			1,
554 554
 			1
555
-		) ) );
555
+		)));
556 556
 
557
-		if ( ! empty( $sort_field_info ) ) {
557
+		if (!empty($sort_field_info)) {
558 558
 			return $sort_field_info;
559 559
 		}
560 560
 
@@ -574,20 +574,20 @@  discard block
 block discarded – undo
574 574
  * @global object $wpdb     WordPress Database object.
575 575
  * @return bool|mixed|void Returns sort results, when the post type is valid. Otherwise returns false.
576 576
  */
577
-function geodir_get_sort_options( $post_type ) {
577
+function geodir_get_sort_options($post_type) {
578 578
 	global $wpdb;
579 579
 
580
-	if ( $post_type != '' ) {
580
+	if ($post_type != '') {
581 581
 		$all_postypes = geodir_get_posttypes();
582 582
 
583
-		if ( ! in_array( $post_type, $all_postypes ) ) {
583
+		if (!in_array($post_type, $all_postypes)) {
584 584
 			return false;
585 585
 		}
586 586
 
587
-		$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(
587
+		$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(
588 588
 			$post_type,
589 589
 			1
590
-		) ) );
590
+		)));
591 591
 
592 592
 		/**
593 593
 		 * Filter post sort options.
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 		 * @param array $sort_field_info Unfiltered sort field array.
598 598
 		 * @param string $post_type      Post type.
599 599
 		 */
600
-		return apply_filters( 'geodir_get_sort_options', $sort_field_info, $post_type );
600
+		return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
601 601
 	}
602 602
 
603 603
 }
@@ -618,63 +618,63 @@  discard block
 block discarded – undo
618 618
 	 *
619 619
 	 * @since 1.4.4
620 620
 	 */
621
-	if ( is_search() ) {
621
+	if (is_search()) {
622 622
 		return;
623 623
 	}
624 624
 
625 625
 	$sort_by = '';
626 626
 
627
-	if ( isset( $_REQUEST['sort_by'] ) ) {
627
+	if (isset($_REQUEST['sort_by'])) {
628 628
 		$sort_by = $_REQUEST['sort_by'];
629 629
 	}
630 630
 
631 631
 	$gd_post_type = geodir_get_current_posttype();
632 632
 
633
-	$sort_options = geodir_get_sort_options( $gd_post_type );
633
+	$sort_options = geodir_get_sort_options($gd_post_type);
634 634
 
635 635
 
636 636
 	$sort_field_options = '';
637 637
 
638
-	if ( ! empty( $sort_options ) ) {
639
-		foreach ( $sort_options as $sort ) {
640
-			$sort = stripslashes_deep( $sort ); // strip slashes
638
+	if (!empty($sort_options)) {
639
+		foreach ($sort_options as $sort) {
640
+			$sort = stripslashes_deep($sort); // strip slashes
641 641
 
642
-			$label = __( $sort->site_title, 'geodirectory' );
642
+			$label = __($sort->site_title, 'geodirectory');
643 643
 
644
-			if ( $sort->field_type == 'random' ) {
644
+			if ($sort->field_type == 'random') {
645 645
 				$key = $sort->field_type;
646
-				( $sort_by == $key || ( $sort->is_default == '1' && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = '';
647
-				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>';
646
+				($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
647
+				$sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
648 648
 			}
649 649
 
650
-			if ( $sort->htmlvar_name == 'comment_count' ) {
650
+			if ($sort->htmlvar_name == 'comment_count') {
651 651
 				$sort->htmlvar_name = 'rating_count';
652 652
 			}
653 653
 
654
-			if ( $sort->sort_asc ) {
655
-				$key   = $sort->htmlvar_name . '_asc';
654
+			if ($sort->sort_asc) {
655
+				$key   = $sort->htmlvar_name.'_asc';
656 656
 				$label = $sort->site_title;
657
-				if ( $sort->asc_title ) {
657
+				if ($sort->asc_title) {
658 658
 					$label = $sort->asc_title;
659 659
 				}
660
-				( $sort_by == $key || ( $sort->is_default == '1' && $sort->default_order == $key && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = '';
661
-				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>';
660
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
661
+				$sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
662 662
 			}
663 663
 
664
-			if ( $sort->sort_desc ) {
665
-				$key   = $sort->htmlvar_name . '_desc';
664
+			if ($sort->sort_desc) {
665
+				$key   = $sort->htmlvar_name.'_desc';
666 666
 				$label = $sort->site_title;
667
-				if ( $sort->desc_title ) {
667
+				if ($sort->desc_title) {
668 668
 					$label = $sort->desc_title;
669 669
 				}
670
-				( $sort_by == $key || ( $sort->is_default == '1' && $sort->default_order == $key && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = '';
671
-				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>';
670
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
671
+				$sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
672 672
 			}
673 673
 
674 674
 		}
675 675
 	}
676 676
 
677
-	if ( $sort_field_options != '' ) {
677
+	if ($sort_field_options != '') {
678 678
 
679 679
 		?>
680 680
 
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
 			<select name="sort_by" id="sort_by" onchange="javascript:window.location=this.value;">
684 684
 
685 685
 				<option
686
-					value="<?php echo esc_url( add_query_arg( 'sort_by', '' ) ); ?>" <?php if ( $sort_by == '' ) {
686
+					value="<?php echo esc_url(add_query_arg('sort_by', '')); ?>" <?php if ($sort_by == '') {
687 687
 					echo 'selected="selected"';
688
-				} ?>><?php _e( 'Sort By', 'geodirectory' ); ?></option><?php
688
+				} ?>><?php _e('Sort By', 'geodirectory'); ?></option><?php
689 689
 
690 690
 				echo $sort_field_options; ?>
691 691
 
@@ -713,9 +713,9 @@  discard block
 block discarded – undo
713 713
  *
714 714
  * @return string Returns the section title.
715 715
  */
716
-function geodir_advance_customfields_heading( $title, $field_type ) {
716
+function geodir_advance_customfields_heading($title, $field_type) {
717 717
 
718
-	if ( in_array( $field_type, array( 'multiselect', 'textarea', 'taxonomy' ) ) ) {
718
+	if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
719 719
 		$title = '';
720 720
 	}
721 721
 
@@ -737,19 +737,19 @@  discard block
 block discarded – undo
737 737
  * @global object $gd_session       GeoDirectory Session object.
738 738
  * @return string Returns related posts html.
739 739
  */
740
-function geodir_related_posts_display( $request ) {
741
-	if ( ! empty( $request ) ) {
742
-		$before_title = ( isset( $request['before_title'] ) && ! empty( $request['before_title'] ) ) ? $request['before_title'] : '';
743
-		$after_title  = ( isset( $request['after_title'] ) && ! empty( $request['after_title'] ) ) ? $request['after_title'] : '';
744
-
745
-		$title               = ( isset( $request['title'] ) && ! empty( $request['title'] ) ) ? $request['title'] : __( 'Related Listings', 'geodirectory' );
746
-		$post_number         = ( isset( $request['post_number'] ) && ! empty( $request['post_number'] ) ) ? $request['post_number'] : '5';
747
-		$relate_to           = ( isset( $request['relate_to'] ) && ! empty( $request['relate_to'] ) ) ? $request['relate_to'] : 'category';
748
-		$layout              = ( isset( $request['layout'] ) && ! empty( $request['layout'] ) ) ? $request['layout'] : 'gridview_onehalf';
749
-		$add_location_filter = ( isset( $request['add_location_filter'] ) && ! empty( $request['add_location_filter'] ) ) ? $request['add_location_filter'] : '0';
750
-		$listing_width       = ( isset( $request['listing_width'] ) && ! empty( $request['listing_width'] ) ) ? $request['listing_width'] : '';
751
-		$list_sort           = ( isset( $request['list_sort'] ) && ! empty( $request['list_sort'] ) ) ? $request['list_sort'] : 'latest';
752
-		$character_count     = ( isset( $request['character_count'] ) && ! empty( $request['character_count'] ) ) ? $request['character_count'] : '';
740
+function geodir_related_posts_display($request) {
741
+	if (!empty($request)) {
742
+		$before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : '';
743
+		$after_title  = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : '';
744
+
745
+		$title               = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
746
+		$post_number         = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5';
747
+		$relate_to           = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category';
748
+		$layout              = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf';
749
+		$add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0';
750
+		$listing_width       = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : '';
751
+		$list_sort           = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest';
752
+		$character_count     = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : '';
753 753
 
754 754
 		global $wpdb, $post, $gd_session, $related_nearest, $related_parent_lat, $related_parent_lon;
755 755
 		$related_parent_lat   = !empty($post->post_latitude) ? $post->post_latitude : '';
@@ -757,10 +757,10 @@  discard block
 block discarded – undo
757 757
 		$arr_detail_page_tabs = geodir_detail_page_tabs_list();
758 758
 
759 759
 		$related_listing_array = array();
760
-		if ( get_option( 'geodir_add_related_listing_posttypes' ) ) {
761
-			$related_listing_array = get_option( 'geodir_add_related_listing_posttypes' );
760
+		if (get_option('geodir_add_related_listing_posttypes')) {
761
+			$related_listing_array = get_option('geodir_add_related_listing_posttypes');
762 762
 		}
763
-		if ( isset($post->post_type) && in_array( $post->post_type, $related_listing_array ) ) {
763
+		if (isset($post->post_type) && in_array($post->post_type, $related_listing_array)) {
764 764
 			$arr_detail_page_tabs['related_listing']['is_display'] = true;
765 765
 		}
766 766
 
@@ -772,90 +772,90 @@  discard block
 block discarded – undo
772 772
 		$tax_field         = 'id';
773 773
 		$category          = array();
774 774
 
775
-		if ( isset( $_REQUEST['backandedit'] ) ) {
776
-			$post      = (object) $gd_session->get( 'listing' );
775
+		if (isset($_REQUEST['backandedit'])) {
776
+			$post      = (object) $gd_session->get('listing');
777 777
 			$post_type = $post->listing_type;
778
-			if ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) {
778
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
779 779
 				$post_id = $_REQUEST['pid'];
780 780
 			}
781
-		} elseif ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) {
782
-			$post      = geodir_get_post_info( $_REQUEST['pid'] );
781
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
782
+			$post      = geodir_get_post_info($_REQUEST['pid']);
783 783
 			$post_type = $post->post_type;
784 784
 			$post_id   = $_REQUEST['pid'];
785
-		} elseif ( isset( $post->post_type ) && $post->post_type != '' ) {
785
+		} elseif (isset($post->post_type) && $post->post_type != '') {
786 786
 			$post_type = $post->post_type;
787 787
 			$post_id   = $post->ID;
788 788
 		}
789 789
 
790
-		if ( $relate_to == 'category' ) {
790
+		if ($relate_to == 'category') {
791 791
 
792
-			$category_taxonomy = $post_type . $relate_to;
793
-			if ( isset( $post->{$category_taxonomy} ) && $post->{$category_taxonomy} != '' ) {
794
-				$category = explode( ',', trim( $post->{$category_taxonomy}, ',' ) );
792
+			$category_taxonomy = $post_type.$relate_to;
793
+			if (isset($post->{$category_taxonomy} ) && $post->{$category_taxonomy} != '') {
794
+				$category = explode(',', trim($post->{$category_taxonomy}, ','));
795 795
 			}
796 796
 
797
-		} elseif ( $relate_to == 'tags' ) {
797
+		} elseif ($relate_to == 'tags') {
798 798
 
799
-			$category_taxonomy = $post_type . '_' . $relate_to;
800
-			if ( $post->post_tags != '' ) {
801
-				$category = explode( ',', trim( $post->post_tags, ',' ) );
799
+			$category_taxonomy = $post_type.'_'.$relate_to;
800
+			if ($post->post_tags != '') {
801
+				$category = explode(',', trim($post->post_tags, ','));
802 802
 			}
803 803
 			$tax_field = 'name';
804 804
 		}
805 805
 
806 806
 		/* --- return false in invalid request --- */
807
-		if ( empty( $category ) ) {
807
+		if (empty($category)) {
808 808
 			return false;
809 809
 		}
810 810
 
811 811
 		$all_postypes = geodir_get_posttypes();
812 812
 
813
-		if ( ! in_array( $post_type, $all_postypes ) ) {
813
+		if (!in_array($post_type, $all_postypes)) {
814 814
 			return false;
815 815
 		}
816 816
 
817 817
 		/* --- return false in invalid request --- */
818 818
 
819 819
 		$location_url = '';
820
-		if ( $add_location_filter != '0' ) {
820
+		if ($add_location_filter != '0') {
821 821
 			$location_url             = array();
822
-			$geodir_show_location_url = get_option( 'geodir_show_location_url' );
822
+			$geodir_show_location_url = get_option('geodir_show_location_url');
823 823
 
824
-			$gd_city = get_query_var( 'gd_city' );
824
+			$gd_city = get_query_var('gd_city');
825 825
 
826
-			if ( $gd_city ) {
827
-				$gd_country = get_query_var( 'gd_country' );
828
-				$gd_region  = get_query_var( 'gd_region' );
826
+			if ($gd_city) {
827
+				$gd_country = get_query_var('gd_country');
828
+				$gd_region  = get_query_var('gd_region');
829 829
 			} else {
830 830
 				$location = geodir_get_default_location();
831 831
 
832
-				$gd_country = isset( $location->country_slug ) ? $location->country_slug : '';
833
-				$gd_region  = isset( $location->region_slug ) ? $location->region_slug : '';
834
-				$gd_city    = isset( $location->city_slug ) ? $location->city_slug : '';
832
+				$gd_country = isset($location->country_slug) ? $location->country_slug : '';
833
+				$gd_region  = isset($location->region_slug) ? $location->region_slug : '';
834
+				$gd_city    = isset($location->city_slug) ? $location->city_slug : '';
835 835
 			}
836 836
 
837
-			if ( $geodir_show_location_url == 'all' ) {
837
+			if ($geodir_show_location_url == 'all') {
838 838
 				$location_url[] = $gd_country;
839 839
 				$location_url[] = $gd_region;
840
-			} else if ( $geodir_show_location_url == 'country_city' ) {
840
+			} else if ($geodir_show_location_url == 'country_city') {
841 841
 				$location_url[] = $gd_country;
842
-			} else if ( $geodir_show_location_url == 'region_city' ) {
842
+			} else if ($geodir_show_location_url == 'region_city') {
843 843
 				$location_url[] = $gd_region;
844 844
 			}
845 845
 
846 846
 			$location_url[] = $gd_city;
847 847
 
848
-			$location_url = implode( '/', $location_url );
848
+			$location_url = implode('/', $location_url);
849 849
 		}
850 850
 
851 851
 
852
-		if ( ! empty( $category ) ) {
852
+		if (!empty($category)) {
853 853
 			global $geodir_add_location_url;
854 854
 			$geodir_add_location_url = '0';
855
-			if ( $add_location_filter != '0' ) {
855
+			if ($add_location_filter != '0') {
856 856
 				$geodir_add_location_url = '1';
857 857
 			}
858
-			$viewall_url             = get_term_link( (int) $category[0], $post_type . $category_taxonomy );
858
+			$viewall_url             = get_term_link((int) $category[0], $post_type.$category_taxonomy);
859 859
 			$geodir_add_location_url = null;
860 860
 		}
861 861
 		ob_start();
@@ -865,24 +865,24 @@  discard block
 block discarded – undo
865 865
 		<div class="geodir_locations geodir_location_listing">
866 866
 
867 867
 			<?php
868
-			if ( isset( $request['is_widget'] ) && $request['is_widget'] == '1' ) {
868
+			if (isset($request['is_widget']) && $request['is_widget'] == '1') {
869 869
 				/** geodir_before_title filter Documented in geodirectory_widgets.php */
870
-				$before_title = isset( $before_title ) ? $before_title : apply_filters( 'geodir_before_title', '<h3 class="widget-title">' );
870
+				$before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
871 871
 				/** geodir_after_title filter Documented in geodirectory_widgets.php */
872
-				$after_title = isset( $after_title ) ? $after_title : apply_filters( 'geodir_after_title', '</h3>' );
872
+				$after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
873 873
 				?>
874 874
 				<div class="location_list_heading clearfix">
875
-					<?php echo $before_title . $title . $after_title; ?>
875
+					<?php echo $before_title.$title.$after_title; ?>
876 876
 				</div>
877 877
 				<?php
878 878
 			}
879 879
 			$query_args = array(
880 880
 				'posts_per_page'   => $post_number,
881 881
 				'is_geodir_loop'   => true,
882
-				'gd_location'      => ( $add_location_filter ) ? true : false,
882
+				'gd_location'      => ($add_location_filter) ? true : false,
883 883
 				'post_type'        => $post_type,
884 884
 				'order_by'         => $list_sort,
885
-				'post__not_in'     => array( $post_id ),
885
+				'post__not_in'     => array($post_id),
886 886
 				'excerpt_length'   => $character_count,
887 887
 				'related_listings' => $is_display
888 888
 			);
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
 				'terms'    => $category
894 894
 			);
895 895
 
896
-			$query_args['tax_query'] = array( $tax_query );
896
+			$query_args['tax_query'] = array($tax_query);
897 897
 
898 898
 			global $gridview_columns, $post;
899 899
 
@@ -905,21 +905,21 @@  discard block
 block discarded – undo
905 905
 			 * @param array $query_args The query array.
906 906
 			 * @param array $request Related posts request array.
907 907
 			 */
908
-			$query_args = apply_filters( 'geodir_related_posts_widget_query_args', $query_args, $request );
908
+			$query_args = apply_filters('geodir_related_posts_widget_query_args', $query_args, $request);
909 909
 
910
-			query_posts( $query_args );
910
+			query_posts($query_args);
911 911
 
912
-			if ( strstr( $layout, 'gridview' ) ) {
913
-				$listing_view_exp = explode( '_', $layout );
912
+			if (strstr($layout, 'gridview')) {
913
+				$listing_view_exp = explode('_', $layout);
914 914
 				$gridview_columns = $layout;
915 915
 				$layout           = $listing_view_exp[0];
916
-			} else if ( $layout == 'list' ) {
916
+			} else if ($layout == 'list') {
917 917
 				$gridview_columns = '';
918 918
 			}
919 919
 			$related_posts = true;
920 920
 
921 921
 			$related_nearest = false;
922
-			if ( $list_sort == 'nearest' ) {
922
+			if ($list_sort == 'nearest') {
923 923
 				$related_nearest = true;
924 924
 			}
925 925
 
@@ -929,14 +929,14 @@  discard block
 block discarded – undo
929 929
 			 *
930 930
 			 * @since 1.0.0
931 931
 			 */
932
-			$template = apply_filters( "geodir_template_part-related-listing-listview", geodir_locate_template( 'listing-listview' ) );
932
+			$template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview'));
933 933
 
934 934
 			/**
935 935
 			 * Includes related listing listview template.
936 936
 			 *
937 937
 			 * @since 1.0.0
938 938
 			 */
939
-			include( $template );
939
+			include($template);
940 940
 
941 941
 			wp_reset_query();
942 942
 			$post            = $origi_post;
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
 function geodir_category_count_script() {
965 965
 	global $geodir_post_category_str;
966 966
 
967
-	if ( ! empty( $geodir_post_category_str ) ) {
968
-		$geodir_post_category_str = serialize( $geodir_post_category_str );
967
+	if (!empty($geodir_post_category_str)) {
968
+		$geodir_post_category_str = serialize($geodir_post_category_str);
969 969
 	}
970 970
 
971
-	$all_var['post_category_array'] = html_entity_decode( (string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8' );
972
-	$script                         = "var post_category_array = " . json_encode( $all_var ) . ';';
971
+	$all_var['post_category_array'] = html_entity_decode((string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8');
972
+	$script                         = "var post_category_array = ".json_encode($all_var).';';
973 973
 	echo '<script>';
974 974
 	echo $script;
975 975
 	echo '</script>';
@@ -984,8 +984,8 @@  discard block
 block discarded – undo
984 984
  * @return string Returns the default language.
985 985
  */
986 986
 function geodir_get_map_default_language() {
987
-	$geodir_default_map_language = get_option( 'geodir_default_map_language' );
988
-	if ( empty( $geodir_default_map_language ) ) {
987
+	$geodir_default_map_language = get_option('geodir_default_map_language');
988
+	if (empty($geodir_default_map_language)) {
989 989
 		$geodir_default_map_language = 'en';
990 990
 	}
991 991
 
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 	 *
997 997
 	 * @param string $geodir_default_map_language Default map language.
998 998
 	 */
999
-	return apply_filters( 'geodir_default_map_language', $geodir_default_map_language );
999
+	return apply_filters('geodir_default_map_language', $geodir_default_map_language);
1000 1000
 }
1001 1001
 
1002 1002
 /**
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
  * @return string Returns the api key.
1008 1008
  */
1009 1009
 function geodir_get_map_api_key() {
1010
-	$key = get_option( 'geodir_google_api_key' );
1010
+	$key = get_option('geodir_google_api_key');
1011 1011
 
1012 1012
 	/**
1013 1013
 	 * Filter Google maps api key.
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 	 *
1017 1017
 	 * @param string $key Google maps api key.
1018 1018
 	 */
1019
-	return apply_filters( 'geodir_google_api_key', $key );
1019
+	return apply_filters('geodir_google_api_key', $key);
1020 1020
 }
1021 1021
 
1022 1022
 
@@ -1035,20 +1035,20 @@  discard block
 block discarded – undo
1035 1035
 	global $wp, $post, $wp_query, $wpdb, $geodir_addon_list;
1036 1036
 
1037 1037
 	$is_geodir_page = geodir_is_geodir_page();
1038
-	if ( ! $is_geodir_page ) {
1038
+	if (!$is_geodir_page) {
1039 1039
 		return;
1040 1040
 	}// if non GD page, bail
1041 1041
 
1042 1042
 	$use_gd_meta = true;
1043
-	if ( class_exists( 'WPSEO_Frontend' ) || class_exists( 'All_in_One_SEO_Pack' ) ) {
1043
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1044 1044
 		$use_gd_meta = false;
1045 1045
 
1046
-		if ( geodir_is_page( 'search' ) ) {
1046
+		if (geodir_is_page('search')) {
1047 1047
 			$use_gd_meta = true;
1048 1048
 		}
1049 1049
 	}
1050 1050
 
1051
-	if ( ! $use_gd_meta ) {
1051
+	if (!$use_gd_meta) {
1052 1052
 		return;
1053 1053
 	}// bail if Yoast Wordpress SEO or All_in_One_SEO_Pack active.
1054 1054
 
@@ -1056,170 +1056,170 @@  discard block
 block discarded – undo
1056 1056
 
1057 1057
 	$all_postypes = geodir_get_posttypes();
1058 1058
 
1059
-	$geodir_taxonomies = geodir_get_taxonomies( '', true );
1059
+	$geodir_taxonomies = geodir_get_taxonomies('', true);
1060 1060
 
1061 1061
 	$meta_desc = '';
1062 1062
 	$meta_key  = '';
1063
-	if ( isset( $current_term->ID ) && $current_term->ID == geodir_location_page_id() ) {
1063
+	if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
1064 1064
 		/**
1065 1065
 		 * Filter SEO meta location description.
1066 1066
 		 *
1067 1067
 		 * @since 1.0.0
1068 1068
 		 */
1069
-		$meta_desc = apply_filters( 'geodir_seo_meta_location_description', '' );
1069
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', '');
1070 1070
 		$meta_desc .= '';
1071 1071
 	}
1072
-	if ( have_posts() && is_single() OR is_page() ) {
1073
-		while ( have_posts() ) {
1072
+	if (have_posts() && is_single() OR is_page()) {
1073
+		while (have_posts()) {
1074 1074
 			the_post();
1075 1075
 
1076
-			if ( has_excerpt() ) {
1077
-				$out_excerpt = strip_tags( strip_shortcodes( get_the_excerpt() ) );
1078
-				if ( empty( $out_excerpt ) ) {
1079
-					$out_excerpt = strip_tags( do_shortcode( get_the_excerpt() ) );
1076
+			if (has_excerpt()) {
1077
+				$out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt()));
1078
+				if (empty($out_excerpt)) {
1079
+					$out_excerpt = strip_tags(do_shortcode(get_the_excerpt()));
1080 1080
 				}
1081
-				$out_excerpt = str_replace( array( "\r\n", "\r", "\n" ), "", $out_excerpt );
1081
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
1082 1082
 			} else {
1083
-				$out_excerpt = str_replace( array( "\r\n", "\r", "\n" ), "", $post->post_content );
1084
-				$out_excerpt = strip_tags( strip_shortcodes( $out_excerpt ) );
1085
-				if ( empty( $out_excerpt ) ) {
1086
-					$out_excerpt = strip_tags( do_shortcode( $out_excerpt ) ); // parse short code from content
1083
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
1084
+				$out_excerpt = strip_tags(strip_shortcodes($out_excerpt));
1085
+				if (empty($out_excerpt)) {
1086
+					$out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content
1087 1087
 				}
1088
-				$out_excerpt = trim( wp_trim_words( $out_excerpt, 35, '' ), '.!?,;:-' );
1088
+				$out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-');
1089 1089
 			}
1090 1090
 
1091 1091
 			$meta_desc .= $out_excerpt;
1092 1092
 		}
1093
-	} elseif ( ( is_category() || is_tag() ) && isset( $current_term->taxonomy ) && in_array( $current_term->taxonomy, $geodir_taxonomies ) ) {
1094
-		if ( is_category() ) {
1095
-			$meta_desc .= __( "Posts related to Category:", 'geodirectory' ) . " " . ucfirst( single_cat_title( "", false ) );
1096
-		} elseif ( is_tag() ) {
1097
-			$meta_desc .= __( "Posts related to Tag:", 'geodirectory' ) . " " . ucfirst( single_tag_title( "", false ) );
1093
+	} elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1094
+		if (is_category()) {
1095
+			$meta_desc .= __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", false));
1096
+		} elseif (is_tag()) {
1097
+			$meta_desc .= __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", false));
1098 1098
 		}
1099
-	} elseif ( isset( $current_term->taxonomy ) && in_array( $current_term->taxonomy, $geodir_taxonomies ) ) {
1100
-		$meta_desc .= isset( $current_term->description ) ? $current_term->description : '';
1099
+	} elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1100
+		$meta_desc .= isset($current_term->description) ? $current_term->description : '';
1101 1101
 	}
1102 1102
 
1103 1103
 
1104 1104
 	$geodir_post_type       = geodir_get_current_posttype();
1105
-	$geodir_post_type_info  = get_post_type_object( $geodir_post_type );
1106
-	$geodir_is_page_listing = geodir_is_page( 'listing' ) ? true : false;
1107
-
1108
-	$category_taxonomy = geodir_get_taxonomies( $geodir_post_type );
1109
-	$tag_taxonomy      = geodir_get_taxonomies( $geodir_post_type, true );
1110
-
1111
-	$geodir_is_category = isset( $category_taxonomy[0] ) && get_query_var( $category_taxonomy[0] ) ? get_query_var( $category_taxonomy[0] ) : false;
1112
-	$geodir_is_tag      = isset( $tag_taxonomy[0] ) && get_query_var( $tag_taxonomy[0] ) ? true : false;
1113
-
1114
-	$geodir_is_search        = geodir_is_page( 'search' ) ? true : false;
1115
-	$geodir_is_location      = geodir_is_page( 'location' ) ? true : false;
1116
-	$geodir_location_manager = isset( $geodir_addon_list['geodir_location_manager'] ) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1117
-	$godir_location_terms    = geodir_get_current_location_terms( 'query_vars' );
1118
-	$gd_city                 = $geodir_location_manager && isset( $godir_location_terms['gd_city'] ) ? $godir_location_terms['gd_city'] : null;
1119
-	$gd_region               = $geodir_location_manager && isset( $godir_location_terms['gd_region'] ) ? $godir_location_terms['gd_region'] : null;
1120
-	$gd_country              = $geodir_location_manager && isset( $godir_location_terms['gd_country'] ) ? $godir_location_terms['gd_country'] : null;
1121
-	$replace_location        = __( 'Everywhere', 'geodirectory' );
1105
+	$geodir_post_type_info  = get_post_type_object($geodir_post_type);
1106
+	$geodir_is_page_listing = geodir_is_page('listing') ? true : false;
1107
+
1108
+	$category_taxonomy = geodir_get_taxonomies($geodir_post_type);
1109
+	$tag_taxonomy      = geodir_get_taxonomies($geodir_post_type, true);
1110
+
1111
+	$geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false;
1112
+	$geodir_is_tag      = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false;
1113
+
1114
+	$geodir_is_search        = geodir_is_page('search') ? true : false;
1115
+	$geodir_is_location      = geodir_is_page('location') ? true : false;
1116
+	$geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1117
+	$godir_location_terms    = geodir_get_current_location_terms('query_vars');
1118
+	$gd_city                 = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : null;
1119
+	$gd_region               = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : null;
1120
+	$gd_country              = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : null;
1121
+	$replace_location        = __('Everywhere', 'geodirectory');
1122 1122
 	$location_id             = null;
1123
-	if ( $geodir_location_manager ) {
1124
-		$sql           = $wpdb->prepare( "SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array( $gd_city ) );
1125
-		$location_id   = (int) $wpdb->get_var( $sql );
1123
+	if ($geodir_location_manager) {
1124
+		$sql           = $wpdb->prepare("SELECT location_id FROM ".POST_LOCATION_TABLE." WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1125
+		$location_id   = (int) $wpdb->get_var($sql);
1126 1126
 		$location_type = geodir_what_is_current_location();
1127
-		if ( $location_type == 'city' ) {
1128
-			$replace_location = geodir_get_current_location( array( 'what' => 'city', 'echo' => false ) );
1129
-		} elseif ( $location_type == 'region' ) {
1130
-			$replace_location = geodir_get_current_location( array( 'what' => 'region', 'echo' => false ) );
1131
-		} elseif ( $location_type == 'country' ) {
1132
-			$replace_location = geodir_get_current_location( array( 'what' => 'country', 'echo' => false ) );
1133
-			$replace_location = __( $replace_location, 'geodirectory' );
1127
+		if ($location_type == 'city') {
1128
+			$replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
1129
+		} elseif ($location_type == 'region') {
1130
+			$replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
1131
+		} elseif ($location_type == 'country') {
1132
+			$replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
1133
+			$replace_location = __($replace_location, 'geodirectory');
1134 1134
 		}
1135
-		$country          = get_query_var( 'gd_country' );
1136
-		$region           = get_query_var( 'gd_region' );
1137
-		$city             = get_query_var( 'gd_city' );
1135
+		$country          = get_query_var('gd_country');
1136
+		$region           = get_query_var('gd_region');
1137
+		$city             = get_query_var('gd_city');
1138 1138
 		$current_location = '';
1139
-		if ( $country != '' ) {
1140
-			$current_location = get_actual_location_name( 'country', $country, true );
1139
+		if ($country != '') {
1140
+			$current_location = get_actual_location_name('country', $country, true);
1141 1141
 		}
1142
-		if ( $region != '' ) {
1143
-			$current_location = get_actual_location_name( 'region', $region );
1142
+		if ($region != '') {
1143
+			$current_location = get_actual_location_name('region', $region);
1144 1144
 		}
1145
-		if ( $city != '' ) {
1146
-			$current_location = get_actual_location_name( 'city', $city );
1145
+		if ($city != '') {
1146
+			$current_location = get_actual_location_name('city', $city);
1147 1147
 		}
1148 1148
 		$replace_location = $current_location != '' ? $current_location : $replace_location;
1149 1149
 	}
1150 1150
 
1151 1151
 	$geodir_meta_keys = '';
1152 1152
 	$geodir_meta_desc = '';
1153
-	if ( $is_geodir_page && ! empty( $geodir_post_type_info ) ) {
1154
-		if ( $geodir_is_page_listing || $geodir_is_search || geodir_is_page( 'add-listing' ) ) {
1155
-			$geodir_meta_keys = isset( $geodir_post_type_info->seo['meta_keyword'] ) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1153
+	if ($is_geodir_page && !empty($geodir_post_type_info)) {
1154
+		if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
1155
+			$geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1156 1156
 
1157
-			$geodir_meta_desc = isset( $geodir_post_type_info->description ) ? $geodir_post_type_info->description : $geodir_meta_desc;
1158
-			$geodir_meta_desc = isset( $geodir_post_type_info->seo['meta_description'] ) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1157
+			$geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc;
1158
+			$geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1159 1159
 
1160
-			if ( $geodir_is_category ) {
1161
-				$category = $geodir_is_category ? get_term_by( 'slug', $geodir_is_category, $category_taxonomy[0] ) : null;
1162
-				if ( isset( $category->term_id ) && ! empty( $category->term_id ) ) {
1160
+			if ($geodir_is_category) {
1161
+				$category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : null;
1162
+				if (isset($category->term_id) && !empty($category->term_id)) {
1163 1163
 					$category_id   = $category->term_id;
1164
-					$category_desc = trim( $category->description ) != '' ? trim( $category->description ) : get_tax_meta( $category_id, 'ct_cat_top_desc', false, $geodir_post_type );
1165
-					if ( $location_id ) {
1166
-						$option_name    = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1167
-						$cat_loc_option = get_option( $option_name );
1168
-
1169
-						$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;
1170
-						if ( ! $gd_cat_loc_default ) {
1171
-							$option_name   = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1172
-							$option        = get_option( $option_name );
1173
-							$category_desc = isset( $option['gd_cat_loc_desc'] ) && trim( $option['gd_cat_loc_desc'] ) != '' ? trim( $option['gd_cat_loc_desc'] ) : $category_desc;
1164
+					$category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1165
+					if ($location_id) {
1166
+						$option_name    = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id;
1167
+						$cat_loc_option = get_option($option_name);
1168
+
1169
+						$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;
1170
+						if (!$gd_cat_loc_default) {
1171
+							$option_name   = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id.'_'.$location_id;
1172
+							$option        = get_option($option_name);
1173
+							$category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1174 1174
 						}
1175 1175
 					}
1176
-					$geodir_meta_desc = __( "Posts related to Category:", 'geodirectory' ) . " " . ucfirst( single_cat_title( "", false ) ) . '. ' . $category_desc;
1176
+					$geodir_meta_desc = __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", false)).'. '.$category_desc;
1177 1177
 				}
1178
-			} else if ( $geodir_is_tag ) {
1179
-				$geodir_meta_desc = __( "Posts related to Tag:", 'geodirectory' ) . " " . ucfirst( single_tag_title( "", false ) ) . '. ' . $geodir_meta_desc;
1178
+			} else if ($geodir_is_tag) {
1179
+				$geodir_meta_desc = __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", false)).'. '.$geodir_meta_desc;
1180 1180
 			}
1181 1181
 		}
1182 1182
 	}
1183 1183
 
1184 1184
 
1185 1185
 	$gd_page = '';
1186
-	if ( geodir_is_page( 'home' ) ) {
1186
+	if (geodir_is_page('home')) {
1187 1187
 		$gd_page   = 'home';
1188
-		$meta_desc = ( get_option( 'geodir_meta_desc_homepage' ) ) ? get_option( 'geodir_meta_desc_homepage' ) : $meta_desc;
1189
-	} elseif ( geodir_is_page( 'detail' ) ) {
1188
+		$meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1189
+	} elseif (geodir_is_page('detail')) {
1190 1190
 		$gd_page   = 'detail';
1191
-		$meta_desc = ( get_option( 'geodir_meta_desc_detail' ) ) ? get_option( 'geodir_meta_desc_detail' ) : $meta_desc;
1192
-	} elseif ( geodir_is_page( 'pt' ) ) {
1191
+		$meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1192
+	} elseif (geodir_is_page('pt')) {
1193 1193
 		$gd_page   = 'pt';
1194
-		$meta_desc = ( get_option( 'geodir_meta_desc_pt' ) ) ? get_option( 'geodir_meta_desc_pt' ) : $meta_desc;
1195
-	} elseif ( geodir_is_page( 'listing' ) ) {
1194
+		$meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1195
+	} elseif (geodir_is_page('listing')) {
1196 1196
 		$gd_page   = 'listing';
1197
-		$meta_desc = ( get_option( 'geodir_meta_desc_listing' ) ) ? get_option( 'geodir_meta_desc_listing' ) : $meta_desc;
1198
-	} elseif ( geodir_is_page( 'location' ) ) {
1197
+		$meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1198
+	} elseif (geodir_is_page('location')) {
1199 1199
 		$gd_page   = 'location';
1200
-		$meta_desc = ( get_option( 'geodir_meta_desc_location' ) ) ? get_option( 'geodir_meta_desc_location' ) : $meta_desc;
1201
-		$meta_desc = apply_filters( 'geodir_seo_meta_location_description', $meta_desc );
1200
+		$meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1201
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1202 1202
 
1203
-	} elseif ( geodir_is_page( 'search' ) ) {
1203
+	} elseif (geodir_is_page('search')) {
1204 1204
 		$gd_page   = 'search';
1205
-		$meta_desc = ( get_option( 'geodir_meta_desc_search' ) ) ? get_option( 'geodir_meta_desc_search' ) : $meta_desc;
1206
-	} elseif ( geodir_is_page( 'add-listing' ) ) {
1205
+		$meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1206
+	} elseif (geodir_is_page('add-listing')) {
1207 1207
 		$gd_page   = 'add-listing';
1208
-		$meta_desc = ( get_option( 'geodir_meta_desc_add-listing' ) ) ? get_option( 'geodir_meta_desc_add-listing' ) : $meta_desc;
1209
-	} elseif ( geodir_is_page( 'author' ) ) {
1208
+		$meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1209
+	} elseif (geodir_is_page('author')) {
1210 1210
 		$gd_page   = 'author';
1211
-		$meta_desc = ( get_option( 'geodir_meta_desc_author' ) ) ? get_option( 'geodir_meta_desc_author' ) : $meta_desc;
1212
-	} elseif ( geodir_is_page( 'login' ) ) {
1211
+		$meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1212
+	} elseif (geodir_is_page('login')) {
1213 1213
 		$gd_page   = 'login';
1214
-		$meta_desc = ( get_option( 'geodir_meta_desc_login' ) ) ? get_option( 'geodir_meta_desc_login' ) : $meta_desc;
1215
-	} elseif ( geodir_is_page( 'listing-success' ) ) {
1214
+		$meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1215
+	} elseif (geodir_is_page('listing-success')) {
1216 1216
 		$gd_page   = 'listing-success';
1217
-		$meta_desc = ( get_option( 'geodir_meta_desc_listing-success' ) ) ? get_option( 'geodir_meta_desc_listing-success' ) : $meta_desc;
1217
+		$meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1218 1218
 	}
1219 1219
 
1220 1220
 
1221
-	if ( $meta_desc ) {
1222
-		$meta_desc = stripslashes_deep( $meta_desc );
1221
+	if ($meta_desc) {
1222
+		$meta_desc = stripslashes_deep($meta_desc);
1223 1223
 		/**
1224 1224
 		 * Filter page description to replace variables.
1225 1225
 		 *
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
 		 * @param string $title   The page description including variables.
1229 1229
 		 * @param string $gd_page The GeoDirectory page type if any.
1230 1230
 		 */
1231
-		$meta_desc = apply_filters( 'geodir_seo_meta_description_pre', __( $meta_desc, 'geodirectory' ), $gd_page, '' );
1231
+		$meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'), $gd_page, '');
1232 1232
 
1233 1233
 		/**
1234 1234
 		 * Filter SEO meta description.
@@ -1237,49 +1237,49 @@  discard block
 block discarded – undo
1237 1237
 		 *
1238 1238
 		 * @param string $meta_desc Meta description content.
1239 1239
 		 */
1240
-		echo apply_filters( 'geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc );
1240
+		echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="'.$meta_desc.'" />', $meta_desc);
1241 1241
 	}
1242 1242
 
1243 1243
 	// meta keywords
1244
-	if ( isset( $post->post_type ) && in_array( $post->post_type, $all_postypes ) ) {
1245
-		$place_tags = wp_get_post_terms( $post->ID, $post->post_type . '_tags', array( "fields" => "names" ) );
1246
-		$place_cats = wp_get_post_terms( $post->ID, $post->post_type . 'category', array( "fields" => "names" ) );
1244
+	if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1245
+		$place_tags = wp_get_post_terms($post->ID, $post->post_type.'_tags', array("fields" => "names"));
1246
+		$place_cats = wp_get_post_terms($post->ID, $post->post_type.'category', array("fields" => "names"));
1247 1247
 
1248
-		$meta_key .= implode( ", ", array_merge( (array) $place_cats, (array) $place_tags ) );
1248
+		$meta_key .= implode(", ", array_merge((array) $place_cats, (array) $place_tags));
1249 1249
 	} else {
1250 1250
 		$posttags = get_the_tags();
1251
-		if ( $posttags ) {
1252
-			foreach ( $posttags as $tag ) {
1253
-				$meta_key .= $tag->name . ' ';
1251
+		if ($posttags) {
1252
+			foreach ($posttags as $tag) {
1253
+				$meta_key .= $tag->name.' ';
1254 1254
 			}
1255 1255
 		} else {
1256
-			$tags = get_tags( array( 'orderby' => 'count', 'order' => 'DESC' ) );
1256
+			$tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
1257 1257
 			$xt   = 1;
1258 1258
 
1259
-			foreach ( $tags as $tag ) {
1260
-				if ( $xt <= 20 ) {
1261
-					$meta_key .= $tag->name . ", ";
1259
+			foreach ($tags as $tag) {
1260
+				if ($xt <= 20) {
1261
+					$meta_key .= $tag->name.", ";
1262 1262
 				}
1263 1263
 
1264
-				$xt ++;
1264
+				$xt++;
1265 1265
 			}
1266 1266
 		}
1267 1267
 	}
1268 1268
 
1269
-	$meta_key         = $meta_key != '' ? rtrim( trim( $meta_key ), "," ) : $meta_key;
1270
-	$geodir_meta_keys = $geodir_meta_keys != '' ? ( $meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys ) : $meta_key;
1271
-	if ( $geodir_meta_keys != '' ) {
1272
-		$geodir_meta_keys = strip_tags( $geodir_meta_keys );
1273
-		$geodir_meta_keys = esc_html( $geodir_meta_keys );
1274
-		$geodir_meta_keys = geodir_strtolower( $geodir_meta_keys );
1275
-		$geodir_meta_keys = wp_html_excerpt( $geodir_meta_keys, 1000, '' );
1276
-		$geodir_meta_keys = str_replace( '%location%', $replace_location, $geodir_meta_keys );
1269
+	$meta_key         = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1270
+	$geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key.', '.$geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1271
+	if ($geodir_meta_keys != '') {
1272
+		$geodir_meta_keys = strip_tags($geodir_meta_keys);
1273
+		$geodir_meta_keys = esc_html($geodir_meta_keys);
1274
+		$geodir_meta_keys = geodir_strtolower($geodir_meta_keys);
1275
+		$geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, '');
1276
+		$geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
1277 1277
 
1278
-		$meta_key = rtrim( trim( $geodir_meta_keys ), "," );
1278
+		$meta_key = rtrim(trim($geodir_meta_keys), ",");
1279 1279
 	}
1280 1280
 
1281
-	if ( $meta_key ) {
1282
-		$meta_key = stripslashes_deep( $meta_key );
1281
+	if ($meta_key) {
1282
+		$meta_key = stripslashes_deep($meta_key);
1283 1283
 		/**
1284 1284
 		 * Filter SEO meta keywords.
1285 1285
 		 *
@@ -1287,7 +1287,7 @@  discard block
 block discarded – undo
1287 1287
 		 *
1288 1288
 		 * @param string $meta_desc Meta keywords.
1289 1289
 		 */
1290
-		echo apply_filters( 'geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key );
1290
+		echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="'.$meta_key.'" />', $meta_key);
1291 1291
 	}
1292 1292
 
1293 1293
 }
@@ -1307,8 +1307,8 @@  discard block
 block discarded – undo
1307 1307
 
1308 1308
 	$geodir_detail_page_tabs_array = geodir_detail_page_tabs_array();
1309 1309
 
1310
-	foreach ( $geodir_detail_page_tabs_array as $key => $tabs_obj ) {
1311
-		$geodir_detail_page_tabs_key_value_array[ $key ] = $tabs_obj['heading_text'];
1310
+	foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
1311
+		$geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text'];
1312 1312
 	}
1313 1313
 
1314 1314
 	return $geodir_detail_page_tabs_key_value_array;
@@ -1330,57 +1330,57 @@  discard block
 block discarded – undo
1330 1330
 	 * @since 1.0.0
1331 1331
 	 */
1332 1332
 	$arr_tabs['post_profile'] = array(
1333
-		'heading_text'  => __( 'Profile', 'geodirectory' ),
1333
+		'heading_text'  => __('Profile', 'geodirectory'),
1334 1334
 		'is_active_tab' => true,
1335
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_profile' ),
1335
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
1336 1336
 		'tab_content'   => ''
1337 1337
 	);
1338
-	$arr_tabs['post_info']    = array(
1339
-		'heading_text'  => __( 'More Info', 'geodirectory' ),
1338
+	$arr_tabs['post_info'] = array(
1339
+		'heading_text'  => __('More Info', 'geodirectory'),
1340 1340
 		'is_active_tab' => false,
1341
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_info' ),
1341
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
1342 1342
 		'tab_content'   => ''
1343 1343
 	);
1344 1344
 
1345 1345
 	$arr_tabs['post_images'] = array(
1346
-		'heading_text'  => __( 'Photo', 'geodirectory' ),
1346
+		'heading_text'  => __('Photo', 'geodirectory'),
1347 1347
 		'is_active_tab' => false,
1348
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_images' ),
1348
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
1349 1349
 		'tab_content'   => ''
1350 1350
 	);
1351 1351
 
1352 1352
 	$arr_tabs['post_video'] = array(
1353
-		'heading_text'  => __( 'Video', 'geodirectory' ),
1353
+		'heading_text'  => __('Video', 'geodirectory'),
1354 1354
 		'is_active_tab' => false,
1355
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_video' ),
1355
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
1356 1356
 		'tab_content'   => ''
1357 1357
 	);
1358 1358
 
1359 1359
 	$arr_tabs['special_offers'] = array(
1360
-		'heading_text'  => __( 'Special Offers', 'geodirectory' ),
1360
+		'heading_text'  => __('Special Offers', 'geodirectory'),
1361 1361
 		'is_active_tab' => false,
1362
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'special_offers' ),
1362
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
1363 1363
 		'tab_content'   => ''
1364 1364
 	);
1365 1365
 
1366 1366
 	$arr_tabs['post_map'] = array(
1367
-		'heading_text'  => __( 'Map', 'geodirectory' ),
1367
+		'heading_text'  => __('Map', 'geodirectory'),
1368 1368
 		'is_active_tab' => false,
1369
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_map' ),
1369
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
1370 1370
 		'tab_content'   => ''
1371 1371
 	);
1372 1372
 
1373 1373
 	$arr_tabs['reviews'] = array(
1374
-		'heading_text'  => __( 'Reviews', 'geodirectory' ),
1374
+		'heading_text'  => __('Reviews', 'geodirectory'),
1375 1375
 		'is_active_tab' => false,
1376
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'reviews' ),
1376
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
1377 1377
 		'tab_content'   => 'review display'
1378 1378
 	);
1379 1379
 
1380 1380
 	$arr_tabs['related_listing'] = array(
1381
-		'heading_text'  => __( 'Related Listing', 'geodirectory' ),
1381
+		'heading_text'  => __('Related Listing', 'geodirectory'),
1382 1382
 		'is_active_tab' => false,
1383
-		'is_display'    => apply_filters( 'geodir_detail_page_tab_is_display', true, 'related_listing' ),
1383
+		'is_display'    => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
1384 1384
 		'tab_content'   => ''
1385 1385
 	);
1386 1386
 
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 	 *
1390 1390
 	 * @since 1.0.0
1391 1391
 	 */
1392
-	return apply_filters( 'geodir_detail_page_tab_list_extend', $arr_tabs );
1392
+	return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
1393 1393
 
1394 1394
 
1395 1395
 }
@@ -1403,13 +1403,13 @@  discard block
 block discarded – undo
1403 1403
  * @return mixed|array Tabs array.
1404 1404
  */
1405 1405
 function geodir_detail_page_tabs_list() {
1406
-	$tabs_excluded = get_option( 'geodir_detail_page_tabs_excluded' );
1406
+	$tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
1407 1407
 	$tabs_array    = geodir_detail_page_tabs_array();
1408 1408
 
1409
-	if ( ! empty( $tabs_excluded ) ) {
1410
-		foreach ( $tabs_excluded as $tab ) {
1411
-			if ( array_key_exists( $tab, $tabs_array ) ) {
1412
-				unset( $tabs_array[ $tab ] );
1409
+	if (!empty($tabs_excluded)) {
1410
+		foreach ($tabs_excluded as $tab) {
1411
+			if (array_key_exists($tab, $tabs_array)) {
1412
+				unset($tabs_array[$tab]);
1413 1413
 			}
1414 1414
 		}
1415 1415
 	}
@@ -1433,58 +1433,58 @@  discard block
 block discarded – undo
1433 1433
 function geodir_show_detail_page_tabs() {
1434 1434
 	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields, $preview;
1435 1435
 
1436
-	$post_id            = ! empty( $post ) && isset( $post->ID ) ? (int) $post->ID : 0;
1437
-	$request_post_id    = ! empty( $_REQUEST['p'] ) ? (int) $_REQUEST['p'] : 0;
1438
-	$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
1436
+	$post_id            = !empty($post) && isset($post->ID) ? (int) $post->ID : 0;
1437
+	$request_post_id    = !empty($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
1438
+	$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
1439 1439
 
1440
-	if ( $is_backend_preview && ! $post_id > 0 && $request_post_id > 0 ) {
1441
-		$post = geodir_get_post_info( $request_post_id );
1442
-		setup_postdata( $post );
1440
+	if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
1441
+		$post = geodir_get_post_info($request_post_id);
1442
+		setup_postdata($post);
1443 1443
 	}
1444 1444
 
1445
-	$geodir_post_detail_fields = geodir_show_listing_info( 'moreinfo' );
1445
+	$geodir_post_detail_fields = geodir_show_listing_info('moreinfo');
1446 1446
 
1447 1447
 
1448
-	if ( geodir_is_page( 'detail' ) ) {
1449
-		$video                 = geodir_get_video( $post->ID );
1450
-		$special_offers        = geodir_get_special_offers( $post->ID );
1448
+	if (geodir_is_page('detail')) {
1449
+		$video                 = geodir_get_video($post->ID);
1450
+		$special_offers        = geodir_get_special_offers($post->ID);
1451 1451
 		$related_listing_array = array();
1452
-		if ( get_option( 'geodir_add_related_listing_posttypes' ) ) {
1453
-			$related_listing_array = get_option( 'geodir_add_related_listing_posttypes' );
1452
+		if (get_option('geodir_add_related_listing_posttypes')) {
1453
+			$related_listing_array = get_option('geodir_add_related_listing_posttypes');
1454 1454
 		}
1455 1455
 
1456 1456
 
1457
-		$excluded_tabs = get_option( 'geodir_detail_page_tabs_excluded' );
1458
-		if ( ! $excluded_tabs ) {
1457
+		$excluded_tabs = get_option('geodir_detail_page_tabs_excluded');
1458
+		if (!$excluded_tabs) {
1459 1459
 			$excluded_tabs = array();
1460 1460
 		}
1461 1461
 
1462 1462
 		$related_listing = '';
1463
-		if ( in_array( $post->post_type, $related_listing_array ) && ! in_array( 'related_listing', $excluded_tabs ) ) {
1463
+		if (in_array($post->post_type, $related_listing_array) && !in_array('related_listing', $excluded_tabs)) {
1464 1464
 			$request = array(
1465
-				'post_number'         => get_option( 'geodir_related_post_count' ),
1466
-				'relate_to'           => get_option( 'geodir_related_post_relate_to' ),
1467
-				'layout'              => get_option( 'geodir_related_post_listing_view' ),
1468
-				'add_location_filter' => get_option( 'geodir_related_post_location_filter' ),
1469
-				'list_sort'           => get_option( 'geodir_related_post_sortby' ),
1470
-				'character_count'     => get_option( 'geodir_related_post_excerpt' )
1465
+				'post_number'         => get_option('geodir_related_post_count'),
1466
+				'relate_to'           => get_option('geodir_related_post_relate_to'),
1467
+				'layout'              => get_option('geodir_related_post_listing_view'),
1468
+				'add_location_filter' => get_option('geodir_related_post_location_filter'),
1469
+				'list_sort'           => get_option('geodir_related_post_sortby'),
1470
+				'character_count'     => get_option('geodir_related_post_excerpt')
1471 1471
 			);
1472 1472
 
1473
-			if ( $post->post_type == 'gd_event' && defined( 'GDEVENTS_VERSION' ) ) {
1474
-				$related_listing = geodir_get_detail_page_related_events( $request );
1473
+			if ($post->post_type == 'gd_event' && defined('GDEVENTS_VERSION')) {
1474
+				$related_listing = geodir_get_detail_page_related_events($request);
1475 1475
 			} else {
1476
-				$related_listing = geodir_related_posts_display( $request );
1476
+				$related_listing = geodir_related_posts_display($request);
1477 1477
 			}
1478 1478
 
1479 1479
 		}
1480 1480
 
1481
-		$post_images = geodir_get_images( $post->ID, 'thumbnail' );
1481
+		$post_images = geodir_get_images($post->ID, 'thumbnail');
1482 1482
 		$thumb_image = '';
1483
-		if ( ! empty( $post_images ) ) {
1484
-			foreach ( $post_images as $image ) {
1485
-				$caption = ( ! empty( $image->caption ) ) ? $image->caption : '';
1486
-				$thumb_image .= '<a href="' . $image->src . '" title="' . $caption . '">';
1487
-				$thumb_image .= geodir_show_image( $image, 'thumbnail', true, false );
1483
+		if (!empty($post_images)) {
1484
+			foreach ($post_images as $image) {
1485
+				$caption = (!empty($image->caption)) ? $image->caption : '';
1486
+				$thumb_image .= '<a href="'.$image->src.'" title="'.$caption.'">';
1487
+				$thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1488 1488
 				$thumb_image .= '</a>';
1489 1489
 			}
1490 1490
 		}
@@ -1493,11 +1493,11 @@  discard block
 block discarded – undo
1493 1493
 		$map_args['map_canvas_name'] = 'detail_page_map_canvas';
1494 1494
 		$map_args['width']           = '600';
1495 1495
 		$map_args['height']          = '300';
1496
-		if ( $post->post_mapzoom ) {
1497
-			$map_args['zoom'] = '' . $post->post_mapzoom . '';
1496
+		if ($post->post_mapzoom) {
1497
+			$map_args['zoom'] = ''.$post->post_mapzoom.'';
1498 1498
 		}
1499 1499
 		$map_args['autozoom']                 = false;
1500
-		$map_args['scrollwheel']              = ( get_option( 'geodir_add_listing_mouse_scroll' ) ) ? 0 : 1;
1500
+		$map_args['scrollwheel']              = (get_option('geodir_add_listing_mouse_scroll')) ? 0 : 1;
1501 1501
 		$map_args['child_collapse']           = '0';
1502 1502
 		$map_args['enable_cat_filters']       = false;
1503 1503
 		$map_args['enable_text_search']       = false;
@@ -1506,43 +1506,43 @@  discard block
 block discarded – undo
1506 1506
 		$map_args['enable_jason_on_load']     = true;
1507 1507
 		$map_args['enable_map_direction']     = true;
1508 1508
 		$map_args['map_class_name']           = 'geodir-map-detail-page';
1509
-		$map_args['maptype']                  = ( ! empty( $post->post_mapview ) ) ? $post->post_mapview : 'ROADMAP';
1510
-	} else if ( geodir_is_page( 'preview' ) ) {
1511
-		$video          = isset( $post->geodir_video ) ? $post->geodir_video : '';
1512
-		$special_offers = isset( $post->geodir_special_offers ) ? $post->geodir_special_offers : '';
1509
+		$map_args['maptype']                  = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
1510
+	} else if (geodir_is_page('preview')) {
1511
+		$video          = isset($post->geodir_video) ? $post->geodir_video : '';
1512
+		$special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : '';
1513 1513
 
1514
-		if ( isset( $post->post_images ) ) {
1515
-			$post->post_images = trim( $post->post_images, "," );
1514
+		if (isset($post->post_images)) {
1515
+			$post->post_images = trim($post->post_images, ",");
1516 1516
 		}
1517 1517
 
1518
-		if ( isset( $post->post_images ) && ! empty( $post->post_images ) ) {
1519
-			$post_images = explode( ",", $post->post_images );
1518
+		if (isset($post->post_images) && !empty($post->post_images)) {
1519
+			$post_images = explode(",", $post->post_images);
1520 1520
 		}
1521 1521
 
1522 1522
 		$thumb_image = '';
1523
-		if ( ! empty( $post_images ) ) {
1524
-			foreach ( $post_images as $image ) {
1525
-				if ( $image != '' ) {
1526
-					$thumb_image .= '<a href="' . $image . '">';
1527
-					$thumb_image .= geodir_show_image( array( 'src' => $image ), 'thumbnail', true, false );
1523
+		if (!empty($post_images)) {
1524
+			foreach ($post_images as $image) {
1525
+				if ($image != '') {
1526
+					$thumb_image .= '<a href="'.$image.'">';
1527
+					$thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1528 1528
 					$thumb_image .= '</a>';
1529 1529
 				}
1530 1530
 			}
1531 1531
 		}
1532 1532
 
1533 1533
 		global $map_jason;
1534
-		$marker_json      = $post->marker_json != '' ? json_decode( $post->marker_json, true ) : array();
1535
-		$marker_icon      = ( ! empty( $marker_json ) && ! empty( $marker_json['i'] ) ) ? $marker_json['i'] : '';
1536
-		$icon_size        = geodir_get_marker_size( $marker_icon );
1534
+		$marker_json      = $post->marker_json != '' ? json_decode($post->marker_json, true) : array();
1535
+		$marker_icon      = (!empty($marker_json) && !empty($marker_json['i'])) ? $marker_json['i'] : '';
1536
+		$icon_size        = geodir_get_marker_size($marker_icon);
1537 1537
 		$marker_json['w'] = $icon_size['w'];
1538 1538
 		$marker_json['h'] = $icon_size['h'];
1539
-		$map_jason[]      = json_encode( $marker_json );
1539
+		$map_jason[]      = json_encode($marker_json);
1540 1540
 
1541
-		$address_latitude  = isset( $post->post_latitude ) ? $post->post_latitude : '';
1542
-		$address_longitude = isset( $post->post_longitude ) ? $post->post_longitude : '';
1543
-		$mapview           = isset( $post->post_mapview ) ? $post->post_mapview : '';
1544
-		$mapzoom           = isset( $post->post_mapzoom ) ? $post->post_mapzoom : '';
1545
-		if ( ! $mapzoom ) {
1541
+		$address_latitude  = isset($post->post_latitude) ? $post->post_latitude : '';
1542
+		$address_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
1543
+		$mapview           = isset($post->post_mapview) ? $post->post_mapview : '';
1544
+		$mapzoom           = isset($post->post_mapzoom) ? $post->post_mapzoom : '';
1545
+		if (!$mapzoom) {
1546 1546
 			$mapzoom = 12;
1547 1547
 		}
1548 1548
 
@@ -1565,37 +1565,37 @@  discard block
 block discarded – undo
1565 1565
 		$map_args['map_class_name']           = 'geodir-map-preview-page';
1566 1566
 	}
1567 1567
 
1568
-	$arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1568
+	$arr_detail_page_tabs = geodir_detail_page_tabs_list(); // get this sooner so we can get the active tab for the user
1569 1569
 
1570 1570
 	$active_tab       = '';
1571 1571
 	$active_tab_name  = '';
1572 1572
 	$default_tab      = '';
1573 1573
 	$default_tab_name = '';
1574
-	foreach ( $arr_detail_page_tabs as $tab_index => $tabs ) {
1575
-		if ( isset( $tabs['is_active_tab'] ) && $tabs['is_active_tab'] && ! empty( $tabs['is_display'] ) && isset( $tabs['heading_text'] ) && $tabs['heading_text'] ) {
1574
+	foreach ($arr_detail_page_tabs as $tab_index => $tabs) {
1575
+		if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1576 1576
 			$active_tab      = $tab_index;
1577
-			$active_tab_name = __( $tabs['heading_text'], 'geodirectory' );
1577
+			$active_tab_name = __($tabs['heading_text'], 'geodirectory');
1578 1578
 		}
1579 1579
 
1580
-		if ( $default_tab === '' && ! empty( $tabs['is_display'] ) && ! empty( $tabs['heading_text'] ) ) {
1580
+		if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
1581 1581
 			$default_tab      = $tab_index;
1582
-			$default_tab_name = __( $tabs['heading_text'], 'geodirectory' );
1582
+			$default_tab_name = __($tabs['heading_text'], 'geodirectory');
1583 1583
 		}
1584 1584
 	}
1585 1585
 
1586
-	if ( $active_tab === '' && $default_tab !== '' ) { // Make first tab acs a active tab if not any tab is active.
1587
-		if ( isset( $arr_detail_page_tabs[ $active_tab ] ) && isset( $arr_detail_page_tabs[ $active_tab ]['is_active_tab'] ) ) {
1588
-			$arr_detail_page_tabs[ $active_tab ]['is_active_tab'] = false;
1586
+	if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active.
1587
+		if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
1588
+			$arr_detail_page_tabs[$active_tab]['is_active_tab'] = false;
1589 1589
 		}
1590 1590
 
1591
-		$arr_detail_page_tabs[ $default_tab ]['is_active_tab'] = true;
1591
+		$arr_detail_page_tabs[$default_tab]['is_active_tab'] = true;
1592 1592
 		$active_tab                                            = $default_tab;
1593 1593
 		$active_tab_name                                       = $default_tab_name;
1594 1594
 	}
1595
-	$tab_list = ( get_option( 'geodir_disable_tabs', false ) ) ? true : false;
1595
+	$tab_list = (get_option('geodir_disable_tabs', false)) ? true : false;
1596 1596
 	?>
1597 1597
 	<div class="geodir-tabs" id="gd-tabs" style="position:relative;">
1598
-		<?php if ( ! $tab_list ){ ?>
1598
+		<?php if (!$tab_list) { ?>
1599 1599
 		<div id="geodir-tab-mobile-menu">
1600 1600
 			<i class="fa fa-bars"></i>
1601 1601
 			<span class="geodir-mobile-active-tab"><?php echo $active_tab_name; ?></span>
@@ -1610,26 +1610,26 @@  discard block
 block discarded – undo
1610 1610
 			 * @since 1.0.0
1611 1611
 			 * @see   'geodir_after_tab_list'
1612 1612
 			 */
1613
-			do_action( 'geodir_before_tab_list' ); ?>
1613
+			do_action('geodir_before_tab_list'); ?>
1614 1614
 			<?php
1615 1615
 
1616
-			foreach ( $arr_detail_page_tabs as $tab_index => $detail_page_tab ) {
1617
-				if ( $detail_page_tab['is_display'] ) {
1616
+			foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1617
+				if ($detail_page_tab['is_display']) {
1618 1618
 
1619
-					if ( ! $tab_list ) {
1619
+					if (!$tab_list) {
1620 1620
 						?>
1621 1621
 						<dt></dt> <!-- added to comply with validation -->
1622
-						<dd <?php if ( $detail_page_tab['is_active_tab'] ){ ?>class="geodir-tab-active"<?php } ?> ><a
1622
+						<dd <?php if ($detail_page_tab['is_active_tab']) { ?>class="geodir-tab-active"<?php } ?> ><a
1623 1623
 								data-tab="#<?php echo $tab_index; ?>"
1624
-								data-status="enable"><?php _e( $detail_page_tab['heading_text'], 'geodirectory' ); ?></a>
1624
+								data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a>
1625 1625
 						</dd>
1626 1626
 						<?php
1627 1627
 					}
1628 1628
 					ob_start() // start tab content buffering
1629 1629
 					?>
1630 1630
 					<li id="<?php echo $tab_index; ?>Tab">
1631
-						<?php if ( $tab_list ) {
1632
-							$tab_title = '<span class="gd-tab-list-title" ><a href="#' . $tab_index . '">' . __( $detail_page_tab['heading_text'], 'geodirectory' ) . '</a></span><hr />';
1631
+						<?php if ($tab_list) {
1632
+							$tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'], 'geodirectory').'</a></span><hr />';
1633 1633
 							/**
1634 1634
 							 * Filter the tab list title html.
1635 1635
 							 *
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
 							 * @param string $tab_index      The tab index type.
1640 1640
 							 * @param array $detail_page_tab The array of values including title text.
1641 1641
 							 */
1642
-							echo apply_filters( 'geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab );
1642
+							echo apply_filters('geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab);
1643 1643
 						} ?>
1644 1644
 						<div id="<?php echo $tab_index; ?>" class="hash-offset"></div>
1645 1645
 						<?php
@@ -1650,7 +1650,7 @@  discard block
 block discarded – undo
1650 1650
 						 *
1651 1651
 						 * @param string $tab_index The tab name ID.
1652 1652
 						 */
1653
-						do_action( 'geodir_before_tab_content', $tab_index );
1653
+						do_action('geodir_before_tab_content', $tab_index);
1654 1654
 
1655 1655
 						/**
1656 1656
 						 * Called before the details tab content is output per tab.
@@ -1660,21 +1660,21 @@  discard block
 block discarded – undo
1660 1660
 						 * @since 1.0.0
1661 1661
 						 * @todo  do we need this if we have the hook above? 'geodir_before_tab_content'
1662 1662
 						 */
1663
-						do_action( 'geodir_before_' . $tab_index . '_tab_content' );
1663
+						do_action('geodir_before_'.$tab_index.'_tab_content');
1664 1664
 						/// write a code to generate content of each tab
1665
-						switch ( $tab_index ) {
1665
+						switch ($tab_index) {
1666 1666
 							case 'post_profile':
1667 1667
 								/**
1668 1668
 								 * Called before the listing description content on the details page tab.
1669 1669
 								 *
1670 1670
 								 * @since 1.0.0
1671 1671
 								 */
1672
-								do_action( 'geodir_before_description_on_listing_detail' );
1673
-								if ( geodir_is_page( 'detail' ) ) {
1672
+								do_action('geodir_before_description_on_listing_detail');
1673
+								if (geodir_is_page('detail')) {
1674 1674
 									the_content();
1675 1675
 								} else {
1676 1676
 									/** This action is documented in geodirectory_template_actions.php */
1677
-									echo apply_filters( 'the_content', stripslashes( $post->post_desc ) );
1677
+									echo apply_filters('the_content', stripslashes($post->post_desc));
1678 1678
 								}
1679 1679
 
1680 1680
 								/**
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
 								 *
1683 1683
 								 * @since 1.0.0
1684 1684
 								 */
1685
-								do_action( 'geodir_after_description_on_listing_detail' );
1685
+								do_action('geodir_after_description_on_listing_detail');
1686 1686
 								break;
1687 1687
 							case 'post_info':
1688 1688
 								echo $geodir_post_detail_fields;
@@ -1692,32 +1692,32 @@  discard block
 block discarded – undo
1692 1692
 								break;
1693 1693
 							case 'post_video':
1694 1694
 								// some browsers hide $_POST data if used for embeds so we repalce with a placeholder
1695
-								if ( $preview ) {
1696
-									if ( $video ) {
1697
-										echo "<span class='gd-video-embed-preview' ><p class='gd-video-preview-text'><i class=\"fa fa-video-camera\" aria-hidden=\"true\"></i><br />" . __( 'Video Preview Placeholder', 'geodirectory' ) . "</p></span>";
1695
+								if ($preview) {
1696
+									if ($video) {
1697
+										echo "<span class='gd-video-embed-preview' ><p class='gd-video-preview-text'><i class=\"fa fa-video-camera\" aria-hidden=\"true\"></i><br />".__('Video Preview Placeholder', 'geodirectory')."</p></span>";
1698 1698
 									}
1699 1699
 								} else {
1700 1700
 
1701 1701
 									// stop payment manager filtering content length
1702
-									$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1703
-									if ( false !== $filter_priority ) {
1704
-										remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1702
+									$filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1703
+									if (false !== $filter_priority) {
1704
+										remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1705 1705
 									}
1706 1706
 
1707 1707
 									/** This action is documented in geodirectory_template_actions.php */
1708
-									echo apply_filters( 'the_content', stripslashes( $video ) );// we apply the_content filter so oembed works also;
1708
+									echo apply_filters('the_content', stripslashes($video)); // we apply the_content filter so oembed works also;
1709 1709
 
1710
-									if ( false !== $filter_priority ) {
1711
-										add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1710
+									if (false !== $filter_priority) {
1711
+										add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1712 1712
 									}
1713 1713
 								}
1714 1714
 								break;
1715 1715
 							case 'special_offers':
1716
-								echo apply_filters( 'gd_special_offers_content', wpautop( stripslashes( $special_offers ) ) );
1716
+								echo apply_filters('gd_special_offers_content', wpautop(stripslashes($special_offers)));
1717 1717
 
1718 1718
 								break;
1719 1719
 							case 'post_map':
1720
-								geodir_draw_map( $map_args );
1720
+								geodir_draw_map($map_args);
1721 1721
 								break;
1722 1722
 							case 'reviews':
1723 1723
 								comments_template();
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
 								echo $related_listing;
1727 1727
 								break;
1728 1728
 							default: {
1729
-								if ( ( isset( $post->{$tab_index} ) || ( ! isset( $post->{$tab_index} ) && ( strpos( $tab_index, 'gd_tab_' ) !== false || $tab_index == 'link_business' ) ) ) && ! empty( $detail_page_tab['tab_content'] ) ) {
1729
+								if ((isset($post->{$tab_index} ) || (!isset($post->{$tab_index} ) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
1730 1730
 									echo $detail_page_tab['tab_content'];
1731 1731
 								}
1732 1732
 							}
@@ -1738,7 +1738,7 @@  discard block
 block discarded – undo
1738 1738
 						 *
1739 1739
 						 * @since 1.0.0
1740 1740
 						 */
1741
-						do_action( 'geodir_after_tab_content', $tab_index );
1741
+						do_action('geodir_after_tab_content', $tab_index);
1742 1742
 
1743 1743
 						/**
1744 1744
 						 * Called after the details tab content is output per tab.
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
 						 * @since 1.0.0
1749 1749
 						 * @todo  do we need this if we have the hook above? 'geodir_after_tab_content'
1750 1750
 						 */
1751
-						do_action( 'geodir_after_' . $tab_index . '_tab_content' );
1751
+						do_action('geodir_after_'.$tab_index.'_tab_content');
1752 1752
 						?> </li>
1753 1753
 					<?php
1754 1754
 					/**
@@ -1756,7 +1756,7 @@  discard block
 block discarded – undo
1756 1756
 					 *
1757 1757
 					 * @since 1.0.0
1758 1758
 					 */
1759
-					$arr_detail_page_tabs[ $tab_index ]['tab_content'] = apply_filters( "geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean() );
1759
+					$arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_".$detail_page_tab['tab_content']."_tab_content", ob_get_clean());
1760 1760
 				} // end of if for is_display
1761 1761
 			}// end of foreach
1762 1762
 
@@ -1766,14 +1766,14 @@  discard block
 block discarded – undo
1766 1766
 			 * @since 1.0.0
1767 1767
 			 * @see   'geodir_before_tab_list'
1768 1768
 			 */
1769
-			do_action( 'geodir_after_tab_list' );
1769
+			do_action('geodir_after_tab_list');
1770 1770
 			?>
1771
-			<?php if ( ! $tab_list ){ ?></dl><?php } ?>
1772
-		<ul class="geodir-tabs-content entry-content <?php if ( $tab_list ) { ?>geodir-tabs-list<?php } ?>"
1771
+			<?php if (!$tab_list) { ?></dl><?php } ?>
1772
+		<ul class="geodir-tabs-content entry-content <?php if ($tab_list) { ?>geodir-tabs-list<?php } ?>"
1773 1773
 		    style="position:relative;">
1774 1774
 			<?php
1775
-			foreach ( $arr_detail_page_tabs as $detail_page_tab ) {
1776
-				if ( $detail_page_tab['is_display'] && ! empty( $detail_page_tab['tab_content'] ) ) {
1775
+			foreach ($arr_detail_page_tabs as $detail_page_tab) {
1776
+				if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
1777 1777
 					echo $detail_page_tab['tab_content'];
1778 1778
 				}// end of if
1779 1779
 			}// end of foreach
@@ -1783,11 +1783,11 @@  discard block
 block discarded – undo
1783 1783
 			 *
1784 1784
 			 * @since 1.0.0
1785 1785
 			 */
1786
-			do_action( 'geodir_add_tab_content' ); ?>
1786
+			do_action('geodir_add_tab_content'); ?>
1787 1787
 		</ul>
1788 1788
 		<!--gd-tabs-content ul end-->
1789 1789
 	</div>
1790
-	<?php if ( ! $tab_list ) { ?>
1790
+	<?php if (!$tab_list) { ?>
1791 1791
 		<script>
1792 1792
 			if (window.location.hash && window.location.hash.indexOf('&') === -1 && jQuery(window.location.hash + 'Tab').length) {
1793 1793
 				hashVal = window.location.hash;
@@ -1819,31 +1819,31 @@  discard block
 block discarded – undo
1819 1819
  *
1820 1820
  * @return mixed Image file.
1821 1821
  */
1822
-function geodir_exif( $file ) {
1823
-	if ( empty( $file ) || ! is_array( $file ) ) {
1822
+function geodir_exif($file) {
1823
+	if (empty($file) || !is_array($file)) {
1824 1824
 		return $file;
1825 1825
 	}
1826 1826
 
1827
-	$file_path = ! empty( $file['tmp_name'] ) ? sanitize_text_field( $file['tmp_name'] ) : '';
1828
-	if ( ! ( $file_path && file_exists( $file_path ) ) ) {
1827
+	$file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : '';
1828
+	if (!($file_path && file_exists($file_path))) {
1829 1829
 		return $file;
1830 1830
 	}
1831 1831
 	$file['file'] = $file_path;
1832 1832
 
1833
-	if ( ! file_is_valid_image( $file_path ) ) {
1833
+	if (!file_is_valid_image($file_path)) {
1834 1834
 		return $file; // Bail if file is not an image.
1835 1835
 	}
1836 1836
 
1837
-	if ( ! function_exists( 'wp_get_image_editor' ) ) {
1837
+	if (!function_exists('wp_get_image_editor')) {
1838 1838
 		return $file;
1839 1839
 	}
1840 1840
 
1841 1841
 	$mime_type = $file['type'];
1842 1842
 	$exif      = array();
1843
-	if ( $mime_type == 'image/jpeg' && function_exists( 'exif_read_data' ) ) {
1843
+	if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1844 1844
 		try {
1845
-			$exif = exif_read_data( $file_path );
1846
-		} catch ( Exception $e ) {
1845
+			$exif = exif_read_data($file_path);
1846
+		} catch (Exception $e) {
1847 1847
 			$exif = array();
1848 1848
 		}
1849 1849
 	}
@@ -1852,13 +1852,13 @@  discard block
 block discarded – undo
1852 1852
 	$flip        = false;
1853 1853
 	$modify      = false;
1854 1854
 	$orientation = 0;
1855
-	if ( ! empty( $exif ) && isset( $exif['Orientation'] ) ) {
1856
-		switch ( (int) $exif['Orientation'] ) {
1855
+	if (!empty($exif) && isset($exif['Orientation'])) {
1856
+		switch ((int) $exif['Orientation']) {
1857 1857
 			case 1:
1858 1858
 				// do nothing
1859 1859
 				break;
1860 1860
 			case 2:
1861
-				$flip   = array( false, true );
1861
+				$flip   = array(false, true);
1862 1862
 				$modify = true;
1863 1863
 				break;
1864 1864
 			case 3:
@@ -1867,13 +1867,13 @@  discard block
 block discarded – undo
1867 1867
 				$modify      = true;
1868 1868
 				break;
1869 1869
 			case 4:
1870
-				$flip   = array( true, false );
1870
+				$flip   = array(true, false);
1871 1871
 				$modify = true;
1872 1872
 				break;
1873 1873
 			case 5:
1874 1874
 				$orientation = - 90;
1875 1875
 				$rotate      = true;
1876
-				$flip        = array( false, true );
1876
+				$flip        = array(false, true);
1877 1877
 				$modify      = true;
1878 1878
 				break;
1879 1879
 			case 6:
@@ -1884,7 +1884,7 @@  discard block
 block discarded – undo
1884 1884
 			case 7:
1885 1885
 				$orientation = - 270;
1886 1886
 				$rotate      = true;
1887
-				$flip        = array( false, true );
1887
+				$flip        = array(false, true);
1888 1888
 				$modify      = true;
1889 1889
 				break;
1890 1890
 			case 8:
@@ -1910,31 +1910,31 @@  discard block
 block discarded – undo
1910 1910
 	 * @param int|null $quality Image Compression quality between 1-100% scale. Default null.
1911 1911
 	 * @param string $quality   Image mime type.
1912 1912
 	 */
1913
-	$quality = apply_filters( 'geodir_image_upload_set_quality', $quality, $mime_type );
1914
-	if ( $quality !== null ) {
1913
+	$quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
1914
+	if ($quality !== null) {
1915 1915
 		$modify = true;
1916 1916
 	}
1917 1917
 
1918
-	if ( ! $modify ) {
1918
+	if (!$modify) {
1919 1919
 		return $file; // no change
1920 1920
 	}
1921 1921
 
1922
-	$image = wp_get_image_editor( $file_path );
1923
-	if ( ! is_wp_error( $image ) ) {
1924
-		if ( $rotate ) {
1925
-			$image->rotate( $orientation );
1922
+	$image = wp_get_image_editor($file_path);
1923
+	if (!is_wp_error($image)) {
1924
+		if ($rotate) {
1925
+			$image->rotate($orientation);
1926 1926
 		}
1927 1927
 
1928
-		if ( ! empty( $flip ) ) {
1929
-			$image->flip( $flip[0], $flip[1] );
1928
+		if (!empty($flip)) {
1929
+			$image->flip($flip[0], $flip[1]);
1930 1930
 		}
1931 1931
 
1932
-		if ( $quality !== null ) {
1933
-			$image->set_quality( (int) $quality );
1932
+		if ($quality !== null) {
1933
+			$image->set_quality((int) $quality);
1934 1934
 		}
1935 1935
 
1936
-		$result = $image->save( $file_path );
1937
-		if ( ! is_wp_error( $result ) ) {
1936
+		$result = $image->save($file_path);
1937
+		if (!is_wp_error($result)) {
1938 1938
 			$file['file']     = $result['path'];
1939 1939
 			$file['tmp_name'] = $result['path'];
1940 1940
 		}
@@ -1961,7 +1961,7 @@  discard block
 block discarded – undo
1961 1961
  *
1962 1962
  * @return string Returns the recent reviews html.
1963 1963
  */
1964
-function geodir_get_recent_reviews( $g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false ) {
1964
+function geodir_get_recent_reviews($g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false) {
1965 1965
 	global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session;
1966 1966
 	$tablecomments = $wpdb->comments;
1967 1967
 	$tableposts    = $wpdb->posts;
@@ -1971,28 +1971,28 @@  discard block
 block discarded – undo
1971 1971
 	$region_filter  = '';
1972 1972
 	$country_filter = '';
1973 1973
 
1974
-	if ( $gd_session->get( 'gd_multi_location' ) ) {
1975
-		if ( $gd_ses_country = $gd_session->get( 'gd_country' ) ) {
1976
-			$country_filter = $wpdb->prepare( " AND r.post_country=%s ", str_replace( "-", " ", $gd_ses_country ) );
1974
+	if ($gd_session->get('gd_multi_location')) {
1975
+		if ($gd_ses_country = $gd_session->get('gd_country')) {
1976
+			$country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
1977 1977
 		}
1978 1978
 
1979
-		if ( $gd_ses_region = $gd_session->get( 'gd_region' ) ) {
1980
-			$region_filter = $wpdb->prepare( " AND r.post_region=%s ", str_replace( "-", " ", $gd_ses_region ) );
1979
+		if ($gd_ses_region = $gd_session->get('gd_region')) {
1980
+			$region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
1981 1981
 		}
1982 1982
 
1983
-		if ( $gd_ses_city = $gd_session->get( 'gd_city' ) ) {
1984
-			$city_filter = $wpdb->prepare( " AND r.post_city=%s ", str_replace( "-", " ", $gd_ses_city ) );
1983
+		if ($gd_ses_city = $gd_session->get('gd_city')) {
1984
+			$city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
1985 1985
 		}
1986 1986
 	}
1987 1987
 
1988 1988
 	$review_table = GEODIR_REVIEW_TABLE;
1989 1989
 	$request      = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments";
1990 1990
 
1991
-	$comments = $wpdb->get_results( $request );
1991
+	$comments = $wpdb->get_results($request);
1992 1992
 
1993
-	foreach ( $comments as $comment ) {
1993
+	foreach ($comments as $comment) {
1994 1994
 		// Set the extra comment info needed.
1995
-		$comment_extra = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID" );
1995
+		$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
1996 1996
 		//echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID";
1997 1997
 		$comment->comment_content      = $comment_extra->comment_content;
1998 1998
 		$comment->comment_author       = $comment_extra->comment_author;
@@ -2000,75 +2000,75 @@  discard block
 block discarded – undo
2000 2000
 
2001 2001
 		$comment_id      = '';
2002 2002
 		$comment_id      = $comment->comment_ID;
2003
-		$comment_content = strip_tags( $comment->comment_content );
2003
+		$comment_content = strip_tags($comment->comment_content);
2004 2004
 
2005
-		$comment_content = preg_replace( '#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content );
2005
+		$comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
2006 2006
 
2007
-		$permalink            = get_permalink( $comment->ID ) . "#comment-" . $comment->comment_ID;
2007
+		$permalink            = get_permalink($comment->ID)."#comment-".$comment->comment_ID;
2008 2008
 		$comment_author_email = $comment->comment_author_email;
2009 2009
 		$comment_post_ID      = $comment->post_id;
2010 2010
 
2011 2011
 		$na = true;
2012
-		if ( function_exists( 'icl_object_id' ) && icl_object_id( $comment_post_ID, $comment->post_type, true ) ) {
2013
-			$comment_post_ID2 = icl_object_id( $comment_post_ID, $comment->post_type, false );
2014
-			if ( $comment_post_ID == $comment_post_ID2 ) {
2012
+		if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
2013
+			$comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false);
2014
+			if ($comment_post_ID == $comment_post_ID2) {
2015 2015
 			} else {
2016 2016
 				$na = false;
2017 2017
 			}
2018 2018
 		}
2019 2019
 
2020
-		$post_title        = get_the_title( $comment_post_ID );
2021
-		$permalink         = get_permalink( $comment_post_ID );
2022
-		$comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
2023
-		$read_more         = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __( 'Read more', 'geodirectory' ) . '</a>';
2020
+		$post_title        = get_the_title($comment_post_ID);
2021
+		$permalink         = get_permalink($comment_post_ID);
2022
+		$comment_permalink = $permalink."#comment-".$comment->comment_ID;
2023
+		$read_more         = '<a class="comment_excerpt" href="'.$comment_permalink.'">'.__('Read more', 'geodirectory').'</a>';
2024 2024
 
2025
-		$comment_content_length = strlen( $comment_content );
2026
-		if ( $comment_content_length > $comment_lenth ) {
2027
-			$comment_excerpt = mb_substr( $comment_content, 0, $comment_lenth ) . '... ' . $read_more;
2025
+		$comment_content_length = strlen($comment_content);
2026
+		if ($comment_content_length > $comment_lenth) {
2027
+			$comment_excerpt = mb_substr($comment_content, 0, $comment_lenth).'... '.$read_more;
2028 2028
 		} else {
2029 2029
 			$comment_excerpt = $comment_content;
2030 2030
 		}
2031 2031
 
2032
-		if ( $comment->user_id ) {
2033
-			$user_profile_url = get_author_posts_url( $comment->user_id );
2032
+		if ($comment->user_id) {
2033
+			$user_profile_url = get_author_posts_url($comment->user_id);
2034 2034
 		} else {
2035 2035
 			$user_profile_url = '';
2036 2036
 		}
2037 2037
 
2038
-		if ( $comment_id && $na ) {
2038
+		if ($comment_id && $na) {
2039 2039
 			$comments_echo .= '<li class="clearfix">';
2040
-			$comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
2041
-			if ( function_exists( 'get_avatar' ) ) {
2042
-				if ( ! isset( $comment->comment_type ) ) {
2043
-					if ( $user_profile_url ) {
2044
-						$comments_echo .= '<a href="' . $user_profile_url . '">';
2040
+			$comments_echo .= "<span class=\"li".$comment_id." geodir_reviewer_image\">";
2041
+			if (function_exists('get_avatar')) {
2042
+				if (!isset($comment->comment_type)) {
2043
+					if ($user_profile_url) {
2044
+						$comments_echo .= '<a href="'.$user_profile_url.'">';
2045 2045
 					}
2046
-					$comments_echo .= get_avatar( $comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2047
-					if ( $user_profile_url ) {
2046
+					$comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2047
+					if ($user_profile_url) {
2048 2048
 						$comments_echo .= '</a>';
2049 2049
 					}
2050
-				} elseif ( ( isset( $comment->comment_type ) && $comment->comment_type == 'trackback' ) || ( isset( $comment->comment_type ) && $comment->comment_type == 'pingback' ) ) {
2051
-					if ( $user_profile_url ) {
2052
-						$comments_echo .= '<a href="' . $user_profile_url . '">';
2050
+				} elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
2051
+					if ($user_profile_url) {
2052
+						$comments_echo .= '<a href="'.$user_profile_url.'">';
2053 2053
 					}
2054
-					$comments_echo .= get_avatar( $comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2054
+					$comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2055 2055
 				}
2056
-			} elseif ( function_exists( 'gravatar' ) ) {
2057
-				if ( $user_profile_url ) {
2058
-					$comments_echo .= '<a href="' . $user_profile_url . '">';
2056
+			} elseif (function_exists('gravatar')) {
2057
+				if ($user_profile_url) {
2058
+					$comments_echo .= '<a href="'.$user_profile_url.'">';
2059 2059
 				}
2060 2060
 				$comments_echo .= "<img src=\"";
2061
-				if ( '' == $comment->comment_type ) {
2062
-					$comments_echo .= gravatar( $comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2063
-					if ( $user_profile_url ) {
2061
+				if ('' == $comment->comment_type) {
2062
+					$comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2063
+					if ($user_profile_url) {
2064 2064
 						$comments_echo .= '</a>';
2065 2065
 					}
2066
-				} elseif ( ( 'trackback' == $comment->comment_type ) || ( 'pingback' == $comment->comment_type ) ) {
2067
-					if ( $user_profile_url ) {
2068
-						$comments_echo .= '<a href="' . $user_profile_url . '">';
2066
+				} elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
2067
+					if ($user_profile_url) {
2068
+						$comments_echo .= '<a href="'.$user_profile_url.'">';
2069 2069
 					}
2070
-					$comments_echo .= gravatar( $comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' );
2071
-					if ( $user_profile_url ) {
2070
+					$comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
2071
+					if ($user_profile_url) {
2072 2072
 						$comments_echo .= '</a>';
2073 2073
 					}
2074 2074
 				}
@@ -2078,17 +2078,17 @@  discard block
 block discarded – undo
2078 2078
 			$comments_echo .= "</span>\n";
2079 2079
 
2080 2080
 			$comments_echo .= '<span class="geodir_reviewer_content">';
2081
-			if ( $comment->user_id ) {
2082
-				$comments_echo .= '<a href="' . get_author_posts_url( $comment->user_id ) . '">';
2081
+			if ($comment->user_id) {
2082
+				$comments_echo .= '<a href="'.get_author_posts_url($comment->user_id).'">';
2083 2083
 			}
2084
-			$comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
2085
-			if ( $comment->user_id ) {
2084
+			$comments_echo .= '<span class="geodir_reviewer_author">'.$comment->comment_author.'</span> ';
2085
+			if ($comment->user_id) {
2086 2086
 				$comments_echo .= '</a>';
2087 2087
 			}
2088
-			$comments_echo .= '<span class="geodir_reviewer_reviewed">' . __( 'reviewed', 'geodirectory' ) . '</span> ';
2089
-			$comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
2090
-			$comments_echo .= geodir_get_rating_stars( $comment->overall_rating, $comment_post_ID );
2091
-			$comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
2088
+			$comments_echo .= '<span class="geodir_reviewer_reviewed">'.__('reviewed', 'geodirectory').'</span> ';
2089
+			$comments_echo .= '<a href="'.$permalink.'" class="geodir_reviewer_title">'.$post_title.'</a>';
2090
+			$comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
2091
+			$comments_echo .= '<p class="geodir_reviewer_text">'.$comment_excerpt.'';
2092 2092
 			//echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
2093 2093
 			$comments_echo .= '</p>';
2094 2094
 
@@ -2108,25 +2108,25 @@  discard block
 block discarded – undo
2108 2108
  * @return array Returns post categories as an array.
2109 2109
  */
2110 2110
 function geodir_home_map_cats_key_value_array() {
2111
-	$post_types = geodir_get_posttypes( 'object' );
2111
+	$post_types = geodir_get_posttypes('object');
2112 2112
 
2113 2113
 	$return = array();
2114
-	if ( ! empty( $post_types ) ) {
2115
-		foreach ( $post_types as $key => $post_type ) {
2116
-			$cpt_name       = __( $post_type->labels->singular_name, 'geodirectory' );
2117
-			$post_type_name = sprintf( __( '%s Categories', 'geodirectory' ), $cpt_name );
2118
-			$taxonomies     = geodir_get_taxonomies( $key );
2119
-			$cat_taxonomy   = ! empty( $taxonomies[0] ) ? $taxonomies[0] : null;
2120
-			$cat_terms      = $cat_taxonomy ? get_terms( $cat_taxonomy ) : null;
2121
-
2122
-			if ( ! empty( $cat_terms ) ) {
2123
-				$return[ 'optgroup_start-' . $key ] = $post_type_name;
2124
-
2125
-				foreach ( $cat_terms as $cat_term ) {
2126
-					$return[ $key . '_' . $cat_term->term_id ] = $cat_term->name;
2114
+	if (!empty($post_types)) {
2115
+		foreach ($post_types as $key => $post_type) {
2116
+			$cpt_name       = __($post_type->labels->singular_name, 'geodirectory');
2117
+			$post_type_name = sprintf(__('%s Categories', 'geodirectory'), $cpt_name);
2118
+			$taxonomies     = geodir_get_taxonomies($key);
2119
+			$cat_taxonomy   = !empty($taxonomies[0]) ? $taxonomies[0] : null;
2120
+			$cat_terms      = $cat_taxonomy ? get_terms($cat_taxonomy) : null;
2121
+
2122
+			if (!empty($cat_terms)) {
2123
+				$return['optgroup_start-'.$key] = $post_type_name;
2124
+
2125
+				foreach ($cat_terms as $cat_term) {
2126
+					$return[$key.'_'.$cat_term->term_id] = $cat_term->name;
2127 2127
 				}
2128 2128
 
2129
-				$return[ 'optgroup_end-' . $key ] = $post_type_name;
2129
+				$return['optgroup_end-'.$key] = $post_type_name;
2130 2130
 			}
2131 2131
 		}
2132 2132
 	}
@@ -2142,14 +2142,14 @@  discard block
 block discarded – undo
2142 2142
  * @package GeoDirectory
2143 2143
  */
2144 2144
 function geodir_twitter_tweet_button() {
2145
-	if ( isset( $_GET['gde'] ) ) {
2146
-		$link = '?url=' . urlencode( geodir_curPageURL() );
2145
+	if (isset($_GET['gde'])) {
2146
+		$link = '?url='.urlencode(geodir_curPageURL());
2147 2147
 	} else {
2148 2148
 		$link = '';
2149 2149
 	}
2150 2150
 	?>
2151 2151
 	<a href="http://twitter.com/share<?php echo $link; ?>"
2152
-	   class="twitter-share-button"><?php _e( 'Tweet', 'geodirectory' ); ?></a>
2152
+	   class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
2153 2153
 	<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
2154 2154
 	<?php
2155 2155
 }
@@ -2166,10 +2166,10 @@  discard block
 block discarded – undo
2166 2166
 function geodir_fb_like_button() {
2167 2167
 	global $post;
2168 2168
 	?>
2169
-	<iframe <?php if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) ) {
2169
+	<iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
2170 2170
 		echo 'allowtransparency="true"';
2171 2171
 	} ?> class="facebook"
2172
-	     src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode( get_permalink( $post->ID ) ); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light"
2172
+	     src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light"
2173 2173
 	     style="border:none; overflow:hidden; width:100px; height:20px"></iframe>
2174 2174
 	<?php
2175 2175
 }
@@ -2200,7 +2200,7 @@  discard block
 block discarded – undo
2200 2200
 
2201 2201
 
2202 2202
 function geodir_listing_bounce_map_pin_on_hover() {
2203
-	if ( get_option( 'geodir_listing_hover_bounce_map_pin', true ) ) {
2203
+	if (get_option('geodir_listing_hover_bounce_map_pin', true)) {
2204 2204
 		?>
2205 2205
 		<script>
2206 2206
 			jQuery(function ($) {
@@ -2223,44 +2223,44 @@  discard block
 block discarded – undo
2223 2223
 	}
2224 2224
 }
2225 2225
 
2226
-add_action( 'geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10 );
2226
+add_action('geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10);
2227 2227
 
2228
-add_action( 'geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1 );
2229
-function geodir_output_favourite_html_listings( $post_id ) {
2230
-	geodir_favourite_html( '', $post_id );
2228
+add_action('geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1);
2229
+function geodir_output_favourite_html_listings($post_id) {
2230
+	geodir_favourite_html('', $post_id);
2231 2231
 }
2232 2232
 
2233
-add_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2 );
2234
-function geodir_output_pinpoint_html_listings( $post_id, $post ) {
2233
+add_action('geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2234
+function geodir_output_pinpoint_html_listings($post_id, $post) {
2235 2235
 	global $wp_query;
2236 2236
 
2237 2237
 	$show_pin_point = $wp_query->is_main_query();
2238 2238
 
2239
-	if ( ! empty( $show_pin_point ) && is_active_widget( false, "", "geodir_map_v3_listing_map" ) ) {
2240
-		$term_icon_url = get_tax_meta( $post->default_category, 'ct_cat_icon', false, $post->post_type );
2241
-		$marker_icon   = isset( $term_icon_url['src'] ) ? $term_icon_url['src'] : get_option( 'geodir_default_marker_icon' );
2239
+	if (!empty($show_pin_point) && is_active_widget(false, "", "geodir_map_v3_listing_map")) {
2240
+		$term_icon_url = get_tax_meta($post->default_category, 'ct_cat_icon', false, $post->post_type);
2241
+		$marker_icon   = isset($term_icon_url['src']) ? $term_icon_url['src'] : get_option('geodir_default_marker_icon');
2242 2242
 		?>
2243 2243
 		<span class="geodir-pinpoint"
2244
-		      style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters( 'geodir_listing_listview_pinpoint_inner_content', '', 'listing' ); ?></span>
2244
+		      style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters('geodir_listing_listview_pinpoint_inner_content', '', 'listing'); ?></span>
2245 2245
 		<a class="geodir-pinpoint-link" href="javascript:void(0)"
2246 2246
 		   onclick="openMarker('listing_map_canvas' ,'<?php echo $post->ID; ?>')"
2247 2247
 		   onmouseover="animate_marker('listing_map_canvas' ,'<?php echo $post->ID; ?>')"
2248
-		   onmouseout="stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')"><?php _e( 'Pinpoint', 'geodirectory' ); ?></a>
2248
+		   onmouseout="stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')"><?php _e('Pinpoint', 'geodirectory'); ?></a>
2249 2249
 		<?php
2250 2250
 	}
2251 2251
 }
2252 2252
 
2253 2253
 function geodir_search_form_submit_button() {
2254 2254
 
2255
-	$new_style = get_option( 'geodir_show_search_old_search_from' ) ? false : true;
2255
+	$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2256 2256
 
2257
-	if ( $new_style ) {
2257
+	if ($new_style) {
2258 2258
 		$default_search_button_label = '<i class="fa fa-search" aria-hidden="true"></i>';
2259
-	}else{
2259
+	} else {
2260 2260
 		$default_search_button_label = 'Search';
2261 2261
 	}
2262
-	if ( get_option( 'geodir_search_button_label' ) && get_option( 'geodir_search_button_label' ) != 'Search' ) {
2263
-		$default_search_button_label = __( get_option( 'geodir_search_button_label' ), 'geodirectory' );
2262
+	if (get_option('geodir_search_button_label') && get_option('geodir_search_button_label') != 'Search') {
2263
+		$default_search_button_label = __(get_option('geodir_search_button_label'), 'geodirectory');
2264 2264
 	}
2265 2265
 
2266 2266
 	/**
@@ -2272,78 +2272,78 @@  discard block
 block discarded – undo
2272 2272
 	 *
2273 2273
 	 * @param string $default_search_button_label The current search button text.
2274 2274
 	 */
2275
-	$default_search_button_label = apply_filters( 'geodir_search_default_search_button_text', $default_search_button_label );
2275
+	$default_search_button_label = apply_filters('geodir_search_default_search_button_text', $default_search_button_label);
2276 2276
 
2277 2277
 	$fa_class = '';
2278
-	if ( strpos( $default_search_button_label, '&#' ) !== false ) {
2278
+	if (strpos($default_search_button_label, '&#') !== false) {
2279 2279
 		$fa_class = 'fa';
2280 2280
 	}
2281 2281
 
2282 2282
 
2283
-	if ( $new_style ) {
2283
+	if ($new_style) {
2284 2284
 	?>
2285
-		<button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e( $default_search_button_label ,'geodirectory'); ?></button>
2286
-<?php }else{?>
2287
-		<input type="button" value="<?php esc_attr_e( $default_search_button_label ); ?>"
2285
+		<button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e($default_search_button_label, 'geodirectory'); ?></button>
2286
+<?php } else {?>
2287
+		<input type="button" value="<?php esc_attr_e($default_search_button_label); ?>"
2288 2288
 	       class="geodir_submit_search <?php echo $fa_class; ?>"/>
2289 2289
 	<?php }
2290 2290
 }
2291 2291
 
2292
-add_action( 'geodir_before_search_button', 'geodir_search_form_submit_button', 5000 );
2292
+add_action('geodir_before_search_button', 'geodir_search_form_submit_button', 5000);
2293 2293
 
2294 2294
 function geodir_search_form_post_type_input() {
2295 2295
 	global $geodir_search_post_type;
2296
-	$post_types     = apply_filters( 'geodir_search_form_post_types', geodir_get_posttypes( 'object' ) );
2296
+	$post_types     = apply_filters('geodir_search_form_post_types', geodir_get_posttypes('object'));
2297 2297
 	$curr_post_type = $geodir_search_post_type;
2298 2298
 
2299
-	if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
2299
+	if (!empty($post_types) && count((array) $post_types) > 1) {
2300 2300
 
2301
-		foreach ( $post_types as $post_type => $info ){
2301
+		foreach ($post_types as $post_type => $info) {
2302 2302
 			global $wpdb;
2303
-			$has_posts = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type ) );
2304
-			if ( ! $has_posts ) {
2303
+			$has_posts = $wpdb->get_row($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type));
2304
+			if (!$has_posts) {
2305 2305
 				unset($post_types->{$post_type});
2306 2306
 			}
2307 2307
 		}
2308 2308
 
2309
-		if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
2309
+		if (!empty($post_types) && count((array) $post_types) > 1) {
2310 2310
 
2311
-			$new_style = get_option( 'geodir_show_search_old_search_from' ) ? false : true;
2312
-			if ( $new_style ) {
2311
+			$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2312
+			if ($new_style) {
2313 2313
 				echo "<div class='gd-search-input-wrapper gd-search-field-cpt'>";
2314 2314
 			}
2315 2315
 			?>
2316 2316
 			<select name="stype" class="search_by_post">
2317
-				<?php foreach ( $post_types as $post_type => $info ):
2317
+				<?php foreach ($post_types as $post_type => $info):
2318 2318
 					global $wpdb;
2319 2319
 					?>
2320 2320
 
2321
-					<option data-label="<?php echo get_post_type_archive_link( $post_type ); ?>"
2322
-					        value="<?php echo $post_type; ?>" <?php if ( isset( $_REQUEST['stype'] ) ) {
2323
-						if ( $post_type == $_REQUEST['stype'] ) {
2321
+					<option data-label="<?php echo get_post_type_archive_link($post_type); ?>"
2322
+					        value="<?php echo $post_type; ?>" <?php if (isset($_REQUEST['stype'])) {
2323
+						if ($post_type == $_REQUEST['stype']) {
2324 2324
 							echo 'selected="selected"';
2325 2325
 						}
2326
-					} elseif ( $curr_post_type == $post_type ) {
2326
+					} elseif ($curr_post_type == $post_type) {
2327 2327
 						echo 'selected="selected"';
2328
-					} ?>><?php _e( ucfirst( $info->labels->name ), 'geodirectory' ); ?></option>
2328
+					} ?>><?php _e(ucfirst($info->labels->name), 'geodirectory'); ?></option>
2329 2329
 
2330 2330
 				<?php endforeach; ?>
2331 2331
 			</select>
2332 2332
 			<?php
2333
-			if ( $new_style ) {
2333
+			if ($new_style) {
2334 2334
 				echo "</div>";
2335 2335
 			}
2336
-		}else{
2337
-			if(! empty( $post_types )){
2338
-				$pt_arr = (array)$post_types;
2339
-				echo '<input type="hidden" name="stype" value="' . key( $pt_arr  ) . '"  />';
2340
-			}else{
2336
+		} else {
2337
+			if (!empty($post_types)) {
2338
+				$pt_arr = (array) $post_types;
2339
+				echo '<input type="hidden" name="stype" value="'.key($pt_arr).'"  />';
2340
+			} else {
2341 2341
 				echo '<input type="hidden" name="stype" value="gd_place"  />';
2342 2342
 			}
2343 2343
 
2344 2344
 		}
2345 2345
 
2346
-	}elseif ( ! empty( $post_types ) ) {
2346
+	}elseif (!empty($post_types)) {
2347 2347
 		echo '<input type="hidden" name="stype" value="gd_place"  />';
2348 2348
 	}
2349 2349
 }
@@ -2351,26 +2351,26 @@  discard block
 block discarded – undo
2351 2351
 function geodir_search_form_search_input() {
2352 2352
 
2353 2353
 	$default_search_for_text = SEARCH_FOR_TEXT;
2354
-	if ( get_option( 'geodir_search_field_default_text' ) ) {
2355
-		$default_search_for_text = __( get_option( 'geodir_search_field_default_text' ), 'geodirectory' );
2354
+	if (get_option('geodir_search_field_default_text')) {
2355
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
2356 2356
 	}
2357 2357
 
2358 2358
 	$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2359
-	if($new_style){
2359
+	if ($new_style) {
2360 2360
 		echo "<div class='gd-search-input-wrapper gd-search-field-search'>";
2361 2361
 	}
2362 2362
 	?>
2363 2363
 	<input class="search_text" name="s"
2364
-	       value="<?php if ( isset( $_REQUEST['s'] ) && trim( $_REQUEST['s'] ) != '' ) {
2365
-		       echo esc_attr( stripslashes_deep( $_REQUEST['s'] ) );
2364
+	       value="<?php if (isset($_REQUEST['s']) && trim($_REQUEST['s']) != '') {
2365
+		       echo esc_attr(stripslashes_deep($_REQUEST['s']));
2366 2366
 	       } else {
2367 2367
 		       echo $default_search_for_text;
2368 2368
 	       } ?>" type="text"
2369
-	       onblur="if (this.value.trim() == '') {this.value = '<?php echo esc_sql( $default_search_for_text ); ?>';}"
2370
-	       onfocus="if (this.value == '<?php echo esc_sql( $default_search_for_text ); ?>') {this.value = '';}"
2369
+	       onblur="if (this.value.trim() == '') {this.value = '<?php echo esc_sql($default_search_for_text); ?>';}"
2370
+	       onfocus="if (this.value == '<?php echo esc_sql($default_search_for_text); ?>') {this.value = '';}"
2371 2371
 	       onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);">
2372 2372
 	<?php
2373
-	if($new_style){
2373
+	if ($new_style) {
2374 2374
 		echo "</div>";
2375 2375
 	}
2376 2376
 }
@@ -2378,12 +2378,12 @@  discard block
 block discarded – undo
2378 2378
 function geodir_search_form_near_input() {
2379 2379
 
2380 2380
 	$default_near_text = NEAR_TEXT;
2381
-	if ( get_option( 'geodir_near_field_default_text' ) ) {
2382
-		$default_near_text = __( get_option( 'geodir_near_field_default_text' ), 'geodirectory' );
2381
+	if (get_option('geodir_near_field_default_text')) {
2382
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
2383 2383
 	}
2384 2384
 
2385
-	if ( isset( $_REQUEST['snear'] ) && $_REQUEST['snear'] != '' ) {
2386
-		$near = esc_attr( stripslashes_deep( $_REQUEST['snear'] ) );
2385
+	if (isset($_REQUEST['snear']) && $_REQUEST['snear'] != '') {
2386
+		$near = esc_attr(stripslashes_deep($_REQUEST['snear']));
2387 2387
 	} else {
2388 2388
 		$near = $default_near_text;
2389 2389
 	}
@@ -2397,7 +2397,7 @@  discard block
 block discarded – undo
2397 2397
 	 * @since 1.6.9
2398 2398
 	 * @param string $curr_post_type The current post type.
2399 2399
 	 */
2400
-	$near_input_extra = apply_filters('geodir_near_input_extra','',$curr_post_type);
2400
+	$near_input_extra = apply_filters('geodir_near_input_extra', '', $curr_post_type);
2401 2401
 
2402 2402
 
2403 2403
 	/**
@@ -2410,7 +2410,7 @@  discard block
 block discarded – undo
2410 2410
 	 * @param string $near              The current near value.
2411 2411
 	 * @param string $default_near_text The default near value.
2412 2412
 	 */
2413
-	$near = apply_filters( 'geodir_search_near_text', $near, $default_near_text );
2413
+	$near = apply_filters('geodir_search_near_text', $near, $default_near_text);
2414 2414
 	/**
2415 2415
 	 * Filter the default "Near" text value for the search form.
2416 2416
 	 *
@@ -2421,7 +2421,7 @@  discard block
 block discarded – undo
2421 2421
 	 * @param string $near              The current near value.
2422 2422
 	 * @param string $default_near_text The default near value.
2423 2423
 	 */
2424
-	$default_near_text = apply_filters( 'geodir_search_default_near_text', $default_near_text, $near );
2424
+	$default_near_text = apply_filters('geodir_search_default_near_text', $default_near_text, $near);
2425 2425
 	/**
2426 2426
 	 * Filter the class for the near search input.
2427 2427
 	 *
@@ -2429,10 +2429,10 @@  discard block
 block discarded – undo
2429 2429
 	 *
2430 2430
 	 * @param string $class The class for the HTML near input, default is blank.
2431 2431
 	 */
2432
-	$near_class = apply_filters( 'geodir_search_near_class', '' );
2432
+	$near_class = apply_filters('geodir_search_near_class', '');
2433 2433
 
2434 2434
 	$new_style = get_option('geodir_show_search_old_search_from') ? false : true;
2435
-	if($new_style){
2435
+	if ($new_style) {
2436 2436
 		echo "<div class='gd-search-input-wrapper gd-search-field-near' $near_input_extra>";
2437 2437
 		
2438 2438
 		do_action('geodir_before_near_input');
@@ -2440,30 +2440,30 @@  discard block
 block discarded – undo
2440 2440
 
2441 2441
 	?>
2442 2442
 	<input name="snear" class="snear <?php echo $near_class; ?>" type="text" value="<?php echo $near; ?>"
2443
-	       onblur="if (this.value.trim() == '') {this.value = ('<?php echo esc_sql( $near ); ?>' != '' ? '<?php echo esc_sql( $near ); ?>' : '<?php echo $default_near_text; ?>');}"
2444
-	       onfocus="if (this.value == '<?php echo $default_near_text; ?>' || this.value =='<?php echo esc_sql( $near ); ?>') {this.value = '';}"
2445
-	       onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);" <?php echo $near_input_extra;?>/>
2443
+	       onblur="if (this.value.trim() == '') {this.value = ('<?php echo esc_sql($near); ?>' != '' ? '<?php echo esc_sql($near); ?>' : '<?php echo $default_near_text; ?>');}"
2444
+	       onfocus="if (this.value == '<?php echo $default_near_text; ?>' || this.value =='<?php echo esc_sql($near); ?>') {this.value = '';}"
2445
+	       onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);" <?php echo $near_input_extra; ?>/>
2446 2446
 	<?php
2447
-	if($new_style){
2447
+	if ($new_style) {
2448 2448
 		do_action('geodir_after_near_input');
2449 2449
 
2450 2450
 		echo "</div>";
2451 2451
 	}
2452 2452
 }
2453 2453
 
2454
-add_action( 'geodir_search_form_inputs', 'geodir_search_form_post_type_input', 10 );
2455
-add_action( 'geodir_search_form_inputs', 'geodir_search_form_search_input', 20 );
2456
-add_action( 'geodir_search_form_inputs', 'geodir_search_form_near_input', 30 );
2454
+add_action('geodir_search_form_inputs', 'geodir_search_form_post_type_input', 10);
2455
+add_action('geodir_search_form_inputs', 'geodir_search_form_search_input', 20);
2456
+add_action('geodir_search_form_inputs', 'geodir_search_form_near_input', 30);
2457 2457
 
2458
-function geodir_get_search_post_type($pt=''){
2458
+function geodir_get_search_post_type($pt = '') {
2459 2459
 	global $geodir_search_post_type;
2460 2460
 
2461
-	if($pt!=''){return $geodir_search_post_type = $pt;}
2462
-	if(!empty($geodir_search_post_type)){ return $geodir_search_post_type;}
2461
+	if ($pt != '') {return $geodir_search_post_type = $pt; }
2462
+	if (!empty($geodir_search_post_type)) { return $geodir_search_post_type; }
2463 2463
 
2464 2464
 	$geodir_search_post_type = geodir_get_current_posttype();
2465 2465
 
2466
-	if(!$geodir_search_post_type) {
2466
+	if (!$geodir_search_post_type) {
2467 2467
 		$geodir_search_post_type = geodir_get_default_posttype();
2468 2468
 	}
2469 2469
 
@@ -2471,7 +2471,7 @@  discard block
 block discarded – undo
2471 2471
 	return $geodir_search_post_type;
2472 2472
 }
2473 2473
 
2474
-function geodir_search_form(){
2474
+function geodir_search_form() {
2475 2475
 
2476 2476
 	geodir_get_search_post_type();
2477 2477
 
@@ -2481,8 +2481,8 @@  discard block
 block discarded – undo
2481 2481
 	die();
2482 2482
 }
2483 2483
 
2484
-add_action( 'wp_ajax_geodir_search_form', 'geodir_search_form' );
2485
-add_action( 'wp_ajax_nopriv_geodir_search_form', 'geodir_search_form' );
2484
+add_action('wp_ajax_geodir_search_form', 'geodir_search_form');
2485
+add_action('wp_ajax_nopriv_geodir_search_form', 'geodir_search_form');
2486 2486
 
2487 2487
 /**
2488 2488
  * Check wpml active or not.
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
         }
2554 2554
     }
2555 2555
 }
2556
-add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 );
2556
+add_filter('icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4);
2557 2557
 
2558 2558
 /**
2559 2559
  * Duplicate post listing manually after listing saved.
@@ -2591,7 +2591,7 @@  discard block
 block discarded – undo
2591 2591
 function geodir_wpml_duplicate_post_reviews($master_post_id, $tr_post_id, $lang) {
2592 2592
     global $wpdb;
2593 2593
 
2594
-    $reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A);
2594
+    $reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM ".GEODIR_REVIEW_TABLE." WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A);
2595 2595
 
2596 2596
     if (!empty($reviews)) {
2597 2597
         foreach ($reviews as $review) {
@@ -2619,14 +2619,14 @@  discard block
 block discarded – undo
2619 2619
     global $wpdb, $plugin_prefix;
2620 2620
 
2621 2621
     $post_type = get_post_type($master_post_id);
2622
-    $post_table = $plugin_prefix . $post_type . '_detail';
2622
+    $post_table = $plugin_prefix.$post_type.'_detail';
2623 2623
 
2624
-    $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id));
2625
-    $data = (array)$wpdb->get_row($query);
2624
+    $query = $wpdb->prepare("SELECT * FROM ".$post_table." WHERE post_id = %d", array($master_post_id));
2625
+    $data = (array) $wpdb->get_row($query);
2626 2626
 
2627
-    if ( !empty( $data ) ) {
2627
+    if (!empty($data)) {
2628 2628
         $data['post_id'] = $tr_post_id;
2629
-        unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category']);
2629
+        unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type.'category']);
2630 2630
         $wpdb->update($post_table, $data, array('post_id' => $tr_post_id));
2631 2631
         return true;
2632 2632
     }
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
     global $sitepress, $wpdb;
2652 2652
     $post_type = get_post_type($master_post_id);
2653 2653
 
2654
-    remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language
2654
+    remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language
2655 2655
 
2656 2656
     $taxonomies = get_object_taxonomies($post_type);
2657 2657
     foreach ($taxonomies as $taxonomy) {
@@ -2660,9 +2660,9 @@  discard block
 block discarded – undo
2660 2660
         
2661 2661
         if ($terms) {
2662 2662
             foreach ($terms as $term) {
2663
-                $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang);
2663
+                $tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang);
2664 2664
                 
2665
-                if (!is_null($tr_id)){
2665
+                if (!is_null($tr_id)) {
2666 2666
                     // not using get_term - unfiltered get_term
2667 2667
                     $translated_term = $wpdb->get_row($wpdb->prepare("
2668 2668
                         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));
@@ -2671,14 +2671,14 @@  discard block
 block discarded – undo
2671 2671
                 }
2672 2672
             }
2673 2673
 
2674
-            if (!is_taxonomy_hierarchical($taxonomy)){
2675
-                $terms_array = array_unique( array_map( 'intval', $terms_array ) );
2674
+            if (!is_taxonomy_hierarchical($taxonomy)) {
2675
+                $terms_array = array_unique(array_map('intval', $terms_array));
2676 2676
             }
2677 2677
 
2678 2678
             wp_set_post_terms($tr_post_id, $terms_array, $taxonomy);
2679 2679
             
2680
-            if ($taxonomy == $post_type . 'category') {
2681
-                geodir_set_postcat_structure($tr_post_id, $post_type . 'category');
2680
+            if ($taxonomy == $post_type.'category') {
2681
+                geodir_set_postcat_structure($tr_post_id, $post_type.'category');
2682 2682
             }
2683 2683
         }
2684 2684
     }
@@ -2699,15 +2699,15 @@  discard block
 block discarded – undo
2699 2699
 function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) {
2700 2700
     global $wpdb;
2701 2701
 
2702
-    $query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
2702
+    $query = $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id));
2703 2703
     $wpdb->query($query);
2704 2704
 
2705
-    $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));
2705
+    $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));
2706 2706
     $post_images = $wpdb->get_results($query);
2707 2707
 
2708
-    if ( !empty( $post_images ) ) {
2709
-        foreach ( $post_images as $post_image) {
2710
-            $image_data = (array)$post_image;
2708
+    if (!empty($post_images)) {
2709
+        foreach ($post_images as $post_image) {
2710
+            $image_data = (array) $post_image;
2711 2711
             unset($image_data['ID']);
2712 2712
             $image_data['post_id'] = $tr_post_id;
2713 2713
             
@@ -2740,13 +2740,13 @@  discard block
 block discarded – undo
2740 2740
 function geodir_wpml_duplicate_post_review($master_comment_id, $master_post_id, $tr_post_id, $lang) {
2741 2741
     global $wpdb, $plugin_prefix, $sitepress;
2742 2742
 
2743
-    $review = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A);
2743
+    $review = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A);
2744 2744
 
2745 2745
     if (empty($review)) {
2746 2746
         return false;
2747 2747
     }
2748 2748
     if ($review['post_id'] != $master_post_id) {
2749
-        $wpdb->query($wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id));
2749
+        $wpdb->query($wpdb->prepare("UPDATE ".GEODIR_REVIEW_TABLE." SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id));
2750 2750
         geodir_update_postrating($master_post_id, $post_type);
2751 2751
     }
2752 2752
 
@@ -2757,9 +2757,9 @@  discard block
 block discarded – undo
2757 2757
     }
2758 2758
 
2759 2759
     $post_type = get_post_type($master_post_id);
2760
-    $post_table = $plugin_prefix . $post_type . '_detail';
2760
+    $post_table = $plugin_prefix.$post_type.'_detail';
2761 2761
 
2762
-    $translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM " . $post_table . " WHERE post_id = %d", $tr_post_id), ARRAY_A);
2762
+    $translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM ".$post_table." WHERE post_id = %d", $tr_post_id), ARRAY_A);
2763 2763
     if (empty($translated_post)) {
2764 2764
         return false;
2765 2765
     }
@@ -2777,7 +2777,7 @@  discard block
 block discarded – undo
2777 2777
         unset($review['id']);
2778 2778
     }
2779 2779
 
2780
-    $tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id));
2780
+    $tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id));
2781 2781
 
2782 2782
     if ($tr_review_id) { // update review
2783 2783
         $wpdb->update(GEODIR_REVIEW_TABLE, $review, array('id' => $tr_review_id));
@@ -2790,8 +2790,8 @@  discard block
 block discarded – undo
2790 2790
         geodir_update_postrating($tr_post_id, $post_type);
2791 2791
         
2792 2792
         if (defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_review') && $sitepress->get_setting('sync_comments_on_duplicates')) {
2793
-            $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_COMMENTS_REVIEWS_TABLE . " WHERE comment_id = %d", array($tr_comment_id)));
2794
-            $likes = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_COMMENTS_REVIEWS_TABLE . " WHERE comment_id=%d ORDER BY like_date ASC", $master_comment_id, $tr_post_id), ARRAY_A);
2793
+            $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_COMMENTS_REVIEWS_TABLE." WHERE comment_id = %d", array($tr_comment_id)));
2794
+            $likes = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_COMMENTS_REVIEWS_TABLE." WHERE comment_id=%d ORDER BY like_date ASC", $master_comment_id, $tr_post_id), ARRAY_A);
2795 2795
 
2796 2796
             if (!empty($likes)) {
2797 2797
                 foreach ($likes as $like) {
@@ -2893,7 +2893,7 @@  discard block
 block discarded – undo
2893 2893
  * @return bool True if review star disabled, otherwise false.
2894 2894
  */ 
2895 2895
 function geodir_rating_disabled_post_types() {
2896
-	$post_types = get_option( 'geodir_disable_rating_cpt' );
2896
+	$post_types = get_option('geodir_disable_rating_cpt');
2897 2897
 	
2898 2898
 	/**
2899 2899
 	 * Filter the post types array which have rating disabled.
@@ -2902,7 +2902,7 @@  discard block
 block discarded – undo
2902 2902
 	 *
2903 2903
 	 * @param array $post_types Array of post types which have rating starts disabled.
2904 2904
 	 */
2905
-	return apply_filters( 'geodir_rating_disabled_post_types', $post_types );
2905
+	return apply_filters('geodir_rating_disabled_post_types', $post_types);
2906 2906
 }
2907 2907
 
2908 2908
 /**
@@ -2914,30 +2914,30 @@  discard block
 block discarded – undo
2914 2914
  * @param bool $taxonomy Whether $post_type is taxonomy or not.
2915 2915
  * @return bool True if review star disabled, otherwise false.
2916 2916
  */ 
2917
-function geodir_cpt_has_rating_disabled( $post_type = '', $taxonomy = false ) {
2917
+function geodir_cpt_has_rating_disabled($post_type = '', $taxonomy = false) {
2918 2918
 	$post_types = geodir_rating_disabled_post_types();
2919 2919
 	
2920
-	if ( empty( $post_types ) ) {
2920
+	if (empty($post_types)) {
2921 2921
 		return false;
2922 2922
 	}
2923 2923
 	
2924
-	if ( is_int( $post_type ) ) {
2925
-		$post_type = get_post_type( $post_type );
2924
+	if (is_int($post_type)) {
2925
+		$post_type = get_post_type($post_type);
2926 2926
 	}
2927 2927
 	
2928
-	if ( $taxonomy && !empty( $post_types ) ) {
2928
+	if ($taxonomy && !empty($post_types)) {
2929 2929
 		$posttypes = array();
2930 2930
 		
2931
-		foreach ( $post_types as $posttype ) {
2932
-			$posttypes[] = $posttype . 'category';
2933
-			$posttypes[] = $posttype . '_tags';
2931
+		foreach ($post_types as $posttype) {
2932
+			$posttypes[] = $posttype.'category';
2933
+			$posttypes[] = $posttype.'_tags';
2934 2934
 		}
2935 2935
 		
2936 2936
 		$post_types = $posttypes;
2937 2937
 	}
2938 2938
 
2939 2939
 	$return = false;
2940
-	if ( $post_type != '' && !empty( $post_types ) && in_array( $post_type, $post_types ) ) {
2940
+	if ($post_type != '' && !empty($post_types) && in_array($post_type, $post_types)) {
2941 2941
 		$return = true;
2942 2942
 	}
2943 2943
 
Please login to merge, or discard this patch.
geodirectory-functions/comments_functions.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function geodir_comment_rating_meta($comment) {
69 69
     $post_type = get_post_type($comment->comment_post_ID);
70
-	if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0 && !(!empty($post_type) && geodir_cpt_has_rating_disabled($post_type))) {
70
+	if (in_array($post_type, (array) geodir_get_posttypes()) && (int) $comment->comment_parent == 0 && !(!empty($post_type) && geodir_cpt_has_rating_disabled($post_type))) {
71 71
 		$rating = geodir_get_commentoverall($comment->comment_ID);
72 72
 		
73
-		if ((int)get_option('geodir_reviewrating_enable_font_awesome') == 1) {
73
+		if ((int) get_option('geodir_reviewrating_enable_font_awesome') == 1) {
74 74
 			$star_texts = array();
75 75
 			$star_texts[] = __('Terrible', 'geodirectory');
76 76
 			$star_texts[] = __('Poor', 'geodirectory');
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
 			echo geodir_font_awesome_rating_form_html('', $star_texts, $rating);
82 82
 		} else {			
83 83
 			if ($rating) {
84
-				echo '<div class="gd_rating" data-average="' . $rating . '" data-id="5">';
84
+				echo '<div class="gd_rating" data-average="'.$rating.'" data-id="5">';
85 85
 
86 86
 			} else {
87 87
 				echo '<div class="gd_rating" data-average="0" data-id="5"></div>';
88 88
 			}
89 89
 		}
90
-		echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="' . $rating . '"  />';
90
+		echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="'.$rating.'"  />';
91 91
 	}
92 92
 }
93 93
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 function geodir_comment_replaylink($link)
146 146
 {
147 147
 
148
-    $link = '<div class="gd_comment_replaylink">' . $link . '</div>';
148
+    $link = '<div class="gd_comment_replaylink">'.$link.'</div>';
149 149
 
150 150
     return $link;
151 151
 }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 function geodir_cancle_replaylink($link)
163 163
 {
164 164
 
165
-    $link = '<span class="gd-cancel-replaylink">' . $link . '</span>';
165
+    $link = '<span class="gd-cancel-replaylink">'.$link.'</span>';
166 166
 
167 167
     return $link;
168 168
 }
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
     if (isset($_REQUEST['geodir_overallrating'])) {
203 203
         $overall_rating = $_REQUEST['geodir_overallrating'];
204 204
         
205
-		if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
205
+		if (isset($comment_info->comment_parent) && (int) $comment_info->comment_parent == 0) {
206 206
             $overall_rating = $overall_rating > 0 ? $overall_rating : '0';
207 207
 
208
-            $sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET
208
+            $sqlqry = $wpdb->prepare("INSERT INTO ".GEODIR_REVIEW_TABLE." SET
209 209
 					post_id		= %d,
210 210
 					post_type = %s,
211 211
 					post_title	= %s,
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 
293 293
     $post_type = get_post_type($post_id);
294 294
 
295
-    $detail_table = $plugin_prefix . $post_type . '_detail';
295
+    $detail_table = $plugin_prefix.$post_type.'_detail';
296 296
 
297 297
     if ($comment_id) {
298 298
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
         if (isset($old_rating)) {
302 302
 
303
-            $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET
303
+            $sqlqry = $wpdb->prepare("UPDATE ".GEODIR_REVIEW_TABLE." SET
304 304
 						overall_rating = %f,
305 305
 						status		= %s,
306 306
 						comment_content = %s 
@@ -342,18 +342,18 @@  discard block
 block discarded – undo
342 342
 
343 343
     $post_type = get_post_type($post_id);
344 344
 
345
-    $detail_table = $plugin_prefix . $post_type . '_detail';
345
+    $detail_table = $plugin_prefix.$post_type.'_detail';
346 346
 
347 347
     if (isset($_REQUEST['geodir_overallrating'])) {
348 348
 
349 349
         $overall_rating = $_REQUEST['geodir_overallrating'];
350 350
 
351
-        if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
351
+        if (isset($comment_info->comment_parent) && (int) $comment_info->comment_parent == 0) {
352 352
             $overall_rating = $overall_rating > 0 ? $overall_rating : '0';
353 353
 
354 354
             if (isset($old_rating)) {
355 355
 
356
-                $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET
356
+                $sqlqry = $wpdb->prepare("UPDATE ".GEODIR_REVIEW_TABLE." SET
357 357
 						overall_rating = %f,
358 358
 						status		= %s,
359 359
 						comment_content	= %s 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
     $wpdb->query(
393 393
         $wpdb->prepare(
394
-            "DELETE FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d",
394
+            "DELETE FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d",
395 395
             array($comment_id)
396 396
         )
397 397
     );
@@ -410,9 +410,9 @@  discard block
 block discarded – undo
410 410
  * @return string The comment content.
411 411
  */
412 412
 function geodir_wrap_comment_text($content, $comment = '') {
413
-    if (!empty($comment->comment_post_ID) && geodir_cpt_has_rating_disabled((int)$comment->comment_post_ID)) {
413
+    if (!empty($comment->comment_post_ID) && geodir_cpt_has_rating_disabled((int) $comment->comment_post_ID)) {
414 414
         if (!is_admin()) {
415
-            return '<div class="description">' . $content . '</div>';
415
+            return '<div class="description">'.$content.'</div>';
416 416
         } else {
417 417
             return $content;
418 418
         }
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
         if (!empty($comment))
422 422
             $rating = geodir_get_commentoverall($comment->comment_ID);
423 423
         if ($rating != 0 && !is_admin()) {
424
-            return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>';
424
+            return '<div><div class="gd-rating-text">'.__('Overall Rating', 'geodirectory').': <div class="rating">'.$rating.'</div></div>'.geodir_get_rating_stars($rating, $comment->comment_ID).'</div><div class="description">'.$content.'</div>';
425 425
         } else
426 426
             return $content;
427 427
     }
@@ -445,18 +445,18 @@  discard block
 block discarded – undo
445 445
     if (!$post_type) {
446 446
         $post_type = get_post_type($post_id);
447 447
     }
448
-    $detail_table = $plugin_prefix . $post_type . '_detail';
448
+    $detail_table = $plugin_prefix.$post_type.'_detail';
449 449
     $post_newrating = geodir_get_post_rating($post_id, 1);
450 450
     $post_newrating_count = geodir_get_review_count_total($post_id);
451 451
 
452 452
 
453 453
     //$post_newrating = ( (float)$post_oldrating - (float)$old_rating ) + (float)$overall_rating ;
454 454
 
455
-    if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) {
455
+    if ($wpdb->get_var("SHOW TABLES LIKE '".$detail_table."'") == $detail_table) {
456 456
 
457 457
         $wpdb->query(
458 458
             $wpdb->prepare(
459
-                "UPDATE " . $detail_table . " SET
459
+                "UPDATE ".$detail_table." SET
460 460
 						overall_rating = %f,
461 461
 						rating_count = %f
462 462
 						where post_id = %d",
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
      * @package GeoDirectory
476 476
      * @param int $post_id The post ID.
477 477
      */
478
-    do_action('geodir_update_postrating',$post_id);
478
+    do_action('geodir_update_postrating', $post_id);
479 479
 
480 480
 }
481 481
 
@@ -496,13 +496,13 @@  discard block
 block discarded – undo
496 496
     global $wpdb, $plugin_prefix;
497 497
 
498 498
     $post_type = get_post_type($post_id);
499
-    $detail_table = $plugin_prefix . $post_type . '_detail';
499
+    $detail_table = $plugin_prefix.$post_type.'_detail';
500 500
 
501
-    if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) {
501
+    if ($wpdb->get_var("SHOW TABLES LIKE '".$detail_table."'") == $detail_table) {
502 502
 
503 503
         $post_ratings = $wpdb->get_var(
504 504
             $wpdb->prepare(
505
-                "SELECT overall_rating FROM " . $detail_table . " WHERE post_id = %d",
505
+                "SELECT overall_rating FROM ".$detail_table." WHERE post_id = %d",
506 506
                 array($post_id)
507 507
             )
508 508
         );
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 
537 537
     $reatings = $wpdb->get_row(
538 538
         $wpdb->prepare(
539
-            "SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d",
539
+            "SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id = %d",
540 540
             array($comment_id)
541 541
         )
542 542
     );
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 
565 565
     $results = $wpdb->get_var(
566 566
         $wpdb->prepare(
567
-            "SELECT SUM(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
567
+            "SELECT SUM(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0",
568 568
             array($post_id)
569 569
         )
570 570
     );
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
     global $wpdb;
592 592
     $results = $wpdb->get_var(
593 593
         $wpdb->prepare(
594
-            "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE user_id = %d AND status=1 AND overall_rating>0",
594
+            "SELECT COUNT(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE user_id = %d AND status=1 AND overall_rating>0",
595 595
             array($user_id)
596 596
         )
597 597
     );
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
 
630 630
     $results = $wpdb->get_var(
631 631
         $wpdb->prepare(
632
-            "SELECT COALESCE(avg(overall_rating),0) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
632
+            "SELECT COALESCE(avg(overall_rating),0) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0",
633 633
             array($post_id)
634 634
         )
635 635
     );
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 
658 658
     $results = $wpdb->get_var(
659 659
         $wpdb->prepare(
660
-            "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
660
+            "SELECT COUNT(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0",
661 661
             array($post_id)
662 662
         )
663 663
     );
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 
687 687
     $results = $wpdb->get_var(
688 688
         $wpdb->prepare(
689
-            "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
689
+            "SELECT COUNT(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0",
690 690
             array($post_id)
691 691
         )
692 692
     );
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 
716 716
     $reatings = $wpdb->get_var(
717 717
         $wpdb->prepare(
718
-            "SELECT overall_rating FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d",
718
+            "SELECT overall_rating FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id = %d",
719 719
             array($comment_id)
720 720
         )
721 721
     );
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
     if (in_array($post->post_type, $post_types)) { // assuming there is a post type called business
766 766
         $template = locate_template(array("geodirectory/reviews.php")); // Use theme template if available
767 767
         if (!$template) {
768
-            $template = dirname(__FILE__) . '/reviews.php';
768
+            $template = dirname(__FILE__).'/reviews.php';
769 769
         }
770 770
         return $template;
771 771
     }
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
                         printf('<cite><b class="reviewer">%1$s</b> %2$s</cite>',
838 838
                             get_comment_author_link(),
839 839
                             // If current post author is also comment author, make it known visually.
840
-                            ($comment->user_id === $post->post_author) ? '<span>' . __('Post author', 'geodirectory') . '</span>' : ''
840
+                            ($comment->user_id === $post->post_author) ? '<span>'.__('Post author', 'geodirectory').'</span>' : ''
841 841
                         );
842 842
                         echo "<span class='item'><small><span class='fn'>$post->post_title</span></small></span>";
843 843
                         printf('<a href="%1$s"><time datetime="%2$s" class="dtreviewed">%3$s<span class="value-title" title="%2$s"></span></time></a>',
@@ -928,29 +928,29 @@  discard block
 block discarded – undo
928 928
  */
929 929
 function geodir_get_rating_stars($rating, $post_id, $small = false)
930 930
 {
931
-    if (!empty($post_id) && geodir_cpt_has_rating_disabled((int)$post_id)) {
931
+    if (!empty($post_id) && geodir_cpt_has_rating_disabled((int) $post_id)) {
932 932
         return NULL;
933 933
     }
934 934
     $a_rating = $rating / 5 * 100;
935 935
 
936 936
     if ($small) {
937
-        $r_html = '<div class="rating"><div class="gd_rating_map" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star_small"></div></div></div>';
937
+        $r_html = '<div class="rating"><div class="gd_rating_map" data-average="'.$rating.'" data-id="'.$post_id.'"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: '.$a_rating.'%;"></div><div class="geodir_Star_small"></div></div></div>';
938 938
     } else {
939 939
 		if (function_exists('geodir_reviewrating_draw_overall_rating')) {
940 940
 			// Show rating stars from review rating manager
941 941
 			$r_html = geodir_reviewrating_draw_overall_rating($rating);
942 942
 		} else {
943
-			$rating_img = '<img alt="rating icon" src="' . get_option('geodir_default_rating_star_icon') . '" />';
943
+			$rating_img = '<img alt="rating icon" src="'.get_option('geodir_default_rating_star_icon').'" />';
944 944
 			
945 945
 			/* fix rating star for safari */
946 946
 			$star_width = 23 * 5;
947 947
 			
948 948
 			if ($star_width > 0) {
949
-				$attach_style = 'max-width:' . $star_width . 'px';
949
+				$attach_style = 'max-width:'.$star_width.'px';
950 950
 			} else {
951 951
 				$attach_style = '';
952 952
 			}
953
-			$r_html = '<div class="geodir-rating" style="' . $attach_style . '"><div class="gd_rating_show" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingAverage" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star">' . $rating_img . $rating_img . $rating_img . $rating_img . $rating_img . '</div></div></div>';
953
+			$r_html = '<div class="geodir-rating" style="'.$attach_style.'"><div class="gd_rating_show" data-average="'.$rating.'" data-id="'.$post_id.'"><div class="geodir_RatingAverage" style="width: '.$a_rating.'%;"></div><div class="geodir_Star">'.$rating_img.$rating_img.$rating_img.$rating_img.$rating_img.'</div></div></div>';
954 954
 		}
955 955
     }
956 956
     return apply_filters('geodir_get_rating_stars_html', $r_html, $rating, 5);
@@ -990,10 +990,10 @@  discard block
 block discarded – undo
990 990
 /*
991 991
  * If Disqus plugin is active, do some fixes to show on blogs but no on GD post types
992 992
  */
993
-if(function_exists('dsq_can_replace')) {
993
+if (function_exists('dsq_can_replace')) {
994 994
     remove_filter('comments_template', 'dsq_comments_template');
995 995
     add_filter('comments_template', 'dsq_comments_template', 100);
996
-    add_filter('pre_option_disqus_active', 'geodir_option_disqus_active',10,1);
996
+    add_filter('pre_option_disqus_active', 'geodir_option_disqus_active', 10, 1);
997 997
 }
998 998
 
999 999
 
@@ -1006,11 +1006,11 @@  discard block
 block discarded – undo
1006 1006
  * @param string $disqus_active Hook called before DB call for option so this is empty.
1007 1007
  * @return string `1` if active `0` if disabled.
1008 1008
  */
1009
-function geodir_option_disqus_active($disqus_active){
1009
+function geodir_option_disqus_active($disqus_active) {
1010 1010
     global $post;
1011 1011
     $all_postypes = geodir_get_posttypes();
1012 1012
 
1013
-    if(isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type,$all_postypes)){
1013
+    if (isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
1014 1014
         $disqus_active = '0';
1015 1015
     }
1016 1016
 
Please login to merge, or discard this patch.