Test Failed
Push — master ( d1dc8e...305a97 )
by Stiofan
09:28
created
geodirectory_template_actions.php 1 patch
Spacing   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
     //php
284 284
     if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
285
+        include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
286 286
     }
287 287
 
288 288
     //geodir_full_page_class
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454 454
     if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
455
+        $width_css = 'style="width:'.$width.'%;"';
456 456
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
457
+        $width_css = 'style="width:'.$width.'%;"';
458 458
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
459
+        $width_css = 'style="width:'.$width.'%;"';
460 460
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
461
+        $width_css = 'style="width:'.$width.'%;"';
462 462
     } else {
463 463
         $width_css = '';
464 464
     }
@@ -572,13 +572,13 @@  discard block
 block discarded – undo
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574 574
     if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
575
+        $width_css = 'style="width:'.$width.'%;"';
576 576
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
577
+        $width_css = 'style="width:'.$width.'%;"';
578 578
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
579
+        $width_css = 'style="width:'.$width.'%;"';
580 580
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
581
+        $width_css = 'style="width:'.$width.'%;"';
582 582
     } else {
583 583
         $width_css = '';
584 584
     }
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
         }
677 677
     }
678 678
 
679
-    $post = (object)$_REQUEST;
679
+    $post = (object) $_REQUEST;
680 680
 
681 681
 
682 682
     if (isset($post->video)) {
@@ -735,10 +735,10 @@  discard block
 block discarded – undo
735 735
 
736 736
     $json = '{';
737 737
     $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
738
+    $json .= '"t": "'.$json_title.'",';
739
+    $json .= '"lt": "'.$post_latitude.'",';
740
+    $json .= '"ln": "'.$post_longitude.'",';
741
+    $json .= '"i":"'.$term_icon.'"';
742 742
     $json .= '}';
743 743
 
744 744
     $post->marker_json = $json;
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
      * @param string $class The class to use. Default is 'entry-header'.
966 966
      */
967 967
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
968
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
                     $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020 1020
 
1021 1021
                     if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1022
+                        $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
1023 1023
                     }
1024 1024
 
1025 1025
                     if (isset($image->src)) {
@@ -1031,9 +1031,9 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
                         $image_title = isset($image->title) ? $image->title : '';
1033 1033
 
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1034
+                        $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1035
+                        $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>';
1036
+                        $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>';
1037 1037
                         $slides++;
1038 1038
                     }
1039 1039
                 }
@@ -1052,10 +1052,10 @@  discard block
 block discarded – undo
1052 1052
                 } else {
1053 1053
                     $spacer_height = ((400 - $image->height) / 2);
1054 1054
                 }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1055
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+                $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1057
+                $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+                $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
1059 1059
                 $slides++;
1060 1060
             }
1061 1061
         }// endfore
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+    global $preview, $post; ?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096 1096
     $taxonomies = array();
@@ -1099,11 +1099,11 @@  discard block
 block discarded – undo
1099 1099
 
1100 1100
     if ($preview && !$is_backend_preview) {
1101 1101
         $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1102
+        $post_taxonomy = $post_type.'category';
1103 1103
         $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104 1104
     } else {
1105 1105
         $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1106
+        $post_taxonomy = $post_type.'category';
1107 1107
     }
1108 1108
 //{	
1109 1109
     $post_type_info = get_post_type_object($post_type);
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
     if (!empty($post->post_tags)) {
1113 1113
 
1114
-        if (taxonomy_exists($post_type . '_tags')):
1114
+        if (taxonomy_exists($post_type.'_tags')):
1115 1115
             $links = array();
1116 1116
             $terms = array();
1117 1117
             // to limit post tags
@@ -1138,8 +1138,8 @@  discard block
 block discarded – undo
1138 1138
                 $post_term = trim($post_term);
1139 1139
 
1140 1140
                 $priority_location = false;
1141
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1141
+                if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
1142
+                    $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
1143 1143
                 } else {
1144 1144
                     $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145 1145
                     $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
@@ -1149,10 +1149,10 @@  discard block
 block discarded – undo
1149 1149
                     $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150 1150
                     if ($match_country || $match_region || $match_city) {
1151 1151
                         $priority_location = true;
1152
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1152
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1153 1153
                     } else {
1154
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1154
+                        $insert_term = wp_insert_term($post_term, $post_type.'_tags');
1155
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1156 1156
                     }
1157 1157
                 }
1158 1158
 
@@ -1169,12 +1169,12 @@  discard block
 block discarded – undo
1169 1169
                          * @param string $tag_link The tag link html.
1170 1170
                          * @param object $term The tag term object.
1171 1171
                          */
1172
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1173 1173
                         $links[] = $tag_link;
1174 1174
                     } else {
1175
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
+                        $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>";
1176 1176
                         /** This action is documented in geodirectory-template_actions.php */
1177
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1178 1178
                         $links[] = $tag_link;
1179 1179
                     }
1180 1180
                     $terms[] = $term;
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
             if (!isset($listing_label)) {
1185 1185
                 $listing_label = '';
1186 1186
             }
1187
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
+            $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1188 1188
         endif;
1189 1189
 
1190 1190
     }
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
                     $term = get_term_by('id', $post_term, $post_taxonomy);
1213 1213
 
1214 1214
                     if (is_object($term)) {
1215
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
+                        $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>";
1216 1216
                         /**
1217 1217
                          * Filter the category name on the details page.
1218 1218
                          *
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
                          * @param string $term_link The link html to the category.
1221 1221
                          * @param object $term The category term object.
1222 1222
                          */
1223
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1224 1224
                         $links[] = $term_link;
1225 1225
                         $terms[] = $term;
1226 1226
                     }
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
         if (!isset($listing_label)) {
1239 1239
             $listing_label = '';
1240 1240
         }
1241
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1241
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1242 1242
 
1243 1243
     }
1244 1244
 
@@ -1251,14 +1251,14 @@  discard block
 block discarded – undo
1251 1251
      * @param string $listing_label The post type label.
1252 1252
      * @param string $listing_label The post type label with ucwords function.
1253 1253
      */
1254
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1254
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1255 1255
 
1256 1256
     if (isset($taxonomies[$post_taxonomy])) {
1257
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
+        echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>';
1258 1258
     }
1259 1259
 
1260
-    if (isset($taxonomies[$post_type . '_tags']))
1261
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1260
+    if (isset($taxonomies[$post_type.'_tags']))
1261
+        echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>';
1262 1262
 
1263 1263
     ?>
1264 1264
     </p><?php
@@ -1279,11 +1279,11 @@  discard block
 block discarded – undo
1279 1279
  * @param object $post Optional. The post object or blank.
1280 1280
  * @package GeoDirectory
1281 1281
  */
1282
-function geodir_action_details_micordata($post='')
1282
+function geodir_action_details_micordata($post = '')
1283 1283
 {
1284 1284
 
1285 1285
     global $preview;
1286
-    if(empty($post)){global $post;}
1286
+    if (empty($post)) {global $post; }
1287 1287
     if ($preview || !geodir_is_page('detail')) {
1288 1288
         return;
1289 1289
     }
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
                 "description" => $review->comment_content,
1305 1305
                 "reviewRating" => array(
1306 1306
                     "@type" => "Rating",
1307
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
+                    "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1308 1308
                     "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309 1309
                     "worstRating" => "1"
1310 1310
                 )
@@ -1332,13 +1332,13 @@  discard block
 block discarded – undo
1332 1332
     }
1333 1333
     //print_r($post);
1334 1334
     // external links
1335
-    $external_links =  array();
1335
+    $external_links = array();
1336 1336
     $external_links[] = $post->geodir_website;
1337 1337
     $external_links[] = $post->geodir_twitter;
1338 1338
     $external_links[] = $post->geodir_facebook;
1339 1339
     $external_links = array_filter($external_links);
1340 1340
 
1341
-    if(!empty($external_links)){
1341
+    if (!empty($external_links)) {
1342 1342
         $external_links = array_values($external_links);
1343 1343
     }
1344 1344
 
@@ -1348,17 +1348,17 @@  discard block
 block discarded – undo
1348 1348
 
1349 1349
     // schema type
1350 1350
     $schema_type = 'LocalBusiness';
1351
-    if(isset($post->default_category) && $post->default_category){
1351
+    if (isset($post->default_category) && $post->default_category) {
1352 1352
         $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
-        if($cat_schema){$schema_type = $cat_schema;}
1354
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
+        if ($cat_schema) {$schema_type = $cat_schema; }
1354
+        if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1355 1355
     }
1356 1356
 
1357 1357
     $schema = array();
1358 1358
     $schema['@context'] = "http://schema.org";
1359 1359
     $schema['@type'] = $schema_type;
1360 1360
     $schema['name'] = $post->post_name;
1361
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1361
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1362 1362
     $schema['telephone'] = $post->geodir_contact;
1363 1363
     $schema['url'] = $c_url;
1364 1364
     $schema['sameAs'] = $external_links;
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
         "postalCode" => $post->post_zip
1373 1373
     );
1374 1374
 
1375
-    if($post->post_latitude && $post->post_longitude) {
1375
+    if ($post->post_latitude && $post->post_longitude) {
1376 1376
         $schema['geo'] = array(
1377 1377
             "@type" => "GeoCoordinates",
1378 1378
             "latitude" => $post->post_latitude,
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
         );
1381 1381
     }
1382 1382
 
1383
-    if($post_avgratings) {
1383
+    if ($post_avgratings) {
1384 1384
         $schema['aggregateRating'] = array(
1385 1385
             "@type" => "AggregateRating",
1386 1386
             "ratingValue" => $post_avgratings,
@@ -1399,10 +1399,10 @@  discard block
 block discarded – undo
1399 1399
      * @param array $schema The array of schema data to be filtered.
1400 1400
      * @param object $post The post object.
1401 1401
      */
1402
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1402
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1403 1403
 
1404 1404
 
1405
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1405
+    echo '<script type="application/ld+json">'.json_encode($schema).'</script>';
1406 1406
 
1407 1407
 
1408 1408
     $uploads = wp_upload_dir();
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
      * @param string $facebook_og The open graph html to be filtered.
1416 1416
      * @param object $post The post object.
1417 1417
      */
1418
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1418
+    echo apply_filters('geodir_details_facebook_og', $facebook_og, $post);
1419 1419
 
1420 1420
 
1421 1421
 
@@ -1438,9 +1438,9 @@  discard block
 block discarded – undo
1438 1438
     ?>
1439 1439
     <div class="geodir-pos_navigation clearfix">
1440 1440
     <div
1441
-        class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
1441
+        class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
1442 1442
     <div
1443
-        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
1443
+        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
1444 1444
     </div><?php
1445 1445
 }
1446 1446
 
@@ -1509,12 +1509,12 @@  discard block
 block discarded – undo
1509 1509
     $gd_post_type = geodir_get_current_posttype();
1510 1510
     $post_type_info = get_post_type_object($gd_post_type);
1511 1511
 
1512
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1512
+    $add_string_in_title = __('All', 'geodirectory').' ';
1513 1513
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1514
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1514
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
1515 1515
     }
1516 1516
 
1517
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1517
+    $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory');
1518 1518
     $single_name = $post_type_info->labels->singular_name;
1519 1519
 
1520 1520
     $taxonomy = geodir_get_taxonomies($gd_post_type, true);
@@ -1542,12 +1542,12 @@  discard block
 block discarded – undo
1542 1542
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
1543 1543
         if (!empty($current_term)) {
1544 1544
             $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1545
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1545
+            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1546 1546
                 $location_last_char = substr($location_name, -1);
1547 1547
                 $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1548
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1548
+                $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1549 1549
             } else {
1550
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1550
+                $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1551 1551
             }
1552 1552
         } else {
1553 1553
             if (count($taxonomy) > 1) {
@@ -1555,12 +1555,12 @@  discard block
 block discarded – undo
1555 1555
 
1556 1556
                 if (!empty($current_term)) {
1557 1557
                     $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1558
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1558
+                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1559 1559
                         $location_last_char = substr($location_name, -1);
1560 1560
                         $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1561
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1561
+                        $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1562 1562
                     } else {
1563
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1563
+                        $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1564 1564
                     }
1565 1565
                 }
1566 1566
             }
@@ -1588,7 +1588,7 @@  discard block
 block discarded – undo
1588 1588
                 $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1589 1589
             }
1590 1590
 
1591
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1591
+            $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
1592 1592
         } else if ($gd_region != '') {
1593 1593
             if ($gd_region_actual != '') {
1594 1594
                 $gd_region = $gd_region_actual;
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
                 $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1599 1599
             }
1600 1600
 
1601
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1601
+            $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
1602 1602
         } else if ($gd_country != '') {
1603 1603
             if ($gd_country_actual != '') {
1604 1604
                 $gd_country = $gd_country_actual;
@@ -1608,12 +1608,12 @@  discard block
 block discarded – undo
1608 1608
                 $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1609 1609
             }
1610 1610
 
1611
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1611
+            $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
1612 1612
         }
1613 1613
     }
1614 1614
 
1615 1615
     if (is_search()) {
1616
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1616
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
1617 1617
     }
1618 1618
     /** This action is documented in geodirectory_template_actions.php */
1619 1619
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
@@ -1622,26 +1622,26 @@  discard block
 block discarded – undo
1622 1622
 
1623 1623
 
1624 1624
     $title = $list_title;
