@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | global $wpdb; |
11 | 11 | |
12 | -if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) { |
|
12 | +if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) { |
|
13 | 13 | /** |
14 | 14 | * Include custom database table related functions. |
15 | 15 | * |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | |
50 | 50 | |
51 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
51 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions |
|
52 | 52 | |
53 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
53 | + update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION); |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @since 1.0.0 |
87 | 87 | * @package GeoDirectory |
88 | 88 | */ |
89 | -function geodir_upgrade_146(){ |
|
89 | +function geodir_upgrade_146() { |
|
90 | 90 | gd_convert_virtual_pages(); |
91 | 91 | } |
92 | 92 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @since 1.5.0 |
97 | 97 | * @package GeoDirectory |
98 | 98 | */ |
99 | -function geodir_upgrade_150(){ |
|
99 | +function geodir_upgrade_150() { |
|
100 | 100 | gd_fix_cpt_rewrite_slug(); |
101 | 101 | } |
102 | 102 | |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | * @since 1.4.8 |
109 | 109 | * @package GeoDirectory |
110 | 110 | */ |
111 | -function geodir_upgrade_148(){ |
|
111 | +function geodir_upgrade_148() { |
|
112 | 112 | /* |
113 | 113 | * Blank the users google password if present as we now use oAuth 2.0 |
114 | 114 | */ |
115 | - update_option('geodir_ga_pass',''); |
|
116 | - update_option('geodir_ga_user',''); |
|
115 | + update_option('geodir_ga_pass', ''); |
|
116 | + update_option('geodir_ga_user', ''); |
|
117 | 117 | |
118 | 118 | } |
119 | 119 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @since 1.5.3 |
125 | 125 | * @package GeoDirectory |
126 | 126 | */ |
127 | -function geodir_upgrade_153(){ |
|
127 | +function geodir_upgrade_153() { |
|
128 | 128 | geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
129 | 129 | geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
130 | 130 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @since 1.5.3 |
136 | 136 | * @package GeoDirectory |
137 | 137 | */ |
138 | -function geodir_upgrade_154(){ |
|
138 | +function geodir_upgrade_154() { |
|
139 | 139 | geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
140 | 140 | } |
141 | 141 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @since 1.5.2 |
146 | 146 | * @package GeoDirectory |
147 | 147 | */ |
148 | -function geodir_upgrade_152(){ |
|
148 | +function geodir_upgrade_152() { |
|
149 | 149 | gd_fix_address_detail_table_limit(); |
150 | 150 | } |
151 | 151 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | function geodir_fix_review_date() |
182 | 182 | { |
183 | 183 | global $wpdb; |
184 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
184 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | function geodir_fix_review_post_status() |
195 | 195 | { |
196 | 196 | global $wpdb; |
197 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
197 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | function geodir_fix_review_content() |
209 | 209 | { |
210 | 210 | global $wpdb; |
211 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
211 | + if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
212 | 212 | return true; |
213 | 213 | } else { |
214 | 214 | return false; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | foreach ($all_postypes as $key) { |
234 | 234 | // update each GD CTP |
235 | 235 | |
236 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
236 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
237 | 237 | |
238 | 238 | } |
239 | 239 | return true; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if (!empty($all_postypes)) { |
258 | 258 | foreach ($all_postypes as $key) { |
259 | 259 | // update each GD CTP |
260 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
260 | + $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d"); |
|
261 | 261 | |
262 | 262 | if (!empty($reviews)) { |
263 | 263 | foreach ($reviews as $post_id) { |
@@ -272,51 +272,51 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | |
275 | -function gd_convert_custom_field_display(){ |
|
275 | +function gd_convert_custom_field_display() { |
|
276 | 276 | global $wpdb; |
277 | 277 | |
278 | - $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE); |
|
278 | + $field_info = $wpdb->get_results("select * from ".GEODIR_CUSTOM_FIELDS_TABLE); |
|
279 | 279 | |
280 | 280 | $has_run = get_option('gd_convert_custom_field_display'); |
281 | - if($has_run){return;} |
|
281 | + if ($has_run) {return; } |
|
282 | 282 | |
283 | 283 | // set the field_type_key for standard fields |
284 | 284 | $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type"); |
285 | 285 | |
286 | 286 | |
287 | - if(is_array( $field_info)){ |
|
287 | + if (is_array($field_info)) { |
|
288 | 288 | |
289 | - foreach( $field_info as $cf){ |
|
289 | + foreach ($field_info as $cf) { |
|
290 | 290 | |
291 | 291 | $id = $cf->id; |
292 | 292 | |
293 | - if(!property_exists($cf,'show_in') || !$id){return;} |
|
293 | + if (!property_exists($cf, 'show_in') || !$id) {return; } |
|
294 | 294 | |
295 | 295 | $show_in_arr = array(); |
296 | 296 | |
297 | - if($cf->is_default){ |
|
297 | + if ($cf->is_default) { |
|
298 | 298 | $show_in_arr[] = "[detail]"; |
299 | 299 | } |
300 | 300 | |
301 | - if($cf->show_on_detail){ |
|
301 | + if ($cf->show_on_detail) { |
|
302 | 302 | $show_in_arr[] = "[moreinfo]"; |
303 | 303 | } |
304 | 304 | |
305 | - if($cf->show_on_listing){ |
|
305 | + if ($cf->show_on_listing) { |
|
306 | 306 | $show_in_arr[] = "[listing]"; |
307 | 307 | } |
308 | 308 | |
309 | - if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){ |
|
309 | + if ($cf->show_as_tab || $cf->htmlvar_name == 'geodir_video' || $cf->htmlvar_name == 'geodir_special_offers') { |
|
310 | 310 | $show_in_arr[] = "[owntab]"; |
311 | 311 | } |
312 | 312 | |
313 | - if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){ |
|
313 | + if ($cf->htmlvar_name == 'post' || $cf->htmlvar_name == 'geodir_contact' || $cf->htmlvar_name == 'geodir_timing') { |
|
314 | 314 | $show_in_arr[] = "[mapbubble]"; |
315 | 315 | } |
316 | 316 | |
317 | - if(!empty($show_in_arr )){ |
|
318 | - $show_in_arr = implode(',',$show_in_arr); |
|
319 | - }else{ |
|
317 | + if (!empty($show_in_arr)) { |
|
318 | + $show_in_arr = implode(',', $show_in_arr); |
|
319 | + } else { |
|
320 | 320 | $show_in_arr = ''; |
321 | 321 | } |
322 | 322 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | } |
326 | 326 | |
327 | - update_option('gd_convert_custom_field_display',1); |
|
327 | + update_option('gd_convert_custom_field_display', 1); |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | |
702 | 702 | update_option('gd_theme_compats', $theme_compat); |
703 | 703 | |
704 | - gd_set_theme_compat();// set the compat pack if avail |
|
704 | + gd_set_theme_compat(); // set the compat pack if avail |
|
705 | 705 | } |
706 | 706 | |
707 | 707 | |
@@ -712,61 +712,61 @@ discard block |
||
712 | 712 | * @package GeoDirectory |
713 | 713 | * @global object $wpdb WordPress Database object. |
714 | 714 | */ |
715 | -function gd_convert_virtual_pages(){ |
|
715 | +function gd_convert_virtual_pages() { |
|
716 | 716 | global $wpdb; |
717 | 717 | |
718 | 718 | // Update the add listing page settings |
719 | 719 | $add_listing_page = $wpdb->get_var( |
720 | 720 | $wpdb->prepare( |
721 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
721 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
722 | 722 | array('add-listing') |
723 | 723 | ) |
724 | 724 | ); |
725 | 725 | |
726 | - if($add_listing_page){ |
|
727 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
728 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
726 | + if ($add_listing_page) { |
|
727 | + wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish')); |
|
728 | + update_option('geodir_add_listing_page', $add_listing_page); |
|
729 | 729 | } |
730 | 730 | |
731 | 731 | // Update the listing preview page settings |
732 | 732 | $listing_preview_page = $wpdb->get_var( |
733 | 733 | $wpdb->prepare( |
734 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
734 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
735 | 735 | array('listing-preview') |
736 | 736 | ) |
737 | 737 | ); |
738 | 738 | |
739 | - if($listing_preview_page){ |
|
740 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
741 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
739 | + if ($listing_preview_page) { |
|
740 | + wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish')); |
|
741 | + update_option('geodir_preview_page', $listing_preview_page); |
|
742 | 742 | } |
743 | 743 | |
744 | 744 | // Update the listing success page settings |
745 | 745 | $listing_success_page = $wpdb->get_var( |
746 | 746 | $wpdb->prepare( |
747 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
747 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
748 | 748 | array('listing-success') |
749 | 749 | ) |
750 | 750 | ); |
751 | 751 | |
752 | - if($listing_success_page){ |
|
753 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
754 | - update_option( 'geodir_success_page', $listing_success_page); |
|
752 | + if ($listing_success_page) { |
|
753 | + wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish')); |
|
754 | + update_option('geodir_success_page', $listing_success_page); |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | // Update the listing success page settings |
758 | 758 | $location_page = $wpdb->get_var( |
759 | 759 | $wpdb->prepare( |
760 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
760 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
761 | 761 | array('location') |
762 | 762 | ) |
763 | 763 | ); |
764 | 764 | |
765 | - if($location_page){ |
|
765 | + if ($location_page) { |
|
766 | 766 | $location_slug = get_option('geodir_location_prefix'); |
767 | - if(!$location_slug ){$location_slug = 'location';} |
|
768 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
769 | - update_option( 'geodir_location_page', $location_page); |
|
767 | + if (!$location_slug) {$location_slug = 'location'; } |
|
768 | + wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug)); |
|
769 | + update_option('geodir_location_page', $location_page); |
|
770 | 770 | } |
771 | 771 | |
772 | 772 | } |
@@ -785,13 +785,13 @@ discard block |
||
785 | 785 | $post_types = get_option('geodir_post_types'); |
786 | 786 | |
787 | 787 | |
788 | - if (is_array($post_types)){ |
|
788 | + if (is_array($post_types)) { |
|
789 | 789 | |
790 | 790 | foreach ($post_types as $post_type => $args) { |
791 | 791 | |
792 | 792 | |
793 | - if(isset($args['rewrite']['slug'])){ |
|
794 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
793 | + if (isset($args['rewrite']['slug'])) { |
|
794 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']); |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | $alt_post_types[$post_type] = $args; |
@@ -799,8 +799,8 @@ discard block |
||
799 | 799 | } |
800 | 800 | } |
801 | 801 | |
802 | - if(!empty($alt_post_types)) { |
|
803 | - update_option('geodir_post_types',$alt_post_types); |
|
802 | + if (!empty($alt_post_types)) { |
|
803 | + update_option('geodir_post_types', $alt_post_types); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | |
@@ -826,9 +826,9 @@ discard block |
||
826 | 826 | foreach ($all_postypes as $key) { |
827 | 827 | // update each GD CTP |
828 | 828 | try { |
829 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
830 | - } catch(Exception $e) { |
|
831 | - error_log( 'Error: ' . $e->getMessage() ); |
|
829 | + $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
830 | + } catch (Exception $e) { |
|
831 | + error_log('Error: '.$e->getMessage()); |
|
832 | 832 | } |
833 | 833 | } |
834 | 834 | } |
@@ -27,7 +27,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
|
112 | - <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
113 | - <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
114 | - <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : '';?>" /> |
|
111 | + <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : ''; ?>" /><?php // show in sidebar value?> |
|
112 | + <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
113 | + <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
114 | + <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $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 |
||
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 |
||
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 |
||
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 | ?> |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | </div> |
213 | 213 | </label> |
214 | 214 | <div class="gd-cf-input-wrap"> |
215 | - <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/> |
|
215 | + <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/> |
|
216 | 216 | </div> |
217 | 217 | </li> |
218 | 218 | <?php |
@@ -221,26 +221,26 @@ discard block |
||
221 | 221 | |
222 | 222 | |
223 | 223 | // htmlvar_name |
224 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
224 | + if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) { |
|
225 | 225 | |
226 | - echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
226 | + echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info); |
|
227 | 227 | |
228 | - }else{ |
|
228 | + } else { |
|
229 | 229 | $value = ''; |
230 | 230 | if (isset($field_info->htmlvar_name)) { |
231 | 231 | $value = esc_attr($field_info->htmlvar_name); |
232 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
232 | + }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) { |
|
233 | 233 | $value = $cf['defaults']['htmlvar_name']; |
234 | 234 | } |
235 | 235 | ?> |
236 | 236 | <li> |
237 | - <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');?> |
|
237 | + <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 | 238 | <div class="gdcf-tooltip"> |
239 | 239 | <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?> |
240 | 240 | </div> |
241 | 241 | </label> |
242 | 242 | <div class="gd-cf-input-wrap"> |
243 | - <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');?>" |
|
243 | + <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 | 244 | value="<?php if ($value) { |
245 | 245 | echo preg_replace('/geodir_/', '', $value, 1); |
246 | 246 | }?>" <?php if ($default) { |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | |
255 | 255 | // is_active |
256 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
256 | + if (has_filter("geodir_cfa_is_active_{$field_type}")) { |
|
257 | 257 | |
258 | - echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
258 | + echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info); |
|
259 | 259 | |
260 | - }else{ |
|
260 | + } else { |
|
261 | 261 | $value = ''; |
262 | 262 | if (isset($field_info->is_active)) { |
263 | 263 | $value = esc_attr($field_info->is_active); |
264 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
264 | + }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) { |
|
265 | 265 | $value = $cf['defaults']['is_active']; |
266 | 266 | } |
267 | 267 | ?> |
@@ -273,17 +273,17 @@ discard block |
||
273 | 273 | </label> |
274 | 274 | <div class="gd-cf-input-wrap gd-switch"> |
275 | 275 | |
276 | - <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
|
276 | + <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled" value="1" |
|
277 | 277 | <?php if ($value == '1') { |
278 | 278 | echo 'checked'; |
279 | 279 | } ?>/> |
280 | - <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
280 | + <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
281 | 281 | |
282 | - <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
|
282 | + <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0" |
|
283 | 283 | <?php if ($value == '0' || !$value) { |
284 | 284 | echo 'checked'; |
285 | 285 | } ?>/> |
286 | - <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
286 | + <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
287 | 287 | |
288 | 288 | </div> |
289 | 289 | </li> |
@@ -292,15 +292,15 @@ discard block |
||
292 | 292 | |
293 | 293 | |
294 | 294 | // for_admin_use |
295 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
295 | + if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) { |
|
296 | 296 | |
297 | - echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
297 | + echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info); |
|
298 | 298 | |
299 | - }else{ |
|
299 | + } else { |
|
300 | 300 | $value = ''; |
301 | 301 | if (isset($field_info->for_admin_use)) { |
302 | 302 | $value = esc_attr($field_info->for_admin_use); |
303 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
303 | + }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) { |
|
304 | 304 | $value = $cf['defaults']['for_admin_use']; |
305 | 305 | } |
306 | 306 | ?> |
@@ -312,17 +312,17 @@ discard block |
||
312 | 312 | </label> |
313 | 313 | <div class="gd-cf-input-wrap gd-switch"> |
314 | 314 | |
315 | - <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
315 | + <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
316 | 316 | <?php if ($value == '1') { |
317 | 317 | echo 'checked'; |
318 | 318 | } ?>/> |
319 | - <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
319 | + <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
320 | 320 | |
321 | - <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
321 | + <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
322 | 322 | <?php if ($value == '0' || !$value) { |
323 | 323 | echo 'checked'; |
324 | 324 | } ?>/> |
325 | - <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
325 | + <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
326 | 326 | |
327 | 327 | </div> |
328 | 328 | </li> |
@@ -331,20 +331,20 @@ discard block |
||
331 | 331 | |
332 | 332 | |
333 | 333 | // default_value |
334 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
334 | + if (has_filter("geodir_cfa_default_value_{$field_type}")) { |
|
335 | 335 | |
336 | - echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
336 | + echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info); |
|
337 | 337 | |
338 | - }else{ |
|
338 | + } else { |
|
339 | 339 | $value = ''; |
340 | 340 | if (isset($field_info->default_value)) { |
341 | 341 | $value = esc_attr($field_info->default_value); |
342 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
342 | + }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) { |
|
343 | 343 | $value = $cf['defaults']['default_value']; |
344 | 344 | } |
345 | 345 | ?> |
346 | 346 | <li> |
347 | - <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?> |
|
347 | + <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 | 348 | <div class="gdcf-tooltip"> |
349 | 349 | <?php |
350 | 350 | if ($field_type == 'checkbox') { |
@@ -361,12 +361,12 @@ discard block |
||
361 | 361 | <?php if ($field_type == 'checkbox') { ?> |
362 | 362 | <select name="default_value" id="default_value"> |
363 | 363 | <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option> |
364 | - <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
364 | + <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
365 | 365 | </select> |
366 | 366 | <?php } else if ($field_type == 'email') { ?> |
367 | - <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
367 | + <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
368 | 368 | <?php } else { ?> |
369 | - <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
369 | + <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
370 | 370 | <?php } ?> |
371 | 371 | </div> |
372 | 372 | </li> |
@@ -375,15 +375,15 @@ discard block |
||
375 | 375 | |
376 | 376 | |
377 | 377 | // show_in |
378 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
378 | + if (has_filter("geodir_cfa_show_in_{$field_type}")) { |
|
379 | 379 | |
380 | - echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
380 | + echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info); |
|
381 | 381 | |
382 | - }else{ |
|
382 | + } else { |
|
383 | 383 | $value = ''; |
384 | 384 | if (isset($field_info->show_in)) { |
385 | 385 | $value = esc_attr($field_info->show_in); |
386 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
386 | + }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) { |
|
387 | 387 | $value = esc_attr($cf['defaults']['show_in']); |
388 | 388 | } |
389 | 389 | ?> |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | * @param object $field_info The field being displayed info. |
417 | 417 | * @param string $field_info The type of field. |
418 | 418 | */ |
419 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
419 | + $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type); |
|
420 | 420 | |
421 | 421 | |
422 | 422 | // remove some locations for some field types |
@@ -424,11 +424,11 @@ discard block |
||
424 | 424 | // don't show new tab option for some types |
425 | 425 | |
426 | 426 | if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) { |
427 | - }else{ |
|
427 | + } else { |
|
428 | 428 | unset($show_in_locations['[owntab]']); |
429 | 429 | } |
430 | 430 | |
431 | - if(!$display_on_listing){ |
|
431 | + if (!$display_on_listing) { |
|
432 | 432 | unset($show_in_locations['[listings]']); |
433 | 433 | } |
434 | 434 | |
@@ -442,17 +442,17 @@ discard block |
||
442 | 442 | option-ajaxchosen="false"> |
443 | 443 | <?php |
444 | 444 | |
445 | - $show_in_values = explode(',',$value); |
|
445 | + $show_in_values = explode(',', $value); |
|
446 | 446 | |
447 | - foreach( $show_in_locations as $key => $val){ |
|
447 | + foreach ($show_in_locations as $key => $val) { |
|
448 | 448 | $selected = ''; |
449 | 449 | |
450 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
450 | + if (is_array($show_in_values) && in_array($key, $show_in_values)) { |
|
451 | 451 | $selected = 'selected'; |
452 | 452 | } |
453 | 453 | |
454 | 454 | ?> |
455 | - <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
|
455 | + <option value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option> |
|
456 | 456 | <?php |
457 | 457 | } |
458 | 458 | ?> |
@@ -464,9 +464,9 @@ discard block |
||
464 | 464 | |
465 | 465 | |
466 | 466 | // advanced_editor |
467 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
467 | + if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) { |
|
468 | 468 | |
469 | - echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
469 | + echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info); |
|
470 | 470 | |
471 | 471 | } |
472 | 472 | |
@@ -477,10 +477,10 @@ discard block |
||
477 | 477 | |
478 | 478 | |
479 | 479 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
480 | - <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/> |
|
480 | + <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/> |
|
481 | 481 | |
482 | 482 | <?php // we dont need to show the sort order ?> |
483 | - <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);} ?>"/> |
|
483 | + <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); } ?>"/> |
|
484 | 484 | |
485 | 485 | |
486 | 486 | |
@@ -533,15 +533,15 @@ discard block |
||
533 | 533 | <?php |
534 | 534 | |
535 | 535 | // is_required |
536 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
536 | + if (has_filter("geodir_cfa_is_required_{$field_type}")) { |
|
537 | 537 | |
538 | - echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
538 | + echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info); |
|
539 | 539 | |
540 | - }else{ |
|
540 | + } else { |
|
541 | 541 | $value = ''; |
542 | 542 | if (isset($field_info->is_required)) { |
543 | 543 | $value = esc_attr($field_info->is_required); |
544 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
544 | + }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) { |
|
545 | 545 | $value = $cf['defaults']['is_required']; |
546 | 546 | } |
547 | 547 | ?> |
@@ -554,17 +554,17 @@ discard block |
||
554 | 554 | |
555 | 555 | <div class="gd-cf-input-wrap gd-switch"> |
556 | 556 | |
557 | - <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled" value="1" |
|
557 | + <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled" value="1" |
|
558 | 558 | <?php if ($value == '1') { |
559 | 559 | echo 'checked'; |
560 | 560 | } ?>/> |
561 | - <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> |
|
561 | + <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> |
|
562 | 562 | |
563 | - <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0" |
|
563 | + <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0" |
|
564 | 564 | <?php if ($value == '0' || !$value) { |
565 | 565 | echo 'checked'; |
566 | 566 | } ?>/> |
567 | - <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> |
|
567 | + <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> |
|
568 | 568 | |
569 | 569 | </div> |
570 | 570 | |
@@ -574,19 +574,19 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | // required_msg |
577 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
577 | + if (has_filter("geodir_cfa_required_msg_{$field_type}")) { |
|
578 | 578 | |
579 | - echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
579 | + echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info); |
|
580 | 580 | |
581 | - }else{ |
|
581 | + } else { |
|
582 | 582 | $value = ''; |
583 | 583 | if (isset($field_info->required_msg)) { |
584 | 584 | $value = esc_attr($field_info->required_msg); |
585 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
585 | + }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) { |
|
586 | 586 | $value = $cf['defaults']['required_msg']; |
587 | 587 | } |
588 | 588 | ?> |
589 | - <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;'";}?>> |
|
589 | + <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;'"; }?>> |
|
590 | 590 | <label for="required_msg" class="gd-cf-tooltip-wrap"> |
591 | 591 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?> |
592 | 592 | <div class="gdcf-tooltip"> |
@@ -603,31 +603,31 @@ discard block |
||
603 | 603 | |
604 | 604 | |
605 | 605 | // required_msg |
606 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
606 | + if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) { |
|
607 | 607 | |
608 | - echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
608 | + echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info); |
|
609 | 609 | |
610 | 610 | } |
611 | 611 | |
612 | 612 | |
613 | 613 | // extra_fields |
614 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
614 | + if (has_filter("geodir_cfa_extra_fields_{$field_type}")) { |
|
615 | 615 | |
616 | - echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
616 | + echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info); |
|
617 | 617 | |
618 | 618 | } |
619 | 619 | |
620 | 620 | |
621 | 621 | // field_icon |
622 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
622 | + if (has_filter("geodir_cfa_field_icon_{$field_type}")) { |
|
623 | 623 | |
624 | - echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
624 | + echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info); |
|
625 | 625 | |
626 | - }else{ |
|
626 | + } else { |
|
627 | 627 | $value = ''; |
628 | 628 | if (isset($field_info->field_icon)) { |
629 | 629 | $value = esc_attr($field_info->field_icon); |
630 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
630 | + }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) { |
|
631 | 631 | $value = $cf['defaults']['field_icon']; |
632 | 632 | } |
633 | 633 | ?> |
@@ -638,12 +638,12 @@ discard block |
||
638 | 638 | <label for="field_icon" class="gd-cf-tooltip-wrap"> |
639 | 639 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?> |
640 | 640 | <div class="gdcf-tooltip"> |
641 | - <?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');?> |
|
641 | + <?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'); ?> |
|
642 | 642 | </div> |
643 | 643 | </label> |
644 | 644 | <div class="gd-cf-input-wrap"> |
645 | 645 | <input type="text" name="field_icon" id="field_icon" |
646 | - value="<?php echo $value;?>"/> |
|
646 | + value="<?php echo $value; ?>"/> |
|
647 | 647 | </div> |
648 | 648 | |
649 | 649 | </li> |
@@ -652,15 +652,15 @@ discard block |
||
652 | 652 | |
653 | 653 | |
654 | 654 | // css_class |
655 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
655 | + if (has_filter("geodir_cfa_css_class_{$field_type}")) { |
|
656 | 656 | |
657 | - echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
657 | + echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info); |
|
658 | 658 | |
659 | - }else{ |
|
659 | + } else { |
|
660 | 660 | $value = ''; |
661 | 661 | if (isset($field_info->css_class)) { |
662 | 662 | $value = esc_attr($field_info->css_class); |
663 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
663 | + }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) { |
|
664 | 664 | $value = $cf['defaults']['css_class']; |
665 | 665 | } |
666 | 666 | ?> |
@@ -669,8 +669,8 @@ discard block |
||
669 | 669 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
670 | 670 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?> |
671 | 671 | <div class="gdcf-tooltip"> |
672 | - <?php _e('Enter custom css class for field custom style.', 'geodirectory');?> |
|
673 | - <?php if($field_type=='multiselect'){_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory');}?> |
|
672 | + <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?> |
|
673 | + <?php if ($field_type == 'multiselect') {_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory'); }?> |
|
674 | 674 | </div> |
675 | 675 | </label> |
676 | 676 | <div class="gd-cf-input-wrap"> |
@@ -685,23 +685,23 @@ discard block |
||
685 | 685 | |
686 | 686 | |
687 | 687 | // cat_sort |
688 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
688 | + if (has_filter("geodir_cfa_cat_sort_{$field_type}")) { |
|
689 | 689 | |
690 | - echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
690 | + echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info); |
|
691 | 691 | |
692 | - }else{ |
|
692 | + } else { |
|
693 | 693 | $value = ''; |
694 | - $hide_cat_sort =''; |
|
694 | + $hide_cat_sort = ''; |
|
695 | 695 | if (isset($field_info->cat_sort)) { |
696 | 696 | $value = esc_attr($field_info->cat_sort); |
697 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
697 | + }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) { |
|
698 | 698 | $value = $cf['defaults']['cat_sort']; |
699 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
699 | + $hide_cat_sort = ($value === false) ? "style='display:none;'" : ''; |
|
700 | 700 | } |
701 | 701 | |
702 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
702 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : ''; |
|
703 | 703 | ?> |
704 | - <li <?php echo $hide_cat_sort ;?>> |
|
704 | + <li <?php echo $hide_cat_sort; ?>> |
|
705 | 705 | <h3><?php |
706 | 706 | /** |
707 | 707 | * Filter the section title. |
@@ -720,23 +720,23 @@ discard block |
||
720 | 720 | <label for="cat_sort" class="gd-cf-tooltip-wrap"> |
721 | 721 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?> |
722 | 722 | <div class="gdcf-tooltip"> |
723 | - <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?> |
|
723 | + <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?> |
|
724 | 724 | </div> |
725 | 725 | </label> |
726 | 726 | |
727 | 727 | <div class="gd-cf-input-wrap gd-switch"> |
728 | 728 | |
729 | - <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled" value="1" |
|
729 | + <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled" value="1" |
|
730 | 730 | <?php if ($value == '1') { |
731 | 731 | echo 'checked'; |
732 | 732 | } ?>/> |
733 | - <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
733 | + <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
734 | 734 | |
735 | - <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0" |
|
735 | + <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0" |
|
736 | 736 | <?php if (!$value) { |
737 | 737 | echo 'checked'; |
738 | 738 | } ?>/> |
739 | - <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
739 | + <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
740 | 740 | |
741 | 741 | </div> |
742 | 742 | </li> |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | * @param object $field_info The current fields info. |
764 | 764 | * @param array $cf The custom field settings |
765 | 765 | */ |
766 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
766 | + do_action('geodir_advance_custom_fields', $field_info, $cf); ?> |
|
767 | 767 | |
768 | 768 | |
769 | 769 | <?php endswitch; ?> |
@@ -775,10 +775,10 @@ discard block |
||
775 | 775 | <h3></h3> |
776 | 776 | </label> |
777 | 777 | <div class="gd-cf-input-wrap"> |
778 | - <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>" |
|
778 | + <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>" |
|
779 | 779 | onclick="save_field('<?php echo esc_attr($result_str); ?>')"/> |
780 | 780 | <?php if (!$default): ?> |
781 | - <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>" |
|
781 | + <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>" |
|
782 | 782 | onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')" |
783 | 783 | class="button"/></a> |
784 | 784 | <?php endif; ?> |
@@ -19,21 +19,21 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return string The html to output for the custom field. |
21 | 21 | */ |
22 | -function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
|
22 | +function geodir_cf_checkbox($html, $location, $cf, $p = '') { |
|
23 | 23 | |
24 | 24 | // check we have the post value |
25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
26 | - else{ global $post;} |
|
25 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
26 | + else { global $post; } |
|
27 | 27 | |
28 | - if(!is_array($cf) && $cf!=''){ |
|
28 | + if (!is_array($cf) && $cf != '') { |
|
29 | 29 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
30 | - if(!$cf){return NULL;} |
|
30 | + if (!$cf) {return NULL; } |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $html_var = $cf['htmlvar_name']; |
34 | 34 | |
35 | 35 | // Check if there is a location specific filter. |
36 | - if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
36 | + if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) { |
|
37 | 37 | /** |
38 | 38 | * Filter the checkbox html by location. |
39 | 39 | * |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | * @param array $cf The custom field array. |
42 | 42 | * @since 1.6.6 |
43 | 43 | */ |
44 | - $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
44 | + $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Check if there is a custom field specific filter. |
48 | - if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
48 | + if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) { |
|
49 | 49 | /** |
50 | 50 | * Filter the checkbox html by individual custom field. |
51 | 51 | * |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | * @param array $cf The custom field array. |
55 | 55 | * @since 1.6.6 |
56 | 56 | */ |
57 | - $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
57 | + $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // Check if there is a custom field key specific filter. |
61 | - if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
61 | + if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) { |
|
62 | 62 | /** |
63 | 63 | * Filter the checkbox html by field type key. |
64 | 64 | * |
@@ -67,18 +67,18 @@ discard block |
||
67 | 67 | * @param array $cf The custom field array. |
68 | 68 | * @since 1.6.6 |
69 | 69 | */ |
70 | - $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
70 | + $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // If not html then we run the standard output. |
74 | - if(empty($html)){ |
|
74 | + if (empty($html)) { |
|
75 | 75 | |
76 | - if ( (int) $post->{$html_var} == 1 ): |
|
76 | + if ((int) $post->{$html_var} == 1): |
|
77 | 77 | |
78 | - if ( $post->{$html_var} == '1' ): |
|
79 | - $html_val = __( 'Yes', 'geodirectory' ); |
|
78 | + if ($post->{$html_var} == '1'): |
|
79 | + $html_val = __('Yes', 'geodirectory'); |
|
80 | 80 | else: |
81 | - $html_val = __( 'No', 'geodirectory' ); |
|
81 | + $html_val = __('No', 'geodirectory'); |
|
82 | 82 | endif; |
83 | 83 | |
84 | 84 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | $field_icon = ''; |
92 | 92 | } |
93 | 93 | |
94 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
95 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
96 | - $html .= '</span>' . $html_val . '</div>'; |
|
94 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af; |
|
95 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
96 | + $html .= '</span>'.$html_val.'</div>'; |
|
97 | 97 | endif; |
98 | 98 | |
99 | 99 | } |
100 | 100 | |
101 | 101 | return $html; |
102 | 102 | } |
103 | -add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3); |
|
103 | +add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3); |
|
104 | 104 | |
105 | 105 | |
106 | 106 | /** |
@@ -113,21 +113,21 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return string The html to output for the custom field. |
115 | 115 | */ |
116 | -function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
|
116 | +function geodir_cf_fieldset($html, $location, $cf, $p = '') { |
|
117 | 117 | |
118 | 118 | // check we have the post value |
119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
120 | - else{ global $post;} |
|
119 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
120 | + else { global $post; } |
|
121 | 121 | |
122 | - if(!is_array($cf) && $cf!=''){ |
|
122 | + if (!is_array($cf) && $cf != '') { |
|
123 | 123 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
124 | - if(!$cf){return NULL;} |
|
124 | + if (!$cf) {return NULL; } |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $html_var = $cf['htmlvar_name']; |
128 | 128 | |
129 | 129 | // Check if there is a location specific filter. |
130 | - if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
130 | + if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) { |
|
131 | 131 | /** |
132 | 132 | * Filter the fieldset html by location. |
133 | 133 | * |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | * @param array $cf The custom field array. |
136 | 136 | * @since 1.6.6 |
137 | 137 | */ |
138 | - $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
138 | + $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | // Check if there is a custom field specific filter. |
142 | - if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
142 | + if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) { |
|
143 | 143 | /** |
144 | 144 | * Filter the fieldset html by individual custom field. |
145 | 145 | * |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | * @param array $cf The custom field array. |
149 | 149 | * @since 1.6.6 |
150 | 150 | */ |
151 | - $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
151 | + $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // Check if there is a custom field key specific filter. |
155 | - if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
155 | + if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) { |
|
156 | 156 | /** |
157 | 157 | * Filter the fieldset html by field type key. |
158 | 158 | * |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | * @param array $cf The custom field array. |
162 | 162 | * @since 1.6.6 |
163 | 163 | */ |
164 | - $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
164 | + $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // If not html then we run the standard output. |
168 | - if(empty($html)){ |
|
168 | + if (empty($html)) { |
|
169 | 169 | |
170 | 170 | global $field_set_start; |
171 | 171 | $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | if ($field_set_start == 1) { |
174 | 174 | $html = ''; |
175 | 175 | } else { |
176 | - $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
176 | + $html = '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>'; |
|
177 | 177 | //$field_set_start = 1; |
178 | 178 | } |
179 | 179 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | return $html; |
183 | 183 | } |
184 | -add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3); |
|
184 | +add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3); |
|
185 | 185 | |
186 | 186 | |
187 | 187 | /** |
@@ -194,21 +194,21 @@ discard block |
||
194 | 194 | * |
195 | 195 | * @return string The html to output for the custom field. |
196 | 196 | */ |
197 | -function geodir_cf_url($html,$location,$cf,$p=''){ |
|
197 | +function geodir_cf_url($html, $location, $cf, $p = '') { |
|
198 | 198 | |
199 | 199 | // check we have the post value |
200 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
201 | - else{ global $post;} |
|
200 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
201 | + else { global $post; } |
|
202 | 202 | |
203 | - if(!is_array($cf) && $cf!=''){ |
|
203 | + if (!is_array($cf) && $cf != '') { |
|
204 | 204 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
205 | - if(!$cf){return NULL;} |
|
205 | + if (!$cf) {return NULL; } |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | $html_var = $cf['htmlvar_name']; |
209 | 209 | |
210 | 210 | // Check if there is a location specific filter. |
211 | - if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
211 | + if (has_filter("geodir_custom_field_output_url_loc_{$location}")) { |
|
212 | 212 | /** |
213 | 213 | * Filter the url html by location. |
214 | 214 | * |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | * @param array $cf The custom field array. |
217 | 217 | * @since 1.6.6 |
218 | 218 | */ |
219 | - $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
219 | + $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | // Check if there is a custom field specific filter. |
223 | - if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
223 | + if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) { |
|
224 | 224 | /** |
225 | 225 | * Filter the url html by individual custom field. |
226 | 226 | * |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | * @param array $cf The custom field array. |
230 | 230 | * @since 1.6.6 |
231 | 231 | */ |
232 | - $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
232 | + $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | // Check if there is a custom field key specific filter. |
236 | - if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
236 | + if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) { |
|
237 | 237 | /** |
238 | 238 | * Filter the url html by field type key. |
239 | 239 | * |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | * @param array $cf The custom field array. |
243 | 243 | * @since 1.6.6 |
244 | 244 | */ |
245 | - $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
245 | + $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | // If not html then we run the standard output. |
249 | - if(empty($html)){ |
|
249 | + if (empty($html)) { |
|
250 | 250 | |
251 | 251 | if ($post->{$cf['htmlvar_name']}): |
252 | 252 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
275 | 275 | $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
276 | - if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
276 | + if (!empty($cf['default_value'])) {$title = $cf['default_value']; } |
|
277 | 277 | $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
278 | 278 | |
279 | 279 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @param string $website Website URL. |
290 | 290 | * @param int $post->ID Post ID. |
291 | 291 | */ |
292 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
292 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>'; |
|
293 | 293 | |
294 | 294 | endif; |
295 | 295 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | |
298 | 298 | return $html; |
299 | 299 | } |
300 | -add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3); |
|
300 | +add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3); |
|
301 | 301 | |
302 | 302 | |
303 | 303 | /** |
@@ -310,21 +310,21 @@ discard block |
||
310 | 310 | * |
311 | 311 | * @return string The html to output for the custom field. |
312 | 312 | */ |
313 | -function geodir_cf_phone($html,$location,$cf,$p=''){ |
|
313 | +function geodir_cf_phone($html, $location, $cf, $p = '') { |
|
314 | 314 | |
315 | 315 | // check we have the post value |
316 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
317 | - else{ global $post;} |
|
316 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
317 | + else { global $post; } |
|
318 | 318 | |
319 | - if(!is_array($cf) && $cf!=''){ |
|
319 | + if (!is_array($cf) && $cf != '') { |
|
320 | 320 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
321 | - if(!$cf){return NULL;} |
|
321 | + if (!$cf) {return NULL; } |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | $html_var = $cf['htmlvar_name']; |
325 | 325 | |
326 | 326 | // Check if there is a location specific filter. |
327 | - if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
327 | + if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) { |
|
328 | 328 | /** |
329 | 329 | * Filter the phone html by location. |
330 | 330 | * |
@@ -332,11 +332,11 @@ discard block |
||
332 | 332 | * @param array $cf The custom field array. |
333 | 333 | * @since 1.6.6 |
334 | 334 | */ |
335 | - $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
335 | + $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | // Check if there is a custom field specific filter. |
339 | - if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
339 | + if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) { |
|
340 | 340 | /** |
341 | 341 | * Filter the phone html by individual custom field. |
342 | 342 | * |
@@ -345,11 +345,11 @@ discard block |
||
345 | 345 | * @param array $cf The custom field array. |
346 | 346 | * @since 1.6.6 |
347 | 347 | */ |
348 | - $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
348 | + $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | // Check if there is a custom field key specific filter. |
352 | - if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
352 | + if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) { |
|
353 | 353 | /** |
354 | 354 | * Filter the phone html by field type key. |
355 | 355 | * |
@@ -358,11 +358,11 @@ discard block |
||
358 | 358 | * @param array $cf The custom field array. |
359 | 359 | * @since 1.6.6 |
360 | 360 | */ |
361 | - $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
361 | + $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | // If not html then we run the standard output. |
365 | - if(empty($html)){ |
|
365 | + if (empty($html)) { |
|
366 | 366 | |
367 | 367 | if ($post->{$cf['htmlvar_name']}): |
368 | 368 | |
@@ -377,9 +377,9 @@ discard block |
||
377 | 377 | } |
378 | 378 | |
379 | 379 | |
380 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
381 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
382 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
380 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af. |
|
381 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
382 | + $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>'; |
|
383 | 383 | |
384 | 384 | endif; |
385 | 385 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | return $html; |
389 | 389 | } |
390 | -add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3); |
|
390 | +add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3); |
|
391 | 391 | |
392 | 392 | |
393 | 393 | /** |
@@ -400,21 +400,21 @@ discard block |
||
400 | 400 | * |
401 | 401 | * @return string The html to output for the custom field. |
402 | 402 | */ |
403 | -function geodir_cf_time($html,$location,$cf,$p=''){ |
|
403 | +function geodir_cf_time($html, $location, $cf, $p = '') { |
|
404 | 404 | |
405 | 405 | // check we have the post value |
406 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
407 | - else{ global $post;} |
|
406 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
407 | + else { global $post; } |
|
408 | 408 | |
409 | - if(!is_array($cf) && $cf!=''){ |
|
409 | + if (!is_array($cf) && $cf != '') { |
|
410 | 410 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
411 | - if(!$cf){return NULL;} |
|
411 | + if (!$cf) {return NULL; } |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | $html_var = $cf['htmlvar_name']; |
415 | 415 | |
416 | 416 | // Check if there is a location specific filter. |
417 | - if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
417 | + if (has_filter("geodir_custom_field_output_time_loc_{$location}")) { |
|
418 | 418 | /** |
419 | 419 | * Filter the time html by location. |
420 | 420 | * |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | * @param array $cf The custom field array. |
423 | 423 | * @since 1.6.6 |
424 | 424 | */ |
425 | - $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
425 | + $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf); |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | // Check if there is a custom field specific filter. |
429 | - if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
429 | + if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) { |
|
430 | 430 | /** |
431 | 431 | * Filter the time html by individual custom field. |
432 | 432 | * |
@@ -435,11 +435,11 @@ discard block |
||
435 | 435 | * @param array $cf The custom field array. |
436 | 436 | * @since 1.6.6 |
437 | 437 | */ |
438 | - $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
438 | + $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | // Check if there is a custom field key specific filter. |
442 | - if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
442 | + if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) { |
|
443 | 443 | /** |
444 | 444 | * Filter the time html by field type key. |
445 | 445 | * |
@@ -448,11 +448,11 @@ discard block |
||
448 | 448 | * @param array $cf The custom field array. |
449 | 449 | * @since 1.6.6 |
450 | 450 | */ |
451 | - $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
451 | + $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | // If not html then we run the standard output. |
455 | - if(empty($html)){ |
|
455 | + if (empty($html)) { |
|
456 | 456 | |
457 | 457 | if ($post->{$cf['htmlvar_name']}): |
458 | 458 | |
@@ -472,9 +472,9 @@ discard block |
||
472 | 472 | } |
473 | 473 | |
474 | 474 | |
475 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
476 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
477 | - $html .= '</span>' . $value . '</div>'; |
|
475 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
476 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
477 | + $html .= '</span>'.$value.'</div>'; |
|
478 | 478 | |
479 | 479 | endif; |
480 | 480 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | return $html; |
484 | 484 | } |
485 | -add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3); |
|
485 | +add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3); |
|
486 | 486 | |
487 | 487 | |
488 | 488 | /** |
@@ -495,21 +495,21 @@ discard block |
||
495 | 495 | * |
496 | 496 | * @return string The html to output for the custom field. |
497 | 497 | */ |
498 | -function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
|
498 | +function geodir_cf_datepicker($html, $location, $cf, $p = '') { |
|
499 | 499 | global $preview; |
500 | 500 | // check we have the post value |
501 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
502 | - else{ global $post;} |
|
501 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
502 | + else { global $post; } |
|
503 | 503 | |
504 | - if(!is_array($cf) && $cf!=''){ |
|
504 | + if (!is_array($cf) && $cf != '') { |
|
505 | 505 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
506 | - if(!$cf){return NULL;} |
|
506 | + if (!$cf) {return NULL; } |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | $html_var = $cf['htmlvar_name']; |
510 | 510 | |
511 | 511 | // Check if there is a location specific filter. |
512 | - if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
512 | + if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) { |
|
513 | 513 | /** |
514 | 514 | * Filter the datepicker html by location. |
515 | 515 | * |
@@ -517,11 +517,11 @@ discard block |
||
517 | 517 | * @param array $cf The custom field array. |
518 | 518 | * @since 1.6.6 |
519 | 519 | */ |
520 | - $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
520 | + $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | // Check if there is a custom field specific filter. |
524 | - if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
524 | + if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) { |
|
525 | 525 | /** |
526 | 526 | * Filter the datepicker html by individual custom field. |
527 | 527 | * |
@@ -530,11 +530,11 @@ discard block |
||
530 | 530 | * @param array $cf The custom field array. |
531 | 531 | * @since 1.6.6 |
532 | 532 | */ |
533 | - $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
533 | + $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | // Check if there is a custom field key specific filter. |
537 | - if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
537 | + if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) { |
|
538 | 538 | /** |
539 | 539 | * Filter the datepicker html by field type key. |
540 | 540 | * |
@@ -543,11 +543,11 @@ discard block |
||
543 | 543 | * @param array $cf The custom field array. |
544 | 544 | * @since 1.6.6 |
545 | 545 | */ |
546 | - $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
546 | + $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | // If not html then we run the standard output. |
550 | - if(empty($html)){ |
|
550 | + if (empty($html)) { |
|
551 | 551 | |
552 | 552 | if ($post->{$cf['htmlvar_name']}): |
553 | 553 | |
@@ -558,24 +558,24 @@ discard block |
||
558 | 558 | } |
559 | 559 | // check if we need to change the format or not |
560 | 560 | $date_format_len = strlen(str_replace(' ', '', $date_format)); |
561 | - if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
561 | + if ($date_format_len > 5) {// if greater then 4 then it's the old style format. |
|
562 | 562 | |
563 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
564 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
563 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
564 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
565 | 565 | |
566 | 566 | $date_format = str_replace($search, $replace, $date_format); |
567 | 567 | |
568 | - $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
569 | - }else{ |
|
568 | + $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y') ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
569 | + } else { |
|
570 | 570 | $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
571 | 571 | } |
572 | 572 | |
573 | - if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
573 | + if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") { |
|
574 | 574 | $date_format_from = $preview ? $date_format : 'Y-m-d'; |
575 | 575 | $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
576 | 576 | //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
577 | 577 | //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
578 | - }else{ |
|
578 | + } else { |
|
579 | 579 | return ''; |
580 | 580 | } |
581 | 581 | |
@@ -592,9 +592,9 @@ discard block |
||
592 | 592 | |
593 | 593 | |
594 | 594 | |
595 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
596 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
597 | - $html .= '</span>' . $value . '</div>'; |
|
595 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af; |
|
596 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
597 | + $html .= '</span>'.$value.'</div>'; |
|
598 | 598 | |
599 | 599 | endif; |
600 | 600 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | |
603 | 603 | return $html; |
604 | 604 | } |
605 | -add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3); |
|
605 | +add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3); |
|
606 | 606 | |
607 | 607 | |
608 | 608 | /** |
@@ -615,21 +615,21 @@ discard block |
||
615 | 615 | * |
616 | 616 | * @return string The html to output for the custom field. |
617 | 617 | */ |
618 | -function geodir_cf_text($html,$location,$cf,$p=''){ |
|
618 | +function geodir_cf_text($html, $location, $cf, $p = '') { |
|
619 | 619 | |
620 | 620 | // check we have the post value |
621 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
622 | - else{ global $post;} |
|
621 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
622 | + else { global $post; } |
|
623 | 623 | |
624 | - if(!is_array($cf) && $cf!=''){ |
|
624 | + if (!is_array($cf) && $cf != '') { |
|
625 | 625 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
626 | - if(!$cf){return NULL;} |
|
626 | + if (!$cf) {return NULL; } |
|
627 | 627 | } |
628 | 628 | |
629 | 629 | $html_var = $cf['htmlvar_name']; |
630 | 630 | |
631 | 631 | // Check if there is a location specific filter. |
632 | - if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
632 | + if (has_filter("geodir_custom_field_output_text_loc_{$location}")) { |
|
633 | 633 | /** |
634 | 634 | * Filter the text html by location. |
635 | 635 | * |
@@ -637,11 +637,11 @@ discard block |
||
637 | 637 | * @param array $cf The custom field array. |
638 | 638 | * @since 1.6.6 |
639 | 639 | */ |
640 | - $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
640 | + $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf); |
|
641 | 641 | } |
642 | 642 | |
643 | 643 | // Check if there is a custom field specific filter. |
644 | - if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
644 | + if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) { |
|
645 | 645 | /** |
646 | 646 | * Filter the text html by individual custom field. |
647 | 647 | * |
@@ -650,11 +650,11 @@ discard block |
||
650 | 650 | * @param array $cf The custom field array. |
651 | 651 | * @since 1.6.6 |
652 | 652 | */ |
653 | - $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
653 | + $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf); |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | // Check if there is a custom field key specific filter. |
657 | - if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
657 | + if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) { |
|
658 | 658 | /** |
659 | 659 | * Filter the text html by field type key. |
660 | 660 | * |
@@ -663,15 +663,15 @@ discard block |
||
663 | 663 | * @param array $cf The custom field array. |
664 | 664 | * @since 1.6.6 |
665 | 665 | */ |
666 | - $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
666 | + $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | |
670 | 670 | |
671 | 671 | // If not html then we run the standard output. |
672 | - if(empty($html)){ |
|
672 | + if (empty($html)) { |
|
673 | 673 | |
674 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
674 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
675 | 675 | |
676 | 676 | $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
677 | 677 | |
@@ -686,9 +686,9 @@ discard block |
||
686 | 686 | } |
687 | 687 | |
688 | 688 | |
689 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
690 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
691 | - $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>'; |
|
689 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af; |
|
690 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
691 | + $html .= '</span>'.$post->{$cf['htmlvar_name']}.'</div>'; |
|
692 | 692 | |
693 | 693 | endif; |
694 | 694 | |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | |
697 | 697 | return $html; |
698 | 698 | } |
699 | -add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3); |
|
699 | +add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3); |
|
700 | 700 | |
701 | 701 | |
702 | 702 | /** |
@@ -709,21 +709,21 @@ discard block |
||
709 | 709 | * |
710 | 710 | * @return string The html to output for the custom field. |
711 | 711 | */ |
712 | -function geodir_cf_radio($html,$location,$cf,$p=''){ |
|
712 | +function geodir_cf_radio($html, $location, $cf, $p = '') { |
|
713 | 713 | |
714 | 714 | // check we have the post value |
715 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
716 | - else{ global $post;} |
|
715 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
716 | + else { global $post; } |
|
717 | 717 | |
718 | - if(!is_array($cf) && $cf!=''){ |
|
718 | + if (!is_array($cf) && $cf != '') { |
|
719 | 719 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
720 | - if(!$cf){return NULL;} |
|
720 | + if (!$cf) {return NULL; } |
|
721 | 721 | } |
722 | 722 | |
723 | 723 | $html_var = $cf['htmlvar_name']; |
724 | 724 | |
725 | 725 | // Check if there is a location specific filter. |
726 | - if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
726 | + if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) { |
|
727 | 727 | /** |
728 | 728 | * Filter the radio html by location. |
729 | 729 | * |
@@ -731,11 +731,11 @@ discard block |
||
731 | 731 | * @param array $cf The custom field array. |
732 | 732 | * @since 1.6.6 |
733 | 733 | */ |
734 | - $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
734 | + $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf); |
|
735 | 735 | } |
736 | 736 | |
737 | 737 | // Check if there is a custom field specific filter. |
738 | - if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
738 | + if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) { |
|
739 | 739 | /** |
740 | 740 | * Filter the radio html by individual custom field. |
741 | 741 | * |
@@ -744,11 +744,11 @@ discard block |
||
744 | 744 | * @param array $cf The custom field array. |
745 | 745 | * @since 1.6.6 |
746 | 746 | */ |
747 | - $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
747 | + $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf); |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | // Check if there is a custom field key specific filter. |
751 | - if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
751 | + if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) { |
|
752 | 752 | /** |
753 | 753 | * Filter the radio html by field type key. |
754 | 754 | * |
@@ -757,11 +757,11 @@ discard block |
||
757 | 757 | * @param array $cf The custom field array. |
758 | 758 | * @since 1.6.6 |
759 | 759 | */ |
760 | - $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
760 | + $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
761 | 761 | } |
762 | 762 | |
763 | 763 | // If not html then we run the standard output. |
764 | - if(empty($html)){ |
|
764 | + if (empty($html)) { |
|
765 | 765 | |
766 | 766 | $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
767 | 767 | if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
@@ -795,16 +795,16 @@ discard block |
||
795 | 795 | } |
796 | 796 | |
797 | 797 | |
798 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
799 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
800 | - $html .= '</span>' . $html_val . '</div>'; |
|
798 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af; |
|
799 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
800 | + $html .= '</span>'.$html_val.'</div>'; |
|
801 | 801 | endif; |
802 | 802 | |
803 | 803 | } |
804 | 804 | |
805 | 805 | return $html; |
806 | 806 | } |
807 | -add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3); |
|
807 | +add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3); |
|
808 | 808 | |
809 | 809 | |
810 | 810 | /** |
@@ -817,21 +817,21 @@ discard block |
||
817 | 817 | * |
818 | 818 | * @return string The html to output for the custom field. |
819 | 819 | */ |
820 | -function geodir_cf_select($html,$location,$cf,$p=''){ |
|
820 | +function geodir_cf_select($html, $location, $cf, $p = '') { |
|
821 | 821 | |
822 | 822 | // check we have the post value |
823 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
824 | - else{ global $post;} |
|
823 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
824 | + else { global $post; } |
|
825 | 825 | |
826 | - if(!is_array($cf) && $cf!=''){ |
|
826 | + if (!is_array($cf) && $cf != '') { |
|
827 | 827 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
828 | - if(!$cf){return NULL;} |
|
828 | + if (!$cf) {return NULL; } |
|
829 | 829 | } |
830 | 830 | |
831 | 831 | $html_var = $cf['htmlvar_name']; |
832 | 832 | |
833 | 833 | // Check if there is a location specific filter. |
834 | - if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
834 | + if (has_filter("geodir_custom_field_output_select_loc_{$location}")) { |
|
835 | 835 | /** |
836 | 836 | * Filter the select html by location. |
837 | 837 | * |
@@ -839,11 +839,11 @@ discard block |
||
839 | 839 | * @param array $cf The custom field array. |
840 | 840 | * @since 1.6.6 |
841 | 841 | */ |
842 | - $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
842 | + $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf); |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | // Check if there is a custom field specific filter. |
846 | - if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
846 | + if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) { |
|
847 | 847 | /** |
848 | 848 | * Filter the select html by individual custom field. |
849 | 849 | * |
@@ -852,11 +852,11 @@ discard block |
||
852 | 852 | * @param array $cf The custom field array. |
853 | 853 | * @since 1.6.6 |
854 | 854 | */ |
855 | - $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
855 | + $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf); |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | // Check if there is a custom field key specific filter. |
859 | - if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
859 | + if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) { |
|
860 | 860 | /** |
861 | 861 | * Filter the select html by field type key. |
862 | 862 | * |
@@ -865,11 +865,11 @@ discard block |
||
865 | 865 | * @param array $cf The custom field array. |
866 | 866 | * @since 1.6.6 |
867 | 867 | */ |
868 | - $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
868 | + $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
869 | 869 | } |
870 | 870 | |
871 | 871 | // If not html then we run the standard output. |
872 | - if(empty($html)){ |
|
872 | + if (empty($html)) { |
|
873 | 873 | |
874 | 874 | if ($post->{$cf['htmlvar_name']}): |
875 | 875 | $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
@@ -897,16 +897,16 @@ discard block |
||
897 | 897 | } |
898 | 898 | |
899 | 899 | |
900 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
901 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
902 | - $html .= '</span>' . $field_value . '</div>'; |
|
900 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
901 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
902 | + $html .= '</span>'.$field_value.'</div>'; |
|
903 | 903 | endif; |
904 | 904 | |
905 | 905 | } |
906 | 906 | |
907 | 907 | return $html; |
908 | 908 | } |
909 | -add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3); |
|
909 | +add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3); |
|
910 | 910 | |
911 | 911 | |
912 | 912 | /** |
@@ -919,21 +919,21 @@ discard block |
||
919 | 919 | * |
920 | 920 | * @return string The html to output for the custom field. |
921 | 921 | */ |
922 | -function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
|
922 | +function geodir_cf_multiselect($html, $location, $cf, $p = '') { |
|
923 | 923 | |
924 | 924 | // check we have the post value |
925 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
926 | - else{ global $post;} |
|
925 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
926 | + else { global $post; } |
|
927 | 927 | |
928 | - if(!is_array($cf) && $cf!=''){ |
|
928 | + if (!is_array($cf) && $cf != '') { |
|
929 | 929 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
930 | - if(!$cf){return NULL;} |
|
930 | + if (!$cf) {return NULL; } |
|
931 | 931 | } |
932 | 932 | |
933 | 933 | $html_var = $cf['htmlvar_name']; |
934 | 934 | |
935 | 935 | // Check if there is a location specific filter. |
936 | - if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
936 | + if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) { |
|
937 | 937 | /** |
938 | 938 | * Filter the multiselect html by location. |
939 | 939 | * |
@@ -941,11 +941,11 @@ discard block |
||
941 | 941 | * @param array $cf The custom field array. |
942 | 942 | * @since 1.6.6 |
943 | 943 | */ |
944 | - $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
944 | + $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf); |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | // Check if there is a custom field specific filter. |
948 | - if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
948 | + if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) { |
|
949 | 949 | /** |
950 | 950 | * Filter the multiselect html by individual custom field. |
951 | 951 | * |
@@ -954,11 +954,11 @@ discard block |
||
954 | 954 | * @param array $cf The custom field array. |
955 | 955 | * @since 1.6.6 |
956 | 956 | */ |
957 | - $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
957 | + $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf); |
|
958 | 958 | } |
959 | 959 | |
960 | 960 | // Check if there is a custom field key specific filter. |
961 | - if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
961 | + if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) { |
|
962 | 962 | /** |
963 | 963 | * Filter the multiselect html by field type key. |
964 | 964 | * |
@@ -967,11 +967,11 @@ discard block |
||
967 | 967 | * @param array $cf The custom field array. |
968 | 968 | * @since 1.6.6 |
969 | 969 | */ |
970 | - $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
970 | + $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
971 | 971 | } |
972 | 972 | |
973 | 973 | // If not html then we run the standard output. |
974 | - if(empty($html)){ |
|
974 | + if (empty($html)) { |
|
975 | 975 | |
976 | 976 | |
977 | 977 | if (!empty($post->{$cf['htmlvar_name']})): |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | |
993 | 993 | $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
994 | 994 | |
995 | - if(is_array($field_values)){ |
|
995 | + if (is_array($field_values)) { |
|
996 | 996 | $field_values = array_map('trim', $field_values); |
997 | 997 | } |
998 | 998 | |
@@ -1010,15 +1010,15 @@ discard block |
||
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | |
1013 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1014 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1013 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
1014 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1015 | 1015 | $html .= '</span>'; |
1016 | 1016 | |
1017 | 1017 | if (count($option_values) > 1) { |
1018 | 1018 | $html .= '<ul>'; |
1019 | 1019 | |
1020 | 1020 | foreach ($option_values as $val) { |
1021 | - $html .= '<li>' . $val . '</li>'; |
|
1021 | + $html .= '<li>'.$val.'</li>'; |
|
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | $html .= '</ul>'; |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | |
1034 | 1034 | return $html; |
1035 | 1035 | } |
1036 | -add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3); |
|
1036 | +add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3); |
|
1037 | 1037 | |
1038 | 1038 | |
1039 | 1039 | /** |
@@ -1046,21 +1046,21 @@ discard block |
||
1046 | 1046 | * |
1047 | 1047 | * @return string The html to output for the custom field. |
1048 | 1048 | */ |
1049 | -function geodir_cf_email($html,$location,$cf,$p=''){ |
|
1049 | +function geodir_cf_email($html, $location, $cf, $p = '') { |
|
1050 | 1050 | |
1051 | 1051 | // check we have the post value |
1052 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1053 | - else{ global $post;} |
|
1052 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1053 | + else { global $post; } |
|
1054 | 1054 | |
1055 | - if(!is_array($cf) && $cf!=''){ |
|
1055 | + if (!is_array($cf) && $cf != '') { |
|
1056 | 1056 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1057 | - if(!$cf){return NULL;} |
|
1057 | + if (!$cf) {return NULL; } |
|
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | $html_var = $cf['htmlvar_name']; |
1061 | 1061 | |
1062 | 1062 | // Check if there is a location specific filter. |
1063 | - if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
1063 | + if (has_filter("geodir_custom_field_output_email_loc_{$location}")) { |
|
1064 | 1064 | /** |
1065 | 1065 | * Filter the email html by location. |
1066 | 1066 | * |
@@ -1068,11 +1068,11 @@ discard block |
||
1068 | 1068 | * @param array $cf The custom field array. |
1069 | 1069 | * @since 1.6.6 |
1070 | 1070 | */ |
1071 | - $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
1071 | + $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf); |
|
1072 | 1072 | } |
1073 | 1073 | |
1074 | 1074 | // Check if there is a custom field specific filter. |
1075 | - if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
1075 | + if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) { |
|
1076 | 1076 | /** |
1077 | 1077 | * Filter the email html by individual custom field. |
1078 | 1078 | * |
@@ -1081,11 +1081,11 @@ discard block |
||
1081 | 1081 | * @param array $cf The custom field array. |
1082 | 1082 | * @since 1.6.6 |
1083 | 1083 | */ |
1084 | - $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
1084 | + $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf); |
|
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | // Check if there is a custom field key specific filter. |
1088 | - if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
1088 | + if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) { |
|
1089 | 1089 | /** |
1090 | 1090 | * Filter the email html by field type key. |
1091 | 1091 | * |
@@ -1094,18 +1094,18 @@ discard block |
||
1094 | 1094 | * @param array $cf The custom field array. |
1095 | 1095 | * @since 1.6.6 |
1096 | 1096 | */ |
1097 | - $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1097 | + $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | // If not html then we run the standard output. |
1101 | - if(empty($html)){ |
|
1101 | + if (empty($html)) { |
|
1102 | 1102 | |
1103 | 1103 | global $preview; |
1104 | 1104 | if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
1105 | 1105 | return ''; // Remove Send Enquiry | Send To Friend from listings page |
1106 | 1106 | } |
1107 | 1107 | |
1108 | - $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
1108 | + $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type); |
|
1109 | 1109 | |
1110 | 1110 | if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
1111 | 1111 | $send_to_friend = true; |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | if (!$preview) { |
1117 | 1117 | $b_send_inquiry = 'b_send_inquiry'; |
1118 | 1118 | $b_sendtofriend = 'b_sendtofriend'; |
1119 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
1119 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>'; |
|
1120 | 1120 | } |
1121 | 1121 | |
1122 | 1122 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1129,26 +1129,26 @@ discard block |
||
1129 | 1129 | $field_icon = ''; |
1130 | 1130 | } |
1131 | 1131 | |
1132 | - $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1132 | + $html .= '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
1133 | 1133 | $seperator = ''; |
1134 | 1134 | if ($post->{$cf['htmlvar_name']}) { |
1135 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
1135 | + $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>'; |
|
1136 | 1136 | $seperator = ' | '; |
1137 | 1137 | } |
1138 | 1138 | |
1139 | 1139 | if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
1140 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
1140 | + $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>'; |
|
1141 | 1141 | } |
1142 | 1142 | |
1143 | 1143 | $html .= '</span></div>'; |
1144 | 1144 | |
1145 | 1145 | |
1146 | 1146 | if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
1147 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
1147 | + $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>'; |
|
1148 | 1148 | } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
1149 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
1149 | + $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>'; |
|
1150 | 1150 | } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
1151 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
1151 | + $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>'; |
|
1152 | 1152 | } |
1153 | 1153 | |
1154 | 1154 | /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
@@ -1168,11 +1168,11 @@ discard block |
||
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 | |
1171 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1172 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1171 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
1172 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1173 | 1173 | $html .= '</span><span class="geodir-email-address-output">'; |
1174 | 1174 | $email = $post->{$cf['htmlvar_name']} ; |
1175 | - if($e_split = explode('@',$email)){ |
|
1175 | + if ($e_split = explode('@', $email)) { |
|
1176 | 1176 | /** |
1177 | 1177 | * Filter email custom field name output. |
1178 | 1178 | * |
@@ -1181,10 +1181,10 @@ discard block |
||
1181 | 1181 | * @param string $email The email string being output. |
1182 | 1182 | * @param array $cf Custom field variables array. |
1183 | 1183 | */ |
1184 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
1185 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1186 | - }else{ |
|
1187 | - $html .= $email; |
|
1184 | + $email_name = apply_filters('geodir_email_field_name_output', $email, $cf); |
|
1185 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1186 | + } else { |
|
1187 | + $html .= $email; |
|
1188 | 1188 | } |
1189 | 1189 | $html .= '</span></div>'; |
1190 | 1190 | } |
@@ -1195,7 +1195,7 @@ discard block |
||
1195 | 1195 | |
1196 | 1196 | return $html; |
1197 | 1197 | } |
1198 | -add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3); |
|
1198 | +add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3); |
|
1199 | 1199 | |
1200 | 1200 | |
1201 | 1201 | /** |
@@ -1208,21 +1208,21 @@ discard block |
||
1208 | 1208 | * |
1209 | 1209 | * @return string The html to output for the custom field. |
1210 | 1210 | */ |
1211 | -function geodir_cf_file($html,$location,$cf,$p=''){ |
|
1211 | +function geodir_cf_file($html, $location, $cf, $p = '') { |
|
1212 | 1212 | |
1213 | 1213 | // check we have the post value |
1214 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1215 | - else{ global $post;} |
|
1214 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1215 | + else { global $post; } |
|
1216 | 1216 | |
1217 | - if(!is_array($cf) && $cf!=''){ |
|
1217 | + if (!is_array($cf) && $cf != '') { |
|
1218 | 1218 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1219 | - if(!$cf){return NULL;} |
|
1219 | + if (!$cf) {return NULL; } |
|
1220 | 1220 | } |
1221 | 1221 | |
1222 | 1222 | $html_var = $cf['htmlvar_name']; |
1223 | 1223 | |
1224 | 1224 | // Check if there is a location specific filter. |
1225 | - if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
1225 | + if (has_filter("geodir_custom_field_output_file_loc_{$location}")) { |
|
1226 | 1226 | /** |
1227 | 1227 | * Filter the file html by location. |
1228 | 1228 | * |
@@ -1230,11 +1230,11 @@ discard block |
||
1230 | 1230 | * @param array $cf The custom field array. |
1231 | 1231 | * @since 1.6.6 |
1232 | 1232 | */ |
1233 | - $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
1233 | + $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf); |
|
1234 | 1234 | } |
1235 | 1235 | |
1236 | 1236 | // Check if there is a custom field specific filter. |
1237 | - if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
1237 | + if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) { |
|
1238 | 1238 | /** |
1239 | 1239 | * Filter the file html by individual custom field. |
1240 | 1240 | * |
@@ -1243,11 +1243,11 @@ discard block |
||
1243 | 1243 | * @param array $cf The custom field array. |
1244 | 1244 | * @since 1.6.6 |
1245 | 1245 | */ |
1246 | - $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
1246 | + $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf); |
|
1247 | 1247 | } |
1248 | 1248 | |
1249 | 1249 | // Check if there is a custom field key specific filter. |
1250 | - if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
1250 | + if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) { |
|
1251 | 1251 | /** |
1252 | 1252 | * Filter the file html by field type key. |
1253 | 1253 | * |
@@ -1256,11 +1256,11 @@ discard block |
||
1256 | 1256 | * @param array $cf The custom field array. |
1257 | 1257 | * @since 1.6.6 |
1258 | 1258 | */ |
1259 | - $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1259 | + $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1260 | 1260 | } |
1261 | 1261 | |
1262 | 1262 | // If not html then we run the standard output. |
1263 | - if(empty($html)){ |
|
1263 | + if (empty($html)) { |
|
1264 | 1264 | |
1265 | 1265 | if (!empty($post->{$cf['htmlvar_name']})): |
1266 | 1266 | |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | if (!empty($files)): |
1269 | 1269 | |
1270 | 1270 | $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL; |
1271 | - $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'] : ''; |
|
1271 | + $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'] : ''; |
|
1272 | 1272 | |
1273 | 1273 | $file_paths = ''; |
1274 | 1274 | foreach ($files as $file) { |
@@ -1305,9 +1305,9 @@ discard block |
||
1305 | 1305 | //$file_paths .= '<img src="'.$file.'" />'; |
1306 | 1306 | $file_paths .= '</div>'; |
1307 | 1307 | } else { |
1308 | - $ext_path = '_' . $html_var . '_'; |
|
1308 | + $ext_path = '_'.$html_var.'_'; |
|
1309 | 1309 | $filename = explode($ext_path, $filename); |
1310 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
1310 | + $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>'; |
|
1311 | 1311 | } |
1312 | 1312 | } |
1313 | 1313 | } |
@@ -1322,11 +1322,11 @@ discard block |
||
1322 | 1322 | $field_icon = ''; |
1323 | 1323 | } |
1324 | 1324 | |
1325 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1325 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
1326 | 1326 | $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
1327 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1327 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1328 | 1328 | $html .= '</span>'; |
1329 | - $html .= $file_paths . '</div></div>'; |
|
1329 | + $html .= $file_paths.'</div></div>'; |
|
1330 | 1330 | |
1331 | 1331 | endif; |
1332 | 1332 | endif; |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | |
1336 | 1336 | return $html; |
1337 | 1337 | } |
1338 | -add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3); |
|
1338 | +add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3); |
|
1339 | 1339 | |
1340 | 1340 | |
1341 | 1341 | |
@@ -1349,21 +1349,21 @@ discard block |
||
1349 | 1349 | * |
1350 | 1350 | * @return string The html to output for the custom field. |
1351 | 1351 | */ |
1352 | -function geodir_cf_textarea($html,$location,$cf,$p=''){ |
|
1352 | +function geodir_cf_textarea($html, $location, $cf, $p = '') { |
|
1353 | 1353 | |
1354 | 1354 | // check we have the post value |
1355 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1356 | - else{ global $post;} |
|
1355 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1356 | + else { global $post; } |
|
1357 | 1357 | |
1358 | - if(!is_array($cf) && $cf!=''){ |
|
1358 | + if (!is_array($cf) && $cf != '') { |
|
1359 | 1359 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1360 | - if(!$cf){return NULL;} |
|
1360 | + if (!$cf) {return NULL; } |
|
1361 | 1361 | } |
1362 | 1362 | |
1363 | 1363 | $html_var = $cf['htmlvar_name']; |
1364 | 1364 | |
1365 | 1365 | // Check if there is a location specific filter. |
1366 | - if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
1366 | + if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) { |
|
1367 | 1367 | /** |
1368 | 1368 | * Filter the textarea html by location. |
1369 | 1369 | * |
@@ -1371,11 +1371,11 @@ discard block |
||
1371 | 1371 | * @param array $cf The custom field array. |
1372 | 1372 | * @since 1.6.6 |
1373 | 1373 | */ |
1374 | - $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
1374 | + $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf); |
|
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | // Check if there is a custom field specific filter. |
1378 | - if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
1378 | + if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) { |
|
1379 | 1379 | /** |
1380 | 1380 | * Filter the textarea html by individual custom field. |
1381 | 1381 | * |
@@ -1384,11 +1384,11 @@ discard block |
||
1384 | 1384 | * @param array $cf The custom field array. |
1385 | 1385 | * @since 1.6.6 |
1386 | 1386 | */ |
1387 | - $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
1387 | + $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf); |
|
1388 | 1388 | } |
1389 | 1389 | |
1390 | 1390 | // Check if there is a custom field key specific filter. |
1391 | - if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
1391 | + if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) { |
|
1392 | 1392 | /** |
1393 | 1393 | * Filter the textarea html by field type key. |
1394 | 1394 | * |
@@ -1397,11 +1397,11 @@ discard block |
||
1397 | 1397 | * @param array $cf The custom field array. |
1398 | 1398 | * @since 1.6.6 |
1399 | 1399 | */ |
1400 | - $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1400 | + $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1401 | 1401 | } |
1402 | 1402 | |
1403 | 1403 | // If not html then we run the standard output. |
1404 | - if(empty($html)){ |
|
1404 | + if (empty($html)) { |
|
1405 | 1405 | |
1406 | 1406 | if (!empty($post->{$cf['htmlvar_name']})) { |
1407 | 1407 | |
@@ -1416,9 +1416,9 @@ discard block |
||
1416 | 1416 | } |
1417 | 1417 | |
1418 | 1418 | |
1419 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1420 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1421 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1419 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
1420 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1421 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
1422 | 1422 | |
1423 | 1423 | } |
1424 | 1424 | |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | |
1427 | 1427 | return $html; |
1428 | 1428 | } |
1429 | -add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3); |
|
1429 | +add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3); |
|
1430 | 1430 | |
1431 | 1431 | |
1432 | 1432 | |
@@ -1440,21 +1440,21 @@ discard block |
||
1440 | 1440 | * |
1441 | 1441 | * @return string The html to output for the custom field. |
1442 | 1442 | */ |
1443 | -function geodir_cf_html($html,$location,$cf,$p=''){ |
|
1443 | +function geodir_cf_html($html, $location, $cf, $p = '') { |
|
1444 | 1444 | |
1445 | 1445 | // check we have the post value |
1446 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1447 | - else{ global $post;} |
|
1446 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1447 | + else { global $post; } |
|
1448 | 1448 | |
1449 | - if(!is_array($cf) && $cf!=''){ |
|
1449 | + if (!is_array($cf) && $cf != '') { |
|
1450 | 1450 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1451 | - if(!$cf){return NULL;} |
|
1451 | + if (!$cf) {return NULL; } |
|
1452 | 1452 | } |
1453 | 1453 | |
1454 | 1454 | $html_var = $cf['htmlvar_name']; |
1455 | 1455 | |
1456 | 1456 | // Check if there is a location specific filter. |
1457 | - if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
1457 | + if (has_filter("geodir_custom_field_output_html_loc_{$location}")) { |
|
1458 | 1458 | /** |
1459 | 1459 | * Filter the html html by location. |
1460 | 1460 | * |
@@ -1462,11 +1462,11 @@ discard block |
||
1462 | 1462 | * @param array $cf The custom field array. |
1463 | 1463 | * @since 1.6.6 |
1464 | 1464 | */ |
1465 | - $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
1465 | + $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf); |
|
1466 | 1466 | } |
1467 | 1467 | |
1468 | 1468 | // Check if there is a custom field specific filter. |
1469 | - if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
1469 | + if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) { |
|
1470 | 1470 | /** |
1471 | 1471 | * Filter the html html by individual custom field. |
1472 | 1472 | * |
@@ -1475,11 +1475,11 @@ discard block |
||
1475 | 1475 | * @param array $cf The custom field array. |
1476 | 1476 | * @since 1.6.6 |
1477 | 1477 | */ |
1478 | - $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
1478 | + $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf); |
|
1479 | 1479 | } |
1480 | 1480 | |
1481 | 1481 | // Check if there is a custom field key specific filter. |
1482 | - if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
1482 | + if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) { |
|
1483 | 1483 | /** |
1484 | 1484 | * Filter the html html by field type key. |
1485 | 1485 | * |
@@ -1488,11 +1488,11 @@ discard block |
||
1488 | 1488 | * @param array $cf The custom field array. |
1489 | 1489 | * @since 1.6.6 |
1490 | 1490 | */ |
1491 | - $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1491 | + $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1492 | 1492 | } |
1493 | 1493 | |
1494 | 1494 | // If not html then we run the standard output. |
1495 | - if(empty($html)){ |
|
1495 | + if (empty($html)) { |
|
1496 | 1496 | |
1497 | 1497 | if (!empty($post->{$cf['htmlvar_name']})) { |
1498 | 1498 | |
@@ -1506,9 +1506,9 @@ discard block |
||
1506 | 1506 | $field_icon = ''; |
1507 | 1507 | } |
1508 | 1508 | |
1509 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1510 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1511 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1509 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
1510 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1511 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
1512 | 1512 | |
1513 | 1513 | } |
1514 | 1514 | |
@@ -1516,7 +1516,7 @@ discard block |
||
1516 | 1516 | |
1517 | 1517 | return $html; |
1518 | 1518 | } |
1519 | -add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3); |
|
1519 | +add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3); |
|
1520 | 1520 | |
1521 | 1521 | |
1522 | 1522 | |
@@ -1530,21 +1530,21 @@ discard block |
||
1530 | 1530 | * |
1531 | 1531 | * @return string The html to output for the custom field. |
1532 | 1532 | */ |
1533 | -function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
|
1533 | +function geodir_cf_taxonomy($html, $location, $cf, $p = '') { |
|
1534 | 1534 | |
1535 | 1535 | // check we have the post value |
1536 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1537 | - else{ global $post;} |
|
1536 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1537 | + else { global $post; } |
|
1538 | 1538 | |
1539 | - if(!is_array($cf) && $cf!=''){ |
|
1539 | + if (!is_array($cf) && $cf != '') { |
|
1540 | 1540 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1541 | - if(!$cf){return NULL;} |
|
1541 | + if (!$cf) {return NULL; } |
|
1542 | 1542 | } |
1543 | 1543 | |
1544 | 1544 | $html_var = $cf['htmlvar_name']; |
1545 | 1545 | |
1546 | 1546 | // Check if there is a location specific filter. |
1547 | - if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
1547 | + if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) { |
|
1548 | 1548 | /** |
1549 | 1549 | * Filter the taxonomy html by location. |
1550 | 1550 | * |
@@ -1552,11 +1552,11 @@ discard block |
||
1552 | 1552 | * @param array $cf The custom field array. |
1553 | 1553 | * @since 1.6.6 |
1554 | 1554 | */ |
1555 | - $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
1555 | + $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf); |
|
1556 | 1556 | } |
1557 | 1557 | |
1558 | 1558 | // Check if there is a custom field specific filter. |
1559 | - if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
1559 | + if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) { |
|
1560 | 1560 | /** |
1561 | 1561 | * Filter the taxonomy html by individual custom field. |
1562 | 1562 | * |
@@ -1565,11 +1565,11 @@ discard block |
||
1565 | 1565 | * @param array $cf The custom field array. |
1566 | 1566 | * @since 1.6.6 |
1567 | 1567 | */ |
1568 | - $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
1568 | + $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf); |
|
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | // Check if there is a custom field key specific filter. |
1572 | - if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
1572 | + if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) { |
|
1573 | 1573 | /** |
1574 | 1574 | * Filter the taxonomy html by field type key. |
1575 | 1575 | * |
@@ -1578,14 +1578,14 @@ discard block |
||
1578 | 1578 | * @param array $cf The custom field array. |
1579 | 1579 | * @since 1.6.6 |
1580 | 1580 | */ |
1581 | - $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1581 | + $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1582 | 1582 | } |
1583 | 1583 | |
1584 | 1584 | // If not html then we run the standard output. |
1585 | - if(empty($html)){ |
|
1585 | + if (empty($html)) { |
|
1586 | 1586 | |
1587 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
1588 | - $post_taxonomy = $post->post_type . 'category'; |
|
1587 | + if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) { |
|
1588 | + $post_taxonomy = $post->post_type.'category'; |
|
1589 | 1589 | $field_value = $post->{$html_var}; |
1590 | 1590 | $links = array(); |
1591 | 1591 | $terms = array(); |
@@ -1603,7 +1603,7 @@ discard block |
||
1603 | 1603 | if ($term != '') { |
1604 | 1604 | $term = get_term_by('id', $term, $html_var); |
1605 | 1605 | if (is_object($term)) { |
1606 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
1606 | + $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>"; |
|
1607 | 1607 | $terms[] = $term; |
1608 | 1608 | } |
1609 | 1609 | } |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | $terms = $termsOrdered; |
1618 | 1618 | } |
1619 | 1619 | } |
1620 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
1620 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : ''; |
|
1621 | 1621 | |
1622 | 1622 | if ($html_value != '') { |
1623 | 1623 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1630,9 +1630,9 @@ discard block |
||
1630 | 1630 | $field_icon = ''; |
1631 | 1631 | } |
1632 | 1632 | |
1633 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
1634 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1635 | - $html .= '</span> ' . $html_value . '</div>'; |
|
1633 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af; |
|
1634 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1635 | + $html .= '</span> '.$html_value.'</div>'; |
|
1636 | 1636 | } |
1637 | 1637 | } |
1638 | 1638 | |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | |
1641 | 1641 | return $html; |
1642 | 1642 | } |
1643 | -add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3); |
|
1643 | +add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3); |
|
1644 | 1644 | |
1645 | 1645 | |
1646 | 1646 | /** |
@@ -1653,21 +1653,21 @@ discard block |
||
1653 | 1653 | * |
1654 | 1654 | * @return string The html to output for the custom field. |
1655 | 1655 | */ |
1656 | -function geodir_cf_address($html,$location,$cf,$p=''){ |
|
1656 | +function geodir_cf_address($html, $location, $cf, $p = '') { |
|
1657 | 1657 | |
1658 | 1658 | // check we have the post value |
1659 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1660 | - else{ global $post;} |
|
1659 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1660 | + else { global $post; } |
|
1661 | 1661 | |
1662 | - if(!is_array($cf) && $cf!=''){ |
|
1662 | + if (!is_array($cf) && $cf != '') { |
|
1663 | 1663 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1664 | - if(!$cf){return NULL;} |
|
1664 | + if (!$cf) {return NULL; } |
|
1665 | 1665 | } |
1666 | 1666 | |
1667 | 1667 | $html_var = $cf['htmlvar_name']; |
1668 | 1668 | |
1669 | 1669 | // Check if there is a location specific filter. |
1670 | - if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
1670 | + if (has_filter("geodir_custom_field_output_address_loc_{$location}")) { |
|
1671 | 1671 | /** |
1672 | 1672 | * Filter the address html by location. |
1673 | 1673 | * |
@@ -1675,11 +1675,11 @@ discard block |
||
1675 | 1675 | * @param array $cf The custom field array. |
1676 | 1676 | * @since 1.6.6 |
1677 | 1677 | */ |
1678 | - $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
1678 | + $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf); |
|
1679 | 1679 | } |
1680 | 1680 | |
1681 | 1681 | // Check if there is a custom field specific filter. |
1682 | - if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
1682 | + if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) { |
|
1683 | 1683 | /** |
1684 | 1684 | * Filter the address html by individual custom field. |
1685 | 1685 | * |
@@ -1688,11 +1688,11 @@ discard block |
||
1688 | 1688 | * @param array $cf The custom field array. |
1689 | 1689 | * @since 1.6.6 |
1690 | 1690 | */ |
1691 | - $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
1691 | + $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf); |
|
1692 | 1692 | } |
1693 | 1693 | |
1694 | 1694 | // Check if there is a custom field key specific filter. |
1695 | - if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
1695 | + if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) { |
|
1696 | 1696 | /** |
1697 | 1697 | * Filter the address html by field type key. |
1698 | 1698 | * |
@@ -1701,14 +1701,14 @@ discard block |
||
1701 | 1701 | * @param array $cf The custom field array. |
1702 | 1702 | * @since 1.6.6 |
1703 | 1703 | */ |
1704 | - $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1704 | + $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1705 | 1705 | } |
1706 | 1706 | |
1707 | 1707 | // If not html then we run the standard output. |
1708 | - if(empty($html)){ |
|
1708 | + if (empty($html)) { |
|
1709 | 1709 | |
1710 | 1710 | global $preview; |
1711 | - $html_var = $cf['htmlvar_name'] . '_address'; |
|
1711 | + $html_var = $cf['htmlvar_name'].'_address'; |
|
1712 | 1712 | |
1713 | 1713 | if ($cf['extra_fields']) { |
1714 | 1714 | |
@@ -1771,10 +1771,10 @@ discard block |
||
1771 | 1771 | |
1772 | 1772 | if ($post->{$html_var}) { |
1773 | 1773 | |
1774 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
1775 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
1774 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1775 | + if (strpos($field_icon, 'http') !== false) { |
|
1776 | 1776 | $field_icon_af = ''; |
1777 | - } elseif ( $field_icon == '' ) { |
|
1777 | + } elseif ($field_icon == '') { |
|
1778 | 1778 | $field_icon_af = '<i class="fa fa-home"></i>'; |
1779 | 1779 | } else { |
1780 | 1780 | $field_icon_af = $field_icon; |
@@ -1783,26 +1783,26 @@ discard block |
||
1783 | 1783 | |
1784 | 1784 | |
1785 | 1785 | |
1786 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1787 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
1788 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
1786 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1787 | + $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af; |
|
1788 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
1789 | 1789 | $html .= '</span>'; |
1790 | 1790 | |
1791 | 1791 | |
1792 | - if ( $post->post_address ) { |
|
1793 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
1792 | + if ($post->post_address) { |
|
1793 | + $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>'; |
|
1794 | 1794 | } |
1795 | - if ($show_city_in_address && $post->post_city ) { |
|
1796 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
1795 | + if ($show_city_in_address && $post->post_city) { |
|
1796 | + $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>'; |
|
1797 | 1797 | } |
1798 | - if ($show_region_in_address && $post->post_region ) { |
|
1799 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
1798 | + if ($show_region_in_address && $post->post_region) { |
|
1799 | + $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>'; |
|
1800 | 1800 | } |
1801 | - if ($show_zip_in_address && $post->post_zip ) { |
|
1802 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
1801 | + if ($show_zip_in_address && $post->post_zip) { |
|
1802 | + $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>'; |
|
1803 | 1803 | } |
1804 | - if ($show_country_in_address && $post->post_country ) { |
|
1805 | - $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
1804 | + if ($show_country_in_address && $post->post_country) { |
|
1805 | + $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>'; |
|
1806 | 1806 | } |
1807 | 1807 | $html .= '</div>'; |
1808 | 1808 | |
@@ -1813,4 +1813,4 @@ discard block |
||
1813 | 1813 | |
1814 | 1814 | return $html; |
1815 | 1815 | } |
1816 | -add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3); |
|
1817 | 1816 | \ No newline at end of file |
1817 | +add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3); |
|
1818 | 1818 | \ No newline at end of file |