@@ -24,8 +24,11 @@ discard block |
||
| 24 | 24 | global $current_tab; |
| 25 | 25 | geodir_redirect_to_admin_panel_on_installed(); |
| 26 | 26 | $current_tab = (isset($_GET['tab']) && $_GET['tab'] != '') ? $_GET['tab'] : 'general_settings'; |
| 27 | - if (!(isset($_REQUEST['action']))) // this will avoid Ajax requests |
|
| 28 | - geodir_handle_option_form_submit($current_tab); // located in admin function.php |
|
| 27 | + if (!(isset($_REQUEST['action']))) { |
|
| 28 | + // this will avoid Ajax requests |
|
| 29 | + geodir_handle_option_form_submit($current_tab); |
|
| 30 | + } |
|
| 31 | + // located in admin function.php |
|
| 29 | 32 | /** |
| 30 | 33 | * Called on the WordPress 'admin_init' hook this hookis used to call everything for the GD settings pages in the admin area. |
| 31 | 34 | * |
@@ -316,8 +319,9 @@ discard block |
||
| 316 | 319 | if (!empty($notification) && get_option('geodir_tiny_editor') == '1') {
|
| 317 | 320 | |
| 318 | 321 | foreach ($notification as $key => $value) {
|
| 319 | - if ($value['type'] == 'textarea') |
|
| 320 | - $notification[$key]['type'] = 'editor'; |
|
| 322 | + if ($value['type'] == 'textarea') { |
|
| 323 | + $notification[$key]['type'] = 'editor'; |
|
| 324 | + } |
|
| 321 | 325 | } |
| 322 | 326 | |
| 323 | 327 | } |
@@ -342,8 +346,9 @@ discard block |
||
| 342 | 346 | if (!empty($design_setting) && get_option('geodir_tiny_editor') == '1') {
|
| 343 | 347 | |
| 344 | 348 | foreach ($design_setting as $key => $value) {
|
| 345 | - if ($value['type'] == 'textarea' && $value['id'] == 'geodir_term_condition_content') |
|
| 346 | - $design_setting[$key]['type'] = 'editor'; |
|
| 349 | + if ($value['type'] == 'textarea' && $value['id'] == 'geodir_term_condition_content') { |
|
| 350 | + $design_setting[$key]['type'] = 'editor'; |
|
| 351 | + } |
|
| 347 | 352 | } |
| 348 | 353 | |
| 349 | 354 | } |
@@ -462,9 +467,9 @@ discard block |
||
| 462 | 467 | class="gd-draggable-form-items gd-<?php echo $val['field_type'];?> geodir-sort-<?php echo $val['htmlvar_name'];?>" href="javascript:void(0);"> |
| 463 | 468 | <?php if (isset($val['field_icon']) && strpos($val['field_icon'], 'fa fa-') !== false) {
|
| 464 | 469 | echo '<i class="'.$val['field_icon'].'" aria-hidden="true"></i>'; |
| 465 | - }elseif(isset($val['field_icon']) && $val['field_icon'] ){
|
|
| 470 | + } elseif(isset($val['field_icon']) && $val['field_icon'] ){
|
|
| 466 | 471 | echo '<b style="background-image: url("'.$val['field_icon'].'")"></b>';
|
| 467 | - }else{
|
|
| 472 | + } else{
|
|
| 468 | 473 | echo '<i class="fa fa-cog" aria-hidden="true"></i>'; |
| 469 | 474 | }?> |
| 470 | 475 | <?php echo $val['site_title'];?> |
@@ -693,9 +698,9 @@ discard block |
||
| 693 | 698 | <?php |
| 694 | 699 | if($type=='predefined'){
|
| 695 | 700 | $cfs = geodir_custom_fields_predefined($listing_type); |
| 696 | - }elseif($type=='custom'){
|
|
| 701 | + } elseif($type=='custom'){
|
|
| 697 | 702 | $cfs = geodir_custom_fields_custom($listing_type); |
| 698 | - }else{
|
|
| 703 | + } else{
|
|
| 699 | 704 | $cfs = geodir_custom_fields($listing_type); |
| 700 | 705 | ?> |
| 701 | 706 | <ul class="full gd-cf-tooltip-wrap"> |
@@ -750,7 +755,7 @@ discard block |
||
| 750 | 755 | </li> |
| 751 | 756 | <?php |
| 752 | 757 | } |
| 753 | - }else{
|
|
| 758 | + } else{
|
|
| 754 | 759 | _e('There are no custom fields here yet.', 'geodirectory');
|
| 755 | 760 | } |
| 756 | 761 | ?> |
@@ -947,8 +952,9 @@ discard block |
||
| 947 | 952 | |
| 948 | 953 | if (!get_option('geodir_remove_unnecessary_fields')) {
|
| 949 | 954 | |
| 950 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $plugin_prefix . "gd_place_detail WHERE field = 'categories'"))
|
|
| 951 | - $wpdb->query("ALTER TABLE `" . $plugin_prefix . "gd_place_detail` DROP `categories`");
|
|
| 955 | + if ($wpdb->get_var("SHOW COLUMNS FROM " . $plugin_prefix . "gd_place_detail WHERE field = 'categories'")) { |
|
| 956 | + $wpdb->query("ALTER TABLE `" . $plugin_prefix . "gd_place_detail` DROP `categories`"); |
|
| 957 | + } |
|
| 952 | 958 | |
| 953 | 959 | update_option('geodir_remove_unnecessary_fields', '1');
|
| 954 | 960 | |
@@ -974,15 +980,17 @@ discard block |
||
| 974 | 980 | $geodir_admin_ajax_action = $_REQUEST['geodir_admin_ajax_action']; |
| 975 | 981 | switch ($geodir_admin_ajax_action) {
|
| 976 | 982 | case 'diagnosis' : |
| 977 | - if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '') |
|
| 978 | - $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']); |
|
| 983 | + if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '') { |
|
| 984 | + $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']); |
|
| 985 | + } |
|
| 979 | 986 | call_user_func('geodir_diagnose_' . $diagnose_this);
|
| 980 | 987 | exit(); |
| 981 | 988 | break; |
| 982 | 989 | |
| 983 | 990 | case 'diagnosis-fix' : |
| 984 | - if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '') |
|
| 985 | - $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']); |
|
| 991 | + if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '') { |
|
| 992 | + $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']); |
|
| 993 | + } |
|
| 986 | 994 | call_user_func('geodir_diagnose_' . $diagnose_this);
|
| 987 | 995 | exit(); |
| 988 | 996 | break; |
@@ -1540,11 +1548,11 @@ discard block |
||
| 1540 | 1548 | ////////////////////////////////// |
| 1541 | 1549 | $option_value = get_option('geodir_home_page');
|
| 1542 | 1550 | $page = get_post($option_value); |
| 1543 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1551 | + if(!empty($page)){$page_found = $page->ID;} else{$page_found = '';}
|
|
| 1544 | 1552 | |
| 1545 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1546 | - $output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>";
|
|
| 1547 | - else {
|
|
| 1553 | + if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') { |
|
| 1554 | + $output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>"; |
|
| 1555 | + } else {
|
|
| 1548 | 1556 | $is_error_during_diagnose = true; |
| 1549 | 1557 | $output_str .= "<li><strong>" . __('GD Home page is missing.', 'geodirectory') . "</strong></li>";
|
| 1550 | 1558 | if ($fix) {
|
@@ -1565,11 +1573,11 @@ discard block |
||
| 1565 | 1573 | ////////////////////////////////// |
| 1566 | 1574 | $option_value = get_option('geodir_add_listing_page');
|
| 1567 | 1575 | $page = get_post($option_value); |
| 1568 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1576 | + if(!empty($page)){$page_found = $page->ID;} else{$page_found = '';}
|
|
| 1569 | 1577 | |
| 1570 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1571 | - $output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>";
|
|
| 1572 | - else {
|
|
| 1578 | + if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') { |
|
| 1579 | + $output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>"; |
|
| 1580 | + } else {
|
|
| 1573 | 1581 | $is_error_during_diagnose = true; |
| 1574 | 1582 | $output_str .= "<li><strong>" . __('Add Listing page is missing.', 'geodirectory') . "</strong></li>";
|
| 1575 | 1583 | if ($fix) {
|
@@ -1591,11 +1599,11 @@ discard block |
||
| 1591 | 1599 | ////////////////////////////////// |
| 1592 | 1600 | $option_value = get_option('geodir_preview_page');
|
| 1593 | 1601 | $page = get_post($option_value); |
| 1594 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1602 | + if(!empty($page)){$page_found = $page->ID;} else{$page_found = '';}
|
|
| 1595 | 1603 | |
| 1596 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1597 | - $output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>";
|
|
| 1598 | - else {
|
|
| 1604 | + if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') { |
|
| 1605 | + $output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>"; |
|
| 1606 | + } else {
|
|
| 1599 | 1607 | $is_error_during_diagnose = true; |
| 1600 | 1608 | $output_str .= "<li><strong>" . __('Listing Preview page is missing.', 'geodirectory') . "</strong></li>";
|
| 1601 | 1609 | if ($fix) {
|
@@ -1616,11 +1624,11 @@ discard block |
||
| 1616 | 1624 | ////////////////////////////////// |
| 1617 | 1625 | $option_value = get_option('geodir_success_page');
|
| 1618 | 1626 | $page = get_post($option_value); |
| 1619 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1627 | + if(!empty($page)){$page_found = $page->ID;} else{$page_found = '';}
|
|
| 1620 | 1628 | |
| 1621 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1622 | - $output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>";
|
|
| 1623 | - else {
|
|
| 1629 | + if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') { |
|
| 1630 | + $output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>"; |
|
| 1631 | + } else {
|
|
| 1624 | 1632 | $is_error_during_diagnose = true; |
| 1625 | 1633 | $output_str .= "<li><strong>" . __('Listing Success page is missing.', 'geodirectory') . "</strong></li>";
|
| 1626 | 1634 | if ($fix) {
|
@@ -1641,11 +1649,11 @@ discard block |
||
| 1641 | 1649 | ////////////////////////////////// |
| 1642 | 1650 | $option_value = get_option('geodir_info_page');
|
| 1643 | 1651 | $page = get_post($option_value); |
| 1644 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1652 | + if(!empty($page)){$page_found = $page->ID;} else{$page_found = '';}
|
|
| 1645 | 1653 | |
| 1646 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1647 | - $output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>";
|
|
| 1648 | - else {
|
|
| 1654 | + if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') { |
|
| 1655 | + $output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>"; |
|
| 1656 | + } else {
|
|
| 1649 | 1657 | $is_error_during_diagnose = true; |
| 1650 | 1658 | $output_str .= "<li><strong>" . __('Info page is missing.', 'geodirectory') . "</strong></li>";
|
| 1651 | 1659 | if ($fix) {
|
@@ -1666,11 +1674,11 @@ discard block |
||
| 1666 | 1674 | ////////////////////////////////// |
| 1667 | 1675 | $option_value = get_option('geodir_login_page');
|
| 1668 | 1676 | $page = get_post($option_value); |
| 1669 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1677 | + if(!empty($page)){$page_found = $page->ID;} else{$page_found = '';}
|
|
| 1670 | 1678 | |
| 1671 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1672 | - $output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>";
|
|
| 1673 | - else {
|
|
| 1679 | + if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') { |
|
| 1680 | + $output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>"; |
|
| 1681 | + } else {
|
|
| 1674 | 1682 | $is_error_during_diagnose = true; |
| 1675 | 1683 | $output_str .= "<li><strong>" . __('Login page is missing.', 'geodirectory') . "</strong></li>";
|
| 1676 | 1684 | if ($fix) {
|
@@ -1691,11 +1699,11 @@ discard block |
||
| 1691 | 1699 | ////////////////////////////////// |
| 1692 | 1700 | $option_value = get_option('geodir_location_page');
|
| 1693 | 1701 | $page = get_post($option_value); |
| 1694 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1702 | + if(!empty($page)){$page_found = $page->ID;} else{$page_found = '';}
|
|
| 1695 | 1703 | |
| 1696 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1697 | - $output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>";
|
|
| 1698 | - else {
|
|
| 1704 | + if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') { |
|
| 1705 | + $output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>"; |
|
| 1706 | + } else {
|
|
| 1699 | 1707 | $is_error_during_diagnose = true; |
| 1700 | 1708 | $output_str .= "<li><strong>" . __('Location page is missing.', 'geodirectory') . "</strong></li>";
|
| 1701 | 1709 | if ($fix) {
|
@@ -2140,8 +2148,9 @@ discard block |
||
| 2140 | 2148 | ); |
| 2141 | 2149 | |
| 2142 | 2150 | $post_location_info = $request_info['post_location']; |
| 2143 | - if ($location_id = geodir_add_new_location($post_location_info)) |
|
| 2144 | - $post_location_id = $location_id; |
|
| 2151 | + if ($location_id = geodir_add_new_location($post_location_info)) { |
|
| 2152 | + $post_location_id = $location_id; |
|
| 2153 | + } |
|
| 2145 | 2154 | } else {
|
| 2146 | 2155 | $post_location_id = 0; |
| 2147 | 2156 | } |
@@ -2204,8 +2213,9 @@ discard block |
||
| 2204 | 2213 | $attachment_set = ''; |
| 2205 | 2214 | |
| 2206 | 2215 | foreach ($attachment as $key => $val) {
|
| 2207 | - if ($val != '') |
|
| 2208 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
| 2216 | + if ($val != '') { |
|
| 2217 | + $attachment_set .= $key . " = '" . $val . "', "; |
|
| 2218 | + } |
|
| 2209 | 2219 | } |
| 2210 | 2220 | $attachment_set = trim($attachment_set, ", "); |
| 2211 | 2221 | |
@@ -2301,8 +2311,7 @@ discard block |
||
| 2301 | 2311 | |
| 2302 | 2312 | $parts = json_decode($response['body']); |
| 2303 | 2313 | //print_r($parts); |
| 2304 | - if(!isset($parts->access_token)){echo $error_msg." - #1";exit;}
|
|
| 2305 | - else{
|
|
| 2314 | + if(!isset($parts->access_token)){echo $error_msg." - #1";exit;} else{
|
|
| 2306 | 2315 | |
| 2307 | 2316 | update_option('gd_ga_access_token', $parts->access_token);
|
| 2308 | 2317 | update_option('gd_ga_refresh_token', $parts->refresh_token);
|
@@ -2310,17 +2319,16 @@ discard block |
||
| 2310 | 2319 | } |
| 2311 | 2320 | |
| 2312 | 2321 | |
| 2313 | - } |
|
| 2314 | - elseif(!empty($response['response']['code'])) {
|
|
| 2322 | + } elseif(!empty($response['response']['code'])) {
|
|
| 2315 | 2323 | $parts = json_decode($response['body']); |
| 2316 | 2324 | |
| 2317 | 2325 | if(isset($parts->error)){
|
| 2318 | 2326 | echo $parts->error.": ".$parts->error_description;exit; |
| 2319 | - }else{
|
|
| 2327 | + } else{
|
|
| 2320 | 2328 | echo $error_msg." - #2";exit; |
| 2321 | 2329 | } |
| 2322 | 2330 | |
| 2323 | - }else{
|
|
| 2331 | + } else{
|
|
| 2324 | 2332 | |
| 2325 | 2333 | echo $error_msg." - #3";exit; |
| 2326 | 2334 | |
@@ -19,8 +19,9 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | if (!isset($field_info->post_type)) {
|
| 21 | 21 | $post_type = sanitize_text_field($_REQUEST['listing_type']); |
| 22 | -} else |
|
| 23 | - $post_type = $field_info->post_type; |
|
| 22 | +} else { |
|
| 23 | + $post_type = $field_info->post_type; |
|
| 24 | +} |
|
| 24 | 25 | |
| 25 | 26 | //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){
|
| 26 | 27 | // $cf_arr = geodir_custom_fields_predefined($post_type); |
@@ -43,8 +44,9 @@ discard block |
||
| 43 | 44 | $nonce = wp_create_nonce('custom_fields_' . $result_str);
|
| 44 | 45 | |
| 45 | 46 | $field_admin_title = ''; |
| 46 | -if (isset($field_info->admin_title)) |
|
| 47 | - $field_admin_title = $field_info->admin_title; |
|
| 47 | +if (isset($field_info->admin_title)) { |
|
| 48 | + $field_admin_title = $field_info->admin_title; |
|
| 49 | +} |
|
| 48 | 50 | |
| 49 | 51 | $default = isset($field_info->is_admin) ? $field_info->is_admin : ''; |
| 50 | 52 | |
@@ -65,15 +67,15 @@ discard block |
||
| 65 | 67 | |
| 66 | 68 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
|
| 67 | 69 | $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
| 68 | -}elseif(isset($cf['icon']) && $cf['icon']){
|
|
| 70 | +} elseif(isset($cf['icon']) && $cf['icon']){
|
|
| 69 | 71 | $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
|
| 70 | -}else{
|
|
| 72 | +} else{
|
|
| 71 | 73 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
| 72 | 74 | } |
| 73 | 75 | |
| 74 | 76 | if(isset($cf['name']) && $cf['name']){
|
| 75 | 77 | $field_type_name = $cf['name']; |
| 76 | -}else{
|
|
| 78 | +} else{
|
|
| 77 | 79 | $field_type_name = $field_type; |
| 78 | 80 | } |
| 79 | 81 | |
@@ -89,8 +91,11 @@ discard block |
||
| 89 | 91 | |
| 90 | 92 | <?php if ($default): ?> |
| 91 | 93 | <div title="<?php _e('Default field, should not be removed.', 'geodirectory'); ?>" class="handlediv move gd-default-remove"><i class="fa fa-times" aria-hidden="true"></i></div>
|
| 92 | - <?php else: ?> |
|
| 93 | - <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
|
|
| 94 | + <?php else { |
|
| 95 | + : ?> |
|
| 96 | + <div title="<?php _e('Click to remove field', 'geodirectory'); |
|
| 97 | +} |
|
| 98 | +?>" |
|
| 94 | 99 | onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
|
| 95 | 100 | class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div> |
| 96 | 101 | <?php endif; |
@@ -141,11 +146,11 @@ discard block |
||
| 141 | 146 | |
| 142 | 147 | echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
|
| 143 | 148 | |
| 144 | - }else{
|
|
| 149 | + } else{
|
|
| 145 | 150 | $value = ''; |
| 146 | 151 | if (isset($field_info->data_type)) {
|
| 147 | 152 | $value = esc_attr($field_info->data_type); |
| 148 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 153 | + } elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 149 | 154 | $value = $cf['defaults']['data_type']; |
| 150 | 155 | } |
| 151 | 156 | ?> |
@@ -159,11 +164,11 @@ discard block |
||
| 159 | 164 | |
| 160 | 165 | echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
|
| 161 | 166 | |
| 162 | - }else{
|
|
| 167 | + } else{
|
|
| 163 | 168 | $value = ''; |
| 164 | 169 | if (isset($field_info->admin_title)) {
|
| 165 | 170 | $value = esc_attr($field_info->admin_title); |
| 166 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
|
|
| 171 | + } elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
|
|
| 167 | 172 | $value = $cf['defaults']['admin_title']; |
| 168 | 173 | } |
| 169 | 174 | ?> |
@@ -188,11 +193,11 @@ discard block |
||
| 188 | 193 | |
| 189 | 194 | echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
|
| 190 | 195 | |
| 191 | - }else{
|
|
| 196 | + } else{
|
|
| 192 | 197 | $value = ''; |
| 193 | 198 | if (isset($field_info->site_title)) {
|
| 194 | 199 | $value = esc_attr($field_info->site_title); |
| 195 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
|
|
| 200 | + } elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
|
|
| 196 | 201 | $value = $cf['defaults']['site_title']; |
| 197 | 202 | } |
| 198 | 203 | ?> |
@@ -216,11 +221,11 @@ discard block |
||
| 216 | 221 | |
| 217 | 222 | echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
|
| 218 | 223 | |
| 219 | - }else{
|
|
| 224 | + } else{
|
|
| 220 | 225 | $value = ''; |
| 221 | 226 | if (isset($field_info->admin_desc)) {
|
| 222 | 227 | $value = esc_attr($field_info->admin_desc); |
| 223 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
|
|
| 228 | + } elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
|
|
| 224 | 229 | $value = $cf['defaults']['admin_desc']; |
| 225 | 230 | } |
| 226 | 231 | ?> |
@@ -244,11 +249,11 @@ discard block |
||
| 244 | 249 | |
| 245 | 250 | echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
|
| 246 | 251 | |
| 247 | - }else{
|
|
| 252 | + } else{
|
|
| 248 | 253 | $value = ''; |
| 249 | 254 | if (isset($field_info->htmlvar_name)) {
|
| 250 | 255 | $value = esc_attr($field_info->htmlvar_name); |
| 251 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
|
|
| 256 | + } elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
|
|
| 252 | 257 | $value = $cf['defaults']['htmlvar_name']; |
| 253 | 258 | } |
| 254 | 259 | ?> |
@@ -276,11 +281,11 @@ discard block |
||
| 276 | 281 | |
| 277 | 282 | echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
|
| 278 | 283 | |
| 279 | - }else{
|
|
| 284 | + } else{
|
|
| 280 | 285 | $value = ''; |
| 281 | 286 | if (isset($field_info->is_active)) {
|
| 282 | 287 | $value = esc_attr($field_info->is_active); |
| 283 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
|
|
| 288 | + } elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
|
|
| 284 | 289 | $value = $cf['defaults']['is_active']; |
| 285 | 290 | } |
| 286 | 291 | ?> |
@@ -315,11 +320,11 @@ discard block |
||
| 315 | 320 | |
| 316 | 321 | echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
|
| 317 | 322 | |
| 318 | - }else{
|
|
| 323 | + } else{
|
|
| 319 | 324 | $value = ''; |
| 320 | 325 | if (isset($field_info->for_admin_use)) {
|
| 321 | 326 | $value = esc_attr($field_info->for_admin_use); |
| 322 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
|
|
| 327 | + } elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
|
|
| 323 | 328 | $value = $cf['defaults']['for_admin_use']; |
| 324 | 329 | } |
| 325 | 330 | ?> |
@@ -354,11 +359,11 @@ discard block |
||
| 354 | 359 | |
| 355 | 360 | echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
|
| 356 | 361 | |
| 357 | - }else{
|
|
| 362 | + } else{
|
|
| 358 | 363 | $value = ''; |
| 359 | 364 | if (isset($field_info->default_value)) {
|
| 360 | 365 | $value = esc_attr($field_info->default_value); |
| 361 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
|
|
| 366 | + } elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
|
|
| 362 | 367 | $value = $cf['defaults']['default_value']; |
| 363 | 368 | } |
| 364 | 369 | ?> |
@@ -398,11 +403,11 @@ discard block |
||
| 398 | 403 | |
| 399 | 404 | echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
|
| 400 | 405 | |
| 401 | - }else{
|
|
| 406 | + } else{
|
|
| 402 | 407 | $value = ''; |
| 403 | 408 | if (isset($field_info->show_in)) {
|
| 404 | 409 | $value = esc_attr($field_info->show_in); |
| 405 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
|
|
| 410 | + } elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
|
|
| 406 | 411 | $value = esc_attr($cf['defaults']['show_in']); |
| 407 | 412 | } |
| 408 | 413 | ?> |
@@ -443,7 +448,7 @@ discard block |
||
| 443 | 448 | // don't show new tab option for some types |
| 444 | 449 | |
| 445 | 450 | if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
|
| 446 | - }else{
|
|
| 451 | + } else{
|
|
| 447 | 452 | unset($show_in_locations['[owntab]']); |
| 448 | 453 | } |
| 449 | 454 | |
@@ -556,11 +561,11 @@ discard block |
||
| 556 | 561 | |
| 557 | 562 | echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
|
| 558 | 563 | |
| 559 | - }else{
|
|
| 564 | + } else{
|
|
| 560 | 565 | $value = ''; |
| 561 | 566 | if (isset($field_info->is_required)) {
|
| 562 | 567 | $value = esc_attr($field_info->is_required); |
| 563 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
|
|
| 568 | + } elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
|
|
| 564 | 569 | $value = $cf['defaults']['is_required']; |
| 565 | 570 | } |
| 566 | 571 | ?> |
@@ -597,11 +602,11 @@ discard block |
||
| 597 | 602 | |
| 598 | 603 | echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
|
| 599 | 604 | |
| 600 | - }else{
|
|
| 605 | + } else{
|
|
| 601 | 606 | $value = ''; |
| 602 | 607 | if (isset($field_info->required_msg)) {
|
| 603 | 608 | $value = esc_attr($field_info->required_msg); |
| 604 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
|
|
| 609 | + } elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
|
|
| 605 | 610 | $value = $cf['defaults']['required_msg']; |
| 606 | 611 | } |
| 607 | 612 | ?> |
@@ -642,11 +647,11 @@ discard block |
||
| 642 | 647 | |
| 643 | 648 | echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
|
| 644 | 649 | |
| 645 | - }else{
|
|
| 650 | + } else{
|
|
| 646 | 651 | $value = ''; |
| 647 | 652 | if (isset($field_info->field_icon)) {
|
| 648 | 653 | $value = esc_attr($field_info->field_icon); |
| 649 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
|
|
| 654 | + } elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
|
|
| 650 | 655 | $value = $cf['defaults']['field_icon']; |
| 651 | 656 | } |
| 652 | 657 | ?> |
@@ -675,11 +680,11 @@ discard block |
||
| 675 | 680 | |
| 676 | 681 | echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
|
| 677 | 682 | |
| 678 | - }else{
|
|
| 683 | + } else{
|
|
| 679 | 684 | $value = ''; |
| 680 | 685 | if (isset($field_info->css_class)) {
|
| 681 | 686 | $value = esc_attr($field_info->css_class); |
| 682 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
|
|
| 687 | + } elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
|
|
| 683 | 688 | $value = $cf['defaults']['css_class']; |
| 684 | 689 | } |
| 685 | 690 | ?> |
@@ -708,12 +713,12 @@ discard block |
||
| 708 | 713 | |
| 709 | 714 | echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
|
| 710 | 715 | |
| 711 | - }else{
|
|
| 716 | + } else{
|
|
| 712 | 717 | $value = ''; |
| 713 | 718 | $hide_cat_sort =''; |
| 714 | 719 | if (isset($field_info->cat_sort)) {
|
| 715 | 720 | $value = esc_attr($field_info->cat_sort); |
| 716 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
|
|
| 721 | + } elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
|
|
| 717 | 722 | $value = $cf['defaults']['cat_sort']; |
| 718 | 723 | $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
| 719 | 724 | } |
@@ -2329,7 +2329,7 @@ |
||
| 2329 | 2329 | if ( $new_style ) {
|
| 2330 | 2330 | echo "</div>"; |
| 2331 | 2331 | } |
| 2332 | - }elseif ( ! empty( $post_types ) ) {
|
|
| 2332 | + } elseif ( ! empty( $post_types ) ) {
|
|
| 2333 | 2333 | echo '<input type="hidden" name="stype" value="' . key( $post_types ) . '" />'; |
| 2334 | 2334 | } |
| 2335 | 2335 | } |
@@ -51,8 +51,9 @@ discard block |
||
| 51 | 51 | global $wpdb; |
| 52 | 52 | $result = 0;// no rows affected |
| 53 | 53 | if (!geodir_column_exist($db, $column)) {
|
| 54 | - if (!empty($db) && !empty($column)) |
|
| 55 | - $result = $wpdb->query("ALTER TABLE `$db` ADD `$column` $column_attr");
|
|
| 54 | + if (!empty($db) && !empty($column)) { |
|
| 55 | + $result = $wpdb->query("ALTER TABLE `$db` ADD `$column` $column_attr"); |
|
| 56 | + } |
|
| 56 | 57 | } |
| 57 | 58 | return $result; |
| 58 | 59 | } |
@@ -82,10 +83,11 @@ discard block |
||
| 82 | 83 | |
| 83 | 84 | $default_query = ''; |
| 84 | 85 | |
| 85 | - if ($default == 'default') |
|
| 86 | - $default_query .= " and is_admin IN ('1') ";
|
|
| 87 | - elseif ($default == 'custom') |
|
| 88 | - $default_query .= " and is_admin = '0' "; |
|
| 86 | + if ($default == 'default') { |
|
| 87 | + $default_query .= " and is_admin IN ('1') "; |
|
| 88 | + } elseif ($default == 'custom') { |
|
| 89 | + $default_query .= " and is_admin = '0' "; |
|
| 90 | + } |
|
| 89 | 91 | |
| 90 | 92 | if ($fields_location == 'none') {
|
| 91 | 93 | } else{
|
@@ -239,10 +241,12 @@ discard block |
||
| 239 | 241 | } |
| 240 | 242 | |
| 241 | 243 | return $field_id; |
| 242 | - } else |
|
| 243 | - return 0; |
|
| 244 | - } else |
|
| 245 | - return 0; |
|
| 244 | + } else { |
|
| 245 | + return 0; |
|
| 246 | + } |
|
| 247 | + } else { |
|
| 248 | + return 0; |
|
| 249 | + } |
|
| 246 | 250 | } |
| 247 | 251 | } |
| 248 | 252 | |
@@ -349,7 +353,9 @@ discard block |
||
| 349 | 353 | |
| 350 | 354 | |
| 351 | 355 | |
| 352 | - if ($post_type == '') $post_type = 'gd_place'; |
|
| 356 | + if ($post_type == '') { |
|
| 357 | + $post_type = 'gd_place'; |
|
| 358 | + } |
|
| 353 | 359 | |
| 354 | 360 | |
| 355 | 361 | $detail_table = $plugin_prefix . $post_type . '_detail'; |
@@ -389,16 +395,17 @@ discard block |
||
| 389 | 395 | } |
| 390 | 396 | |
| 391 | 397 | $option_values = ''; |
| 392 | - if (isset($request_field['option_values'])) |
|
| 393 | - $option_values = $request_field['option_values']; |
|
| 398 | + if (isset($request_field['option_values'])) { |
|
| 399 | + $option_values = $request_field['option_values']; |
|
| 400 | + } |
|
| 394 | 401 | |
| 395 | 402 | $cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0'; |
| 396 | 403 | |
| 397 | 404 | $cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0'; |
| 398 | 405 | |
| 399 | - if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg'])) |
|
| 400 | - $price_pkg = implode(",", $request_field['show_on_pkg']);
|
|
| 401 | - else {
|
|
| 406 | + if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg'])) { |
|
| 407 | + $price_pkg = implode(",", $request_field['show_on_pkg']); |
|
| 408 | + } else {
|
|
| 402 | 409 | $package_info = array(); |
| 403 | 410 | |
| 404 | 411 | $package_info = geodir_post_package_info($package_info, '', $post_type); |
@@ -406,22 +413,29 @@ discard block |
||
| 406 | 413 | } |
| 407 | 414 | |
| 408 | 415 | |
| 409 | - if (isset($request_field['extra']) && !empty($request_field['extra'])) |
|
| 410 | - $extra_fields = $request_field['extra']; |
|
| 416 | + if (isset($request_field['extra']) && !empty($request_field['extra'])) { |
|
| 417 | + $extra_fields = $request_field['extra']; |
|
| 418 | + } |
|
| 411 | 419 | |
| 412 | - if (isset($request_field['is_default']) && $request_field['is_default'] != '') |
|
| 413 | - $is_default = $request_field['is_default']; |
|
| 414 | - else |
|
| 415 | - $is_default = '0'; |
|
| 420 | + if (isset($request_field['is_default']) && $request_field['is_default'] != '') { |
|
| 421 | + $is_default = $request_field['is_default']; |
|
| 422 | + } else { |
|
| 423 | + $is_default = '0'; |
|
| 424 | + } |
|
| 416 | 425 | |
| 417 | - if (isset($request_field['is_admin']) && $request_field['is_admin'] != '') |
|
| 418 | - $is_admin = $request_field['is_admin']; |
|
| 419 | - else |
|
| 420 | - $is_admin = '0'; |
|
| 426 | + if (isset($request_field['is_admin']) && $request_field['is_admin'] != '') { |
|
| 427 | + $is_admin = $request_field['is_admin']; |
|
| 428 | + } else { |
|
| 429 | + $is_admin = '0'; |
|
| 430 | + } |
|
| 421 | 431 | |
| 422 | 432 | |
| 423 | - if ($is_active == '') $is_active = 1; |
|
| 424 | - if ($is_required == '') $is_required = 0; |
|
| 433 | + if ($is_active == '') { |
|
| 434 | + $is_active = 1; |
|
| 435 | + } |
|
| 436 | + if ($is_required == '') { |
|
| 437 | + $is_required = 0; |
|
| 438 | + } |
|
| 425 | 439 | |
| 426 | 440 | |
| 427 | 441 | if ($sort_order == '') {
|
@@ -690,7 +704,7 @@ discard block |
||
| 690 | 704 | } |
| 691 | 705 | if($op_max){$op_size =$op_max; }
|
| 692 | 706 | } |
| 693 | - }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
|
|
| 707 | + } elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
|
|
| 694 | 708 | if(strlen($option_values)){
|
| 695 | 709 | $op_size = strlen($option_values); |
| 696 | 710 | } |
@@ -707,11 +721,13 @@ discard block |
||
| 707 | 721 | return __('Column change failed, you may have too many columns.','geodirectory');
|
| 708 | 722 | } |
| 709 | 723 | |
| 710 | - if (isset($request_field['cat_display_type'])) |
|
| 711 | - $extra_fields = $request_field['cat_display_type']; |
|
| 724 | + if (isset($request_field['cat_display_type'])) { |
|
| 725 | + $extra_fields = $request_field['cat_display_type']; |
|
| 726 | + } |
|
| 712 | 727 | |
| 713 | - if (isset($request_field['multi_display_type'])) |
|
| 714 | - $extra_fields = $request_field['multi_display_type']; |
|
| 728 | + if (isset($request_field['multi_display_type'])) { |
|
| 729 | + $extra_fields = $request_field['multi_display_type']; |
|
| 730 | + } |
|
| 715 | 731 | |
| 716 | 732 | |
| 717 | 733 | break; |
@@ -725,8 +741,9 @@ discard block |
||
| 725 | 741 | if($alter_result===false){
|
| 726 | 742 | return __('Column change failed, you may have too many columns.','geodirectory');
|
| 727 | 743 | } |
| 728 | - if (isset($request_field['advanced_editor'])) |
|
| 729 | - $extra_fields = $request_field['advanced_editor']; |
|
| 744 | + if (isset($request_field['advanced_editor'])) { |
|
| 745 | + $extra_fields = $request_field['advanced_editor']; |
|
| 746 | + } |
|
| 730 | 747 | |
| 731 | 748 | break; |
| 732 | 749 | |
@@ -822,8 +839,9 @@ discard block |
||
| 822 | 839 | ); |
| 823 | 840 | |
| 824 | 841 | |
| 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)));
|
|
| 842 | + if ($cat_sort == '') { |
|
| 843 | + $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name))); |
|
| 844 | + } |
|
| 827 | 845 | |
| 828 | 846 | |
| 829 | 847 | /** |
@@ -1193,8 +1211,10 @@ discard block |
||
| 1193 | 1211 | } |
| 1194 | 1212 | |
| 1195 | 1213 | return $post_meta_info; |
| 1196 | - else: |
|
| 1197 | - return false; |
|
| 1214 | + else { |
|
| 1215 | + : |
|
| 1216 | + return false; |
|
| 1217 | + } |
|
| 1198 | 1218 | endif; |
| 1199 | 1219 | } |
| 1200 | 1220 | |
@@ -1205,8 +1225,9 @@ discard block |
||
| 1205 | 1225 | if (is_admin()) {
|
| 1206 | 1226 | global $post,$gd_session; |
| 1207 | 1227 | |
| 1208 | - if (isset($_REQUEST['post'])) |
|
| 1209 | - $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1228 | + if (isset($_REQUEST['post'])) { |
|
| 1229 | + $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1230 | + } |
|
| 1210 | 1231 | } |
| 1211 | 1232 | |
| 1212 | 1233 | if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
|
@@ -1259,8 +1280,9 @@ discard block |
||
| 1259 | 1280 | if (is_admin()) {
|
| 1260 | 1281 | global $post; |
| 1261 | 1282 | |
| 1262 | - if (isset($_REQUEST['post'])) |
|
| 1263 | - $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1283 | + if (isset($_REQUEST['post'])) { |
|
| 1284 | + $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1285 | + } |
|
| 1264 | 1286 | } |
| 1265 | 1287 | |
| 1266 | 1288 | |
@@ -1352,7 +1374,7 @@ discard block |
||
| 1352 | 1374 | $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
|
| 1353 | 1375 | } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
|
| 1354 | 1376 | $field_icon = '<i class="' . $cf['field_icon'] . '"></i>'; |
| 1355 | - }else{
|
|
| 1377 | + } else{
|
|
| 1356 | 1378 | $field_icon = $cf['field_icon']; |
| 1357 | 1379 | } |
| 1358 | 1380 | |
@@ -1425,8 +1447,9 @@ discard block |
||
| 1425 | 1447 | $variables_array['post_id'] = $post->ID; |
| 1426 | 1448 | $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
| 1427 | 1449 | $variables_array['value'] = ''; |
| 1428 | - if (isset($post->{$type['htmlvar_name']}))
|
|
| 1429 | - $variables_array['value'] = $post->{$type['htmlvar_name']};
|
|
| 1450 | + if (isset($post->{$type['htmlvar_name']})) { |
|
| 1451 | + $variables_array['value'] = $post->{$type['htmlvar_name']}; |
|
| 1452 | + } |
|
| 1430 | 1453 | endif; |
| 1431 | 1454 | |
| 1432 | 1455 | |
@@ -1448,7 +1471,9 @@ discard block |
||
| 1448 | 1471 | * @param string $html Custom field unfiltered HTML. |
| 1449 | 1472 | * @param array $variables_array Custom field variables array. |
| 1450 | 1473 | */ |
| 1451 | - if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
|
|
| 1474 | + if ($html) { |
|
| 1475 | + echo apply_filters("geodir_show_{$html_var}", $html, $variables_array); |
|
| 1476 | + } |
|
| 1452 | 1477 | |
| 1453 | 1478 | /** |
| 1454 | 1479 | * Called after a custom fields is output on the frontend. |
@@ -1482,10 +1507,11 @@ discard block |
||
| 1482 | 1507 | */ |
| 1483 | 1508 | function geodir_default_date_format() |
| 1484 | 1509 | {
|
| 1485 | - if ($format = get_option('date_format'))
|
|
| 1486 | - return $format; |
|
| 1487 | - else |
|
| 1488 | - return 'dd-mm-yy'; |
|
| 1510 | + if ($format = get_option('date_format')) { |
|
| 1511 | + return $format; |
|
| 1512 | + } else { |
|
| 1513 | + return 'dd-mm-yy'; |
|
| 1514 | + } |
|
| 1489 | 1515 | } |
| 1490 | 1516 | } |
| 1491 | 1517 | |
@@ -1592,11 +1618,13 @@ discard block |
||
| 1592 | 1618 | // Set an array containing a list of acceptable formats |
| 1593 | 1619 | //$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 | 1620 | |
| 1595 | - if (!function_exists('wp_handle_upload'))
|
|
| 1596 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1621 | + if (!function_exists('wp_handle_upload')) { |
|
| 1622 | + require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1623 | + } |
|
| 1597 | 1624 | |
| 1598 | - if (!is_dir($geodir_uploadpath)) |
|
| 1599 | - mkdir($geodir_uploadpath); |
|
| 1625 | + if (!is_dir($geodir_uploadpath)) { |
|
| 1626 | + mkdir($geodir_uploadpath); |
|
| 1627 | + } |
|
| 1600 | 1628 | |
| 1601 | 1629 | $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1]; |
| 1602 | 1630 | $explode_sub_dir = explode("/", $sub_dir);
|
@@ -1609,16 +1637,19 @@ discard block |
||
| 1609 | 1637 | } |
| 1610 | 1638 | |
| 1611 | 1639 | $uploaded_file = ''; |
| 1612 | - if (file_exists($img_path)) |
|
| 1613 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1640 | + if (file_exists($img_path)) { |
|
| 1641 | + $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1642 | + } |
|
| 1614 | 1643 | |
| 1615 | 1644 | if ($curr_img_dir != $geodir_uploaddir) {
|
| 1616 | - if (file_exists($img_path)) |
|
| 1617 | - unlink($img_path); |
|
| 1645 | + if (file_exists($img_path)) { |
|
| 1646 | + unlink($img_path); |
|
| 1647 | + } |
|
| 1618 | 1648 | } |
| 1619 | 1649 | |
| 1620 | - if (!empty($uploaded_file)) |
|
| 1621 | - $file_urls = $geodir_uploadurl . '/' . $new_name; |
|
| 1650 | + if (!empty($uploaded_file)) { |
|
| 1651 | + $file_urls = $geodir_uploadurl . '/' . $new_name; |
|
| 1652 | + } |
|
| 1622 | 1653 | |
| 1623 | 1654 | } else {
|
| 1624 | 1655 | $file_urls = $post_image[$m]; |
@@ -1639,8 +1670,9 @@ discard block |
||
| 1639 | 1670 | |
| 1640 | 1671 | geodir_save_post_meta($post_id, $field_id, $file_urls); |
| 1641 | 1672 | |
| 1642 | - if (!empty($invalid_files)) |
|
| 1643 | - geodir_remove_attachments($invalid_files); |
|
| 1673 | + if (!empty($invalid_files)) { |
|
| 1674 | + geodir_remove_attachments($invalid_files); |
|
| 1675 | + } |
|
| 1644 | 1676 | |
| 1645 | 1677 | } |
| 1646 | 1678 | } |
@@ -1866,8 +1898,9 @@ discard block |
||
| 1866 | 1898 | |
| 1867 | 1899 | $all_postypes = geodir_get_posttypes(); |
| 1868 | 1900 | |
| 1869 | - if (!in_array($post_type, $all_postypes)) |
|
| 1870 | - return false; |
|
| 1901 | + if (!in_array($post_type, $all_postypes)) { |
|
| 1902 | + return false; |
|
| 1903 | + } |
|
| 1871 | 1904 | |
| 1872 | 1905 | $fields = array(); |
| 1873 | 1906 | |
@@ -1965,8 +1998,10 @@ discard block |
||
| 1965 | 1998 | } |
| 1966 | 1999 | |
| 1967 | 2000 | return $field_ids; |
| 1968 | - else: |
|
| 1969 | - return false; |
|
| 2001 | + else { |
|
| 2002 | + : |
|
| 2003 | + return false; |
|
| 2004 | + } |
|
| 1970 | 2005 | endif; |
| 1971 | 2006 | } |
| 1972 | 2007 | |
@@ -2139,8 +2174,9 @@ discard block |
||
| 2139 | 2174 | |
| 2140 | 2175 | return $field_id; |
| 2141 | 2176 | |
| 2142 | - } else |
|
| 2143 | - return 0; |
|
| 2177 | + } else { |
|
| 2178 | + return 0; |
|
| 2179 | + } |
|
| 2144 | 2180 | |
| 2145 | 2181 | } |
| 2146 | 2182 | } |
@@ -2181,8 +2217,9 @@ discard block |
||
| 2181 | 2217 | $htmlvar_name = isset($field_type_key) ? $field_type_key : ''; |
| 2182 | 2218 | |
| 2183 | 2219 | $site_title = ''; |
| 2184 | - if ($site_title == '') |
|
| 2185 | - $site_title = isset($field_info->site_title) ? $field_info->site_title : ''; |
|
| 2220 | + if ($site_title == '') { |
|
| 2221 | + $site_title = isset($field_info->site_title) ? $field_info->site_title : ''; |
|
| 2222 | + } |
|
| 2186 | 2223 | |
| 2187 | 2224 | if ($site_title == '') {
|
| 2188 | 2225 | $fields = geodir_get_custom_sort_options($post_type); |
@@ -2196,8 +2233,9 @@ discard block |
||
| 2196 | 2233 | } |
| 2197 | 2234 | } |
| 2198 | 2235 | |
| 2199 | - if ($htmlvar_name == '') |
|
| 2200 | - $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : ''; |
|
| 2236 | + if ($htmlvar_name == '') { |
|
| 2237 | + $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : ''; |
|
| 2238 | + } |
|
| 2201 | 2239 | |
| 2202 | 2240 | $nonce = wp_create_nonce('custom_fields_' . $result_str);
|
| 2203 | 2241 | |
@@ -2210,7 +2248,7 @@ discard block |
||
| 2210 | 2248 | |
| 2211 | 2249 | if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
|
| 2212 | 2250 | $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>'; |
| 2213 | - }elseif(isset($cso['field_icon']) && $cso['field_icon']){
|
|
| 2251 | + } elseif(isset($cso['field_icon']) && $cso['field_icon']){
|
|
| 2214 | 2252 | $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
|
| 2215 | 2253 | } |
| 2216 | 2254 | |
@@ -2735,11 +2773,13 @@ discard block |
||
| 2735 | 2773 | |
| 2736 | 2774 | <?php |
| 2737 | 2775 | $selected = ''; |
| 2738 | - if (isset($field_info->extra_fields)) |
|
| 2739 | - $advanced_editor = unserialize($field_info->extra_fields); |
|
| 2776 | + if (isset($field_info->extra_fields)) { |
|
| 2777 | + $advanced_editor = unserialize($field_info->extra_fields); |
|
| 2778 | + } |
|
| 2740 | 2779 | |
| 2741 | - if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
|
|
| 2742 | - $selected = 'checked="checked"'; |
|
| 2780 | + if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor)) { |
|
| 2781 | + $selected = 'checked="checked"'; |
|
| 2782 | + } |
|
| 2743 | 2783 | ?> |
| 2744 | 2784 | |
| 2745 | 2785 | <input type="checkbox" name="advanced_editor[]" id="advanced_editor" |
@@ -2761,7 +2801,7 @@ discard block |
||
| 2761 | 2801 | $value = ''; |
| 2762 | 2802 | if (isset($field_info->validation_pattern)) {
|
| 2763 | 2803 | $value = esc_attr($field_info->validation_pattern); |
| 2764 | - }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
|
|
| 2804 | + } elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
|
|
| 2765 | 2805 | $value = esc_attr($cf['defaults']['validation_pattern']); |
| 2766 | 2806 | } |
| 2767 | 2807 | ?> |
@@ -2781,7 +2821,7 @@ discard block |
||
| 2781 | 2821 | $value = ''; |
| 2782 | 2822 | if (isset($field_info->validation_msg)) {
|
| 2783 | 2823 | $value = esc_attr($field_info->validation_msg); |
| 2784 | - }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
|
|
| 2824 | + } elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
|
|
| 2785 | 2825 | $value = esc_attr($cf['defaults']['validation_msg']); |
| 2786 | 2826 | } |
| 2787 | 2827 | ?> |
@@ -2811,8 +2851,9 @@ discard block |
||
| 2811 | 2851 | |
| 2812 | 2852 | if (!isset($field_info->post_type)) {
|
| 2813 | 2853 | $post_type = sanitize_text_field($_REQUEST['listing_type']); |
| 2814 | - } else |
|
| 2815 | - $post_type = $field_info->post_type; |
|
| 2854 | + } else { |
|
| 2855 | + $post_type = $field_info->post_type; |
|
| 2856 | + } |
|
| 2816 | 2857 | ?> |
| 2817 | 2858 | <li style="display: none;"> |
| 2818 | 2859 | <label for="htmlvar_name" class="gd-cf-tooltip-wrap"> |
@@ -3086,7 +3127,7 @@ discard block |
||
| 3086 | 3127 | $value = ''; |
| 3087 | 3128 | if (isset($field_info->option_values)) {
|
| 3088 | 3129 | $value = esc_attr($field_info->option_values); |
| 3089 | - }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
|
|
| 3130 | + } elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
|
|
| 3090 | 3131 | $value = esc_attr($cf['defaults']['option_values']); |
| 3091 | 3132 | } |
| 3092 | 3133 | |
@@ -353,7 +353,7 @@ |
||
| 353 | 353 | |
| 354 | 354 | if(!$cpt_left){ |
| 355 | 355 | $cpt_left = "gd-cpt-flat"; |
| 356 | - }else{ |
|
| 356 | + } else{ |
|
| 357 | 357 | $cpt_left = ''; |
| 358 | 358 | } |
| 359 | 359 | |