1625
-    if(geodir_is_page('pt')){
1625
+    if (geodir_is_page('pt')) {
1626 1626
         $gd_page = 'pt';
1627
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1627
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1628 1628
     }
1629
-    elseif(geodir_is_page('listing')){
1629
+    elseif (geodir_is_page('listing')) {
1630 1630
         $gd_page = 'listing';
1631 1631
         global $wp_query;
1632 1632
         $current_term = $wp_query->get_queried_object();
1633
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1633
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1634 1634
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1635
-        }else{
1635
+        } else {
1636 1636
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1637 1637
         }
1638 1638
 
1639 1639
     }
1640
-    elseif(geodir_is_page('author')){
1640
+    elseif (geodir_is_page('author')) {
1641 1641
         $gd_page = 'author';
1642
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1642
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1643 1643
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1644
-        }else{
1644
+        } else {
1645 1645
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1646 1646
         }
1647 1647
 
@@ -1655,16 +1655,16 @@  discard block
 block discarded – undo
1655 1655
      * @param string $title The page title including variables.
1656 1656
      * @param string $gd_page The GeoDirectory page type if any.
1657 1657
      */
1658
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1658
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1659 1659
 
1660
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1660
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
1661 1661
         /**
1662 1662
          * Filter the listing page title.
1663 1663
          *
1664 1664
          * @since 1.0.0
1665 1665
          * @param string $list_title The title for the category page.
1666 1666
          */
1667
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1667
+        apply_filters('geodir_listing_page_title', $title).'</h1></header>';
1668 1668
 }
1669 1669
 
1670 1670
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1683,16 +1683,16 @@  discard block
 block discarded – undo
1683 1683
     $gd_post_type = geodir_get_current_posttype();
1684 1684
     if (isset($current_term->term_id) && $current_term->term_id != '') {
1685 1685
 
1686
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1686
+        $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags');
1687 1687
         $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1688 1688
         if ($term_desc && !$saved_data) {
1689 1689
             $saved_data = $term_desc;
1690 1690
         }
1691 1691
 
1692 1692
         // stop payment manager filtering content length
1693
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1694
-        if ( false !== $filter_priority ) {
1695
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1693
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1694
+        if (false !== $filter_priority) {
1695
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1696 1696
         }
1697 1697
 
1698 1698
         /**
@@ -1706,14 +1706,14 @@  discard block
 block discarded – undo
1706 1706
         $cat_description = apply_filters('the_content', $saved_data);
1707 1707
 
1708 1708
 
1709
-        if ( false !== $filter_priority ) {
1710
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1709
+        if (false !== $filter_priority) {
1710
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1711 1711
         }
1712 1712
 
1713 1713
         if ($cat_description) {
1714 1714
             ?>
1715 1715
 
1716
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1716
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1717 1717
         }
1718 1718
 
1719 1719
     }
@@ -1763,13 +1763,13 @@  discard block
 block discarded – undo
1763 1763
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1764 1764
 {
1765 1765
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1766
-        $width_css = 'style="width:' . $width . '%;"';
1766
+        $width_css = 'style="width:'.$width.'%;"';
1767 1767
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1768
-        $width_css = 'style="width:' . $width . '%;"';
1768
+        $width_css = 'style="width:'.$width.'%;"';
1769 1769
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1770
-        $width_css = 'style="width:' . $width . '%;"';
1770
+        $width_css = 'style="width:'.$width.'%;"';
1771 1771
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1772
-        $width_css = 'style="width:' . $width . '%;"';
1772
+        $width_css = 'style="width:'.$width.'%;"';
1773 1773
     } else {
1774 1774
         $width_css = '';
1775 1775
     }
@@ -2074,11 +2074,11 @@  discard block
 block discarded – undo
2074 2074
 
2075 2075
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2076 2076
 
2077
-    if(geodir_is_page('add-listing')){
2077
+    if (geodir_is_page('add-listing')) {
2078 2078
         $gd_page = 'add-listing';
2079
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2079
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2080 2080
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2081
-        }elseif(isset($listing_type)){
2081
+        }elseif (isset($listing_type)) {
2082 2082
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2083 2083
         }
2084 2084
 
@@ -2092,9 +2092,9 @@  discard block
 block discarded – undo
2092 2092
      * @param string $title The page title including variables.
2093 2093
      * @param string $gd_page The GeoDirectory page type if any.
2094 2094
      */
2095
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2095
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2096 2096
 
2097
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2097
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2098 2098
     echo $title;
2099 2099
     echo '</h1></header>';
2100 2100
 }
@@ -2108,7 +2108,7 @@  discard block
 block discarded – undo
2108 2108
  */
2109 2109
 function geodir_action_add_listing_page_mandatory()
2110 2110
 {?>
2111
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2111
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2112 2112
 <?php
2113 2113
 }
2114 2114
 
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 
2144 2144
     if (isset($_REQUEST['backandedit'])) {
2145 2145
         global $post;
2146
-        $post = (object)$gd_session->get('listing');
2146
+        $post = (object) $gd_session->get('listing');
2147 2147
         $listing_type = $post->listing_type;
2148 2148
         $title = $post->post_title;
2149 2149
         $desc = $post->post_desc;
@@ -2158,7 +2158,7 @@  discard block
 block discarded – undo
2158 2158
         $thumb_img_arr = geodir_get_images($post->ID);
2159 2159
         if ($thumb_img_arr) {
2160 2160
             foreach ($thumb_img_arr as $post_img) {
2161
-                $curImages .= $post_img->src . ',';
2161
+                $curImages .= $post_img->src.',';
2162 2162
             }
2163 2163
         }
2164 2164
 
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
         $title = $post->post_title;
2167 2167
         $desc = $post->post_content;
2168 2168
         $kw_tags = $post->post_tags;
2169
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2169
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2170 2170
     } else {
2171 2171
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2172 2172
     }
@@ -2177,18 +2177,18 @@  discard block
 block discarded – undo
2177 2177
 
2178 2178
     $post_type_info = geodir_get_posttype_info($listing_type);
2179 2179
 
2180
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2180
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing', 'geodirectory');
2181 2181
 
2182 2182
     ?>
2183
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2184
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2185
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2183
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2184
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2185
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2186 2186
         <?php if ($page_id) { ?>
2187
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2187
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2188 2188
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2189
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2189
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2190 2190
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2191
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2191
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2192 2192
         <?php
2193 2193
         } 
2194 2194
         /**
@@ -2200,7 +2200,7 @@  discard block
 block discarded – undo
2200 2200
          */
2201 2201
         do_action('geodir_before_detail_fields');
2202 2202
         ?>
2203
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2203
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2204 2204
         <?php
2205 2205
         /**
2206 2206
          * Called at the top of the add listing page form for frontend.
@@ -2212,10 +2212,10 @@  discard block
 block discarded – undo
2212 2212
         do_action('geodir_before_main_form_fields');
2213 2213
         ?>
2214 2214
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2215
-            <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
2215
+            <label><?php echo sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name); ?><span>*</span> </label>
2216 2216
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2217 2217
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2218
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2218
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2219 2219
         </div>
2220 2220
         <?php
2221 2221
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2250,7 +2250,7 @@  discard block
 block discarded – undo
2250 2250
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2251 2251
         
2252 2252
         $desc_class = '';
2253
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2253
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2254 2254
             /**
2255 2255
              * Called on the add listing page form for frontend just before the description field.
2256 2256
              *
@@ -2263,8 +2263,8 @@  discard block
 block discarded – undo
2263 2263
             $desc_class = ' hidden';
2264 2264
         }
2265 2265
         ?>
2266
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2267
-            <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2266
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2267
+            <label><?php echo sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2268 2268
             <?php
2269 2269
             if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2270 2270
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2273,16 +2273,16 @@  discard block
 block discarded – undo
2273 2273
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2274 2274
                 </div>
2275 2275
             <?php if ($desc_limit != '') { ?>
2276
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2276
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2277 2277
             <?php } } else { ?>
2278 2278
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2279 2279
             <?php } if ($desc_limit_msg != '') { ?>
2280 2280
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2281 2281
             <?php } ?>
2282
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2282
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2283 2283
         </div>
2284 2284
         <?php
2285
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2285
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2286 2286
             /**
2287 2287
              * Called on the add listing page form for frontend just after the description field.
2288 2288
              *
@@ -2321,7 +2321,7 @@  discard block
 block discarded – undo
2321 2321
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2322 2322
         
2323 2323
         $tags_class = '';
2324
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2324
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2325 2325
             /**
2326 2326
              * Called on the add listing page form for frontend just before the tags field.
2327 2327
              *
@@ -2332,14 +2332,14 @@  discard block
 block discarded – undo
2332 2332
             $tags_class = ' hidden';
2333 2333
         }
2334 2334
         ?>
2335
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2335
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2336 2336
             <label><?php echo TAGKW_TEXT; ?></label>
2337 2337
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2338
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2339
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2338
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2339
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2340 2340
         </div>
2341 2341
         <?php
2342
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2342
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2343 2343
             /**
2344 2344
              * Called on the add listing page form for frontend just after the tags field.
2345 2345
              *
@@ -2365,7 +2365,7 @@  discard block
 block discarded – undo
2365 2365
         $thumb_img_arr = array();
2366 2366
         $totImg = 0;
2367 2367
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2368
-            $post = (object)$gd_session->get('listing');
2368
+            $post = (object) $gd_session->get('listing');
2369 2369
             if (isset($post->post_images))
2370 2370
                 $curImages = trim($post->post_images, ",");
2371 2371
 
@@ -2378,7 +2378,7 @@  discard block
 block discarded – undo
2378 2378
             $listing_type = $post->listing_type;
2379 2379
 
2380 2380
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2381
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2381
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2382 2382
             $listing_type = $post->post_type;
2383 2383
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2384 2384
 
@@ -2392,7 +2392,7 @@  discard block
 block discarded – undo
2392 2392
                 //$curImages = $img->src.",";
2393 2393
             }
2394 2394
 
2395
-            $totImg = count((array)$thumb_img_arr);
2395
+            $totImg = count((array) $thumb_img_arr);
2396 2396
         }
2397 2397
 
2398 2398
         if ($curImages != '')
@@ -2413,15 +2413,15 @@  discard block
 block discarded – undo
2413 2413
         if ($show_image_input_box) {
2414 2414
             ?>
2415 2415
 
2416
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2416
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2417 2417
                 <?php if ($image_limit == 1) {
2418
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2418
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2419 2419
                 } ?>
2420 2420
                 <?php if ($image_limit > 1) {
2421
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2421
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2422 2422
                 } ?>
2423 2423
                 <?php if ($image_limit == '') {
2424
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2424
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2425 2425
                 } ?>
2426 2426
             </h5>
2427 2427
 
@@ -2436,11 +2436,11 @@  discard block
 block discarded – undo
2436 2436
                 <div
2437 2437
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2438 2438
                     id="<?php echo $id; ?>plupload-upload-ui">
2439
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2439
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2440 2440
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2441 2441
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2442 2442
                     <span class="ajaxnonceplu"
2443
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2443
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2444 2444
                     <?php if ($width && $height): ?>
2445 2445
                         <span class="plupload-resize"></span>
2446 2446
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2454 2454
                 </div>
2455 2455
                 <span
2456
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2456
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2457 2457
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2458 2458
             </div>
2459 2459
 
@@ -2465,7 +2465,7 @@  discard block
 block discarded – undo
2465 2465
          *
2466 2466
          * @since 1.0.0
2467 2467
          */
2468
-        do_action('geodir_after_main_form_fields');?>
2468
+        do_action('geodir_after_main_form_fields'); ?>
2469 2469
 
2470 2470
 
2471 2471
         <!-- add captcha code -->
@@ -2476,7 +2476,7 @@  discard block
 block discarded – undo
2476 2476
         </script>
2477 2477
         <noscript>
2478 2478
             <div>
2479
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2479
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2480 2480
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2481 2481
             </div>
2482 2482
         </noscript>
@@ -2486,10 +2486,10 @@  discard block
 block discarded – undo
2486 2486
         <!-- end captcha code -->
2487 2487
 
2488 2488
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2489
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2490
-                   class="geodir_button" <?php echo $submit_button;?>/>
2489
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2490
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2491 2491
             <span class="geodir_message_note"
2492
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2492
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2493 2493
         </div>
2494 2494
 
2495 2495
     </form>
@@ -2551,7 +2551,7 @@  discard block
 block discarded – undo
2551 2551
         class="<?php
2552 2552
         /** This action is documented in geodirectory_template_actions.php */
2553 2553
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2554
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2554
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2555 2555
     </div><!-- clearfix ends here-->
2556 2556
 <?php
2557 2557
 }
@@ -2573,7 +2573,7 @@  discard block
 block discarded – undo
2573 2573
 
2574 2574
     ?>
2575 2575
     <script type="text/javascript">
2576
-        <?php if ( $user_login ) { ?>
2576
+        <?php if ($user_login) { ?>
2577 2577
         setTimeout(function () {
2578 2578
             try {
2579 2579
                 d = document.getElementById('user_pass');
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
         <?php } ?>
2591 2591
     </script>
2592 2592
     <script type="text/javascript">
2593
-        <?php if ( $user_login ) { ?>
2593
+        <?php if ($user_login) { ?>
2594 2594
         setTimeout(function () {
2595 2595
             try {
2596 2596
                 d = document.getElementById('user_pass');
@@ -2615,7 +2615,7 @@  discard block
 block discarded – undo
2615 2615
         foreach ($errors as $errorsObj) {
2616 2616
             foreach ($errorsObj as $key => $val) {
2617 2617
                 for ($i = 0; $i < count($val); $i++) {
2618
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2618
+                    echo "<div class=error_msg_fix>".$val[$i].'</div>';
2619 2619
                     $registration_error_msg = 1;
2620 2620
                 }
2621 2621
             }
@@ -2632,7 +2632,7 @@  discard block
 block discarded – undo
2632 2632
              *
2633 2633
              * @since 1.0.0
2634 2634
              */
2635
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2635
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2636 2636
         </div>
2637 2637
 
2638 2638
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
@@ -2644,7 +2644,7 @@  discard block
 block discarded – undo
2644 2644
              *
2645 2645
              * @since 1.0.0
2646 2646
              */
2647
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2647
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2648 2648
         </div>
2649 2649
 
2650 2650
     <?php } else { ?>
@@ -2656,7 +2656,7 @@  discard block
 block discarded – undo
2656 2656
              *
2657 2657
              * @since 1.0.0
2658 2658
              */
2659
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2659
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2660 2660
         </div>
2661 2661
         <div class="registration_form_r">
2662 2662
             <?php
@@ -2665,7 +2665,7 @@  discard block
 block discarded – undo
2665 2665
              *
2666 2666
              * @since 1.0.0
2667 2667
              */
2668
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2668
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2669 2669
         </div>
2670 2670
 
2671 2671
     <?php }?>
@@ -2701,12 +2701,12 @@  discard block
 block discarded – undo
2701 2701
     $gd_post_type = geodir_get_current_posttype();
2702 2702
     $post_type_info = get_post_type_object($gd_post_type);
2703 2703
 
2704
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2704
+    $add_string_in_title = __('All', 'geodirectory').' ';
2705 2705
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2706
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2706
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2707 2707
     }
2708 2708
 
2709
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2709
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2710 2710
     $single_name = $post_type_info->labels->singular_name;
2711 2711
 
2712 2712
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2714,12 +2714,12 @@  discard block
 block discarded – undo
2714 2714
     if (!empty($term)) {
2715 2715
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2716 2716
         if (!empty($current_term))
2717
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2717
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2718 2718
     }
2719 2719
 
2720 2720
 
2721 2721
     if (is_search()) {
2722
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2722
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2723 2723
 
2724 2724
     }
2725 2725
     /** This action is documented in geodirectory_template_actions.php */
@@ -2728,11 +2728,11 @@  discard block
 block discarded – undo
2728 2728
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2729 2729
 
2730 2730
     $title = $list_title;
2731
-    if(geodir_is_page('author')){
2731
+    if (geodir_is_page('author')) {
2732 2732
         $gd_page = 'author';
2733
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2733
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2734 2734
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2735
-        }else{
2735
+        } else {
2736 2736
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2737 2737
         }
2738 2738
 
@@ -2746,16 +2746,16 @@  discard block
 block discarded – undo
2746 2746
      * @param string $title The page title including variables.
2747 2747
      * @param string $gd_page The GeoDirectory page type if any.
2748 2748
      */
2749
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2749
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2750 2750
 
2751
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2751
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2752 2752
         /**
2753 2753
          * Filter the author page title text.
2754 2754
          *
2755 2755
          * @since 1.0.0
2756 2756
          * @param string $list_title The title for the page.
2757 2757
          */
2758
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2758
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2759 2759
 }
2760 2760
 
2761 2761
 
@@ -2960,19 +2960,19 @@  discard block
 block discarded – undo
2960 2960
     $post_type_info = get_post_type_object($gd_post_type);
2961 2961
 
2962 2962
     $pt_name = '';
2963
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2963
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2964 2964
 
2965 2965
     if (is_search()) {
2966
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2966
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2967 2967
 
2968 2968
     }
2969 2969
     /** This action is documented in geodirectory_template_actions.php */
2970 2970
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2971 2971
     /** This action is documented in geodirectory_template_actions.php */
2972 2972
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2973
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2973
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2974 2974
         /** This action is documented in geodirectory_template_actions.php */
2975
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2975
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
2976 2976
 }
2977 2977
 
2978 2978
 // action for adding the listings page top widget area
@@ -3376,7 +3376,7 @@  discard block
 block discarded – undo
3376 3376
         $gd_post_type = geodir_get_current_posttype();
3377 3377
         $post_type_info = get_post_type_object($gd_post_type);
3378 3378
 
3379
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3379
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3380 3380
     }
3381 3381
     return $list_title;
3382 3382
 }
@@ -3392,7 +3392,7 @@  discard block
 block discarded – undo
3392 3392
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3393 3393
  * @param string $gd_page The geodirectory page type. Default null.
3394 3394
  */
3395
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3395
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3396 3396
     global $post;
3397 3397
         
3398 3398
     $gd_page_id = NULL;
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_input_functions.php 1 patch
Spacing   +233 added lines, -233 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string The html to output for the custom field.
19 19
  */
20
-function geodir_cfi_fieldset($html,$cf){
20
+function geodir_cfi_fieldset($html, $cf) {
21 21
 
22 22
     $html_var = $cf['htmlvar_name'];
23 23
 
24 24
     // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
25
+    if (has_filter("geodir_custom_field_input_fieldset_{$html_var}")) {
26 26
         /**
27 27
          * Filter the fieldset html by individual custom field.
28 28
          *
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
          * @param array $cf The custom field array.
31 31
          * @since 1.6.6
32 32
          */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
33
+        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}", $html, $cf);
34 34
     }
35 35
 
36 36
     // If no html then we run the standard output.
37
-    if(empty($html)) {
37
+    if (empty($html)) {
38 38
 
39 39
         ob_start(); // Start  buffering;
40 40
         ?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42 42
             gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo $cf['site_title']; ?>
43
-            <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . $cf['desc'] . ' )</small>';
43
+            <?php if ($cf['desc'] != '') {
44
+                echo '<small>( '.$cf['desc'].' )</small>';
45 45
             } ?></h5>
46 46
         <?php
47 47
         $html = ob_get_clean();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     return $html;
51 51
 }
52
-add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
52
+add_filter('geodir_custom_field_input_fieldset', 'geodir_cfi_fieldset', 10, 2);
53 53
 
54 54
 
55 55
 
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
  *
63 63
  * @return string The html to output for the custom field.
64 64
  */
65
-function geodir_cfi_text($html,$cf){
65
+function geodir_cfi_text($html, $cf) {
66 66
 
67 67
     $html_var = $cf['htmlvar_name'];
68 68
 
69 69
     // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
70
+    if (has_filter("geodir_custom_field_input_text_{$html_var}")) {
71 71
         /**
72 72
          * Filter the text html by individual custom field.
73 73
          *
@@ -75,41 +75,41 @@  discard block
 block discarded – undo
75 75
          * @param array $cf The custom field array.
76 76
          * @since 1.6.6
77 77
          */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
78
+        $html = apply_filters("geodir_custom_field_input_text_{$html_var}", $html, $cf);
79 79
     }
80 80
 
81 81
     // If no html then we run the standard output.
82
-    if(empty($html)) {
82
+    if (empty($html)) {
83 83
 
84 84
         ob_start(); // Start  buffering;
85 85
 
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if (isset($cf['data_type']) && $cf['data_type'] == 'INT') {$type = 'number'; }
90
+        elseif (isset($cf['data_type']) && $cf['data_type'] == 'FLOAT') {$type = 'float'; }
91 91
 
92 92
         //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
93
+        if (isset($cf['validation_pattern']) && $cf['validation_pattern']) {
94 94
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
95
+        } else {$validation = ''; }
96 96
 
97 97
         // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
98
+        if (isset($cf['validation_msg']) && $cf['validation_msg']) {
99 99
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
100
+        } else {$validation_msg = ''; }
101 101
         ?>
102 102
 
103
-        <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+        <div id="<?php echo $cf['name']; ?>_row"
104
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 107
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
108
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
109 109
             </label>
110
-            <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
112
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
110
+            <input field_type="<?php echo $type; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
111
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> />
112
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
113 113
             <?php if ($cf['is_required']) { ?>
114 114
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
115 115
             <?php } ?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     return $html;
123 123
 }
124
-add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
124
+add_filter('geodir_custom_field_input_text', 'geodir_cfi_text', 10, 2);
125 125
 
126 126
 
127 127
 /**
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return string The html to output for the custom field.
135 135
  */
136
-function geodir_cfi_email($html,$cf){
136
+function geodir_cfi_email($html, $cf) {
137 137
 
138 138
     $html_var = $cf['htmlvar_name'];
139 139
 
140 140
     // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
141
+    if (has_filter("geodir_custom_field_input_email_{$html_var}")) {
142 142
         /**
143 143
          * Filter the email html by individual custom field.
144 144
          *
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
          * @param array $cf The custom field array.
147 147
          * @since 1.6.6
148 148
          */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
149
+        $html = apply_filters("geodir_custom_field_input_email_{$html_var}", $html, $cf);
150 150
     }
151 151
 
152 152
     // If no html then we run the standard output.
153
-    if(empty($html)) {
153
+    if (empty($html)) {
154 154
 
155 155
         ob_start(); // Start  buffering;
156 156
         $value = geodir_get_cf_value($cf);
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
             $value = '';
160 160
         }?>
161 161
 
162
-        <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
162
+        <div id="<?php echo $cf['name']; ?>_row"
163
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 166
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
167
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
168 168
             </label>
169
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
170
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
171
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
169
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
170
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/>
171
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
172 172
             <?php if ($cf['is_required']) { ?>
173 173
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
174 174
             <?php } ?>
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     return $html;
182 182
 }
183
-add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
183
+add_filter('geodir_custom_field_input_email', 'geodir_cfi_email', 10, 2);
184 184
 
185 185
 
186 186
 
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
  *
194 194
  * @return string The html to output for the custom field.
195 195
  */
196
-function geodir_cfi_phone($html,$cf){
196
+function geodir_cfi_phone($html, $cf) {
197 197
 
198 198
     $html_var = $cf['htmlvar_name'];
199 199
 
200 200
     // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
201
+    if (has_filter("geodir_custom_field_input_phone_{$html_var}")) {
202 202
         /**
203 203
          * Filter the phone html by individual custom field.
204 204
          *
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
          * @param array $cf The custom field array.
207 207
          * @since 1.6.6
208 208
          */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
209
+        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}", $html, $cf);
210 210
     }
211 211
 
212 212
     // If no html then we run the standard output.
213
-    if(empty($html)) {
213
+    if (empty($html)) {
214 214
 
215 215
         ob_start(); // Start  buffering;
216 216
         $value = geodir_get_cf_value($cf);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
             $value = '';
220 220
         }?>
221 221
 
222
-        <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
222
+        <div id="<?php echo $cf['name']; ?>_row"
223
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 226
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
227
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
228 228
             </label>
229
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
230
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
231
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
229
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
230
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/>
231
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
232 232
             <?php if ($cf['is_required']) { ?>
233 233
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
234 234
             <?php } ?>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
     return $html;
242 242
 }
243
-add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
243
+add_filter('geodir_custom_field_input_phone', 'geodir_cfi_phone', 10, 2);
244 244
 
245 245
 
246 246
 
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
  *
254 254
  * @return string The html to output for the custom field.
255 255
  */
256
-function geodir_cfi_url($html,$cf){
256
+function geodir_cfi_url($html, $cf) {
257 257
 
258 258
     $html_var = $cf['htmlvar_name'];
259 259
 
260 260
     // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
261
+    if (has_filter("geodir_custom_field_input_url_{$html_var}")) {
262 262
         /**
263 263
          * Filter the url html by individual custom field.
264 264
          *
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
          * @param array $cf The custom field array.
267 267
          * @since 1.6.6
268 268
          */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
269
+        $html = apply_filters("geodir_custom_field_input_url_{$html_var}", $html, $cf);
270 270
     }
271 271
 
272 272
     // If no html then we run the standard output.
273
-    if(empty($html)) {
273
+    if (empty($html)) {
274 274
 
275 275
         ob_start(); // Start  buffering;
276 276
         $value = geodir_get_cf_value($cf);
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
             $value = '';
280 280
         }?>
281 281
 
282
-        <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
282
+        <div id="<?php echo $cf['name']; ?>_row"
283
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 286
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
287
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
288 288
             </label>
289
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
289
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
290
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield"
291 291
                    oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')"
292 292
                    onchange="try{setCustomValidity('')}catch(e){}"
293 293
             />
294
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
294
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
295 295
             <?php if ($cf['is_required']) { ?>
296 296
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
297 297
             <?php } ?>
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     return $html;
305 305
 }
306
-add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
306
+add_filter('geodir_custom_field_input_url', 'geodir_cfi_url', 10, 2);
307 307
 
308 308
 
309 309
 /**
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
  *
316 316
  * @return string The html to output for the custom field.
317 317
  */
318
-function geodir_cfi_radio($html,$cf){
318
+function geodir_cfi_radio($html, $cf) {
319 319
 
320 320
     $html_var = $cf['htmlvar_name'];
321 321
 
322 322
     // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
323
+    if (has_filter("geodir_custom_field_input_radio_{$html_var}")) {
324 324
         /**
325 325
          * Filter the radio html by individual custom field.
326 326
          *
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
          * @param array $cf The custom field array.
329 329
          * @since 1.6.6
330 330
          */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
331
+        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}", $html, $cf);
332 332
     }
333 333
 
334 334
     // If no html then we run the standard output.
335
-    if(empty($html)) {
335
+    if (empty($html)) {
336 336
 
337 337
         ob_start(); // Start  buffering;
338 338
         $value = geodir_get_cf_value($cf);
339 339
 
340 340
         ?>
341
-        <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
341
+        <div id="<?php echo $cf['name']; ?>_row"
342
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 345
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
346
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349 349
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
                     foreach ($option_values as $option_value) {
353 353
                         if (empty($option_value['optgroup'])) {
354 354
                             ?>
355
-                            <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
355
+                            <span class="gd-radios"><input name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" <?php checked($value, $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357 357
                         }
358 358
                     }
359 359
                 }
360 360
             }
361 361
             ?>
362
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
362
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
365 365
             <?php } ?>
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     return $html;
373 373
 }
374
-add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
374
+add_filter('geodir_custom_field_input_radio', 'geodir_cfi_radio', 10, 2);
375 375
 
376 376
 
377 377
 /**
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return string The html to output for the custom field.
385 385
  */
386
-function geodir_cfi_checkbox($html,$cf){
386
+function geodir_cfi_checkbox($html, $cf) {
387 387
 
388 388
     $html_var = $cf['htmlvar_name'];
389 389
 
390 390
     // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
391
+    if (has_filter("geodir_custom_field_input_checkbox_{$html_var}")) {
392 392
         /**
393 393
          * Filter the checkbox html by individual custom field.
394 394
          *
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
          * @param array $cf The custom field array.
397 397
          * @since 1.6.6
398 398
          */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
399
+        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}", $html, $cf);
400 400
     }
401 401
 
402 402
     // If no html then we run the standard output.
403
-    if(empty($html)) {
403
+    if (empty($html)) {
404 404
 
405 405
         ob_start(); // Start  buffering;
406 406
         $value = geodir_get_cf_value($cf);
@@ -409,22 +409,22 @@  discard block
 block discarded – undo
409 409
             $value = '';
410 410
         }?>
411 411
 
412
-        <div id="<?php echo $cf['name'];?>_row"
413
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
412
+        <div id="<?php echo $cf['name']; ?>_row"
413
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
414 414
             <label>
415 415
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
416 416
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
417
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
417
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
418 418
             </label>
419 419
             <?php if ($value != '1') {
420 420
                 $value = '0';
421 421
             }?>
422
-            <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
422
+            <input type="hidden" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" value="<?php echo esc_attr($value); ?>"/>
423 423
             <input  <?php if ($value == '1') {
424 424
                 echo 'checked="checked"';
425
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
426
-                 onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
427
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
425
+            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="checkbox"
426
+                 onchange="if(this.checked){jQuery('#<?php echo $cf['name']; ?>').val('1');} else{ jQuery('#<?php echo $cf['name']; ?>').val('0');}"/>
427
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
428 428
             <?php if ($cf['is_required']) { ?>
429 429
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
430 430
             <?php } ?>
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 
437 437
     return $html;
438 438
 }
439
-add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
439
+add_filter('geodir_custom_field_input_checkbox', 'geodir_cfi_checkbox', 10, 2);
440 440
 
441 441
 
442 442
 /**
@@ -448,12 +448,12 @@  discard block
 block discarded – undo
448 448
  *
449 449
  * @return string The html to output for the custom field.
450 450
  */
451
-function geodir_cfi_textarea($html,$cf){
451
+function geodir_cfi_textarea($html, $cf) {
452 452
 
453 453
     $html_var = $cf['htmlvar_name'];
454 454
 
455 455
     // Check if there is a custom field specific filter.
456
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
456
+    if (has_filter("geodir_custom_field_input_textarea_{$html_var}")) {
457 457
         /**
458 458
          * Filter the textarea html by individual custom field.
459 459
          *
@@ -461,11 +461,11 @@  discard block
 block discarded – undo
461 461
          * @param array $cf The custom field array.
462 462
          * @since 1.6.6
463 463
          */
464
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
464
+        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}", $html, $cf);
465 465
     }
466 466
 
467 467
     // If no html then we run the standard output.
468
-    if(empty($html)) {
468
+    if (empty($html)) {
469 469
 
470 470
         ob_start(); // Start  buffering;
471 471
         $value = geodir_get_cf_value($cf);
@@ -473,32 +473,32 @@  discard block
 block discarded – undo
473 473
         $extra_fields = unserialize($cf['extra_fields']);
474 474
         ?>
475 475
 
476
-        <div id="<?php echo $cf['name'];?>_row"
477
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
476
+        <div id="<?php echo $cf['name']; ?>_row"
477
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
478 478
             <label>
479 479
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
480 480
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
481
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
481
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
482 482
             </label><?php
483 483
 
484 484
 
485 485
             if (is_array($extra_fields) && in_array('1', $extra_fields)) {
486 486
 
487
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
487
+                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
488 488
 
489
-            <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
489
+            <div class="editor" field_id="<?php echo $cf['name']; ?>" field_type="editor">
490 490
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
491 491
                 </div><?php
492 492
 
493 493
             } else {
494 494
 
495
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
496
-                            id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
495
+                ?><textarea field_type="<?php echo $cf['type']; ?>" class="geodir_textarea" name="<?php echo $cf['name']; ?>"
496
+                            id="<?php echo $cf['name']; ?>"><?php echo stripslashes($value); ?></textarea><?php
497 497
 
498 498
             }?>
499 499
 
500 500
 
501
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
501
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
502 502
             <?php if ($cf['is_required']) { ?>
503 503
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
504 504
             <?php } ?>
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 
511 511
     return $html;
512 512
 }
513
-add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
513
+add_filter('geodir_custom_field_input_textarea', 'geodir_cfi_textarea', 10, 2);
514 514
 
515 515
 
516 516
 /**
@@ -522,12 +522,12 @@  discard block
 block discarded – undo
522 522
  *
523 523
  * @return string The html to output for the custom field.
524 524
  */
525
-function geodir_cfi_select($html,$cf){
525
+function geodir_cfi_select($html, $cf) {
526 526
 
527 527
     $html_var = $cf['htmlvar_name'];
528 528
 
529 529
     // Check if there is a custom field specific filter.
530
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
530
+    if (has_filter("geodir_custom_field_input_select_{$html_var}")) {
531 531
         /**
532 532
          * Filter the select html by individual custom field.
533 533
          *
@@ -535,22 +535,22 @@  discard block
 block discarded – undo
535 535
          * @param array $cf The custom field array.
536 536
          * @since 1.6.6
537 537
          */
538
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
538
+        $html = apply_filters("geodir_custom_field_input_select_{$html_var}", $html, $cf);
539 539
     }
540 540
 
541 541
     // If no html then we run the standard output.
542
-    if(empty($html)) {
542
+    if (empty($html)) {
543 543
 
544 544
         ob_start(); // Start  buffering;
545 545
         $value = geodir_get_cf_value($cf);
546 546
 
547 547
         ?>
548
-        <div id="<?php echo $cf['name'];?>_row"
549
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
548
+        <div id="<?php echo $cf['name']; ?>_row"
549
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550 550
             <label>
551 551
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
552 552
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
553
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
553
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
554 554
             </label>
555 555
             <?php
556 556
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -560,22 +560,22 @@  discard block
 block discarded – undo
560 560
                     if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
561 561
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
562 562
 
563
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
563
+                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
564 564
                     } else {
565 565
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
566 566
                         $option_value = isset($option_row['value']) ? $option_row['value'] : '';
567 567
                         $selected = $option_value == $value ? 'selected="selected"' : '';
568 568
 
569
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
569
+                        $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
570 570
                     }
571 571
                 }
572 572
             }
573 573
             ?>
574
-            <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
574
+            <select field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
575 575
                     class="geodir_textfield textfield_x chosen_select"
576
-                    data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
577
-                    option-ajaxchosen="false"><?php echo $select_options;?></select>
578
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
576
+                    data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'&hellip;'; ?>"
577
+                    option-ajaxchosen="false"><?php echo $select_options; ?></select>
578
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
579 579
             <?php if ($cf['is_required']) { ?>
580 580
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
581 581
             <?php } ?>
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 
588 588
     return $html;
589 589
 }
590
-add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
590
+add_filter('geodir_custom_field_input_select', 'geodir_cfi_select', 10, 2);
591 591
 
592 592
 
593 593
 /**
@@ -599,12 +599,12 @@  discard block
 block discarded – undo
599 599
  *
600 600
  * @return string The html to output for the custom field.
601 601
  */
602
-function geodir_cfi_multiselect($html,$cf){
602
+function geodir_cfi_multiselect($html, $cf) {
603 603
 
604 604
     $html_var = $cf['htmlvar_name'];
605 605
 
606 606
     // Check if there is a custom field specific filter.
607
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
607
+    if (has_filter("geodir_custom_field_input_multiselect_{$html_var}")) {
608 608
         /**
609 609
          * Filter the multiselect html by individual custom field.
610 610
          *
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
          * @param array $cf The custom field array.
613 613
          * @since 1.6.6
614 614
          */
615
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
615
+        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}", $html, $cf);
616 616
     }
617 617
 
618 618
     // If no html then we run the standard output.
619
-    if(empty($html)) {
619
+    if (empty($html)) {
620 620
 
621 621
         ob_start(); // Start  buffering;
622 622
         $value = geodir_get_cf_value($cf);
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
654 654
 
655 655
                                 if ($multi_display == 'select') {
656
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
656
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
657 657
                                 } else {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
658
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : '';
659 659
                                 }
660 660
                             } else {
661 661
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
@@ -680,9 +680,9 @@  discard block
 block discarded – undo
680 680
                                 }
681 681
 
682 682
                                 if ($multi_display == 'select') {
683
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
683
+                                    $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
684 684
                                 } else {
685
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
685
+                                    $select_options .= '<li><input name="'.$cf['name'].'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" />&nbsp;'.$option_label.' </li>';
686 686
                                 }
687 687
                             }
688 688
                         }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 
703 703
     return $html;
704 704
 }
705
-add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
705
+add_filter('geodir_custom_field_input_multiselect', 'geodir_cfi_multiselect', 10, 2);
706 706
 
707 707
 
708 708
 /**
@@ -714,12 +714,12 @@  discard block
 block discarded – undo
714 714
  *
715 715
  * @return string The html to output for the custom field.
716 716
  */
717
-function geodir_cfi_html($html,$cf){
717
+function geodir_cfi_html($html, $cf) {
718 718
 
719 719
     $html_var = $cf['htmlvar_name'];
720 720
 
721 721
     // Check if there is a custom field specific filter.
722
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
722
+    if (has_filter("geodir_custom_field_input_html_{$html_var}")) {
723 723
         /**
724 724
          * Filter the html html by individual custom field.
725 725
          *
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
          * @param array $cf The custom field array.
728 728
          * @since 1.6.6
729 729
          */
730
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
730
+        $html = apply_filters("geodir_custom_field_input_html_{$html_var}", $html, $cf);
731 731
     }
732 732
 
733 733
     // If no html then we run the standard output.
734
-    if(empty($html)) {
734
+    if (empty($html)) {
735 735
 
736 736
         ob_start(); // Start  buffering;
737 737
         $value = geodir_get_cf_value($cf);
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
     return $html;
766 766
 }
767
-add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
767
+add_filter('geodir_custom_field_input_html', 'geodir_cfi_html', 10, 2);
768 768
 
769 769
 
770 770
 
@@ -777,12 +777,12 @@  discard block
 block discarded – undo
777 777
  *
778 778
  * @return string The html to output for the custom field.
779 779
  */
780
-function geodir_cfi_datepicker($html,$cf){
780
+function geodir_cfi_datepicker($html, $cf) {
781 781
 
782 782
     $html_var = $cf['htmlvar_name'];
783 783
 
784 784
     // Check if there is a custom field specific filter.
785
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
785
+    if (has_filter("geodir_custom_field_input_datepicker_{$html_var}")) {
786 786
         /**
787 787
          * Filter the datepicker html by individual custom field.
788 788
          *
@@ -790,11 +790,11 @@  discard block
 block discarded – undo
790 790
          * @param array $cf The custom field array.
791 791
          * @since 1.6.6
792 792
          */
793
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
793
+        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}", $html, $cf);
794 794
     }
795 795
 
796 796
     // If no html then we run the standard output.
797
-    if(empty($html)) {
797
+    if (empty($html)) {
798 798
 
799 799
         ob_start(); // Start  buffering;
800 800
         $value = geodir_get_cf_value($cf);
@@ -806,23 +806,23 @@  discard block
 block discarded – undo
806 806
             $extra_fields['date_format'] = 'yy-mm-dd';
807 807
 
808 808
         $date_format = $extra_fields['date_format'];
809
-        $jquery_date_format  = $date_format;
809
+        $jquery_date_format = $date_format;
810 810
 
811 811
 
812 812
         // check if we need to change the format or not
813 813
         $date_format_len = strlen(str_replace(' ', '', $date_format));
814
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
814
+        if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
815 815
 
816
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
817
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
816
+            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
817
+            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
818 818
 
819 819
             $date_format = str_replace($search, $replace, $date_format);
820
-        }else{
821
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
820
+        } else {
821
+            $jquery_date_format = geodir_date_format_php_to_jqueryui($jquery_date_format);
822 822
         }
823 823
 
824
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
825
-        if($value && !isset($_REQUEST['backandedit'])) {
824
+        if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty
825
+        if ($value && !isset($_REQUEST['backandedit'])) {
826 826
             $time = strtotime($value);
827 827
             $value = date_i18n($date_format, $time);
828 828
         }
@@ -832,37 +832,37 @@  discard block
 block discarded – undo
832 832
 
833 833
             jQuery(function () {
834 834
 
835
-                jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
835
+                jQuery("#<?php echo $cf['name']; ?>").datepicker({changeMonth: true, changeYear: true <?php
836 836
                     /**
837 837
                      * Used to add extra option to datepicker per custom field.
838 838
                      *
839 839
                      * @since 1.5.7
840 840
                      * @param string $name The custom field name.
841 841
                      */
842
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
842
+                    echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>});
843 843
 
844
-                jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
844
+                jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format; ?>');
845 845
 
846
-                <?php if(!empty($value)){?>
847
-                jQuery("#<?php echo $name;?>").datepicker("setDate", "<?php echo $value;?>");
846
+                <?php if (!empty($value)) {?>
847
+                jQuery("#<?php echo $name; ?>").datepicker("setDate", "<?php echo $value; ?>");
848 848
                 <?php } ?>
849 849
 
850 850
             });
851 851
 
852 852
         </script>
853
-        <div id="<?php echo $name;?>_row"
854
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
853
+        <div id="<?php echo $name; ?>_row"
854
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
855 855
             <label>
856 856
 
857 857
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
858 858
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
859
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
859
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
860 860
             </label>
861 861
 
862
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
863
-                   value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
862
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
863
+                   value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
864 864
 
865
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
865
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
866 866
             <?php if ($cf['is_required']) { ?>
867 867
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
868 868
             <?php } ?>
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 
875 875
     return $html;
876 876
 }
877
-add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
877
+add_filter('geodir_custom_field_input_datepicker', 'geodir_cfi_datepicker', 10, 2);
878 878
 
879 879
 
880 880
 /**
@@ -886,12 +886,12 @@  discard block
 block discarded – undo
886 886
  *
887 887
  * @return string The html to output for the custom field.
888 888
  */
889
-function geodir_cfi_time($html,$cf){
889
+function geodir_cfi_time($html, $cf) {
890 890
 
891 891
     $html_var = $cf['htmlvar_name'];
892 892
 
893 893
     // Check if there is a custom field specific filter.
894
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
894
+    if (has_filter("geodir_custom_field_input_time_{$html_var}")) {
895 895
         /**
896 896
          * Filter the time html by individual custom field.
897 897
          *
@@ -899,11 +899,11 @@  discard block
 block discarded – undo
899 899
          * @param array $cf The custom field array.
900 900
          * @since 1.6.6
901 901
          */
902
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
902
+        $html = apply_filters("geodir_custom_field_input_time_{$html_var}", $html, $cf);
903 903
     }
904 904
 
905 905
     // If no html then we run the standard output.
906
-    if(empty($html)) {
906
+    if (empty($html)) {
907 907
 
908 908
         ob_start(); // Start  buffering;
909 909
         $value = geodir_get_cf_value($cf);
@@ -916,25 +916,25 @@  discard block
 block discarded – undo
916 916
         <script type="text/javascript">
917 917
             jQuery(document).ready(function () {
918 918
 
919
-                jQuery('#<?php echo $name;?>').timepicker({
919
+                jQuery('#<?php echo $name; ?>').timepicker({
920 920
                     showPeriod: true,
921 921
                     showLeadingZero: true,
922 922
                     showPeriod: true,
923 923
                 });
924 924
             });
925 925
         </script>
926
-        <div id="<?php echo $name;?>_row"
927
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
926
+        <div id="<?php echo $name; ?>_row"
927
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
928 928
             <label>
929 929
 
930 930
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
931 931
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
932
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
932
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
933 933
             </label>
934
-            <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
935
-                   id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
934
+            <input readonly="readonly" field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>"
935
+                   id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
936 936
 
937
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
937
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
938 938
             <?php if ($cf['is_required']) { ?>
939 939
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
940 940
             <?php } ?>
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 
946 946
     return $html;
947 947
 }
948
-add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
948
+add_filter('geodir_custom_field_input_time', 'geodir_cfi_time', 10, 2);
949 949
 
950 950
 
951 951
 /**
@@ -957,12 +957,12 @@  discard block
 block discarded – undo
957 957
  *
958 958
  * @return string The html to output for the custom field.
959 959
  */
960
-function geodir_cfi_address($html,$cf){
960
+function geodir_cfi_address($html, $cf) {
961 961
 
962 962
     $html_var = $cf['htmlvar_name'];
963 963
 
964 964
     // Check if there is a custom field specific filter.
965
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
965
+    if (has_filter("geodir_custom_field_input_address_{$html_var}")) {
966 966
         /**
967 967
          * Filter the address html by individual custom field.
968 968
          *
@@ -970,11 +970,11 @@  discard block
 block discarded – undo
970 970
          * @param array $cf The custom field array.
971 971
          * @since 1.6.6
972 972
          */
973
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
973
+        $html = apply_filters("geodir_custom_field_input_address_{$html_var}", $html, $cf);
974 974
     }
975 975
 
976 976
     // If no html then we run the standard output.
977
-    if(empty($html)) {
977
+    if (empty($html)) {
978 978
 
979 979
         global $gd_session;
980 980
         ob_start(); // Start  buffering;
@@ -987,12 +987,12 @@  discard block
 block discarded – undo
987 987
         $site_title = $cf['site_title'];
988 988
         $is_admin = $cf['is_admin'];
989 989
         $extra_fields = unserialize($cf['extra_fields']);
990
-        $prefix = $name . '_';
990
+        $prefix = $name.'_';
991 991
 
992
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
993
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
992
+        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address');
993
+        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code ');
994 994
         ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
995
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
995
+        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview');
996 996
 
997 997
         $address = '';
998 998
         $zip = '';
@@ -1003,21 +1003,21 @@  discard block
 block discarded – undo
1003 1003
 
1004 1004
         if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1005 1005
             $post = $gd_ses_listing;
1006
-            $address = $post[$prefix . 'address'];
1007
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1008
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1009
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1010
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1011
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1006
+            $address = $post[$prefix.'address'];
1007
+            $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : '';
1008
+            $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : '';
1009
+            $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : '';
1010
+            $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : '';
1011
+            $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : '';
1012 1012
         } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1013
-            $post_info = (array)$post_info;
1014
-
1015
-            $address = $post_info[$prefix . 'address'];
1016
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1017
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1018
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1019
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1020
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1013
+            $post_info = (array) $post_info;
1014
+
1015
+            $address = $post_info[$prefix.'address'];
1016
+            $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : '';
1017
+            $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : '';
1018
+            $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : '';
1019
+            $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : '';
1020
+            $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : '';
1021 1021
         }
1022 1022
 
1023 1023
         $location = geodir_get_default_location();
@@ -1054,16 +1054,16 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
         ?>
1056 1056
 
1057
-        <div id="geodir_<?php echo $prefix . 'address';?>_row"
1058
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1057
+        <div id="geodir_<?php echo $prefix.'address'; ?>_row"
1058
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1059 1059
             <label>
1060 1060
                 <?php _e($address_title, 'geodirectory'); ?>
1061
-                <?php if ($is_required) echo '<span>*</span>';?>
1061
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1062 1062
             </label>
1063
-            <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1064
-                   id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
1063
+            <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>"
1064
+                   id="<?php echo $prefix.'address'; ?>" class="geodir_textfield"
1065 1065
                    value="<?php echo esc_attr(stripslashes($address)); ?>"/>
1066
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1066
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1067 1067
             <?php if ($is_required) { ?>
1068 1068
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1069 1069
             <?php } ?>
@@ -1083,14 +1083,14 @@  discard block
 block discarded – undo
1083 1083
 
1084 1084
         if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1085 1085
 
1086
-            <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1086
+            <div id="geodir_<?php echo $prefix.'zip'; ?>_row"
1087 1087
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
1088 1088
                 <label>
1089 1089
                     <?php _e($zip_title, 'geodirectory'); ?>
1090 1090
                     <?php /*if($is_required) echo '<span>*</span>';*/ ?>
1091 1091
                 </label>
1092
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>"
1093
-                       id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill"
1092
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>"
1093
+                       id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill"
1094 1094
                        value="<?php echo esc_attr(stripslashes($zip)); ?>"/>
1095 1095
                 <?php /*if($is_required) {?>
1096 1096
 					<span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span>
@@ -1100,14 +1100,14 @@  discard block
 block discarded – undo
1100 1100
 
1101 1101
         <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?>
1102 1102
 
1103
-            <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1103
+            <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1104 1104
                 <?php
1105 1105
                 /**
1106 1106
                  * Contains add listing page map functions.
1107 1107
                  *
1108 1108
                  * @since 1.0.0
1109 1109
                  */
1110
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1110
+                include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1111 1111
                 if ($lat_lng_blank) {
1112 1112
                     $lat = '';
1113 1113
                     $lng = '';
@@ -1118,14 +1118,14 @@  discard block
 block discarded – undo
1118 1118
             <?php
1119 1119
             /* show lat lng */
1120 1120
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1121
-            <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1121
+            <div id="geodir_<?php echo $prefix.'latitude'; ?>_row"
1122 1122
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1123 1123
                 <label>
1124 1124
                     <?php echo PLACE_ADDRESS_LAT; ?>
1125 1125
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1126 1126
                 </label>
1127
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1128
-                       id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
1127
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>"
1128
+                       id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield"
1129 1129
                        value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/>
1130 1130
                 <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span>
1131 1131
                 <?php if ($is_required) { ?>
@@ -1133,14 +1133,14 @@  discard block
 block discarded – undo
1133 1133
                 <?php } ?>
1134 1134
             </div>
1135 1135
 
1136
-            <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1136
+            <div id="geodir_<?php echo $prefix.'longitude'; ?>_row"
1137 1137
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1138 1138
                 <label>
1139 1139
                     <?php echo PLACE_ADDRESS_LNG; ?>
1140 1140
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1141 1141
                 </label>
1142
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1143
-                       id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
1142
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>"
1143
+                       id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield"
1144 1144
                        value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/>
1145 1145
                 <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span>
1146 1146
                 <?php if ($is_required) { ?>
@@ -1150,32 +1150,32 @@  discard block
 block discarded – undo
1150 1150
         <?php } ?>
1151 1151
 
1152 1152
         <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?>
1153
-            <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1153
+            <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1154 1154
                 <label><?php _e($mapview_title, 'geodirectory'); ?></label>
1155 1155
 
1156 1156
 
1157 1157
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1158 1158
                                                             class="gd-checkbox"
1159
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1160
-                                                            id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1159
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1160
+                                                            id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1161 1161
                             echo 'checked="checked"';
1162 1162
                         } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1163 1163
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1164 1164
                                                              class="gd-checkbox"
1165
-                                                             name="<?php echo $prefix . 'mapview'; ?>"
1165
+                                                             name="<?php echo $prefix.'mapview'; ?>"
1166 1166
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1167 1167
                             echo 'checked="checked"';
1168 1168
                         } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1169 1169
 
1170 1170
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1171 1171
                                                             class="gd-checkbox"
1172
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1172
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1173 1173
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1174 1174
                             echo 'checked="checked"';
1175 1175
                         } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1176 1176
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1177 1177
                                                             class="gd-checkbox"
1178
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1178
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1179 1179
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1180 1180
                             echo 'checked="checked"';
1181 1181
                         } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1188 1188
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1189 1189
                 echo esc_attr($mapzoom);
1190
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1190
+            } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/>
1191 1191
         <?php }
1192 1192
 
1193 1193
         $html = ob_get_clean();
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
     return $html;
1197 1197
 }
1198
-add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1198
+add_filter('geodir_custom_field_input_address', 'geodir_cfi_address', 10, 2);
1199 1199
 
1200 1200
 
1201 1201
 
@@ -1208,12 +1208,12 @@  discard block
 block discarded – undo
1208 1208
  *
1209 1209
  * @return string The html to output for the custom field.
1210 1210
  */
1211
-function geodir_cfi_taxonomy($html,$cf){
1211
+function geodir_cfi_taxonomy($html, $cf) {
1212 1212
 
1213 1213
     $html_var = $cf['htmlvar_name'];
1214 1214
 
1215 1215
     // Check if there is a custom field specific filter.
1216
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1216
+    if (has_filter("geodir_custom_field_input_taxonomy_{$html_var}")) {
1217 1217
         /**
1218 1218
          * Filter the taxonomy html by individual custom field.
1219 1219
          *
@@ -1221,11 +1221,11 @@  discard block
 block discarded – undo
1221 1221
          * @param array $cf The custom field array.
1222 1222
          * @since 1.6.6
1223 1223
          */
1224
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1224
+        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}", $html, $cf);
1225 1225
     }
1226 1226
 
1227 1227
     // If no html then we run the standard output.
1228
-    if(empty($html)) {
1228
+    if (empty($html)) {
1229 1229
 
1230 1230
         ob_start(); // Start  buffering;
1231 1231
         $value = geodir_get_cf_value($cf);
@@ -1240,15 +1240,15 @@  discard block
 block discarded – undo
1240 1240
         if ($value == $cf['default']) {
1241 1241
             $value = '';
1242 1242
         } ?>
1243
-        <div id="<?php echo $name;?>_row"
1244
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1243
+        <div id="<?php echo $name; ?>_row"
1244
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1245 1245
             <label>
1246 1246
                 <?php $site_title = __($site_title, 'geodirectory');
1247 1247
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1248
-                <?php if ($is_required) echo '<span>*</span>';?>
1248
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1249 1249
             </label>
1250 1250
 
1251
-            <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1251
+            <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1252 1252
                 <?php
1253 1253
                 global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1254 1254
 
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
                     $package_info = array();
1262 1262
 
1263
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1263
+                    $package_info = (array) geodir_post_package_info($package_info, $post, $post_type);
1264 1264
 
1265 1265
                     if (!empty($package_info)) {
1266 1266
 
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 
1290 1290
                     $catadd_limit = $wpdb->get_var(
1291 1291
                         $wpdb->prepare(
1292
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1292
+                            "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d",
1293 1293
                             array($package_id)
1294 1294
                         )
1295 1295
                     );
@@ -1305,13 +1305,13 @@  discard block
 block discarded – undo
1305 1305
                     $required_limit_msg = '';
1306 1306
                     if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1307 1307
 
1308
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1308
+                        $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory');
1309 1309
 
1310 1310
                     } else {
1311 1311
                         $required_limit_msg = $required_msg;
1312 1312
                     }
1313 1313
 
1314
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1314
+                    echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']"  />';
1315 1315
 
1316 1316
 
1317 1317
                     if ($cat_display == 'select' || $cat_display == 'multiselect') {
@@ -1321,11 +1321,11 @@  discard block
 block discarded – undo
1321 1321
                         if ($cat_display == 'multiselect')
1322 1322
                             $multiple = 'multiple="multiple"';
1323 1323
 
1324
-                        echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1324
+                        echo '<select id="'.$name.'" '.$multiple.' type="'.$name.'" name="post_category['.$name.'][]" alt="'.$name.'" field_type="'.$cat_display.'" class="geodir_textfield textfield_x chosen_select" data-placeholder="'.__('Select Category', 'geodirectory').'">';
1325 1325
 
1326 1326
 
1327 1327
                         if ($cat_display == 'select')
1328
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1328
+                            echo '<option value="">'.__('Select Category', 'geodirectory').'</option>';
1329 1329
 
1330 1330
                     }
1331 1331
 
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
                 ?>
1344 1344
             </div>
1345 1345
 
1346
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1346
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1347 1347
             <?php if ($is_required) { ?>
1348 1348
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1349 1349
             <?php } ?>
@@ -1355,7 +1355,7 @@  discard block
 block discarded – undo
1355 1355
 
1356 1356
     return $html;
1357 1357
 }
1358
-add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1358
+add_filter('geodir_custom_field_input_taxonomy', 'geodir_cfi_taxonomy', 10, 2);
1359 1359
 
1360 1360
 
1361 1361
 /**
@@ -1367,12 +1367,12 @@  discard block
 block discarded – undo
1367 1367
  *
1368 1368
  * @return string The html to output for the custom field.
1369 1369
  */
1370
-function geodir_cfi_file($html,$cf){
1370
+function geodir_cfi_file($html, $cf) {
1371 1371
 
1372 1372
     $html_var = $cf['htmlvar_name'];
1373 1373
 
1374 1374
     // Check if there is a custom field specific filter.
1375
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1375
+    if (has_filter("geodir_custom_field_input_file_{$html_var}")) {
1376 1376
         /**
1377 1377
          * Filter the file html by individual custom field.
1378 1378
          *
@@ -1380,11 +1380,11 @@  discard block
 block discarded – undo
1380 1380
          * @param array $cf The custom field array.
1381 1381
          * @since 1.6.6
1382 1382
          */
1383
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1383
+        $html = apply_filters("geodir_custom_field_input_file_{$html_var}", $html, $cf);
1384 1384
     }
1385 1385
 
1386 1386
     // If no html then we run the standard output.
1387
-    if(empty($html)) {
1387
+    if (empty($html)) {
1388 1388
 
1389 1389
         ob_start(); // Start  buffering;
1390 1390
         $value = geodir_get_cf_value($cf);
@@ -1427,8 +1427,8 @@  discard block
 block discarded – undo
1427 1427
                 $file_totImg = count($curImages);
1428 1428
         }
1429 1429
 
1430
-        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1431
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1430
+        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? implode(",", $extra_fields['gd_file_types']) : '';
1431
+        $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : '';
1432 1432
 
1433 1433
         ?>
1434 1434
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
@@ -1438,13 +1438,13 @@  discard block
 block discarded – undo
1438 1438
 			</h5>   <?php */
1439 1439
         ?>
1440 1440
 
1441
-        <div id="<?php echo $name;?>_row"
1442
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1441
+        <div id="<?php echo $name; ?>_row"
1442
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1443 1443
 
1444 1444
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1445 1445
                 <label
1446 1446
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1447
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1447
+                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label>
1448 1448
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1449 1449
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1450 1450
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
                        id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/>
1453 1453
                 <?php if ($allowed_file_types != '') { ?>
1454 1454
                     <input type="hidden" name="<?php echo $file_id; ?>_allowed_types"
1455
-                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/>
1455
+                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/>
1456 1456
                 <?php } ?>
1457 1457
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1458 1458
                        value="<?php if (isset($file_totImg)) {
@@ -1468,10 +1468,10 @@  discard block
 block discarded – undo
1468 1468
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1469 1469
                         ?>
1470 1470
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1471
-                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1471
+                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>"
1472 1472
                                class="geodir_button" style="margin-top:10px;"/>
1473 1473
                             <span class="ajaxnonceplu"
1474
-                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span>
1474
+                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span>
1475 1475
                         <?php if ($file_width && $file_height): ?>
1476 1476
                             <span class="plupload-resize"></span>
1477 1477
                             <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span>
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
 
1492 1492
                 </div>
1493 1493
             </div>
1494
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span>
1494
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span>
1495 1495
             <?php if ($is_required) { ?>
1496 1496
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1497 1497
             <?php } ?>
@@ -1504,4 +1504,4 @@  discard block
 block discarded – undo
1504 1504
 
1505 1505
     return $html;
1506 1506
 }
1507
-add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1508 1507
\ No newline at end of file
1508
+add_filter('geodir_custom_field_input_file', 'geodir_cfi_file', 10, 2);
1509 1509
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_functions.php 1 patch
Spacing   +324 added lines, -324 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50 50
     {
51 51
         global $wpdb;
52
-        $result = 0;// no rows affected
52
+        $result = 0; // no rows affected
53 53
         if (!geodir_column_exist($db, $column)) {
54 54
             if (!empty($db) && !empty($column))
55 55
                 $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 {
75 75
     global $wpdb, $geodir_post_custom_fields_cache;
76 76
 
77
-    $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
77
+    $cache_stored = $post_type.'_'.$package_id.'_'.$default.'_'.$fields_location;
78 78
 
79 79
     if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80 80
         return $geodir_post_custom_fields_cache[$cache_stored];
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
         $default_query .= " and is_admin = '0' ";
89 89
 
90 90
     if ($fields_location == 'none') {
91
-    } else{
92
-        $fields_location = esc_sql( $fields_location );
91
+    } else {
92
+        $fields_location = esc_sql($fields_location);
93 93
         $default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94 94
     }
95 95
 
96 96
     $post_meta_info = $wpdb->get_results(
97 97
         $wpdb->prepare(
98
-            "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
98
+            "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99 99
             array($post_type)
100 100
         )
101 101
     );
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
      * @param string $field_ins_upd When set to "submit" displays form.
163 163
      * @param string $field_type_key The key of the custom field.
164 164
      */
165
-    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
165
+    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
166 166
     {
167 167
         global $wpdb;
168 168
         $cf = $result_str;
169 169
         if (!is_object($cf)) {
170 170
 
171
-            $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
171
+            $field_info = $wpdb->get_row($wpdb->prepare("select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)));
172 172
 
173 173
         } else {
174 174
             $field_info = $cf;
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
         if ($field_id != '') {
203 203
             $cf = trim($field_id, '_');
204 204
 
205
-            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
-                $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
205
+            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)))) {
206
+                $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d ", array($cf)));
207 207
 
208 208
                 $post_type = $field->post_type;
209 209
                 $htmlvar_name = $field->htmlvar_name;
210 210
 
211 211
                 if ($post_type != '' && $htmlvar_name != '') {
212
-                    $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
212
+                    $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213 213
                 }
214 214
 
215 215
                 /**
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
                 do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224 224
 
225 225
                 if ($field->field_type == 'address') {
226
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
226
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_address`");
227
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_city`");
228
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_region`");
229
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_country`");
230
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_zip`");
231
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_latitude`");
232
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_longitude`");
233
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapview`");
234
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapzoom`");
235 235
                 } else {
236 236
                     if ($field->field_type != 'fieldset') {
237
-                        $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
237
+                        $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."`");
238 238
                     }
239 239
                 }
240 240
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
305 305
 
306 306
         // some servers fail if a POST value is VARCHAR so we change it.
307
-        if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
307
+        if (isset($request_field['data_type']) && $request_field['data_type'] == 'XVARCHAR') {
308 308
             $request_field['data_type'] = 'VARCHAR';
309 309
         }
310 310
 
@@ -317,12 +317,12 @@  discard block
 block discarded – undo
317 317
         $post_type = $request_field['listing_type'];
318 318
 
319 319
         if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
320
-            $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
320
+            $cehhtmlvar_name = 'geodir_'.$cehhtmlvar_name;
321 321
         }
322 322
 
323 323
         $check_html_variable = $wpdb->get_var(
324 324
             $wpdb->prepare(
325
-                "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
325
+                "select htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where id <> %d and htmlvar_name = %s and post_type = %s ",
326 326
                 array($cf, $cehhtmlvar_name, $post_type)
327 327
             )
328 328
         );
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
                 $post_meta_info = $wpdb->get_row(
336 336
                     $wpdb->prepare(
337
-                        "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
337
+                        "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id = %d",
338 338
                         array($cf)
339 339
                     )
340 340
                 );
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             if ($post_type == '') $post_type = 'gd_place';
353 353
 
354 354
 
355
-            $detail_table = $plugin_prefix . $post_type . '_detail';
355
+            $detail_table = $plugin_prefix.$post_type.'_detail';
356 356
 
357 357
             $admin_title = $request_field['admin_title'];
358 358
             $site_title = $request_field['site_title'];
@@ -380,12 +380,12 @@  discard block
 block discarded – undo
380 380
             $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
381 381
 
382 382
             
383
-            if(is_array($show_in)){
383
+            if (is_array($show_in)) {
384 384
                 $show_in = implode(",", $request_field['show_in']);
385 385
             }
386 386
             
387 387
             if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
388
-                $htmlvar_name = 'geodir_' . $htmlvar_name;
388
+                $htmlvar_name = 'geodir_'.$htmlvar_name;
389 389
             }
390 390
 
391 391
             $option_values = '';
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
 
427 427
             if ($sort_order == '') {
428 428
 
429
-                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
429
+                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM ".GEODIR_CUSTOM_FIELDS_TABLE);
430 430
 
431
-                $sort_order = (int)$last_order + 1;
431
+                $sort_order = (int) $last_order + 1;
432 432
             }
433 433
 
434 434
             $default_value_add = '';
@@ -440,15 +440,15 @@  discard block
 block discarded – undo
440 440
                     case 'address':
441 441
 
442 442
                         if ($htmlvar_name != '') {
443
-                            $prefix = $htmlvar_name . '_';
443
+                            $prefix = $htmlvar_name.'_';
444 444
                         }
445
-                        $old_prefix = $old_html_variable . '_';
445
+                        $old_prefix = $old_html_variable.'_';
446 446
 
447 447
 
448
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
448
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."address` `".$prefix."address` VARCHAR( 254 ) NULL";
449 449
 
450 450
                         if ($default_value != '') {
451
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
451
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
452 452
                         }
453 453
 
454 454
                         $wpdb->query($meta_field_add);
@@ -457,12 +457,12 @@  discard block
 block discarded – undo
457 457
 
458 458
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
459 459
 
460
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
460
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."city'");
461 461
                                 if ($is_column) {
462
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
462
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."city` `".$prefix."city` VARCHAR( 50 ) NULL";
463 463
 
464 464
                                     if ($default_value != '') {
465
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
465
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
466 466
                                     }
467 467
 
468 468
                                     $wpdb->query($meta_field_add);
@@ -470,9 +470,9 @@  discard block
 block discarded – undo
470 470
 
471 471
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
472 472
                                     if ($default_value != '') {
473
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
473
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
474 474
                                     }
475
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
475
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
476 476
 
477 477
                                 }
478 478
 
@@ -482,36 +482,36 @@  discard block
 block discarded – undo
482 482
 
483 483
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
484 484
 
485
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
485
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."region'");
486 486
 
487 487
                                 if ($is_column) {
488
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
488
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."region` `".$prefix."region` VARCHAR( 50 ) NULL";
489 489
 
490 490
                                     if ($default_value != '') {
491
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
491
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
492 492
                                     }
493 493
 
494 494
                                     $wpdb->query($meta_field_add);
495 495
                                 } else {
496 496
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
497 497
                                     if ($default_value != '') {
498
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
498
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
499 499
                                     }
500 500
 
501
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
501
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
502 502
                                 }
503 503
 
504 504
                             }
505 505
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
506 506
 
507
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
507
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."country'");
508 508
 
509 509
                                 if ($is_column) {
510 510
 
511
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
511
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."country` `".$prefix."country` VARCHAR( 50 ) NULL";
512 512
 
513 513
                                     if ($default_value != '') {
514
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
514
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
515 515
                                     }
516 516
 
517 517
                                     $wpdb->query($meta_field_add);
@@ -519,24 +519,24 @@  discard block
 block discarded – undo
519 519
 
520 520
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
521 521
                                     if ($default_value != '') {
522
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
522
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
523 523
                                     }
524 524
 
525
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
525
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
526 526
 
527 527
                                 }
528 528
 
529 529
                             }
530 530
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
531 531
 
532
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
532
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."zip'");
533 533
 
534 534
                                 if ($is_column) {
535 535
 
536
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
536
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."zip` `".$prefix."zip` VARCHAR( 50 ) NULL";
537 537
 
538 538
                                     if ($default_value != '') {
539
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
539
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
540 540
                                     }
541 541
 
542 542
                                     $wpdb->query($meta_field_add);
@@ -544,128 +544,128 @@  discard block
 block discarded – undo
544 544
 
545 545
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
546 546
                                     if ($default_value != '') {
547
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
547
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
548 548
                                     }
549 549
 
550
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
550
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
551 551
 
552 552
                                 }
553 553
 
554 554
                             }
555 555
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
556 556
 
557
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
557
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latitude'");
558 558
                                 if ($is_column) {
559 559
 
560
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
560
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latitude` `".$prefix."latitude` VARCHAR( 20 ) NULL";
561 561
 
562 562
                                     if ($default_value != '') {
563
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
563
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
564 564
                                     }
565 565
 
566 566
                                     $wpdb->query($meta_field_add);
567 567
                                 } else {
568 568
 
569
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
569
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
570 570
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
571 571
                                     if ($default_value != '') {
572
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
572
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
573 573
                                     }
574 574
 
575
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
575
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
576 576
 
577 577
                                 }
578 578
 
579 579
 
580
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
580
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."longitude'");
581 581
 
582 582
                                 if ($is_column) {
583
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
583
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."longitude` `".$prefix."longitude` VARCHAR( 20 ) NULL";
584 584
 
585 585
                                     if ($default_value != '') {
586
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
586
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
587 587
                                     }
588 588
 
589 589
                                     $wpdb->query($meta_field_add);
590 590
                                 } else {
591 591
 
592
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
592
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
593 593
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
594 594
                                     if ($default_value != '') {
595
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
595
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
596 596
                                     }
597 597
 
598
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
598
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
599 599
                                 }
600 600
 
601 601
                             }
602 602
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
603 603
 
604
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
604
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapview'");
605 605
 
606 606
                                 if ($is_column) {
607
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
607
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapview` `".$prefix."mapview` VARCHAR( 15 ) NULL";
608 608
 
609 609
                                     if ($default_value != '') {
610
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
610
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
611 611
                                     }
612 612
 
613 613
                                     $wpdb->query($meta_field_add);
614 614
                                 } else {
615 615
 
616
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
616
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
617 617
 
618 618
                                     $meta_field_add = "VARCHAR( 15 ) NULL";
619 619
                                     if ($default_value != '') {
620
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
620
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
621 621
                                     }
622 622
 
623
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
623
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
624 624
                                 }
625 625
 
626 626
 
627 627
                             }
628 628
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
629 629
 
630
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
630
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapzoom'");
631 631
                                 if ($is_column) {
632
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
632
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapzoom` `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
633 633
 
634 634
                                     if ($default_value != '') {
635
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
635
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
636 636
                                     }
637 637
 
638 638
                                     $wpdb->query($meta_field_add);
639 639
 
640 640
                                 } else {
641 641
 
642
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
642
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
643 643
 
644 644
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
645 645
                                     if ($default_value != '') {
646
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
646
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
647 647
                                     }
648 648
 
649
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
649
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
650 650
                                 }
651 651
 
652 652
                             }
653 653
                             // show lat lng
654 654
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
655
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
655
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latlng'");
656 656
 
657 657
                                 if ($is_column) {
658
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
658
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latlng` `".$prefix."latlng` VARCHAR( 3 ) NULL";
659 659
                                     $meta_field_add .= " DEFAULT '1'";
660 660
 
661 661
                                     $wpdb->query($meta_field_add);
662 662
                                 } else {
663
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
663
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
664 664
 
665 665
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
666 666
                                     $meta_field_add .= " DEFAULT '1'";
667 667
 
668
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
668
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
669 669
                                 }
670 670
 
671 671
                             }
@@ -681,30 +681,30 @@  discard block
 block discarded – undo
681 681
                         $op_size = '500';
682 682
 
683 683
                         // only make the field as big as it needs to be.
684
-                        if(isset($option_values) && $option_values && $field_type=='select'){
685
-                            $option_values_arr = explode(',',$option_values);
686
-                            if(is_array($option_values_arr)){
684
+                        if (isset($option_values) && $option_values && $field_type == 'select') {
685
+                            $option_values_arr = explode(',', $option_values);
686
+                            if (is_array($option_values_arr)) {
687 687
                                 $op_max = 0;
688
-                                foreach($option_values_arr as $op_val){
689
-                                    if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
688
+                                foreach ($option_values_arr as $op_val) {
689
+                                    if (strlen($op_val) && strlen($op_val) > $op_max) {$op_max = strlen($op_val); }
690 690
                                 }
691
-                                if($op_max){$op_size =$op_max; }
691
+                                if ($op_max) {$op_size = $op_max; }
692 692
                             }
693
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
694
-                            if(strlen($option_values)){
695
-                                $op_size =  strlen($option_values);
693
+                        }elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
694
+                            if (strlen($option_values)) {
695
+                                $op_size = strlen($option_values);
696 696
                             }
697 697
                         }
698 698
 
699
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
699
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."`VARCHAR( $op_size ) NULL";
700 700
 
701 701
                         if ($default_value != '') {
702
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
702
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
703 703
                         }
704 704
 
705 705
                         $alter_result = $wpdb->query($meta_field_add);
706
-                        if($alter_result===false){
707
-                            return __('Column change failed, you may have too many columns.','geodirectory');
706
+                        if ($alter_result === false) {
707
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
708 708
                         }
709 709
 
710 710
                         if (isset($request_field['cat_display_type']))
@@ -721,9 +721,9 @@  discard block
 block discarded – undo
721 721
                     case 'url':
722 722
                     case 'file':
723 723
 
724
-                        $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
725
-                        if($alter_result===false){
726
-                            return __('Column change failed, you may have too many columns.','geodirectory');
724
+                        $alter_result = $wpdb->query("ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TEXT NULL");
725
+                        if ($alter_result === false) {
726
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
727 727
                         }
728 728
                         if (isset($request_field['advanced_editor']))
729 729
                             $extra_fields = $request_field['advanced_editor'];
@@ -737,24 +737,24 @@  discard block
 block discarded – undo
737 737
                     default:
738 738
                         if ($data_type != 'VARCHAR' && $data_type != '') {
739 739
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
740
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
740
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` DECIMAL(11, ".(int) $decimal_point.") NULL";
741 741
                             } else {
742
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
742
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` ".$data_type." NULL";
743 743
                             }
744 744
 
745 745
                             if (is_numeric($default_value) && $default_value != '') {
746
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
746
+                                $default_value_add .= " DEFAULT '".$default_value."'";
747 747
                             }
748 748
                         } else {
749
-                            $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
749
+                            $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` VARCHAR( 254 ) NULL";
750 750
                             if ($default_value != '') {
751
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
751
+                                $default_value_add .= " DEFAULT '".$default_value."'";
752 752
                             }
753 753
                         }
754 754
 
755 755
                         $alter_result = $wpdb->query($default_value_add);
756
-                        if($alter_result===false){
757
-                            return __('Column change failed, you may have too many columns.','geodirectory');
756
+                        if ($alter_result === false) {
757
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
758 758
                         }
759 759
                         break;
760 760
                 endswitch;
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
 
771 771
                     $wpdb->prepare(
772 772
 
773
-                        "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
773
+                        "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
774 774
 					post_type = %s,
775 775
 					admin_title = %s,
776 776
 					site_title = %s,
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 					for_admin_use = %s
805 805
 					where id = %d",
806 806
 
807
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
807
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use, $cf)
808 808
                     )
809 809
 
810 810
                 );
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 
815 815
                 $wpdb->query(
816 816
                     $wpdb->prepare(
817
-                        "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
817
+                        "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
818 818
 					 	site_title=%s
819 819
 					where post_type = %s and htmlvar_name = %s",
820 820
                         array($site_title, $post_type, $htmlvar_name)
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
 
825 825
                 if ($cat_sort == '')
826
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
826
+                    $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
827 827
 
828 828
 
829 829
                 /**
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
                         $data_type = '';
844 844
 
845 845
                         if ($htmlvar_name != '') {
846
-                            $prefix = $htmlvar_name . '_';
846
+                            $prefix = $htmlvar_name.'_';
847 847
                         }
848 848
                         $old_prefix = $old_html_variable;
849 849
 
@@ -851,109 +851,109 @@  discard block
 block discarded – undo
851 851
 
852 852
                         $meta_field_add = "VARCHAR( 254 ) NULL";
853 853
                         if ($default_value != '') {
854
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
854
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
855 855
                         }
856 856
 
857
-                        geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
857
+                        geodir_add_column_if_not_exist($detail_table, $prefix."address", $meta_field_add);
858 858
                         //$wpdb->query($meta_field_add);
859 859
 
860 860
 
861 861
                         if (!empty($extra_fields)) {
862 862
 
863 863
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
864
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
864
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."city` VARCHAR( 30 ) NULL";
865 865
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
866 866
                                 if ($default_value != '') {
867
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
867
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
868 868
                                 }
869 869
 
870
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
870
+                                geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
871 871
                                 //$wpdb->query($meta_field_add);
872 872
                             }
873 873
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
874
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
874
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."region` VARCHAR( 30 ) NULL";
875 875
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
876 876
                                 if ($default_value != '') {
877
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
877
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
878 878
                                 }
879 879
 
880
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
880
+                                geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
881 881
                                 //$wpdb->query($meta_field_add);
882 882
                             }
883 883
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
884
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
884
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."country` VARCHAR( 30 ) NULL";
885 885
 
886 886
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
887 887
                                 if ($default_value != '') {
888
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
888
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
889 889
                                 }
890 890
 
891
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
891
+                                geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
892 892
                                 //$wpdb->query($meta_field_add);
893 893
                             }
894 894
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
895
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
895
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."zip` VARCHAR( 15 ) NULL";
896 896
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
897 897
                                 if ($default_value != '') {
898
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
898
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
899 899
                                 }
900 900
 
901
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
901
+                                geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
902 902
                                 //$wpdb->query($meta_field_add);
903 903
                             }
904 904
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
905
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
905
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
906 906
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
907 907
                                 if ($default_value != '') {
908
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
908
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
909 909
                                 }
910 910
 
911
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
911
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
912 912
                                 //$wpdb->query($meta_field_add);
913 913
 
914
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
914
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
915 915
 
916 916
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
917 917
                                 if ($default_value != '') {
918
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
918
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
919 919
                                 }
920 920
 
921
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
921
+                                geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
922 922
 
923 923
                                 //$wpdb->query($meta_field_add);
924 924
                             }
925 925
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
926
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
926
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
927 927
 
928 928
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
929 929
                                 if ($default_value != '') {
930
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
930
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
931 931
                                 }
932 932
 
933
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
933
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
934 934
 
935 935
                                 //$wpdb->query($meta_field_add);
936 936
                             }
937 937
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
938
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
938
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
939 939
 
940 940
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
941 941
                                 if ($default_value != '') {
942
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
942
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
943 943
                                 }
944 944
 
945
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
945
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
946 946
 
947 947
                                 //$wpdb->query($meta_field_add);
948 948
                             }
949 949
                             // show lat lng
950 950
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
951
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
951
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
952 952
 
953 953
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
954 954
                                 $meta_field_add .= " DEFAULT '1'";
955 955
 
956
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
956
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
957 957
                                 //$wpdb->query($meta_field_add);
958 958
                             }
959 959
                         }
@@ -963,8 +963,8 @@  discard block
 block discarded – undo
963 963
                     case 'checkbox':
964 964
                         $data_type = 'TINYINT';
965 965
 
966
-                        $meta_field_add = $data_type . "( 1 ) NOT NULL ";
967
-                        if ((int)$default_value === 1) {
966
+                        $meta_field_add = $data_type."( 1 ) NOT NULL ";
967
+                        if ((int) $default_value === 1) {
968 968
                             $meta_field_add .= " DEFAULT '1'";
969 969
                         }
970 970
 
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                             }
998 998
                         } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
999 999
                             if (strlen($option_values)) {
1000
-                                $op_size =  strlen($option_values);
1000
+                                $op_size = strlen($option_values);
1001 1001
                             }
1002 1002
 
1003 1003
                             if (isset($request_field['multi_display_type'])) {
@@ -1005,9 +1005,9 @@  discard block
 block discarded – undo
1005 1005
                             }
1006 1006
                         }
1007 1007
 
1008
-                        $meta_field_add = $data_type . "( $op_size ) NULL ";
1008
+                        $meta_field_add = $data_type."( $op_size ) NULL ";
1009 1009
                         if ($default_value != '') {
1010
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
1010
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
1011 1011
                         }
1012 1012
 
1013 1013
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
@@ -1022,9 +1022,9 @@  discard block
 block discarded – undo
1022 1022
 
1023 1023
                         $data_type = 'TEXT';
1024 1024
 
1025
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1025
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1026 1026
 
1027
-                        $meta_field_add = $data_type . " NULL ";
1027
+                        $meta_field_add = $data_type." NULL ";
1028 1028
                         /*if($default_value != '')
1029 1029
 					{ $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
1030 1030
 
@@ -1039,9 +1039,9 @@  discard block
 block discarded – undo
1039 1039
 
1040 1040
                         $data_type = 'DATE';
1041 1041
 
1042
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1042
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1043 1043
 
1044
-                        $meta_field_add = $data_type . " NULL ";
1044
+                        $meta_field_add = $data_type." NULL ";
1045 1045
 
1046 1046
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1047 1047
                         if ($add_result === false) {
@@ -1054,9 +1054,9 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
                         $data_type = 'TIME';
1056 1056
 
1057
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1057
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1058 1058
 
1059
-                        $meta_field_add = $data_type . " NULL ";
1059
+                        $meta_field_add = $data_type." NULL ";
1060 1060
 
1061 1061
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1062 1062
                         if ($add_result === false) {
@@ -1068,22 +1068,22 @@  discard block
 block discarded – undo
1068 1068
                     default:
1069 1069
 
1070 1070
                         if ($data_type != 'VARCHAR' && $data_type != '') {
1071
-                            $meta_field_add = $data_type . " NULL ";
1071
+                            $meta_field_add = $data_type." NULL ";
1072 1072
 
1073 1073
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
1074
-                                $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1074
+                                $meta_field_add = "DECIMAL(11, ".(int) $decimal_point.") NULL ";
1075 1075
                             }
1076 1076
 
1077 1077
                             if (is_numeric($default_value) && $default_value != '') {
1078
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1079
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1078
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1079
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1080 1080
                             }
1081 1081
                         } else {
1082 1082
                             $meta_field_add = " VARCHAR( 254 ) NULL ";
1083 1083
 
1084 1084
                             if ($default_value != '') {
1085
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1086
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1085
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1086
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1087 1087
                             }
1088 1088
                         }
1089 1089
 
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
 
1106 1106
                     $wpdb->prepare(
1107 1107
 
1108
-                        "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1108
+                        "insert into ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1109 1109
 					post_type = %s,
1110 1110
 					admin_title = %s,
1111 1111
 					site_title = %s,
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 					validation_msg = %s,
1139 1139
 					for_admin_use = %s ",
1140 1140
 
1141
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1141
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use)
1142 1142
 
1143 1143
                     )
1144 1144
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 
1151 1151
             }
1152 1152
 
1153
-            return (int)$lastid;
1153
+            return (int) $lastid;
1154 1154
 
1155 1155
 
1156 1156
         } else {
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 
1184 1184
             $post_meta_info = $wpdb->query(
1185 1185
                 $wpdb->prepare(
1186
-                    "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1186
+                    "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1187 1187
 															sort_order=%d 
1188 1188
 															where id= %d",
1189 1189
                     array($count, $cf)
@@ -1199,10 +1199,10 @@  discard block
 block discarded – undo
1199 1199
 }
1200 1200
 
1201 1201
 
1202
-function geodir_get_cf_value($cf){
1202
+function geodir_get_cf_value($cf) {
1203 1203
     $value = '';
1204 1204
     if (is_admin()) {
1205
-        global $post,$gd_session;
1205
+        global $post, $gd_session;
1206 1206
 
1207 1207
         if (isset($_REQUEST['post']))
1208 1208
             $_REQUEST['pid'] = $_REQUEST['post'];
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
         $is_default = $val['is_default'];
1251 1251
 
1252 1252
         /* field available to site admin only for edit */
1253
-        $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1253
+        $for_admin_use = isset($val['for_admin_use']) && (int) $val['for_admin_use'] == 1 ? true : false;
1254 1254
         if ($for_admin_use && !is_super_admin()) {
1255 1255
             continue;
1256 1256
         }
@@ -1275,11 +1275,11 @@  discard block
 block discarded – undo
1275 1275
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1276 1276
          * @see 'geodir_after_custom_form_field_$name'
1277 1277
          */
1278
-        do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1278
+        do_action('geodir_before_custom_form_field_'.$name, $listing_type, $package_id, $val);
1279 1279
 
1280 1280
 
1281 1281
         $custom_field = $val;
1282
-        $html ='';
1282
+        $html = '';
1283 1283
         /**
1284 1284
          * Filter the output for custom fields.
1285 1285
          *
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
          * @param string $html The html to be filtered (blank).
1289 1289
          * @param array $custom_field The custom field array values.
1290 1290
          */
1291
-        echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1291
+        echo apply_filters("geodir_custom_field_input_{$type}", $html, $custom_field);
1292 1292
 
1293 1293
 
1294 1294
 
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1304 1304
          * @see 'geodir_before_custom_form_field_$name'
1305 1305
          */
1306
-        do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1306
+        do_action('geodir_after_custom_form_field_'.$name, $listing_type, $package_id, $val);
1307 1307
 
1308 1308
     }
1309 1309
 
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 
1330 1330
         $filter = $wpdb->get_row(
1331 1331
             $wpdb->prepare(
1332
-                "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1332
+                "SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND ".$key."='".$value."'",
1333 1333
                 array($geodir_post_type)
1334 1334
             )
1335 1335
         );
@@ -1344,14 +1344,14 @@  discard block
 block discarded – undo
1344 1344
 }
1345 1345
 
1346 1346
 
1347
-function geodir_field_icon_proccess($cf){
1347
+function geodir_field_icon_proccess($cf) {
1348 1348
 
1349 1349
 
1350 1350
     if (strpos($cf['field_icon'], 'http') !== false) {
1351
-        $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1351
+        $field_icon = ' background: url('.$cf['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1352 1352
     } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1353
-        $field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1354
-    }else{
1353
+        $field_icon = '<i class="'.$cf['field_icon'].'"></i>';
1354
+    } else {
1355 1355
         $field_icon = $cf['field_icon'];
1356 1356
     }
1357 1357
 
@@ -1412,11 +1412,11 @@  discard block
 block discarded – undo
1412 1412
                  * @param string $fields_location The location the field is to be show.
1413 1413
                  * @param array $type The array of field values.
1414 1414
                  */
1415
-                $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1415
+                $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
1416 1416
 
1417 1417
                 $variables_array = array();
1418 1418
 
1419
-                if ($fields_location == 'detail' && isset($type['show_as_tab']) && (int)$type['show_as_tab'] == 1 && in_array($type['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
1419
+                if ($fields_location == 'detail' && isset($type['show_as_tab']) && (int) $type['show_as_tab'] == 1 && in_array($type['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
1420 1420
                     continue;
1421 1421
                 }
1422 1422
 
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
 
1543 1543
         $post_type = get_post_type($post_id);
1544 1544
         //echo $field_id; exit;
1545
-        $table = $plugin_prefix . $post_type . '_detail';
1545
+        $table = $plugin_prefix.$post_type.'_detail';
1546 1546
 
1547 1547
         $postcurr_images = array();
1548 1548
         $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
@@ -1561,13 +1561,13 @@  discard block
 block discarded – undo
1561 1561
             $geodir_uploadurl = $uploads['url'];
1562 1562
             $sub_dir = $uploads['subdir'];
1563 1563
 
1564
-            $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1564
+            $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
1565 1565
 
1566 1566
             for ($m = 0; $m < count($post_image); $m++) {
1567 1567
 
1568 1568
                 /* --------- start ------- */
1569 1569
 
1570
-                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1570
+                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM ".$table." WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1571 1571
 
1572 1572
 
1573 1573
                     $curr_img_url = $post_image[$m];
@@ -1593,24 +1593,24 @@  discard block
 block discarded – undo
1593 1593
                     //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1594 1594
 
1595 1595
                     if (!function_exists('wp_handle_upload'))
1596
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1596
+                        require_once(ABSPATH.'wp-admin/includes/file.php');
1597 1597
 
1598 1598
                     if (!is_dir($geodir_uploadpath))
1599 1599
                         mkdir($geodir_uploadpath);
1600 1600
 
1601
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1601
+                    $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1];
1602 1602
                     $explode_sub_dir = explode("/", $sub_dir);
1603 1603
                     if ($curr_img_dir == end($explode_sub_dir)) {
1604
-                        $img_path = $geodir_uploadpath . '/' . $filename;
1605
-                        $img_url = $geodir_uploadurl . '/' . $filename;
1604
+                        $img_path = $geodir_uploadpath.'/'.$filename;
1605
+                        $img_url = $geodir_uploadurl.'/'.$filename;
1606 1606
                     } else {
1607
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1608
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1607
+                        $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1608
+                        $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1609 1609
                     }
1610 1610
 
1611 1611
                     $uploaded_file = '';
1612 1612
                     if (file_exists($img_path))
1613
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1613
+                        $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1614 1614
 
1615 1615
                     if ($curr_img_dir != $geodir_uploaddir) {
1616 1616
                         if (file_exists($img_path))
@@ -1618,7 +1618,7 @@  discard block
 block discarded – undo
1618 1618
                     }
1619 1619
 
1620 1620
                     if (!empty($uploaded_file))
1621
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1621
+                        $file_urls = $geodir_uploadurl.'/'.$new_name;
1622 1622
 
1623 1623
                 } else {
1624 1624
                     $file_urls = $post_image[$m];
@@ -1632,8 +1632,8 @@  discard block
 block discarded – undo
1632 1632
         if (!empty($postcurr_images)) {
1633 1633
 
1634 1634
             if ($file_urls != $postcurr_images) {
1635
-                $invalid_files[] = (object)array('src' => $postcurr_images);
1636
-                $invalid_files = (object)$invalid_files;
1635
+                $invalid_files[] = (object) array('src' => $postcurr_images);
1636
+                $invalid_files = (object) $invalid_files;
1637 1637
             }
1638 1638
         }
1639 1639
 
@@ -1685,9 +1685,9 @@  discard block
 block discarded – undo
1685 1685
     function geodir_upload_dir($upload)
1686 1686
     {
1687 1687
         global $current_user;
1688
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1689
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
1690
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
1688
+        $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID;
1689
+        $upload['path'] = $upload['basedir'].$upload['subdir'];
1690
+        $upload['url'] = $upload['baseurl'].$upload['subdir'];
1691 1691
         return $upload;
1692 1692
     }
1693 1693
 
@@ -1702,20 +1702,20 @@  discard block
 block discarded – undo
1702 1702
         // check ajax noonce
1703 1703
         $imgid = $_POST["imgid"];
1704 1704
 
1705
-        check_ajax_referer($imgid . 'pluploadan');
1705
+        check_ajax_referer($imgid.'pluploadan');
1706 1706
 
1707 1707
         // handle custom file uploaddir
1708 1708
         add_filter('upload_dir', 'geodir_upload_dir');
1709 1709
 
1710 1710
         // change file orinetation if needed
1711
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1711
+        $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']);
1712 1712
 
1713 1713
         // handle file upload
1714 1714
         $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1715 1715
         // remove handle custom file uploaddir
1716 1716
         remove_filter('upload_dir', 'geodir_upload_dir');
1717 1717
 
1718
-        if(!isset($status['url']) && isset($status['error'])){
1718
+        if (!isset($status['url']) && isset($status['error'])) {
1719 1719
             print_r($status);
1720 1720
         }
1721 1721
 
@@ -1745,9 +1745,9 @@  discard block
 block discarded – undo
1745 1745
 
1746 1746
     $post_type = get_post_type($post_id);
1747 1747
 
1748
-    $table = $plugin_prefix . $post_type . '_detail';
1748
+    $table = $plugin_prefix.$post_type.'_detail';
1749 1749
 
1750
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1750
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id)));
1751 1751
 
1752 1752
     if ($results) {
1753 1753
         return $results[0]->geodir_video;
@@ -1771,9 +1771,9 @@  discard block
 block discarded – undo
1771 1771
 
1772 1772
     $post_type = get_post_type($post_id);
1773 1773
 
1774
-    $table = $plugin_prefix . $post_type . '_detail';
1774
+    $table = $plugin_prefix.$post_type.'_detail';
1775 1775
 
1776
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1776
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id)));
1777 1777
 
1778 1778
     if ($results) {
1779 1779
         return $results[0]->geodir_special_offers;
@@ -1791,12 +1791,12 @@  discard block
 block discarded – undo
1791 1791
      */
1792 1792
     function geodir_max_upload_size()
1793 1793
     {
1794
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1794
+        $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1795 1795
 
1796 1796
         if ($max_filesize > 0 && $max_filesize < 1) {
1797
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
1797
+            $max_filesize = (int) ($max_filesize * 1024).'kb';
1798 1798
         } else {
1799
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1799
+            $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1800 1800
         }
1801 1801
         /** Filter documented in geodirectory-functions/general_functions.php **/
1802 1802
         return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
 
1829 1829
             $custom_fields = $wpdb->get_results(
1830 1830
                 $wpdb->prepare(
1831
-                    "select post_type,data_type,field_type,site_title,htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1831
+                    "select post_type,data_type,field_type,site_title,htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1832 1832
                     array($post_type)
1833 1833
                 ), 'ARRAY_A'
1834 1834
             );
@@ -1945,7 +1945,7 @@  discard block
 block discarded – undo
1945 1945
 
1946 1946
             $post_meta_info = $wpdb->query(
1947 1947
                 $wpdb->prepare(
1948
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1948
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
1949 1949
 															sort_order=%d 
1950 1950
 															where id= %d",
1951 1951
                     array($count, $cf)
@@ -2027,14 +2027,14 @@  discard block
 block discarded – undo
2027 2027
 
2028 2028
         $check_html_variable = $wpdb->get_var(
2029 2029
             $wpdb->prepare(
2030
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2030
+                "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ",
2031 2031
                 array($cehhtmlvar_name, $post_type, $field_type)
2032 2032
             )
2033 2033
         );
2034 2034
 
2035 2035
         if ($is_default == 1) {
2036 2036
 
2037
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2037
+            $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type)));
2038 2038
 
2039 2039
         }
2040 2040
 
@@ -2045,7 +2045,7 @@  discard block
 block discarded – undo
2045 2045
 
2046 2046
                 $wpdb->prepare(
2047 2047
 
2048
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2048
+                    "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2049 2049
 				post_type = %s,
2050 2050
 				data_type = %s,
2051 2051
 				field_type = %s,
@@ -2076,7 +2076,7 @@  discard block
 block discarded – undo
2076 2076
 
2077 2077
                 $wpdb->prepare(
2078 2078
 
2079
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2079
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2080 2080
 				post_type = %s,
2081 2081
 				data_type = %s,
2082 2082
 				field_type = %s,
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
         }
2103 2103
 
2104 2104
 
2105
-        return (int)$lastid;
2105
+        return (int) $lastid;
2106 2106
 
2107 2107
     }
2108 2108
 }
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
         if ($field_id != '') {
2126 2126
             $cf = trim($field_id, '_');
2127 2127
 
2128
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2128
+            $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf)));
2129 2129
 
2130 2130
             return $field_id;
2131 2131
 
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
         global $wpdb;
2154 2154
         $cf = $result_str;
2155 2155
         if (!is_object($cf)) {
2156
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2156
+            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf)));
2157 2157
         } else {
2158 2158
             $field_info = $cf;
2159 2159
             $result_str = $cf->id;
@@ -2190,41 +2190,41 @@  discard block
 block discarded – undo
2190 2190
         if ($htmlvar_name == '')
2191 2191
             $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2192 2192
 
2193
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
2193
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
2194 2194
 
2195 2195
         ?>
2196
-        <li class="text" id="licontainer_<?php echo $result_str;?>">
2197
-            <div class="title title<?php echo $result_str;?> gt-fieldset"
2198
-                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>"
2199
-                 ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
2196
+        <li class="text" id="licontainer_<?php echo $result_str; ?>">
2197
+            <div class="title title<?php echo $result_str; ?> gt-fieldset"
2198
+                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>"
2199
+                 ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
2200 2200
                 <?php
2201 2201
 
2202
-                $nonce = wp_create_nonce('custom_fields_' . $result_str);
2202
+                $nonce = wp_create_nonce('custom_fields_'.$result_str);
2203 2203
                 ?>
2204 2204
 
2205
-                <div title="<?php _e('Click to remove field', 'geodirectory');?>"
2206
-                     onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2205
+                <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
2206
+                     onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2207 2207
                      class="handlediv close"></div>
2208 2208
 
2209 2209
                 <b style="cursor:pointer;"
2210
-                   onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b>
2210
+                   onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b>
2211 2211
 
2212 2212
             </div>
2213 2213
 
2214
-            <div id="field_frm<?php echo $result_str;?>" class="field_frm"
2214
+            <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
2215 2215
                  style="display:<?php if ($field_ins_upd == 'submit') {
2216 2216
                      echo 'block;';
2217 2217
                  } else {
2218 2218
                      echo 'none;';
2219 2219
                  } ?>">
2220 2220
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
2221
-                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
2222
-                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
2223
-                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
2221
+                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
2222
+                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
2223
+                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/>
2224 2224
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
2225 2225
                     echo $field_info->data_type;
2226 2226
                 }?>"/>
2227
-                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
2227
+                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/>
2228 2228
 
2229 2229
 
2230 2230
                 <table class="widefat post fixed" border="0" style="width:100%;">
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
                                        } ?>" style="width:45%;"/>
2249 2249
 
2250 2250
                                 <input type="radio" name="is_default"
2251
-                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
2251
+                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') {
2252 2252
                                     echo 'checked="checked"';
2253 2253
                                 } ?>/><span><?php _e('Set as default sort.', 'geodirectory'); ?></span>
2254 2254
 
@@ -2271,7 +2271,7 @@  discard block
 block discarded – undo
2271 2271
                                            echo esc_attr($field_info->desc_title);
2272 2272
                                        } ?>" style="width:45%;"/>
2273 2273
                                 <input type="radio" name="is_default"
2274
-                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
2274
+                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') {
2275 2275
                                     echo 'checked="checked"';
2276 2276
                                 } ?>/><span><?php _e('Set as default sort.', 'geodirectory'); ?></span>
2277 2277
                                 <br/>
@@ -2306,42 +2306,42 @@  discard block
 block discarded – undo
2306 2306
                     <?php } ?>
2307 2307
 
2308 2308
                     <tr>
2309
-                        <td><strong><?php _e('Is active :', 'geodirectory');?></strong></td>
2309
+                        <td><strong><?php _e('Is active :', 'geodirectory'); ?></strong></td>
2310 2310
                         <td align="left">
2311 2311
                             <select name="is_active" id="is_active">
2312 2312
                                 <option
2313 2313
                                     value="1" <?php if (isset($field_info->is_active) && $field_info->is_active == '1') {
2314 2314
                                     echo 'selected="selected"';
2315
-                                }?>><?php _e('Yes', 'geodirectory');?></option>
2315
+                                }?>><?php _e('Yes', 'geodirectory'); ?></option>
2316 2316
                                 <option
2317 2317
                                     value="0" <?php if (isset($field_info->is_active) && $field_info->is_active == '0') {
2318 2318
                                     echo 'selected="selected"';
2319
-                                }?>><?php _e('No', 'geodirectory');?></option>
2319
+                                }?>><?php _e('No', 'geodirectory'); ?></option>
2320 2320
                             </select>
2321 2321
                             <br/>
2322
-                            <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere.', 'geodirectory');?></span>
2322
+                            <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere.', 'geodirectory'); ?></span>
2323 2323
                         </td>
2324 2324
                     </tr>
2325 2325
 
2326 2326
                     <tr>
2327
-                        <td><strong><?php _e('Display order :', 'geodirectory');?></strong></td>
2327
+                        <td><strong><?php _e('Display order :', 'geodirectory'); ?></strong></td>
2328 2328
                         <td align="left"><input type="text" readonly="readonly" name="sort_order" id="sort_order"
2329 2329
                                                 value="<?php if (isset($field_info->sort_order)) {
2330 2330
                                                     echo esc_attr($field_info->sort_order);
2331 2331
                                                 }?>" size="50"/>
2332 2332
                             <br/>
2333
-                            <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory');?></span>
2333
+                            <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory'); ?></span>
2334 2334
                         </td>
2335 2335
                     </tr>
2336 2336
 
2337 2337
                     <tr>
2338 2338
                         <td>&nbsp;</td>
2339 2339
                         <td align="left">
2340
-                            <input type="button" class="button" name="save" id="save" value="<?php esc_attr_e('Save', 'geodirectory');?>"
2341
-                                   onclick="save_sort_field('<?php echo $result_str;?>')"/>
2340
+                            <input type="button" class="button" name="save" id="save" value="<?php esc_attr_e('Save', 'geodirectory'); ?>"
2341
+                                   onclick="save_sort_field('<?php echo $result_str; ?>')"/>
2342 2342
 
2343
-                            <a href="javascript:void(0)"><input type="button" name="delete" value="<?php esc_attr_e('Delete', 'geodirectory');?>"
2344
-                                                                onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2343
+                            <a href="javascript:void(0)"><input type="button" name="delete" value="<?php esc_attr_e('Delete', 'geodirectory'); ?>"
2344
+                                                                onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2345 2345
                                                                 class="button_n"/></a>
2346 2346
 
2347 2347
                         </td>
@@ -2376,7 +2376,7 @@  discard block
 block discarded – undo
2376 2376
         if (!$package_id || !$field_name || !$post_type) {
2377 2377
             return true;
2378 2378
         }
2379
-        $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
2379
+        $sql = $wpdb->prepare("SELECT id FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int) $package_id));
2380 2380
 
2381 2381
         if ($wpdb->get_var($sql)) {
2382 2382
             return true;
@@ -2498,7 +2498,7 @@  discard block
 block discarded – undo
2498 2498
 }
2499 2499
 
2500 2500
 
2501
-function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
2501
+function geodir_cfa_data_type_text($output, $result_str, $cf, $field_info) {
2502 2502
     ob_start();
2503 2503
     ?>
2504 2504
     <li>
@@ -2544,43 +2544,43 @@  discard block
 block discarded – undo
2544 2544
     $output = ob_get_clean();
2545 2545
     return $output;
2546 2546
 }
2547
-add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
2547
+add_filter('geodir_cfa_data_type_text', 'geodir_cfa_data_type_text', 10, 4);
2548 2548
 
2549 2549
 // htmlvar not needed for fieldset and taxonomy
2550
-add_filter('geodir_cfa_htmlvar_name_fieldset','__return_empty_string',10,4);
2551
-add_filter('geodir_cfa_htmlvar_name_taxonomy','__return_empty_string',10,4);
2550
+add_filter('geodir_cfa_htmlvar_name_fieldset', '__return_empty_string', 10, 4);
2551
+add_filter('geodir_cfa_htmlvar_name_taxonomy', '__return_empty_string', 10, 4);
2552 2552
 
2553 2553
 
2554 2554
 // default_value not needed for textarea, html, file, fieldset, taxonomy, address
2555
-add_filter('geodir_cfa_default_value_textarea','__return_empty_string',10,4);
2556
-add_filter('geodir_cfa_default_value_html','__return_empty_string',10,4);
2557
-add_filter('geodir_cfa_default_value_file','__return_empty_string',10,4);
2558
-add_filter('geodir_cfa_default_value_taxonomy','__return_empty_string',10,4);
2559
-add_filter('geodir_cfa_default_value_address','__return_empty_string',10,4);
2560
-add_filter('geodir_cfa_default_value_fieldset','__return_empty_string',10,4);
2555
+add_filter('geodir_cfa_default_value_textarea', '__return_empty_string', 10, 4);
2556
+add_filter('geodir_cfa_default_value_html', '__return_empty_string', 10, 4);
2557
+add_filter('geodir_cfa_default_value_file', '__return_empty_string', 10, 4);
2558
+add_filter('geodir_cfa_default_value_taxonomy', '__return_empty_string', 10, 4);
2559
+add_filter('geodir_cfa_default_value_address', '__return_empty_string', 10, 4);
2560
+add_filter('geodir_cfa_default_value_fieldset', '__return_empty_string', 10, 4);
2561 2561
 
2562 2562
 // is_required not needed for fieldset
2563
-add_filter('geodir_cfa_is_required_fieldset','__return_empty_string',10,4);
2564
-add_filter('geodir_cfa_required_msg_fieldset','__return_empty_string',10,4);
2563
+add_filter('geodir_cfa_is_required_fieldset', '__return_empty_string', 10, 4);
2564
+add_filter('geodir_cfa_required_msg_fieldset', '__return_empty_string', 10, 4);
2565 2565
 
2566 2566
 // field_icon not needed for fieldset
2567
-add_filter('geodir_cfa_field_icon_fieldset','__return_empty_string',10,4);
2568
-add_filter('geodir_cfa_css_class_fieldset','__return_empty_string',10,4);
2567
+add_filter('geodir_cfa_field_icon_fieldset', '__return_empty_string', 10, 4);
2568
+add_filter('geodir_cfa_css_class_fieldset', '__return_empty_string', 10, 4);
2569 2569
 
2570 2570
 // cat_sort not needed for some fields
2571
-add_filter('geodir_cfa_cat_sort_html','__return_empty_string',10,4);
2572
-add_filter('geodir_cfa_cat_sort_file','__return_empty_string',10,4);
2573
-add_filter('geodir_cfa_cat_sort_url','__return_empty_string',10,4);
2574
-add_filter('geodir_cfa_cat_sort_fieldset','__return_empty_string',10,4);
2575
-add_filter('geodir_cfa_cat_sort_multiselect','__return_empty_string',10,4);
2576
-add_filter('geodir_cfa_cat_sort_textarea','__return_empty_string',10,4);
2577
-add_filter('geodir_cfa_cat_sort_taxonomy','__return_empty_string',10,4);
2578
-add_filter('geodir_cfa_cat_sort_address','__return_empty_string',10,4);
2571
+add_filter('geodir_cfa_cat_sort_html', '__return_empty_string', 10, 4);
2572
+add_filter('geodir_cfa_cat_sort_file', '__return_empty_string', 10, 4);
2573
+add_filter('geodir_cfa_cat_sort_url', '__return_empty_string', 10, 4);
2574
+add_filter('geodir_cfa_cat_sort_fieldset', '__return_empty_string', 10, 4);
2575
+add_filter('geodir_cfa_cat_sort_multiselect', '__return_empty_string', 10, 4);
2576
+add_filter('geodir_cfa_cat_sort_textarea', '__return_empty_string', 10, 4);
2577
+add_filter('geodir_cfa_cat_sort_taxonomy', '__return_empty_string', 10, 4);
2578
+add_filter('geodir_cfa_cat_sort_address', '__return_empty_string', 10, 4);
2579 2579
 
2580 2580
 
2581 2581
 
2582
-function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
2583
-    if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2582
+function geodir_cfa_advanced_editor_geodir_special_offers($output, $result_str, $cf, $field_info) {
2583
+    if ($field_info->htmlvar_name != 'geodir_special_offers') {return ''; }
2584 2584
     ob_start();
2585 2585
     ?>
2586 2586
     <li>
@@ -2611,10 +2611,10 @@  discard block
 block discarded – undo
2611 2611
     $output = ob_get_clean();
2612 2612
     return $output;
2613 2613
 }
2614
-add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
2614
+add_filter('geodir_cfa_advanced_editor_textarea', 'geodir_cfa_advanced_editor_geodir_special_offers', 10, 4);
2615 2615
 
2616 2616
 
2617
-function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
2617
+function geodir_cfa_validation_pattern_text($output, $result_str, $cf, $field_info) {
2618 2618
     ob_start();
2619 2619
     ?>
2620 2620
     <li>
@@ -2651,10 +2651,10 @@  discard block
 block discarded – undo
2651 2651
     $output = ob_get_clean();
2652 2652
     return $output;
2653 2653
 }
2654
-add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
2654
+add_filter('geodir_cfa_validation_pattern_text', 'geodir_cfa_validation_pattern_text', 10, 4);
2655 2655
 
2656 2656
 
2657
-function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
2657
+function geodir_cfa_htmlvar_name_taxonomy($output, $result_str, $cf, $field_info) {
2658 2658
     ob_start();
2659 2659
     global $post_type;
2660 2660
 
@@ -2679,7 +2679,7 @@  discard block
 block discarded – undo
2679 2679
                     ?>
2680 2680
                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
2681 2681
                         echo 'selected="selected"';
2682
-                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2682
+                    }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php
2683 2683
                 }
2684 2684
                 ?>
2685 2685
             </select>
@@ -2690,7 +2690,7 @@  discard block
 block discarded – undo
2690 2690
         <label for="cat_display_type" class="gd-cf-tooltip-wrap">
2691 2691
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Category display type :', 'geodirectory'); ?>
2692 2692
             <div class="gdcf-tooltip">
2693
-                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory');?>
2693
+                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory'); ?>
2694 2694
             </div>
2695 2695
         </label>
2696 2696
         <div class="gd-cf-input-wrap">
@@ -2698,19 +2698,19 @@  discard block
 block discarded – undo
2698 2698
             <select name="cat_display_type" id="cat_display_type">
2699 2699
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
2700 2700
                     echo 'selected="selected"';
2701
-                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2701
+                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
2702 2702
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2703 2703
                     echo 'selected="selected"';
2704
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2704
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
2705 2705
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
2706 2706
                     echo 'selected="selected"';
2707
-                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2707
+                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
2708 2708
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2709 2709
                     echo 'selected="selected"';
2710
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2710
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
2711 2711
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2712 2712
                     echo 'selected="selected"';
2713
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2713
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
2714 2714
             </select>
2715 2715
         </div>
2716 2716
     </li>
@@ -2719,10 +2719,10 @@  discard block
 block discarded – undo
2719 2719
     $output = ob_get_clean();
2720 2720
     return $output;
2721 2721
 }
2722
-add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
2722
+add_filter('geodir_cfa_htmlvar_name_taxonomy', 'geodir_cfa_htmlvar_name_taxonomy', 10, 4);
2723 2723
 
2724 2724
 
2725
-function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
2725
+function geodir_cfa_extra_fields_address($output, $result_str, $cf, $field_info) {
2726 2726
 
2727 2727
     ob_start();
2728 2728
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -2743,32 +2743,32 @@  discard block
 block discarded – undo
2743 2743
         <label for="show_zip" class="gd-cf-tooltip-wrap">
2744 2744
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display zip/post code :', 'geodirectory'); ?>
2745 2745
             <div class="gdcf-tooltip">
2746
-                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?>
2746
+                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?>
2747 2747
             </div>
2748 2748
         </label>
2749 2749
         <div class="gd-cf-input-wrap gd-switch">
2750 2750
 
2751
-            <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2751
+            <input type="radio" id="show_zip_yes<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2752 2752
                 <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
2753 2753
                     echo 'checked';
2754 2754
                 } ?>/>
2755
-            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2755
+            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2756 2756
 
2757
-            <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2757
+            <input type="radio" id="show_zip_no<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2758 2758
                 <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
2759 2759
                     echo 'checked';
2760 2760
                 } ?>/>
2761
-            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2761
+            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2762 2762
 
2763 2763
 
2764 2764
         </div>
2765 2765
     </li>
2766 2766
 
2767
-    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'";}?> >
2767
+    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'"; }?> >
2768 2768
         <label for="zip_lable" class="gd-cf-tooltip-wrap">
2769 2769
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Zip/Post code label :', 'geodirectory'); ?>
2770 2770
             <div class="gdcf-tooltip">
2771
-                <?php _e('Enter zip/post code field label in address section.', 'geodirectory');?>
2771
+                <?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?>
2772 2772
             </div>
2773 2773
         </label>
2774 2774
         <div class="gd-cf-input-wrap">
@@ -2786,7 +2786,7 @@  discard block
 block discarded – undo
2786 2786
         <label for="map_lable" class="gd-cf-tooltip-wrap">
2787 2787
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map button label :', 'geodirectory'); ?>
2788 2788
             <div class="gdcf-tooltip">
2789
-                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory');?>
2789
+                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory'); ?>
2790 2790
             </div>
2791 2791
         </label>
2792 2792
         <div class="gd-cf-input-wrap">
@@ -2801,22 +2801,22 @@  discard block
 block discarded – undo
2801 2801
         <label for="show_mapzoom" class="gd-cf-tooltip-wrap">
2802 2802
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Use user zoom level:', 'geodirectory'); ?>
2803 2803
             <div class="gdcf-tooltip">
2804
-                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory');?>
2804
+                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory'); ?>
2805 2805
             </div>
2806 2806
         </label>
2807 2807
         <div class="gd-cf-input-wrap gd-switch">
2808 2808
 
2809
-            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2809
+            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2810 2810
                 <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
2811 2811
                     echo 'checked';
2812 2812
                 } ?>/>
2813
-            <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2813
+            <label for="show_mapzoom_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2814 2814
 
2815
-            <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2815
+            <input type="radio" id="show_mapzoom_no<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2816 2816
                 <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
2817 2817
                     echo 'checked';
2818 2818
                 } ?>/>
2819
-            <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2819
+            <label for="show_mapzoom_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2820 2820
 
2821 2821
         </div>
2822 2822
     </li>
@@ -2825,22 +2825,22 @@  discard block
 block discarded – undo
2825 2825
         <label for="show_mapview" class="gd-cf-tooltip-wrap">
2826 2826
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display map view:', 'geodirectory'); ?>
2827 2827
             <div class="gdcf-tooltip">
2828
-                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory');?>
2828
+                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory'); ?>
2829 2829
             </div>
2830 2830
         </label>
2831 2831
         <div class="gd-cf-input-wrap gd-switch">
2832 2832
 
2833
-            <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
2833
+            <input type="radio" id="show_mapview_yes<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
2834 2834
                 <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
2835 2835
                     echo 'checked';
2836 2836
                 } ?>/>
2837
-            <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2837
+            <label for="show_mapview_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2838 2838
 
2839
-            <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
2839
+            <input type="radio" id="show_mapview_no<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
2840 2840
                 <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
2841 2841
                     echo 'checked';
2842 2842
                 } ?>/>
2843
-            <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2843
+            <label for="show_mapview_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2844 2844
 
2845 2845
         </div>
2846 2846
     </li>
@@ -2850,7 +2850,7 @@  discard block
 block discarded – undo
2850 2850
         <label for="mapview_lable" class="gd-cf-tooltip-wrap">
2851 2851
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map view label:', 'geodirectory'); ?>
2852 2852
             <div class="gdcf-tooltip">
2853
-                <?php _e('Enter mapview field label in address section.', 'geodirectory');?>
2853
+                <?php _e('Enter mapview field label in address section.', 'geodirectory'); ?>
2854 2854
             </div>
2855 2855
         </label>
2856 2856
         <div class="gd-cf-input-wrap">
@@ -2864,22 +2864,22 @@  discard block
 block discarded – undo
2864 2864
         <label for="show_latlng" class="gd-cf-tooltip-wrap">
2865 2865
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show latitude and longitude', 'geodirectory'); ?>
2866 2866
             <div class="gdcf-tooltip">
2867
-                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory');?>
2867
+                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory'); ?>
2868 2868
             </div>
2869 2869
         </label>
2870 2870
         <div class="gd-cf-input-wrap gd-switch">
2871 2871
 
2872
-            <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
2872
+            <input type="radio" id="show_latlng_yes<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
2873 2873
                 <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
2874 2874
                     echo 'checked';
2875 2875
                 } ?>/>
2876
-            <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2876
+            <label for="show_latlng_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2877 2877
 
2878
-            <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
2878
+            <input type="radio" id="show_latlng_no<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
2879 2879
                 <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
2880 2880
                     echo 'checked';
2881 2881
                 } ?>/>
2882
-            <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2882
+            <label for="show_latlng_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2883 2883
 
2884 2884
         </div>
2885 2885
     </li>
@@ -2888,17 +2888,17 @@  discard block
 block discarded – undo
2888 2888
     $output = ob_get_clean();
2889 2889
     return $output;
2890 2890
 }
2891
-add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
2891
+add_filter('geodir_cfa_extra_fields_address', 'geodir_cfa_extra_fields_address', 10, 4);
2892 2892
 
2893 2893
 
2894
-function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
2894
+function geodir_cfa_extra_fields_multiselect($output, $result_str, $cf, $field_info) {
2895 2895
     ob_start();
2896 2896
     ?>
2897 2897
     <li>
2898 2898
         <label for="multi_display_type" class="gd-cf-tooltip-wrap">
2899 2899
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
2900 2900
             <div class="gdcf-tooltip">
2901
-                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory');?>
2901
+                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory'); ?>
2902 2902
             </div>
2903 2903
         </label>
2904 2904
         <div class="gd-cf-input-wrap">
@@ -2906,13 +2906,13 @@  discard block
 block discarded – undo
2906 2906
             <select name="multi_display_type" id="multi_display_type">
2907 2907
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2908 2908
                     echo 'selected="selected"';
2909
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2909
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
2910 2910
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2911 2911
                     echo 'selected="selected"';
2912
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2912
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
2913 2913
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2914 2914
                     echo 'selected="selected"';
2915
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2915
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
2916 2916
             </select>
2917 2917
 
2918 2918
             <br/>
@@ -2923,21 +2923,21 @@  discard block
 block discarded – undo
2923 2923
     $output = ob_get_clean();
2924 2924
     return $output;
2925 2925
 }
2926
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
2926
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_multiselect', 10, 4);
2927 2927
 
2928 2928
 
2929
-function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
2929
+function geodir_cfa_extra_fields_smr($output, $result_str, $cf, $field_info) {
2930 2930
     ob_start();
2931 2931
     ?>
2932 2932
     <li>
2933 2933
         <label for="option_values" class="gd-cf-tooltip-wrap">
2934 2934
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
2935 2935
             <div class="gdcf-tooltip">
2936
-                <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
2936
+                <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
2937 2937
                 <br/>
2938
-                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory');?></span>
2938
+                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory'); ?></span>
2939 2939
                     <br/>
2940
-                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
2940
+                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
2941 2941
                     <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
2942 2942
                         <br/>
2943 2943
                         <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
@@ -2960,12 +2960,12 @@  discard block
 block discarded – undo
2960 2960
     $output = ob_get_clean();
2961 2961
     return $output;
2962 2962
 }
2963
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
2964
-add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
2965
-add_filter('geodir_cfa_extra_fields_radio','geodir_cfa_extra_fields_smr',10,4);
2963
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_smr', 10, 4);
2964
+add_filter('geodir_cfa_extra_fields_select', 'geodir_cfa_extra_fields_smr', 10, 4);
2965
+add_filter('geodir_cfa_extra_fields_radio', 'geodir_cfa_extra_fields_smr', 10, 4);
2966 2966
 
2967 2967
 
2968
-function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
2968
+function geodir_cfa_extra_fields_datepicker($output, $result_str, $cf, $field_info) {
2969 2969
     ob_start();
2970 2970
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
2971 2971
         $extra = unserialize($field_info->extra_fields);
@@ -2975,7 +2975,7 @@  discard block
 block discarded – undo
2975 2975
         <label for="date_format" class="gd-cf-tooltip-wrap">
2976 2976
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
2977 2977
             <div class="gdcf-tooltip">
2978
-                <?php _e('Select the date format.', 'geodirectory');?>
2978
+                <?php _e('Select the date format.', 'geodirectory'); ?>
2979 2979
             </div>
2980 2980
         </label>
2981 2981
         <div class="gd-cf-input-wrap" style="overflow:inherit;">
@@ -2995,16 +2995,16 @@  discard block
 block discarded – undo
2995 2995
              * @since 1.6.5
2996 2996
              * @param array $date_formats The PHP date format array.
2997 2997
              */
2998
-            $date_formats = apply_filters('geodir_date_formats',$date_formats);
2998
+            $date_formats = apply_filters('geodir_date_formats', $date_formats);
2999 2999
             ?>
3000 3000
             <select name="extra[date_format]" id="date_format">
3001 3001
                 <?php
3002
-                foreach($date_formats as $format){
3002
+                foreach ($date_formats as $format) {
3003 3003
                     $selected = '';
3004
-                    if(esc_attr($extra['date_format'])==$format){
3004
+                    if (esc_attr($extra['date_format']) == $format) {
3005 3005
                         $selected = "selected='selected'";
3006 3006
                     }
3007
-                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3007
+                    echo "<option $selected value='$format'>$format       (".date_i18n($format, time()).")</option>";
3008 3008
                 }
3009 3009
                 ?>
3010 3010
             </select>
@@ -3016,10 +3016,10 @@  discard block
 block discarded – undo
3016 3016
     $output = ob_get_clean();
3017 3017
     return $output;
3018 3018
 }
3019
-add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
3019
+add_filter('geodir_cfa_extra_fields_datepicker', 'geodir_cfa_extra_fields_datepicker', 10, 4);
3020 3020
 
3021 3021
 
3022
-function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
3022
+function geodir_cfa_extra_fields_file($output, $result_str, $cf, $field_info) {
3023 3023
     ob_start();
3024 3024
     $allowed_file_types = geodir_allowed_mime_types();
3025 3025
 
@@ -3030,16 +3030,16 @@  discard block
 block discarded – undo
3030 3030
         <label for="gd_file_types" class="gd-cf-tooltip-wrap">
3031 3031
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
3032 3032
             <div class="gdcf-tooltip">
3033
-                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory');?>
3033
+                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory'); ?>
3034 3034
             </div>
3035 3035
         </label>
3036 3036
         <div class="gd-cf-input-wrap">
3037 3037
             <select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;">
3038
-                <option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
3039
-                <?php foreach ( $allowed_file_types as $format => $types ) { ?>
3040
-                    <optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
3041
-                        <?php foreach ( $types as $ext => $type ) { ?>
3042
-                            <option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option>
3038
+                <option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
3039
+                <?php foreach ($allowed_file_types as $format => $types) { ?>
3040
+                    <optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
3041
+                        <?php foreach ($types as $ext => $type) { ?>
3042
+                            <option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.'.$ext; ?></option>
3043 3043
                         <?php } ?>
3044 3044
                     </optgroup>
3045 3045
                 <?php } ?>
@@ -3051,4 +3051,4 @@  discard block
 block discarded – undo
3051 3051
     $output = ob_get_clean();
3052 3052
     return $output;
3053 3053
 }
3054
-add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
3055 3054
\ No newline at end of file
3055
+add_filter('geodir_cfa_extra_fields_file', 'geodir_cfa_extra_fields_file', 10, 4);
3056 3056
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_field_html.php 1 patch
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 $field_info = stripslashes_deep($field_info); // strip slashes from labels
29 29
 
30
-$nonce = wp_create_nonce('custom_fields_' . $result_str);
30
+$nonce = wp_create_nonce('custom_fields_'.$result_str);
31 31
 
32 32
 $field_admin_title = '';
33 33
 if (isset($field_info->admin_title))
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 
53 53
 if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
54 54
     $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
55
-}elseif(isset($cf['icon']) && $cf['icon']){
55
+}elseif (isset($cf['icon']) && $cf['icon']) {
56 56
     $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
57
-}else{
57
+} else {
58 58
     $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
59 59
 }
60 60
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
66 66
         <?php
67 67
 
68
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
68
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
69 69
         ?>
70 70
 
71 71
         <?php if ($default): ?>
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
             <i class="fa fa-long-arrow-left " aria-hidden="true"></i>
81 81
             <i class="fa fa-long-arrow-right " aria-hidden="true"></i>
82 82
             <b style="cursor:pointer;"
83
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
83
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b>
84 84
         <?php
85 85
         } else {echo $field_icon;
86 86
             ?>
87 87
             <b style="cursor:pointer;"
88
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type . ')');?></b>
88
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type.')'); ?></b>
89 89
         <?php
90 90
         }
91 91
         ?>
@@ -108,43 +108,43 @@  discard block
 block discarded – undo
108 108
         } ?>"/>
109 109
         <input type="hidden" name="is_active" id="is_active" value="1"/>
110 110
 
111
-        <input type="hidden" name="is_default" value="<?php echo $field_info->is_default;?>" /><?php // show in sidebar value?>
112
-        <input type="hidden" name="show_on_listing" value="<?php echo $field_info->show_on_listing;?>" />
113
-        <input type="hidden" name="show_on_detail" value="<?php echo $field_info->show_on_listing;?>" />
114
-        <input type="hidden" name="show_as_tab" value="<?php echo $field_info->show_as_tab;?>" />
111
+        <input type="hidden" name="is_default" value="<?php echo $field_info->is_default; ?>" /><?php // show in sidebar value?>
112
+        <input type="hidden" name="show_on_listing" value="<?php echo $field_info->show_on_listing; ?>" />
113
+        <input type="hidden" name="show_on_detail" value="<?php echo $field_info->show_on_listing; ?>" />
114
+        <input type="hidden" name="show_as_tab" value="<?php echo $field_info->show_as_tab; ?>" />
115 115
 
116 116
         <ul class="widefat post fixed" border="0" style="width:100%;">
117 117
 
118 118
             <?php
119 119
 
120 120
             // data_type
121
-            if(has_filter("geodir_cfa_data_type_{$field_type}")){
121
+            if (has_filter("geodir_cfa_data_type_{$field_type}")) {
122 122
 
123
-                echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
123
+                echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info);
124 124
 
125
-            }else{
125
+            } else {
126 126
                 $value = '';
127 127
                 if (isset($field_info->data_type)) {
128 128
                     $value = esc_attr($field_info->data_type);
129
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
129
+                }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
130 130
                     $value = $cf['defaults']['data_type'];
131 131
                 }
132 132
                 ?>
133
-                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/>
133
+                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/>
134 134
             <?php
135 135
             }
136 136
 
137 137
 
138 138
             // admin_title
139
-            if(has_filter("geodir_cfa_admin_title_{$field_type}")){
139
+            if (has_filter("geodir_cfa_admin_title_{$field_type}")) {
140 140
 
141
-                echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
141
+                echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info);
142 142
 
143
-            }else{
143
+            } else {
144 144
                 $value = '';
145 145
                 if (isset($field_info->admin_title)) {
146 146
                     $value = esc_attr($field_info->admin_title);
147
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
147
+                }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) {
148 148
                     $value = $cf['defaults']['admin_title'];
149 149
                 }
150 150
                 ?>
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                     </label>
158 158
                     <div class="gd-cf-input-wrap">
159 159
                         <input type="text" name="admin_title" id="admin_title"
160
-                               value="<?php echo $value;?>"/>
160
+                               value="<?php echo $value; ?>"/>
161 161
                     </div>
162 162
                 </li>
163 163
                 <?php
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
 
166 166
 
167 167
             // site_title
168
-            if(has_filter("geodir_cfa_site_title_{$field_type}")){
168
+            if (has_filter("geodir_cfa_site_title_{$field_type}")) {
169 169
 
170
-                echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
170
+                echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info);
171 171
 
172
-            }else{
172
+            } else {
173 173
                 $value = '';
174 174
                 if (isset($field_info->site_title)) {
175 175
                     $value = esc_attr($field_info->site_title);
176
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
176
+                }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) {
177 177
                     $value = $cf['defaults']['site_title'];
178 178
                 }
179 179
                 ?>
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
 
194 194
 
195 195
             // admin_desc
196
-            if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
196
+            if (has_filter("geodir_cfa_admin_desc_{$field_type}")) {
197 197
 
198
-                echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
198
+                echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info);
199 199
 
200
-            }else{
200
+            } else {
201 201
                 $value = '';
202 202
                 if (isset($field_info->admin_desc)) {
203 203
                     $value = esc_attr($field_info->admin_desc);
204
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
204
+                }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) {
205 205
                     $value = $cf['defaults']['admin_desc'];
206 206
                 }
207 207
                 ?>
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     </label>
214 214
                     <div class="gd-cf-input-wrap">
215 215
                         <input type="text" name="admin_desc" id="admin_desc"
216
-                               value="<?php echo $value;?>"/>
216
+                               value="<?php echo $value; ?>"/>
217 217
                     </div>
218 218
                 </li>
219 219
                 <?php
@@ -222,26 +222,26 @@  discard block
 block discarded – undo
222 222
 
223 223
 
224 224
             // htmlvar_name
225
-            if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
225
+            if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) {
226 226
 
227
-                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
227
+                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info);
228 228
 
229
-            }else{
229
+            } else {
230 230
                 $value = '';
231 231
                 if (isset($field_info->htmlvar_name)) {
232 232
                     $value = esc_attr($field_info->htmlvar_name);
233
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
233
+                }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) {
234 234
                     $value = $cf['defaults']['htmlvar_name'];
235 235
                 }
236 236
                 ?>
237 237
                 <li>
238
-                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
238
+                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory'); ?>
239 239
                         <div class="gdcf-tooltip">
240 240
                             <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?>
241 241
                         </div>
242 242
                     </label>
243 243
                     <div class="gd-cf-input-wrap">
244
-                        <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>"
244
+                        <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory'); ?>"
245 245
                                value="<?php if ($value) {
246 246
                                    echo preg_replace('/geodir_/', '', $value, 1);
247 247
                                }?>" <?php if ($default) {
@@ -254,15 +254,15 @@  discard block
 block discarded – undo
254 254
 
255 255
 
256 256
             // is_active
257
-            if(has_filter("geodir_cfa_is_active_{$field_type}")){
257
+            if (has_filter("geodir_cfa_is_active_{$field_type}")) {
258 258
 
259
-                echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
259
+                echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info);
260 260
 
261
-            }else{
261
+            } else {
262 262
                 $value = '';
263 263
                 if (isset($field_info->is_active)) {
264 264
                     $value = esc_attr($field_info->is_active);
265
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
265
+                }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) {
266 266
                     $value = $cf['defaults']['is_active'];
267 267
                 }
268 268
                 ?>
@@ -274,17 +274,17 @@  discard block
 block discarded – undo
274 274
                     </label>
275 275
                     <div class="gd-cf-input-wrap gd-switch">
276 276
 
277
-                        <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
277
+                        <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
278 278
                             <?php if ($value == '1') {
279 279
                                 echo 'checked';
280 280
                             } ?>/>
281
-                        <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
281
+                        <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
282 282
 
283
-                        <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
283
+                        <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
284 284
                             <?php if ($value == '0' || !$value) {
285 285
                                 echo 'checked';
286 286
                             } ?>/>
287
-                        <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
287
+                        <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
288 288
 
289 289
                     </div>
290 290
                 </li>
@@ -293,15 +293,15 @@  discard block
 block discarded – undo
293 293
 
294 294
 
295 295
             // for_admin_use
296
-            if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
296
+            if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) {
297 297
 
298
-                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
298
+                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info);
299 299
 
300
-            }else{
300
+            } else {
301 301
                 $value = '';
302 302
                 if (isset($field_info->for_admin_use)) {
303 303
                     $value = esc_attr($field_info->for_admin_use);
304
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
304
+                }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) {
305 305
                     $value = $cf['defaults']['for_admin_use'];
306 306
                 }
307 307
                 ?>
@@ -313,17 +313,17 @@  discard block
 block discarded – undo
313 313
                     </label>
314 314
                     <div class="gd-cf-input-wrap gd-switch">
315 315
 
316
-                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled"  value="1"
316
+                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled"  value="1"
317 317
                             <?php if ($value == '1') {
318 318
                                 echo 'checked';
319 319
                             } ?>/>
320
-                        <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
320
+                        <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
321 321
 
322
-                        <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0"
322
+                        <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0"
323 323
                             <?php if ($value == '0' || !$value) {
324 324
                                 echo 'checked';
325 325
                             } ?>/>
326
-                        <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
326
+                        <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
327 327
 
328 328
                     </div>
329 329
                 </li>
@@ -332,20 +332,20 @@  discard block
 block discarded – undo
332 332
 
333 333
 
334 334
             // default_value
335
-            if(has_filter("geodir_cfa_default_value_{$field_type}")){
335
+            if (has_filter("geodir_cfa_default_value_{$field_type}")) {
336 336
 
337
-                echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
337
+                echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info);
338 338
 
339
-            }else{
339
+            } else {
340 340
                 $value = '';
341 341
                 if (isset($field_info->default_value)) {
342 342
                     $value = esc_attr($field_info->default_value);
343
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
343
+                }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) {
344 344
                     $value = $cf['defaults']['default_value'];
345 345
                 }
346 346
                 ?>
347 347
                 <li>
348
-                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
348
+                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?>
349 349
                         <div class="gdcf-tooltip">
350 350
                             <?php
351 351
                             if ($field_type == 'checkbox') {
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
                         <?php if ($field_type == 'checkbox') { ?>
363 363
                             <select name="default_value" id="default_value">
364 364
                                 <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option>
365
-                                <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option>
365
+                                <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option>
366 366
                             </select>
367 367
                         <?php } else if ($field_type == 'email') { ?>
368
-                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
368
+                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
369 369
                         <?php } else { ?>
370
-                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
370
+                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
371 371
                         <?php } ?>
372 372
                     </div>
373 373
                 </li>
@@ -376,11 +376,11 @@  discard block
 block discarded – undo
376 376
 
377 377
 
378 378
             // show_in
379
-            if(has_filter("geodir_cfa_show_in_{$field_type}")){
379
+            if (has_filter("geodir_cfa_show_in_{$field_type}")) {
380 380
 
381
-                echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
381
+                echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info);
382 382
 
383
-            }else{
383
+            } else {
384 384
                 $value = '';
385 385
                 ?>
386 386
                 <li>
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                          * @param object $field_info The field being displayed info.
413 413
                          * @param string $field_info The type of field.
414 414
                          */
415
-                        $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
415
+                        $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type);
416 416
 
417 417
 
418 418
                         // remove some locations for some field types
@@ -420,11 +420,11 @@  discard block
 block discarded – undo
420 420
                         // don't show new tab option for some types
421 421
 
422 422
                         if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
423
-                        }else{
423
+                        } else {
424 424
                             unset($show_in_locations['[owntab]']);
425 425
                         }
426 426
 
427
-                        if(!$display_on_listing){
427
+                        if (!$display_on_listing) {
428 428
                             unset($show_in_locations['[listings]']);
429 429
                         }
430 430
 
@@ -438,17 +438,17 @@  discard block
 block discarded – undo
438 438
                                 option-ajaxchosen="false">
439 439
                             <?php
440 440
 
441
-                            $show_in_values = explode(',',$field_info->show_in);
441
+                            $show_in_values = explode(',', $field_info->show_in);
442 442
 
443
-                            foreach( $show_in_locations as $key => $val){
443
+                            foreach ($show_in_locations as $key => $val) {
444 444
                                 $selected = '';
445 445
 
446
-                                if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
446
+                                if (is_array($show_in_values) && in_array($key, $show_in_values)) {
447 447
                                     $selected = 'selected';
448 448
                                 }
449 449
 
450 450
                                 ?>
451
-                                <option  value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option>
451
+                                <option  value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option>
452 452
                                 <?php
453 453
                             }
454 454
                             ?>
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
 
461 461
 
462 462
             // advanced_editor
463
-            if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
463
+            if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) {
464 464
 
465
-                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
465
+                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info);
466 466
 
467 467
             }
468 468
 
@@ -473,10 +473,10 @@  discard block
 block discarded – undo
473 473
 
474 474
 
475 475
             <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?>
476
-            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/>
476
+            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/>
477 477
 
478 478
             <?php // we dont need to show the sort order ?>
479
-            <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order);} ?>"/>
479
+            <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order); } ?>"/>
480 480
 
481 481
 
482 482
 
@@ -529,15 +529,15 @@  discard block
 block discarded – undo
529 529
             <?php
530 530
 
531 531
             // is_required
532
-            if(has_filter("geodir_cfa_is_required_{$field_type}")){
532
+            if (has_filter("geodir_cfa_is_required_{$field_type}")) {
533 533
 
534
-                echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
534
+                echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info);
535 535
 
536
-            }else{
536
+            } else {
537 537
                 $value = '';
538 538
                 if (isset($field_info->is_required)) {
539 539
                     $value = esc_attr($field_info->is_required);
540
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
540
+                }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) {
541 541
                     $value = $cf['defaults']['is_required'];
542 542
                 }
543 543
                 ?>
@@ -550,17 +550,17 @@  discard block
 block discarded – undo
550 550
 
551 551
                     <div class="gd-cf-input-wrap gd-switch">
552 552
 
553
-                        <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled"  value="1"
553
+                        <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled"  value="1"
554 554
                             <?php if ($value == '1') {
555 555
                                 echo 'checked';
556 556
                             } ?>/>
557
-                        <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
557
+                        <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
558 558
 
559
-                        <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0"
559
+                        <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0"
560 560
                             <?php if ($value == '0' || !$value) {
561 561
                                 echo 'checked';
562 562
                             } ?>/>
563
-                        <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
563
+                        <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
564 564
 
565 565
                     </div>
566 566
 
@@ -570,19 +570,19 @@  discard block
 block discarded – undo
570 570
             }
571 571
 
572 572
             // required_msg
573
-            if(has_filter("geodir_cfa_required_msg_{$field_type}")){
573
+            if (has_filter("geodir_cfa_required_msg_{$field_type}")) {
574 574
 
575
-                echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
575
+                echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info);
576 576
 
577
-            }else{
577
+            } else {
578 578
                 $value = '';
579 579
                 if (isset($field_info->required_msg)) {
580 580
                     $value = esc_attr($field_info->required_msg);
581
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
581
+                }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) {
582 582
                     $value = $cf['defaults']['required_msg'];
583 583
                 }
584 584
                 ?>
585
-                <li class="cf-is-required-msg"<?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>>
585
+                <li class="cf-is-required-msg"<?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'"; }?>>
586 586
                     <label for="required_msg" class="gd-cf-tooltip-wrap">
587 587
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
588 588
                         <div class="gdcf-tooltip">
@@ -599,31 +599,31 @@  discard block
 block discarded – undo
599 599
 
600 600
 
601 601
             // required_msg
602
-            if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
602
+            if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) {
603 603
 
604
-                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
604
+                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info);
605 605
 
606 606
             }
607 607
 
608 608
 
609 609
             // extra_fields
610
-            if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
610
+            if (has_filter("geodir_cfa_extra_fields_{$field_type}")) {
611 611
 
612
-                echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
612
+                echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info);
613 613
 
614 614
             }
615 615
 
616 616
 
617 617
             // field_icon
618
-            if(has_filter("geodir_cfa_field_icon_{$field_type}")){
618
+            if (has_filter("geodir_cfa_field_icon_{$field_type}")) {
619 619
 
620
-                echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
620
+                echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info);
621 621
 
622
-            }else{
622
+            } else {
623 623
                 $value = '';
624 624
                 if (isset($field_info->field_icon)) {
625 625
                     $value = esc_attr($field_info->field_icon);
626
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
626
+                }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) {
627 627
                     $value = $cf['defaults']['field_icon'];
628 628
                 }
629 629
                 ?>
@@ -634,12 +634,12 @@  discard block
 block discarded – undo
634 634
                     <label for="field_icon" class="gd-cf-tooltip-wrap">
635 635
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?>
636 636
                         <div class="gdcf-tooltip">
637
-                            <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?>
637
+                            <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory'); ?>
638 638
                         </div>
639 639
                     </label>
640 640
                     <div class="gd-cf-input-wrap">
641 641
                         <input type="text" name="field_icon" id="field_icon"
642
-                               value="<?php echo $value;?>"/>
642
+                               value="<?php echo $value; ?>"/>
643 643
                     </div>
644 644
 
645 645
                 </li>
@@ -648,15 +648,15 @@  discard block
 block discarded – undo
648 648
 
649 649
 
650 650
             // css_class
651
-            if(has_filter("geodir_cfa_css_class_{$field_type}")){
651
+            if (has_filter("geodir_cfa_css_class_{$field_type}")) {
652 652
 
653
-                echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
653
+                echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info);
654 654
 
655
-            }else{
655
+            } else {
656 656
                 $value = '';
657 657
                 if (isset($field_info->css_class)) {
658 658
                     $value = esc_attr($field_info->css_class);
659
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
659
+                }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) {
660 660
                     $value = $cf['defaults']['css_class'];
661 661
                 }
662 662
                 ?>
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
                     <label for="css_class" class="gd-cf-tooltip-wrap">
666 666
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?>
667 667
                         <div class="gdcf-tooltip">
668
-                            <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
668
+                            <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?>
669 669
                         </div>
670 670
                     </label>
671 671
                     <div class="gd-cf-input-wrap">
@@ -680,15 +680,15 @@  discard block
 block discarded – undo
680 680
 
681 681
 
682 682
             // cat_sort
683
-            if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
683
+            if (has_filter("geodir_cfa_cat_sort_{$field_type}")) {
684 684
 
685
-                echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
685
+                echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info);
686 686
 
687
-            }else{
687
+            } else {
688 688
                 $value = '';
689 689
                 if (isset($field_info->cat_sort)) {
690 690
                     $value = esc_attr($field_info->cat_sort);
691
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
691
+                }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) {
692 692
                     $value = $cf['defaults']['cat_sort'];
693 693
                 }
694 694
                 ?>
@@ -711,23 +711,23 @@  discard block
 block discarded – undo
711 711
                     <label for="cat_sort" class="gd-cf-tooltip-wrap">
712 712
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
713 713
                         <div class="gdcf-tooltip">
714
-                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?>
714
+                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?>
715 715
                         </div>
716 716
                     </label>
717 717
 
718 718
                     <div class="gd-cf-input-wrap gd-switch">
719 719
 
720
-                        <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled"  value="1"
720
+                        <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled"  value="1"
721 721
                             <?php if ($value == '1') {
722 722
                                 echo 'checked';
723 723
                             } ?>/>
724
-                        <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
724
+                        <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
725 725
 
726
-                        <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0"
726
+                        <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0"
727 727
                             <?php if (!$value) {
728 728
                                 echo 'checked';
729 729
                             } ?>/>
730
-                        <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
730
+                        <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
731 731
 
732 732
                     </div>
733 733
                 </li>
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
                      * @since 1.0.0
753 753
                      * @param object $field_info The current fields info.
754 754
                      */
755
-                    do_action('geodir_advance_custom_fields', $field_info);?>
755
+                    do_action('geodir_advance_custom_fields', $field_info); ?>
756 756
 
757 757
 
758 758
                 <?php endswitch; ?>
@@ -764,10 +764,10 @@  discard block
 block discarded – undo
764 764
                     <h3></h3>
765 765
                 </label>
766 766
                 <div class="gd-cf-input-wrap">
767
-                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
767
+                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
768 768
                            onclick="save_field('<?php echo esc_attr($result_str); ?>')"/>
769 769
                     <?php if (!$default): ?>
770
-                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
770
+                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
771 771
                                                             onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')"
772 772
                                                             class="button"/></a>
773 773
                     <?php endif; ?>
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/create_field.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 /* ---- Show field form in admin ---- */
39 39
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
40
-    geodir_custom_field_adminhtml($field_type, $field_id, $field_action,$field_type_key);
40
+    geodir_custom_field_adminhtml($field_type, $field_id, $field_action, $field_type_key);
41 41
 }
42 42
 
43 43
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 
47 47
 /* ---- Delete field ---- */
48 48
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
49
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
49
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
50 50
         return;
51 51
     
52 52
     echo geodir_custom_field_delete($field_id);
53 53
 }
54 54
 
55 55
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
56
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
56
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
57 57
         return;
58 58
     
59 59
     echo geodir_custom_sort_field_delete($field_id);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 /* ---- Save field  ---- */
63 63
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
64
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
64
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
65 65
         return;
66 66
 
67 67
     foreach ($_REQUEST as $pkey => $pval) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     if (is_int($return)) {
82 82
         $lastid = $return;
83
-        geodir_custom_field_adminhtml($field_type, $lastid, 'submit',$field_type_key);
83
+        geodir_custom_field_adminhtml($field_type, $lastid, 'submit', $field_type_key);
84 84
     } else {
85 85
         echo $return;
86 86
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
 /* ---- Save sort field  ---- */
90 90
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
91
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
91
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
92 92
         return;
93 93
 
94 94
     foreach ($_REQUEST as $pkey => $pval) {
Please login to merge, or discard this patch.
geodirectory-admin/admin_hooks_actions.php 1 patch
Spacing   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  */
63 63
 function geodir_get_admin_option_form($current_tab)
64 64
 {
65
-    geodir_admin_option_form($current_tab);// defined in admin template tags.php
65
+    geodir_admin_option_form($current_tab); // defined in admin template tags.php
66 66
 }
67 67
 
68 68
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 add_action('geodir_update_options_compatibility_settings', 'geodir_update_options_compatibility_settings');
71 71
 add_action('geodir_update_options_default_location_settings', 'geodir_location_form_submit');
72 72
 add_action('geodir_before_admin_panel', 'geodir_before_admin_panel'); // this function is in admin_functions.php
73
-add_action('geodir_before_update_options', 'geodir_before_update_options',10,2);
73
+add_action('geodir_before_update_options', 'geodir_before_update_options', 10, 2);
74 74
 
75 75
 //add_action('geodir_before_admin_panel', 'geodir_autoinstall_admin_header');
76 76
 
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
 
229 229
         // Filter-Payment-Manager
230 230
 
231
-        add_meta_box('geodir_post_images', $post_typename . ' ' . __('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side');
231
+        add_meta_box('geodir_post_images', $post_typename.' '.__('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side');
232 232
 
233
-        add_meta_box('geodir_post_info', $post_typename . ' ' . __('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high');
233
+        add_meta_box('geodir_post_info', $post_typename.' '.__('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high');
234 234
 
235 235
         // no need of this box as all fields moved to main information box
236 236
         //add_meta_box( 'geodir_post_addinfo', $post_typename. ' ' .__('Additional Information' , 'geodirectory'), 'geodir_post_addinfo_setting', $geodir_posttype,'normal', 'high' );
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
 }
241 241
 
242
-add_action('save_post', 'geodir_post_information_save',10,2);
242
+add_action('save_post', 'geodir_post_information_save', 10, 2);
243 243
 
244 244
 
245 245
 
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
 
267 267
             $gd_taxonomy = geodir_get_taxonomies($geodir_post_type);
268 268
 
269
-            if(!empty($gd_taxonomy)) {
269
+            if (!empty($gd_taxonomy)) {
270 270
                 foreach ($gd_taxonomy as $tax) {
271 271
 
272
-                    remove_meta_box($tax . 'div', $geodir_post_type, 'normal');
272
+                    remove_meta_box($tax.'div', $geodir_post_type, 'normal');
273 273
 
274 274
                 }
275 275
             }
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
     global $wpdb;
419 419
     $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
420 420
     ?>
421
-    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/>
421
+    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/>
422 422
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/>
423 423
     <ul>
424 424
     <?php
@@ -429,18 +429,18 @@  discard block
 block discarded – undo
429 429
 
430 430
             $check_html_variable = $wpdb->get_var(
431 431
                 $wpdb->prepare(
432
-                    "SELECT htmlvar_name FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s",
432
+                    "SELECT htmlvar_name FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s",
433 433
                     array($val['htmlvar_name'], $listing_type, $val['field_type'])
434 434
                 )
435 435
             );
436 436
             
437 437
             $display = $check_html_variable ? ' style="display:none;"' : '';
438 438
             ?>
439
-            <li <?php echo $display;?>>
440
-            <a id="gt-<?php echo $val['field_type'];?>-_-<?php echo $val['htmlvar_name'];?>"
441
-               title="<?php echo $val['site_title'];?>"
442
-               class="gt-draggable-form-items gt-<?php echo $val['field_type'];?> geodir-sort-<?php echo $val['htmlvar_name'];?>"
443
-               href="javascript:void(0);"><b></b><?php _e($val['site_title'], 'geodirectory');?></a>
439
+            <li <?php echo $display; ?>>
440
+            <a id="gt-<?php echo $val['field_type']; ?>-_-<?php echo $val['htmlvar_name']; ?>"
441
+               title="<?php echo $val['site_title']; ?>"
442
+               class="gt-draggable-form-items gt-<?php echo $val['field_type']; ?> geodir-sort-<?php echo $val['htmlvar_name']; ?>"
443
+               href="javascript:void(0);"><b></b><?php _e($val['site_title'], 'geodirectory'); ?></a>
444 444
             </li>
445 445
             <?php
446 446
         }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
     <?php 
466 466
         global $wpdb;
467 467
         
468
-        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type)));
468
+        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type)));
469 469
 
470 470
         if (!empty($fields)) {
471 471
             foreach ($fields as $field) {
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
  * @since 1.6.6
492 492
  * @package GeoDirectory
493 493
  */
494
-function geodir_custom_fields($post_type=''){
494
+function geodir_custom_fields($post_type = '') {
495 495
     
496 496
     $custom_fields = array(
497 497
         'text' => array(
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
             'name'  =>  __('Test', 'geodirectory'),
593 593
             'description' =>  __('Adds a test value bla bla', 'geodirectory'),
594 594
             'defaults'  => array(
595
-                'data_type'     =>  '',   // true to show options, or define the SQL data type.
595
+                'data_type'     =>  '', // true to show options, or define the SQL data type.
596 596
                 'admin_title'   =>  'testing yo', // pre-fill value
597 597
                 'site_title'    =>  '', // pre-fill value
598 598
             )
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
      * }
634 634
      * @param string $post_type The post type requested.
635 635
      */
636
-    return apply_filters('geodir_custom_fields',$custom_fields,$post_type);
636
+    return apply_filters('geodir_custom_fields', $custom_fields, $post_type);
637 637
 }
638 638
 
639 639
 /**
@@ -646,17 +646,17 @@  discard block
 block discarded – undo
646 646
 {
647 647
     $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
648 648
     ?>
649
-    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/>
649
+    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/>
650 650
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/>
651 651
     <ul class="full gd-cf-tooltip-wrap">
652 652
         <li>
653 653
             <div class="gdcf-tooltip">
654
-                <?php _e('This adds a section separator with a title.', 'geodirectory');?>
654
+                <?php _e('This adds a section separator with a title.', 'geodirectory'); ?>
655 655
             </div>
656 656
             <a id="gt-fieldset" class="gd-draggable-form-items gt-fieldset" href="javascript:void(0);">
657 657
                 <i class="fa fa-long-arrow-left " aria-hidden="true"></i>
658 658
                 <i class="fa fa-long-arrow-right " aria-hidden="true"></i>
659
-                <?php _e('Fieldset (section separator)', 'geodirectory');?>
659
+                <?php _e('Fieldset (section separator)', 'geodirectory'); ?>
660 660
             </a>
661 661
         </li>
662 662
     </ul>
@@ -664,23 +664,23 @@  discard block
 block discarded – undo
664 664
         <?php
665 665
         $cfs = geodir_custom_fields($listing_type);
666 666
 
667
-        foreach($cfs as $id=>$cf){
667
+        foreach ($cfs as $id=>$cf) {
668 668
             ?>
669 669
             <li   class="gd-cf-tooltip-wrap">
670 670
                 <?php
671
-                if(isset($cf['description']) && $cf['description']){
671
+                if (isset($cf['description']) && $cf['description']) {
672 672
                    echo '<div class="gdcf-tooltip">'.$cf['description'].'</div>';
673 673
                 }?>
674 674
 
675
-                <a id="gd-<?php echo $id;?>" data-field-type-key="<?php echo $id;?>"  data-field-type="<?php echo $cf['field_type'];?>" class="gd-draggable-form-items <?php echo $cf['class'];?>" href="javascript:void(0);">
675
+                <a id="gd-<?php echo $id; ?>" data-field-type-key="<?php echo $id; ?>"  data-field-type="<?php echo $cf['field_type']; ?>" class="gd-draggable-form-items <?php echo $cf['class']; ?>" href="javascript:void(0);">
676 676
                     <?php if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
677 677
                         echo '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
678
-                    }elseif(isset($cf['icon']) && $cf['icon'] ){
678
+                    }elseif (isset($cf['icon']) && $cf['icon']) {
679 679
                         echo '<b style="background-image: url("'.$cf['icon'].'")"></b>';
680
-                    }else{
680
+                    } else {
681 681
                         echo '<i class="fa fa-cog" aria-hidden="true"></i>';
682 682
                     }?>
683
-                    <?php echo $cf['name'];?>
683
+                    <?php echo $cf['name']; ?>
684 684
                 </a>
685 685
             </li>
686 686
         <?php
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
     <ul class="core">
711 711
     <?php 
712 712
         global $wpdb;
713
-        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type)));
713
+        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type)));
714 714
 
715 715
         if (!empty($fields)) {
716 716
             foreach ($fields as $field) {
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
                 $field_type_key = $field->field_type_key;
721 721
                 $field_ins_upd = 'display';
722 722
 
723
-                geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd,$field_type_key);
723
+                geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd, $field_type_key);
724 724
             }
725 725
         }
726 726
         ?></ul>
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 
799 799
     switch ($sub_tab) {
800 800
         case 'custom_fields':
801
-            $note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type));;
801
+            $note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type)); ;
802 802
             break;
803 803
 
804 804
         case 'sorting_options':
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 
853 853
     switch ($sub_tab) {
854 854
         case 'custom_fields':
855
-            $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type));;
855
+            $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type)); ;
856 856
             break;
857 857
 
858 858
         case 'sorting_options':
@@ -879,8 +879,8 @@  discard block
 block discarded – undo
879 879
 
880 880
     if (!get_option('geodir_remove_unnecessary_fields')) {
881 881
 
882
-        if ($wpdb->get_var("SHOW COLUMNS FROM " . $plugin_prefix . "gd_place_detail WHERE field = 'categories'"))
883
-            $wpdb->query("ALTER TABLE `" . $plugin_prefix . "gd_place_detail` DROP `categories`");
882
+        if ($wpdb->get_var("SHOW COLUMNS FROM ".$plugin_prefix."gd_place_detail WHERE field = 'categories'"))
883
+            $wpdb->query("ALTER TABLE `".$plugin_prefix."gd_place_detail` DROP `categories`");
884 884
 
885 885
         update_option('geodir_remove_unnecessary_fields', '1');
886 886
 
@@ -908,14 +908,14 @@  discard block
 block discarded – undo
908 908
             case 'diagnosis' :
909 909
                 if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
910 910
                     $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
911
-                call_user_func('geodir_diagnose_' . $diagnose_this);
911
+                call_user_func('geodir_diagnose_'.$diagnose_this);
912 912
                 exit();
913 913
                 break;
914 914
 
915 915
             case 'diagnosis-fix' :
916 916
                 if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
917 917
                     $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
918
-                call_user_func('geodir_diagnose_' . $diagnose_this);
918
+                call_user_func('geodir_diagnose_'.$diagnose_this);
919 919
                 exit();
920 920
                 break;
921 921
         }
@@ -940,50 +940,50 @@  discard block
 block discarded – undo
940 940
 {
941 941
     global $wpdb;
942 942
     //$filter_arr['output_str'] .='###'.$table.'###';
943
-    if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0) {
944
-        $filter_arr['output_str'] .= "<li>" . __('ERROR: You did not follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory') . "</li>";
943
+    if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") > 0) {
944
+        $filter_arr['output_str'] .= "<li>".__('ERROR: You did not follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory')."</li>";
945 945
         $filter_arr['is_error_during_diagnose'] = true;
946 946
 
947
-    } elseif ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
948
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name) . "</li>";
947
+    } elseif ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") > 0) {
948
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name)."</li>";
949 949
         $filter_arr['is_error_during_diagnose'] = true;
950
-        $filter_arr['output_str'] .= "<li>" . __('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory') . "</li>";
950
+        $filter_arr['output_str'] .= "<li>".__('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory')."</li>";
951 951
         $filter_arr['is_error_during_diagnose'] = true;
952 952
 
953 953
         if ($fix) {
954
-            $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $table . "_ms_bak");// get backup table count
955
-            $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table");// get new table count
954
+            $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$table."_ms_bak"); // get backup table count
955
+            $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."$table"); // get new table count
956 956
 
957 957
             if ($ms_bak_count == $new_table_count) {// if they are the same count rename to bak2
958 958
                 //$filter_arr['output_str'] .= "<li>".sprintf( __('-->PROBLEM: %s table count is the same as new table, contact support' , 'geodirectory'), $table )."</li>" ;
959 959
 
960
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename bak table to new table
960
+                $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$table."_ms_bak2"); // rename bak table to new table
961 961
 
962
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
963
-                    $filter_arr['output_str'] .= "<li>" . __('-->FIXED: Renamed and backed up the tables', 'geodirectory') . "</li>";
962
+                if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") == 0) {
963
+                    $filter_arr['output_str'] .= "<li>".__('-->FIXED: Renamed and backed up the tables', 'geodirectory')."</li>";
964 964
                 } else {
965
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
965
+                    $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>";
966 966
                 }
967 967
 
968 968
             } elseif ($ms_bak_count > $new_table_count) {//if backup is greater then restore it
969 969
 
970
-                $wpdb->query("RENAME TABLE " . $wpdb->prefix . "$table TO " . $table . "_ms_bak2");// rename new table to bak2
971
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $wpdb->prefix . "$table");// rename bak table to new table
970
+                $wpdb->query("RENAME TABLE ".$wpdb->prefix."$table TO ".$table."_ms_bak2"); // rename new table to bak2
971
+                $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$wpdb->prefix."$table"); // rename bak table to new table
972 972
 
973
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
974
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table) . "</li>";
973
+                if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
974
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table)."</li>";
975 975
                 } else {
976
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
976
+                    $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>";
977 977
                 }
978 978
 
979 979
             } elseif ($new_table_count > $ms_bak_count) {// we cant do much so rename the table to stop errors
980 980
 
981
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename ms_bak table to ms_bak2
981
+                $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$table."_ms_bak2"); // rename ms_bak table to ms_bak2
982 982
 
983
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
984
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table) . "</li>";
983
+                if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") == 0) {
984
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table)."</li>";
985 985
                 } else {
986
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
986
+                    $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>";
987 987
                 }
988 988
 
989 989
             }
@@ -991,54 +991,54 @@  discard block
 block discarded – undo
991 991
         }
992 992
 
993 993
 
994
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
995
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name) . "</li>";
994
+    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") > 0) {
995
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name)."</li>";
996 996
         $filter_arr['is_error_during_diagnose'] = true;
997 997
 
998 998
         if ($fix) {
999 999
             if ($wpdb->get_var("SELECT COUNT(*) FROM $table") == 0) {// if first table is empty just delete it
1000 1000
                 if ($wpdb->query("DROP TABLE IF EXISTS $table")) {
1001
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table) . "</li>";
1001
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table)."</li>";
1002 1002
                 } else {
1003
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table) . "</li>";
1003
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table)."</li>";
1004 1004
                 }
1005 1005
 
1006
-            } elseif ($wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table") == 0) {// if main table is empty but original is not, delete main and rename original
1007
-                if ($wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "$table")) {
1008
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
1006
+            } elseif ($wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."$table") == 0) {// if main table is empty but original is not, delete main and rename original
1007
+                if ($wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."$table")) {
1008
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix.$table)."</li>";
1009 1009
                 } else {
1010
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
1010
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix.$table)."</li>";
1011 1011
                 }
1012
-                if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1013
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1012
+                if ($wpdb->query("RENAME TABLE $table TO ".$wpdb->prefix."$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1013
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1014 1014
                 } else {
1015
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1015
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1016 1016
                 }
1017 1017
             } else {// else rename the original table to _ms_bak
1018
-                if ($wpdb->query("RENAME TABLE $table TO " . $table . "_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1019
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
1018
+                if ($wpdb->query("RENAME TABLE $table TO ".$table."_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1019
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table."_ms_bak")."</li>";
1020 1020
                 } else {
1021
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
1021
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table."_ms_bak")."</li>";
1022 1022
                 }
1023 1023
             }
1024 1024
         }
1025 1025
 
1026
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
1027
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name) . "</li>";
1026
+    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") == 0) {
1027
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name)."</li>";
1028 1028
         $filter_arr['is_error_during_diagnose'] = true;
1029 1029
 
1030 1030
         if ($fix) {
1031 1031
             // if original table exists but new does not, rename
1032
-            if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1033
-                $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1032
+            if ($wpdb->query("RENAME TABLE $table TO ".$wpdb->prefix."$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1033
+                $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1034 1034
             } else {
1035
-                $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1035
+                $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1036 1036
             }
1037 1037
 
1038 1038
         }
1039 1039
 
1040
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
1041
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name) . "</li>";
1040
+    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") == 0) {
1041
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name)."</li>";
1042 1042
         $filter_arr['is_error_during_diagnose'] = true;
1043 1043
 
1044 1044
         if ($fix) {
@@ -1052,11 +1052,11 @@  discard block
 block discarded – undo
1052 1052
             delete_option('geodir_custom_posts_db_version');
1053 1053
             delete_option('geodir_reviewratings_db_version');
1054 1054
             delete_option('geodiradvancesearch_db_version');
1055
-            $filter_arr['output_str'] .= "<li>" . __('-->TRY: Please refresh page to run table install functions', 'geodirectory') . "</li>";
1055
+            $filter_arr['output_str'] .= "<li>".__('-->TRY: Please refresh page to run table install functions', 'geodirectory')."</li>";
1056 1056
         }
1057 1057
 
1058 1058
     } else {
1059
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name) . "</li>";
1059
+        $filter_arr['output_str'] .= "<li>".sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name)."</li>";
1060 1060
     }
1061 1061
     return $filter_arr;
1062 1062
 }
@@ -1085,23 +1085,23 @@  discard block
 block discarded – undo
1085 1085
     if (!empty($all_postypes)) {
1086 1086
         foreach ($all_postypes as $key) {
1087 1087
             // update each GD CPT
1088
-            $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
1088
+            $posts = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."geodir_".$key."_detail d");
1089 1089
 
1090 1090
             if (!empty($posts)) {
1091 1091
 
1092 1092
                 foreach ($posts as $p) {
1093 1093
                     $p->post_type = $key;
1094
-                    $raw_tags = wp_get_object_terms($p->post_id, $p->post_type . '_tags', array('fields' => 'names'));
1094
+                    $raw_tags = wp_get_object_terms($p->post_id, $p->post_type.'_tags', array('fields' => 'names'));
1095 1095
                     if (empty($raw_tags)) {
1096 1096
                         $post_tags = '';
1097 1097
                     } else {
1098 1098
                         $post_tags = implode(",", $raw_tags);
1099 1099
                     }
1100
-                    $tablename = $plugin_prefix . $p->post_type . '_detail';
1101
-                    $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id));
1100
+                    $tablename = $plugin_prefix.$p->post_type.'_detail';
1101
+                    $wpdb->query($wpdb->prepare("UPDATE ".$tablename." SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id));
1102 1102
 
1103 1103
                 }
1104
-                $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
1104
+                $output_str .= "<li>".$key.__(': Done', 'geodirectory')."</li>";
1105 1105
             }
1106 1106
 
1107 1107
         }
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 
1111 1111
     if ($is_error_during_diagnose) {
1112 1112
         $info_div_class = "geodir_problem_info";
1113
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1113
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1114 1114
     } else {
1115 1115
         $info_div_class = "geodir_noproblem_info";
1116 1116
         $fix_button_txt = '';
@@ -1147,29 +1147,29 @@  discard block
 block discarded – undo
1147 1147
     if (!empty($all_postypes)) {
1148 1148
         foreach ($all_postypes as $key) {
1149 1149
             // update each GD CTP
1150
-            $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d WHERE d." . $key . "category='' ");
1150
+            $posts = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."geodir_".$key."_detail d WHERE d.".$key."category='' ");
1151 1151
 
1152 1152
             if (!empty($posts)) {
1153 1153
 
1154 1154
                 foreach ($posts as $p) {
1155 1155
                     $p->post_type = $key;
1156
-                    $raw_cats = wp_get_object_terms($p->post_id, $p->post_type . 'category', array('fields' => 'ids'));
1156
+                    $raw_cats = wp_get_object_terms($p->post_id, $p->post_type.'category', array('fields' => 'ids'));
1157 1157
 
1158 1158
                     if (empty($raw_cats)) {
1159 1159
                         $post_categories = get_post_meta($p->post_id, 'post_categories', true);
1160 1160
 
1161
-                        if (!empty($post_categories) && !empty($post_categories[$p->post_type . 'category'])) {
1162
-                            $post_categories[$p->post_type . 'category'] = str_replace("d:", "", $post_categories[$p->post_type . 'category']);
1163
-                            foreach (explode(",", $post_categories[$p->post_type . 'category']) as $cat_part) {
1161
+                        if (!empty($post_categories) && !empty($post_categories[$p->post_type.'category'])) {
1162
+                            $post_categories[$p->post_type.'category'] = str_replace("d:", "", $post_categories[$p->post_type.'category']);
1163
+                            foreach (explode(",", $post_categories[$p->post_type.'category']) as $cat_part) {
1164 1164
                                 if (is_numeric($cat_part)) {
1165
-                                    $raw_cats[] = (int)$cat_part;
1165
+                                    $raw_cats[] = (int) $cat_part;
1166 1166
                                 }
1167 1167
                             }
1168 1168
 
1169 1169
                         }
1170 1170
 
1171 1171
                         if (!empty($raw_cats)) {
1172
-                            $term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type . 'category');
1172
+                            $term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type.'category');
1173 1173
 
1174 1174
                         }
1175 1175
 
@@ -1179,14 +1179,14 @@  discard block
 block discarded – undo
1179 1179
                     if (empty($raw_cats)) {
1180 1180
                         $post_cats = '';
1181 1181
                     } else {
1182
-                        $post_cats = ',' . implode(",", $raw_cats) . ',';
1182
+                        $post_cats = ','.implode(",", $raw_cats).',';
1183 1183
                     }
1184
-                    $tablename = $plugin_prefix . $p->post_type . '_detail';
1185
-                    $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET " . $p->post_type . "category=%s WHERE post_id =%d", $post_cats, $p->post_id));
1184
+                    $tablename = $plugin_prefix.$p->post_type.'_detail';
1185
+                    $wpdb->query($wpdb->prepare("UPDATE ".$tablename." SET ".$p->post_type."category=%s WHERE post_id =%d", $post_cats, $p->post_id));
1186 1186
                 }
1187 1187
 
1188 1188
             }
1189
-            $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
1189
+            $output_str .= "<li>".$key.__(': Done', 'geodirectory')."</li>";
1190 1190
 
1191 1191
         }
1192 1192
 
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
     if ($is_error_during_diagnose) {
1196 1196
         $info_div_class = "geodir_problem_info";
1197
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1197
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1198 1198
     } else {
1199 1199
         $info_div_class = "geodir_noproblem_info";
1200 1200
         $fix_button_txt = '';
@@ -1247,15 +1247,15 @@  discard block
 block discarded – undo
1247 1247
     if (!empty($ver_arr)) {
1248 1248
         foreach ($ver_arr as $key => $val) {
1249 1249
             if (delete_option($val)) {
1250
-                $output_str .= "<li>" . $key . __(' Version: Deleted', 'geodirectory') . "</li>";
1250
+                $output_str .= "<li>".$key.__(' Version: Deleted', 'geodirectory')."</li>";
1251 1251
             } else {
1252
-                $output_str .= "<li>" . $key . __(' Version: Not Found', 'geodirectory') . "</li>";
1252
+                $output_str .= "<li>".$key.__(' Version: Not Found', 'geodirectory')."</li>";
1253 1253
             }
1254 1254
 
1255 1255
         }
1256 1256
 
1257 1257
         if ($output_str) {
1258
-            $output_str .= "<li><strong>" . __(' Upgrade/install scripts will run on next page reload.', 'geodirectory') . "</strong></li>";
1258
+            $output_str .= "<li><strong>".__(' Upgrade/install scripts will run on next page reload.', 'geodirectory')."</strong></li>";
1259 1259
         }
1260 1260
 
1261 1261
     }
@@ -1292,43 +1292,43 @@  discard block
 block discarded – undo
1292 1292
     $output_str = '';
1293 1293
 
1294 1294
     // check review locations
1295
-    if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) {
1296
-        $output_str .= "<li>" . __('Review locations missing or broken', 'geodirectory') . "</li>";
1295
+    if ($wpdb->get_results("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) {
1296
+        $output_str .= "<li>".__('Review locations missing or broken', 'geodirectory')."</li>";
1297 1297
         $is_error_during_diagnose = true;
1298 1298
 
1299 1299
         if ($fix) {
1300 1300
             if (geodir_fix_review_location()) {
1301
-                $output_str .= "<li><strong>" . __('-->FIXED: Review locations fixed', 'geodirectory') . "</strong></li>";
1301
+                $output_str .= "<li><strong>".__('-->FIXED: Review locations fixed', 'geodirectory')."</strong></li>";
1302 1302
             } else {
1303
-                $output_str .= "<li><strong>" . __('-->FAILED: Review locations fix failed', 'geodirectory') . "</strong></li>";
1303
+                $output_str .= "<li><strong>".__('-->FAILED: Review locations fix failed', 'geodirectory')."</strong></li>";
1304 1304
             }
1305 1305
         }
1306 1306
 
1307 1307
     } else {
1308
-        $output_str .= "<li>" . __('Review locations ok', 'geodirectory') . "</li>";
1308
+        $output_str .= "<li>".__('Review locations ok', 'geodirectory')."</li>";
1309 1309
     }
1310 1310
 
1311 1311
     // check review content
1312
-    if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_content IS NULL")) {
1313
-        $output_str .= "<li>" . __('Review content missing or broken', 'geodirectory') . "</li>";
1312
+    if ($wpdb->get_results("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_content IS NULL")) {
1313
+        $output_str .= "<li>".__('Review content missing or broken', 'geodirectory')."</li>";
1314 1314
         $is_error_during_diagnose = true;
1315 1315
 
1316 1316
         if ($fix) {
1317 1317
             if (geodir_fix_review_content()) {
1318
-                $output_str .= "<li><strong>" . __('-->FIXED: Review content fixed', 'geodirectory') . "</strong></li>";
1318
+                $output_str .= "<li><strong>".__('-->FIXED: Review content fixed', 'geodirectory')."</strong></li>";
1319 1319
             } else {
1320
-                $output_str .= "<li><strong>" . __('-->FAILED: Review content fix failed', 'geodirectory') . "</strong></li>";
1320
+                $output_str .= "<li><strong>".__('-->FAILED: Review content fix failed', 'geodirectory')."</strong></li>";
1321 1321
             }
1322 1322
         }
1323 1323
 
1324 1324
     } else {
1325
-        $output_str .= "<li>" . __('Review content ok', 'geodirectory') . "</li>";
1325
+        $output_str .= "<li>".__('Review content ok', 'geodirectory')."</li>";
1326 1326
     }
1327 1327
 
1328 1328
 
1329 1329
     if ($is_error_during_diagnose) {
1330 1330
         $info_div_class = "geodir_problem_info";
1331
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1331
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1332 1332
     } else {
1333 1333
         $info_div_class = "geodir_noproblem_info";
1334 1334
         $fix_button_txt = '';
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 
1393 1393
     if ($is_error_during_diagnose) {
1394 1394
         $info_div_class = "geodir_problem_info";
1395
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />";
1395
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />";
1396 1396
     } else {
1397 1397
         $info_div_class = "geodir_noproblem_info";
1398 1398
         $fix_button_txt = '';
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
     else {
1427 1427
         $page_found = $wpdb->get_var(
1428 1428
             $wpdb->prepare(
1429
-                "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
1429
+                "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s LIMIT 1;",
1430 1430
                 array($slug)
1431 1431
             )
1432 1432
         );
@@ -1472,18 +1472,18 @@  discard block
 block discarded – undo
1472 1472
     //////////////////////////////////
1473 1473
     $option_value = get_option('geodir_home_page');
1474 1474
     $page = get_post($option_value);
1475
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1475
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1476 1476
 
1477
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1478
-        $output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>";
1477
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1478
+        $output_str .= "<li>".__('GD Home page exists with proper setting.', 'geodirectory')."</li>";
1479 1479
     else {
1480 1480
         $is_error_during_diagnose = true;
1481
-        $output_str .= "<li><strong>" . __('GD Home page is missing.', 'geodirectory') . "</strong></li>";
1481
+        $output_str .= "<li><strong>".__('GD Home page is missing.', 'geodirectory')."</strong></li>";
1482 1482
         if ($fix) {
1483 1483
             if (geodir_fix_virtual_page('gd-home', __('GD Home page', 'geodirectory'), $page_found, 'geodir_home_page')) {
1484
-                $output_str .= "<li><strong>" . __('-->FIXED: GD Home page fixed', 'geodirectory') . "</strong></li>";
1484
+                $output_str .= "<li><strong>".__('-->FIXED: GD Home page fixed', 'geodirectory')."</strong></li>";
1485 1485
             } else {
1486
-                $output_str .= "<li><strong>" . __('-->FAILED: GD Home page fix failed', 'geodirectory') . "</strong></li>";
1486
+                $output_str .= "<li><strong>".__('-->FAILED: GD Home page fix failed', 'geodirectory')."</strong></li>";
1487 1487
             }
1488 1488
         }
1489 1489
     }
@@ -1497,18 +1497,18 @@  discard block
 block discarded – undo
1497 1497
     //////////////////////////////////
1498 1498
     $option_value = get_option('geodir_add_listing_page');
1499 1499
     $page = get_post($option_value);
1500
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1500
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1501 1501
 
1502
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1503
-        $output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>";
1502
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1503
+        $output_str .= "<li>".__('Add Listing page exists with proper setting.', 'geodirectory')."</li>";
1504 1504
     else {
1505 1505
         $is_error_during_diagnose = true;
1506
-        $output_str .= "<li><strong>" . __('Add Listing page is missing.', 'geodirectory') . "</strong></li>";
1506
+        $output_str .= "<li><strong>".__('Add Listing page is missing.', 'geodirectory')."</strong></li>";
1507 1507
         if ($fix) {
1508 1508
             if (geodir_fix_virtual_page('add-listing', __('Add Listing', 'geodirectory'), $page_found, 'geodir_add_listing_page')) {
1509
-                $output_str .= "<li><strong>" . __('-->FIXED: Add Listing page fixed', 'geodirectory') . "</strong></li>";
1509
+                $output_str .= "<li><strong>".__('-->FIXED: Add Listing page fixed', 'geodirectory')."</strong></li>";
1510 1510
             } else {
1511
-                $output_str .= "<li><strong>" . __('-->FAILED: Add Listing page fix failed', 'geodirectory') . "</strong></li>";
1511
+                $output_str .= "<li><strong>".__('-->FAILED: Add Listing page fix failed', 'geodirectory')."</strong></li>";
1512 1512
             }
1513 1513
         }
1514 1514
     }
@@ -1523,18 +1523,18 @@  discard block
 block discarded – undo
1523 1523
     //////////////////////////////////
1524 1524
     $option_value = get_option('geodir_preview_page');
1525 1525
     $page = get_post($option_value);
1526
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1526
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1527 1527
 
1528
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1529
-        $output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>";
1528
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1529
+        $output_str .= "<li>".__('Listing Preview page exists with proper setting.', 'geodirectory')."</li>";
1530 1530
     else {
1531 1531
         $is_error_during_diagnose = true;
1532
-        $output_str .= "<li><strong>" . __('Listing Preview page is missing.', 'geodirectory') . "</strong></li>";
1532
+        $output_str .= "<li><strong>".__('Listing Preview page is missing.', 'geodirectory')."</strong></li>";
1533 1533
         if ($fix) {
1534 1534
             if (geodir_fix_virtual_page('listing-preview', __('Listing Preview', 'geodirectory'), $page_found, 'geodir_preview_page')) {
1535
-                $output_str .= "<li><strong>" . __('-->FIXED: Listing Preview page fixed', 'geodirectory') . "</strong></li>";
1535
+                $output_str .= "<li><strong>".__('-->FIXED: Listing Preview page fixed', 'geodirectory')."</strong></li>";
1536 1536
             } else {
1537
-                $output_str .= "<li><strong>" . __('-->FAILED: Listing Preview page fix failed', 'geodirectory') . "</strong></li>";
1537
+                $output_str .= "<li><strong>".__('-->FAILED: Listing Preview page fix failed', 'geodirectory')."</strong></li>";
1538 1538
             }
1539 1539
         }
1540 1540
     }
@@ -1548,18 +1548,18 @@  discard block
 block discarded – undo
1548 1548
     //////////////////////////////////
1549 1549
     $option_value = get_option('geodir_success_page');
1550 1550
     $page = get_post($option_value);
1551
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1551
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1552 1552
 
1553
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1554
-        $output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>";
1553
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1554
+        $output_str .= "<li>".__('Listing Success page exists with proper setting.', 'geodirectory')."</li>";
1555 1555
     else {
1556 1556
         $is_error_during_diagnose = true;
1557
-        $output_str .= "<li><strong>" . __('Listing Success page is missing.', 'geodirectory') . "</strong></li>";
1557
+        $output_str .= "<li><strong>".__('Listing Success page is missing.', 'geodirectory')."</strong></li>";
1558 1558
         if ($fix) {
1559 1559
             if (geodir_fix_virtual_page('listing-success', __('Listing Success', 'geodirectory'), $page_found, 'geodir_success_page')) {
1560
-                $output_str .= "<li><strong>" . __('-->FIXED: Listing Success page fixed', 'geodirectory') . "</strong></li>";
1560
+                $output_str .= "<li><strong>".__('-->FIXED: Listing Success page fixed', 'geodirectory')."</strong></li>";
1561 1561
             } else {
1562
-                $output_str .= "<li><strong>" . __('-->FAILED: Listing Success page fix failed', 'geodirectory') . "</strong></li>";
1562
+                $output_str .= "<li><strong>".__('-->FAILED: Listing Success page fix failed', 'geodirectory')."</strong></li>";
1563 1563
             }
1564 1564
         }
1565 1565
     }
@@ -1573,18 +1573,18 @@  discard block
 block discarded – undo
1573 1573
     //////////////////////////////////
1574 1574
     $option_value = get_option('geodir_info_page');
1575 1575
     $page = get_post($option_value);
1576
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1576
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1577 1577
 
1578
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1579
-        $output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>";
1578
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1579
+        $output_str .= "<li>".__('Info page exists with proper setting.', 'geodirectory')."</li>";
1580 1580
     else {
1581 1581
         $is_error_during_diagnose = true;
1582
-        $output_str .= "<li><strong>" . __('Info page is missing.', 'geodirectory') . "</strong></li>";
1582
+        $output_str .= "<li><strong>".__('Info page is missing.', 'geodirectory')."</strong></li>";
1583 1583
         if ($fix) {
1584 1584
             if (geodir_fix_virtual_page('gd-info', __('Info', 'geodirectory'), $page_found, 'geodir_info_page')) {
1585
-                $output_str .= "<li><strong>" . __('-->FIXED: Info page fixed', 'geodirectory') . "</strong></li>";
1585
+                $output_str .= "<li><strong>".__('-->FIXED: Info page fixed', 'geodirectory')."</strong></li>";
1586 1586
             } else {
1587
-                $output_str .= "<li><strong>" . __('-->FAILED: Info page fix failed', 'geodirectory') . "</strong></li>";
1587
+                $output_str .= "<li><strong>".__('-->FAILED: Info page fix failed', 'geodirectory')."</strong></li>";
1588 1588
             }
1589 1589
         }
1590 1590
     }
@@ -1598,18 +1598,18 @@  discard block
 block discarded – undo
1598 1598
     //////////////////////////////////
1599 1599
     $option_value = get_option('geodir_login_page');
1600 1600
     $page = get_post($option_value);
1601
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1601
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1602 1602
 
1603
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1604
-        $output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>";
1603
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1604
+        $output_str .= "<li>".__('Login page exists with proper setting.', 'geodirectory')."</li>";
1605 1605
     else {
1606 1606
         $is_error_during_diagnose = true;
1607
-        $output_str .= "<li><strong>" . __('Login page is missing.', 'geodirectory') . "</strong></li>";
1607
+        $output_str .= "<li><strong>".__('Login page is missing.', 'geodirectory')."</strong></li>";
1608 1608
         if ($fix) {
1609 1609
             if (geodir_fix_virtual_page('gd-login', __('Login', 'geodirectory'), $page_found, 'geodir_login_page')) {
1610
-                $output_str .= "<li><strong>" . __('-->FIXED: Login page fixed', 'geodirectory') . "</strong></li>";
1610
+                $output_str .= "<li><strong>".__('-->FIXED: Login page fixed', 'geodirectory')."</strong></li>";
1611 1611
             } else {
1612
-                $output_str .= "<li><strong>" . __('-->FAILED: Login page fix failed', 'geodirectory') . "</strong></li>";
1612
+                $output_str .= "<li><strong>".__('-->FAILED: Login page fix failed', 'geodirectory')."</strong></li>";
1613 1613
             }
1614 1614
         }
1615 1615
     }
@@ -1623,18 +1623,18 @@  discard block
 block discarded – undo
1623 1623
     //////////////////////////////////
1624 1624
     $option_value = get_option('geodir_location_page');
1625 1625
     $page = get_post($option_value);
1626
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1626
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1627 1627
 
1628
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1629
-        $output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>";
1628
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1629
+        $output_str .= "<li>".__('Location page exists with proper setting.', 'geodirectory')."</li>";
1630 1630
     else {
1631 1631
         $is_error_during_diagnose = true;
1632
-        $output_str .= "<li><strong>" . __('Location page is missing.', 'geodirectory') . "</strong></li>";
1632
+        $output_str .= "<li><strong>".__('Location page is missing.', 'geodirectory')."</strong></li>";
1633 1633
         if ($fix) {
1634 1634
             if (geodir_fix_virtual_page('location', __('Location', 'geodirectory'), $page_found, 'geodir_location_page')) {
1635
-                $output_str .= "<li><strong>" . __('-->FIXED: Location page fixed', 'geodirectory') . "</strong></li>";
1635
+                $output_str .= "<li><strong>".__('-->FIXED: Location page fixed', 'geodirectory')."</strong></li>";
1636 1636
             } else {
1637
-                $output_str .= "<li><strong>" . __('-->FAILED: Location page fix failed', 'geodirectory') . "</strong></li>";
1637
+                $output_str .= "<li><strong>".__('-->FAILED: Location page fix failed', 'geodirectory')."</strong></li>";
1638 1638
             }
1639 1639
         }
1640 1640
     }
@@ -1643,13 +1643,13 @@  discard block
 block discarded – undo
1643 1643
     /* Diagnose Location Page Ends */
1644 1644
     ////////////////////////////////
1645 1645
 
1646
-    $page_chk_arr = array('output_str'=>$output_str,'is_error_during_diagnose'=>$is_error_during_diagnose );
1646
+    $page_chk_arr = array('output_str'=>$output_str, 'is_error_during_diagnose'=>$is_error_during_diagnose);
1647 1647
     /**
1648 1648
      * This action is called at the end of the GD Tools page check function.
1649 1649
      *
1650 1650
      * @since 1.5.2
1651 1651
      */
1652
-    $page_chk_arr = apply_filters('geodir_diagnose_default_pages',$page_chk_arr);
1652
+    $page_chk_arr = apply_filters('geodir_diagnose_default_pages', $page_chk_arr);
1653 1653
 
1654 1654
     $output_str = $page_chk_arr['output_str'];
1655 1655
     $is_error_during_diagnose = $page_chk_arr['is_error_during_diagnose'];
@@ -1659,7 +1659,7 @@  discard block
 block discarded – undo
1659 1659
             flush_rewrite_rules();
1660 1660
         }
1661 1661
         $info_div_class = "geodir_problem_info";
1662
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />";
1662
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />";
1663 1663
     } else {
1664 1664
         $info_div_class = "geodir_noproblem_info";
1665 1665
         $fix_button_txt = '';
@@ -1687,10 +1687,10 @@  discard block
 block discarded – undo
1687 1687
     $fix_button_txt = '';
1688 1688
 
1689 1689
     if ($is_error_during_diagnose) {
1690
-        $output_str .= "<li>" . __('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory') . ' ' . geodir_plugin_path() . '/db-language.php' . "</li>";
1690
+        $output_str .= "<li>".__('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory').' '.geodir_plugin_path().'/db-language.php'."</li>";
1691 1691
 		$info_div_class = "geodir_problem_info";
1692 1692
     } else {
1693
-        $output_str .= "<li>" . __('Load custom fields in to file for translation: ok', 'geodirectory') . "</li>";
1693
+        $output_str .= "<li>".__('Load custom fields in to file for translation: ok', 'geodirectory')."</li>";
1694 1694
 		$info_div_class = "geodir_noproblem_info";
1695 1695
         $fix_button_txt = '';
1696 1696
     }
@@ -1732,17 +1732,17 @@  discard block
 block discarded – undo
1732 1732
     global $wpdb, $wp_query, $plugin_prefix;
1733 1733
 
1734 1734
     if (is_admin() && !empty($wp_query->query_vars) && !empty($wp_query->query_vars['is_geodir_loop']) && !empty($wp_query->query_vars['orderby']) && $wp_query->query_vars['orderby'] == 'expire' && !empty($wp_query->query_vars['post_type']) && in_array($wp_query->query_vars['post_type'], geodir_get_posttypes()) && !empty($wp_query->query_vars['orderby']) && isset($clauses['join']) && isset($clauses['orderby']) && isset($clauses['fields'])) {
1735
-        $table = $plugin_prefix . $wp_query->query_vars['post_type'] . '_detail';
1735
+        $table = $plugin_prefix.$wp_query->query_vars['post_type'].'_detail';
1736 1736
 
1737
-        $join = $clauses['join'] . ' INNER JOIN ' . $table . ' AS gd_posts ON (gd_posts.post_id = ' . $wpdb->posts . '.ID)';
1737
+        $join = $clauses['join'].' INNER JOIN '.$table.' AS gd_posts ON (gd_posts.post_id = '.$wpdb->posts.'.ID)';
1738 1738
         $clauses['join'] = $join;
1739 1739
 
1740
-        $fields = $clauses['fields'] != '' ? $clauses['fields'] . ', ' : '';
1740
+        $fields = $clauses['fields'] != '' ? $clauses['fields'].', ' : '';
1741 1741
         $fields .= 'IF(UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), 253402300799) AS gd_expire';
1742 1742
         $clauses['fields'] = $fields;
1743 1743
 
1744 1744
         $order = !empty($wp_query->query_vars['order']) ? $wp_query->query_vars['order'] : 'ASC';
1745
-        $orderby = 'gd_expire ' . $order;
1745
+        $orderby = 'gd_expire '.$order;
1746 1746
         $clauses['orderby'] = $orderby;
1747 1747
     }
1748 1748
     return $clauses;
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
         global $current_user;
1786 1786
         $upload_dir = wp_upload_dir();
1787 1787
 
1788
-        $file = $upload_dir['path'] . '/temp_' . $current_user->data->ID . '/geodir_tmp.csv';
1788
+        $file = $upload_dir['path'].'/temp_'.$current_user->data->ID.'/geodir_tmp.csv';
1789 1789
         $handle = fopen($file, 'w');
1790 1790
 
1791 1791
         fwrite($handle, $input);
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
     $uploads_dir = $uploads['path'];
1831 1831
     $image_name_arr = explode('/', $filename);
1832 1832
     $filename = end($image_name_arr);
1833
-    $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1833
+    $target_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1834 1834
     $return = array();
1835 1835
     $return['file'] = $uploadedFile;
1836 1836
     $return['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory');
@@ -1847,8 +1847,8 @@  discard block
 block discarded – undo
1847 1847
 
1848 1848
                 if (($handle = fopen($target_path, "r")) !== FALSE) {
1849 1849
                     while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
1850
-                        if(is_array($data) && !empty($data)) {
1851
-                            $file[] = '"' . implode('","', $data) . '"';
1850
+                        if (is_array($data) && !empty($data)) {
1851
+                            $file[] = '"'.implode('","', $data).'"';
1852 1852
                         }
1853 1853
                     }
1854 1854
                     fclose($handle);
@@ -1965,10 +1965,10 @@  discard block
 block discarded – undo
1965 1965
                     $tag_arr = explode(',', $post_tags);
1966 1966
                 }
1967 1967
 
1968
-                $table = $plugin_prefix . $buffer[5] . '_detail'; // check table in database
1968
+                $table = $plugin_prefix.$buffer[5].'_detail'; // check table in database
1969 1969
 
1970 1970
                 $error = '';
1971
-                if ($wpdb->get_var("SHOW TABLES LIKE '" . $table . "'") != $table) {
1971
+                if ($wpdb->get_var("SHOW TABLES LIKE '".$table."'") != $table) {
1972 1972
                     $invalid_post_type++;
1973 1973
                     continue;
1974 1974
                 }
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
                             if ($buffer[$c] != '0' && $buffer[$c] != '') {
1995 1995
                                 $submitdata = date('Y-m-d');
1996 1996
 
1997
-                                $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata . "+" . addslashes($buffer[$c]) . " days"));
1997
+                                $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata."+".addslashes($buffer[$c])." days"));
1998 1998
                             } else {
1999 1999
                                 $gd_post_info['expire_date'] = 'Never';
2000 2000
                             }
@@ -2022,7 +2022,7 @@  discard block
 block discarded – undo
2022 2022
 						
2023 2023
 						// Post status
2024 2024
 						if ($customKeyarray[$c] == 'post_status') {
2025
-                            $post_status = sanitize_key( $buffer[$c] );
2025
+                            $post_status = sanitize_key($buffer[$c]);
2026 2026
                         }
2027 2027
                     }
2028 2028
 
@@ -2040,8 +2040,8 @@  discard block
 block discarded – undo
2040 2040
 					
2041 2041
 					// Default post status
2042 2042
 					$default_status = 'publish';
2043
-					$post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status;
2044
-					$post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status;
2043
+					$post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status;
2044
+					$post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status;
2045 2045
 
2046 2046
                     $my_post['post_title'] = $post_title;
2047 2047
                     $my_post['post_content'] = $post_desc;
@@ -2085,7 +2085,7 @@  discard block
 block discarded – undo
2085 2085
                     $payment_info = array();
2086 2086
                     $package_info = array();
2087 2087
 
2088
-                    $package_info = (array)geodir_post_package_info($package_info, '', $buffer[5]);
2088
+                    $package_info = (array) geodir_post_package_info($package_info, '', $buffer[5]);
2089 2089
                     $package_id = '';
2090 2090
                     if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') {
2091 2091
                         $package_id = $gd_post_info['package_id'];
@@ -2095,7 +2095,7 @@  discard block
 block discarded – undo
2095 2095
                         $payment_info['package_id'] = $package_info['pid'];
2096 2096
 
2097 2097
                         if (isset($package_info['alive_days']) && $package_info['alive_days'] != 0) {
2098
-                            $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['alive_days'] . " days"));
2098
+                            $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['alive_days']." days"));
2099 2099
                         } else {
2100 2100
                             $payment_info['expire_date'] = 'Never';
2101 2101
                         }
@@ -2107,7 +2107,7 @@  discard block
 block discarded – undo
2107 2107
 
2108 2108
                     $post_type = get_post_type($last_postid);
2109 2109
 
2110
-                    $table = $plugin_prefix . $post_type . '_detail';
2110
+                    $table = $plugin_prefix.$post_type.'_detail';
2111 2111
 
2112 2112
                     geodir_save_post_info($last_postid, $gd_post_info);
2113 2113
 
@@ -2128,7 +2128,7 @@  discard block
 block discarded – undo
2128 2128
                             $attachment['post_id'] = $last_postid;
2129 2129
                             $attachment['title'] = $img_name_arr[0];
2130 2130
                             $attachment['content'] = '';
2131
-                            $attachment['file'] = $sub_dir . '/' . $image_name;
2131
+                            $attachment['file'] = $sub_dir.'/'.$image_name;
2132 2132
                             $attachment['mime_type'] = $uploaded_file_type;
2133 2133
                             $attachment['menu_order'] = $menu_order;
2134 2134
                             $attachment['is_featured'] = 0;
@@ -2137,15 +2137,15 @@  discard block
 block discarded – undo
2137 2137
 
2138 2138
                             foreach ($attachment as $key => $val) {
2139 2139
                                 if ($val != '')
2140
-                                    $attachment_set .= $key . " = '" . $val . "', ";
2140
+                                    $attachment_set .= $key." = '".$val."', ";
2141 2141
                             }
2142 2142
                             $attachment_set = trim($attachment_set, ", ");
2143 2143
 
2144
-                            $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
2144
+                            $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
2145 2145
 
2146 2146
                             if ($menu_order == 1) {
2147 2147
                                 $post_type = get_post_type($last_postid);
2148
-                                $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($sub_dir . '/' . $image_name, $last_postid)));
2148
+                                $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($sub_dir.'/'.$image_name, $last_postid)));
2149 2149
                             }
2150 2150
                             $menu_order++;
2151 2151
                         }
@@ -2186,11 +2186,11 @@  discard block
 block discarded – undo
2186 2186
 }
2187 2187
 
2188 2188
 // Add the tab in left sidebar menu fro import & export page.
2189
-add_filter( 'geodir_settings_tabs_array', 'geodir_import_export_tab', 94 );
2189
+add_filter('geodir_settings_tabs_array', 'geodir_import_export_tab', 94);
2190 2190
 
2191 2191
 // Handle ajax request for import/export.
2192
-add_action( 'wp_ajax_geodir_import_export', 'geodir_ajax_import_export' );
2193
-add_action( 'wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export' );
2192
+add_action('wp_ajax_geodir_import_export', 'geodir_ajax_import_export');
2193
+add_action('wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export');
2194 2194
 
2195 2195
 
2196 2196
 /**
@@ -2201,40 +2201,40 @@  discard block
 block discarded – undo
2201 2201
  * @param $post_id int $post_id The post ID of the post being saved.
2202 2202
  * @param $post object $post The post object of the post being saved.
2203 2203
  */
2204
-function geodir_update_location_prefix($post_id,$post){
2205
-    if($post->post_type=='page' && $post->post_name && $post_id==get_option('geodir_location_page')){
2206
-        update_option('geodir_location_prefix',$post->post_name);
2204
+function geodir_update_location_prefix($post_id, $post) {
2205
+    if ($post->post_type == 'page' && $post->post_name && $post_id == get_option('geodir_location_page')) {
2206
+        update_option('geodir_location_prefix', $post->post_name);
2207 2207
     }
2208 2208
 
2209 2209
 }
2210 2210
 
2211
-add_action('save_post', 'geodir_update_location_prefix',10,2);
2211
+add_action('save_post', 'geodir_update_location_prefix', 10, 2);
2212 2212
 
2213
-add_action( 'wp_ajax_geodir_ga_callback', 'geodir_ga_callback' );
2213
+add_action('wp_ajax_geodir_ga_callback', 'geodir_ga_callback');
2214 2214
 
2215
-function geodir_ga_callback(){
2215
+function geodir_ga_callback() {
2216 2216
 
2217
-if(isset($_REQUEST['code']) && $_REQUEST['code']) {
2217
+if (isset($_REQUEST['code']) && $_REQUEST['code']) {
2218 2218
     $oAuthURL = "https://www.googleapis.com/oauth2/v3/token?";
2219 2219
     $code = "code=".$_REQUEST['code'];
2220 2220
     $grant_type = "&grant_type=authorization_code";
2221
-    $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
2221
+    $redirect_uri = "&redirect_uri=".admin_url('admin-ajax.php')."?action=geodir_ga_callback";
2222 2222
     $client_id = "&client_id=".get_option('geodir_ga_client_id');
2223 2223
     $client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
2224 2224
 
2225
-    $auth_url = $oAuthURL . $code . $redirect_uri .  $grant_type . $client_id .$client_secret;
2225
+    $auth_url = $oAuthURL.$code.$redirect_uri.$grant_type.$client_id.$client_secret;
2226 2226
 
2227 2227
     $response = wp_remote_post($auth_url, array('timeout' => 15));
2228 2228
 
2229 2229
     //print_r($response);
2230 2230
 
2231
-    $error_msg =  __('Something went wrong','geodirectory');
2232
-    if(!empty($response['response']['code']) && $response['response']['code']==200){
2231
+    $error_msg = __('Something went wrong', 'geodirectory');
2232
+    if (!empty($response['response']['code']) && $response['response']['code'] == 200) {
2233 2233
 
2234 2234
         $parts = json_decode($response['body']);
2235 2235
         //print_r($parts);
2236
-        if(!isset($parts->access_token)){echo $error_msg." - #1";exit;}
2237
-        else{
2236
+        if (!isset($parts->access_token)) {echo $error_msg." - #1"; exit; }
2237
+        else {
2238 2238
 
2239 2239
             update_option('gd_ga_access_token', $parts->access_token);
2240 2240
             update_option('gd_ga_refresh_token', $parts->refresh_token);
@@ -2243,25 +2243,25 @@  discard block
 block discarded – undo
2243 2243
 
2244 2244
 
2245 2245
     }
2246
-    elseif(!empty($response['response']['code'])) {
2246
+    elseif (!empty($response['response']['code'])) {
2247 2247
         $parts = json_decode($response['body']);
2248 2248
 
2249
-        if(isset($parts->error)){
2250
-            echo $parts->error.": ".$parts->error_description;exit;
2251
-        }else{
2252
-            echo $error_msg." - #2";exit;
2249
+        if (isset($parts->error)) {
2250
+            echo $parts->error.": ".$parts->error_description; exit;
2251
+        } else {
2252
+            echo $error_msg." - #2"; exit;
2253 2253
         }
2254 2254
 
2255
-    }else{
2255
+    } else {
2256 2256
 
2257
-        echo $error_msg." - #3";exit;
2257
+        echo $error_msg." - #3"; exit;
2258 2258
 
2259 2259
     }
2260 2260
 }
2261 2261
     exit;
2262 2262
 }
2263 2263
 
2264
-add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 );
2264
+add_filter('icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4);
2265 2265
 
2266 2266
 if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'permalink_settings') {
2267 2267
 	add_action('geodir_before_admin_panel', 'geodir_wpml_permalink_setting_notice');
Please login to merge, or discard this patch.