@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | |
15 | 15 | |
16 | 16 | if (function_exists('geodir_location_geo_home_link')) { |
17 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
17 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
18 | 18 | } |
19 | 19 | $search_url = trailingslashit(get_home_url()); |
20 | 20 | if (function_exists('geodir_location_geo_home_link')) { |
21 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
21 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
25 | 25 | $new_style = get_option('geodir_show_search_old_search_from') ? false : true; |
26 | 26 | $form_class = 'geodir-listing-search'; |
27 | 27 | if($new_style){ |
28 | - $form_class .= ' gd-search-bar-style'; |
|
28 | + $form_class .= ' gd-search-bar-style'; |
|
29 | 29 | } |
30 | 30 | ?> |
31 | 31 | |
@@ -44,56 +44,56 @@ discard block |
||
44 | 44 | <div class="geodir-loc-bar"> |
45 | 45 | |
46 | 46 | <?php |
47 | - /** |
|
48 | - * Called inside the search form but before any of the fields. |
|
49 | - * |
|
50 | - * @since 1.0.0 |
|
51 | - */ |
|
52 | - do_action('geodir_before_search_form') ?> |
|
47 | + /** |
|
48 | + * Called inside the search form but before any of the fields. |
|
49 | + * |
|
50 | + * @since 1.0.0 |
|
51 | + */ |
|
52 | + do_action('geodir_before_search_form') ?> |
|
53 | 53 | |
54 | 54 | <div class="clearfix geodir-loc-bar-in"> |
55 | 55 | <div class="geodir-search"> |
56 | 56 | |
57 | 57 | <?php |
58 | 58 | |
59 | - /** |
|
60 | - * Adds the input fields to the search form. |
|
61 | - * |
|
62 | - * @since 1.6.9 |
|
63 | - */ |
|
64 | - do_action('geodir_search_form_inputs'); |
|
59 | + /** |
|
60 | + * Adds the input fields to the search form. |
|
61 | + * |
|
62 | + * @since 1.6.9 |
|
63 | + */ |
|
64 | + do_action('geodir_search_form_inputs'); |
|
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | - /** |
|
69 | - * Called on the GD search form just before the search button. |
|
70 | - * |
|
71 | - * @since 1.0.0 |
|
72 | - */ |
|
73 | - do_action('geodir_before_search_button'); |
|
68 | + /** |
|
69 | + * Called on the GD search form just before the search button. |
|
70 | + * |
|
71 | + * @since 1.0.0 |
|
72 | + */ |
|
73 | + do_action('geodir_before_search_button'); |
|
74 | 74 | |
75 | 75 | |
76 | - /** |
|
77 | - * Called on the GD search form just after the search button. |
|
78 | - * |
|
79 | - * @since 1.0.0 |
|
80 | - */ |
|
81 | - do_action('geodir_after_search_button'); |
|
76 | + /** |
|
77 | + * Called on the GD search form just after the search button. |
|
78 | + * |
|
79 | + * @since 1.0.0 |
|
80 | + */ |
|
81 | + do_action('geodir_after_search_button'); |
|
82 | 82 | |
83 | 83 | |
84 | - ?> |
|
84 | + ?> |
|
85 | 85 | </div> |
86 | 86 | |
87 | 87 | |
88 | 88 | </div> |
89 | 89 | |
90 | 90 | <?php |
91 | - /** |
|
92 | - * Called inside the search form but after all the input fields. |
|
93 | - * |
|
94 | - * @since 1.0.0 |
|
95 | - */ |
|
96 | - do_action('geodir_after_search_form') ?> |
|
91 | + /** |
|
92 | + * Called inside the search form but after all the input fields. |
|
93 | + * |
|
94 | + * @since 1.0.0 |
|
95 | + */ |
|
96 | + do_action('geodir_after_search_form') ?> |
|
97 | 97 | |
98 | 98 | |
99 | 99 | </div> |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | $new_style = get_option('geodir_show_search_old_search_from') ? false : true; |
26 | 26 | $form_class = 'geodir-listing-search'; |
27 | -if($new_style){ |
|
27 | +if ($new_style) { |
|
28 | 28 | $form_class .= ' gd-search-bar-style'; |
29 | 29 | } |
30 | 30 | ?> |
@@ -19,8 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | if (!isset($field_info->post_type)) { |
21 | 21 | $post_type = sanitize_text_field($_REQUEST['listing_type']); |
22 | -} else |
|
23 | - $post_type = $field_info->post_type; |
|
22 | +} else { |
|
23 | + $post_type = $field_info->post_type; |
|
24 | +} |
|
24 | 25 | |
25 | 26 | //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){ |
26 | 27 | // $cf_arr = geodir_custom_fields_predefined($post_type); |
@@ -43,8 +44,9 @@ discard block |
||
43 | 44 | $nonce = wp_create_nonce('custom_fields_' . $result_str); |
44 | 45 | |
45 | 46 | $field_admin_title = ''; |
46 | -if (isset($field_info->admin_title)) |
|
47 | - $field_admin_title = $field_info->admin_title; |
|
47 | +if (isset($field_info->admin_title)) { |
|
48 | + $field_admin_title = $field_info->admin_title; |
|
49 | +} |
|
48 | 50 | |
49 | 51 | $default = isset($field_info->is_admin) ? $field_info->is_admin : ''; |
50 | 52 | |
@@ -65,15 +67,15 @@ discard block |
||
65 | 67 | |
66 | 68 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) { |
67 | 69 | $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
68 | -}elseif(isset($cf['icon']) && $cf['icon']){ |
|
70 | +} elseif(isset($cf['icon']) && $cf['icon']){ |
|
69 | 71 | $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>'; |
70 | -}else{ |
|
72 | +} else{ |
|
71 | 73 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
72 | 74 | } |
73 | 75 | |
74 | 76 | if(isset($cf['name']) && $cf['name']){ |
75 | 77 | $field_type_name = $cf['name']; |
76 | -}else{ |
|
78 | +} else{ |
|
77 | 79 | $field_type_name = $field_type; |
78 | 80 | } |
79 | 81 | |
@@ -89,8 +91,11 @@ discard block |
||
89 | 91 | |
90 | 92 | <?php if ($default): ?> |
91 | 93 | <div title="<?php _e('Default field, should not be removed.', 'geodirectory'); ?>" class="handlediv move gd-default-remove"><i class="fa fa-times" aria-hidden="true"></i></div> |
92 | - <?php else: ?> |
|
93 | - <div title="<?php _e('Click to remove field', 'geodirectory'); ?>" |
|
94 | + <?php else { |
|
95 | + : ?> |
|
96 | + <div title="<?php _e('Click to remove field', 'geodirectory'); |
|
97 | +} |
|
98 | +?>" |
|
94 | 99 | onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')" |
95 | 100 | class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div> |
96 | 101 | <?php endif; |
@@ -141,11 +146,11 @@ discard block |
||
141 | 146 | |
142 | 147 | echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
143 | 148 | |
144 | - }else{ |
|
149 | + } else{ |
|
145 | 150 | $value = ''; |
146 | 151 | if (isset($field_info->data_type)) { |
147 | 152 | $value = esc_attr($field_info->data_type); |
148 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
153 | + } elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
149 | 154 | $value = $cf['defaults']['data_type']; |
150 | 155 | } |
151 | 156 | ?> |
@@ -159,11 +164,11 @@ discard block |
||
159 | 164 | |
160 | 165 | echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
161 | 166 | |
162 | - }else{ |
|
167 | + } else{ |
|
163 | 168 | $value = ''; |
164 | 169 | if (isset($field_info->admin_title)) { |
165 | 170 | $value = esc_attr($field_info->admin_title); |
166 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
171 | + } elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
167 | 172 | $value = $cf['defaults']['admin_title']; |
168 | 173 | } |
169 | 174 | ?> |
@@ -188,11 +193,11 @@ discard block |
||
188 | 193 | |
189 | 194 | echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
190 | 195 | |
191 | - }else{ |
|
196 | + } else{ |
|
192 | 197 | $value = ''; |
193 | 198 | if (isset($field_info->site_title)) { |
194 | 199 | $value = esc_attr($field_info->site_title); |
195 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
200 | + } elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
196 | 201 | $value = $cf['defaults']['site_title']; |
197 | 202 | } |
198 | 203 | ?> |
@@ -216,11 +221,11 @@ discard block |
||
216 | 221 | |
217 | 222 | echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
218 | 223 | |
219 | - }else{ |
|
224 | + } else{ |
|
220 | 225 | $value = ''; |
221 | 226 | if (isset($field_info->admin_desc)) { |
222 | 227 | $value = esc_attr($field_info->admin_desc); |
223 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
228 | + } elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
224 | 229 | $value = $cf['defaults']['admin_desc']; |
225 | 230 | } |
226 | 231 | ?> |
@@ -244,11 +249,11 @@ discard block |
||
244 | 249 | |
245 | 250 | echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
246 | 251 | |
247 | - }else{ |
|
252 | + } else{ |
|
248 | 253 | $value = ''; |
249 | 254 | if (isset($field_info->htmlvar_name)) { |
250 | 255 | $value = esc_attr($field_info->htmlvar_name); |
251 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
256 | + } elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
252 | 257 | $value = $cf['defaults']['htmlvar_name']; |
253 | 258 | } |
254 | 259 | ?> |
@@ -276,11 +281,11 @@ discard block |
||
276 | 281 | |
277 | 282 | echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
278 | 283 | |
279 | - }else{ |
|
284 | + } else{ |
|
280 | 285 | $value = ''; |
281 | 286 | if (isset($field_info->is_active)) { |
282 | 287 | $value = esc_attr($field_info->is_active); |
283 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
288 | + } elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
284 | 289 | $value = $cf['defaults']['is_active']; |
285 | 290 | } |
286 | 291 | ?> |
@@ -315,11 +320,11 @@ discard block |
||
315 | 320 | |
316 | 321 | echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
317 | 322 | |
318 | - }else{ |
|
323 | + } else{ |
|
319 | 324 | $value = ''; |
320 | 325 | if (isset($field_info->for_admin_use)) { |
321 | 326 | $value = esc_attr($field_info->for_admin_use); |
322 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
327 | + } elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
323 | 328 | $value = $cf['defaults']['for_admin_use']; |
324 | 329 | } |
325 | 330 | ?> |
@@ -354,11 +359,11 @@ discard block |
||
354 | 359 | |
355 | 360 | echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
356 | 361 | |
357 | - }else{ |
|
362 | + } else{ |
|
358 | 363 | $value = ''; |
359 | 364 | if (isset($field_info->default_value)) { |
360 | 365 | $value = esc_attr($field_info->default_value); |
361 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
366 | + } elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
362 | 367 | $value = $cf['defaults']['default_value']; |
363 | 368 | } |
364 | 369 | ?> |
@@ -398,11 +403,11 @@ discard block |
||
398 | 403 | |
399 | 404 | echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
400 | 405 | |
401 | - }else{ |
|
406 | + } else{ |
|
402 | 407 | $value = ''; |
403 | 408 | if (isset($field_info->show_in)) { |
404 | 409 | $value = esc_attr($field_info->show_in); |
405 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
410 | + } elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
406 | 411 | $value = esc_attr($cf['defaults']['show_in']); |
407 | 412 | } |
408 | 413 | ?> |
@@ -443,7 +448,7 @@ discard block |
||
443 | 448 | // don't show new tab option for some types |
444 | 449 | |
445 | 450 | if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) { |
446 | - }else{ |
|
451 | + } else{ |
|
447 | 452 | unset($show_in_locations['[owntab]']); |
448 | 453 | } |
449 | 454 | |
@@ -556,11 +561,11 @@ discard block |
||
556 | 561 | |
557 | 562 | echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
558 | 563 | |
559 | - }else{ |
|
564 | + } else{ |
|
560 | 565 | $value = ''; |
561 | 566 | if (isset($field_info->is_required)) { |
562 | 567 | $value = esc_attr($field_info->is_required); |
563 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
568 | + } elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
564 | 569 | $value = $cf['defaults']['is_required']; |
565 | 570 | } |
566 | 571 | ?> |
@@ -597,11 +602,11 @@ discard block |
||
597 | 602 | |
598 | 603 | echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
599 | 604 | |
600 | - }else{ |
|
605 | + } else{ |
|
601 | 606 | $value = ''; |
602 | 607 | if (isset($field_info->required_msg)) { |
603 | 608 | $value = esc_attr($field_info->required_msg); |
604 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
609 | + } elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
605 | 610 | $value = $cf['defaults']['required_msg']; |
606 | 611 | } |
607 | 612 | ?> |
@@ -642,11 +647,11 @@ discard block |
||
642 | 647 | |
643 | 648 | echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
644 | 649 | |
645 | - }else{ |
|
650 | + } else{ |
|
646 | 651 | $value = ''; |
647 | 652 | if (isset($field_info->field_icon)) { |
648 | 653 | $value = esc_attr($field_info->field_icon); |
649 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
654 | + } elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
650 | 655 | $value = $cf['defaults']['field_icon']; |
651 | 656 | } |
652 | 657 | ?> |
@@ -675,11 +680,11 @@ discard block |
||
675 | 680 | |
676 | 681 | echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
677 | 682 | |
678 | - }else{ |
|
683 | + } else{ |
|
679 | 684 | $value = ''; |
680 | 685 | if (isset($field_info->css_class)) { |
681 | 686 | $value = esc_attr($field_info->css_class); |
682 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
687 | + } elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
683 | 688 | $value = $cf['defaults']['css_class']; |
684 | 689 | } |
685 | 690 | ?> |
@@ -708,12 +713,12 @@ discard block |
||
708 | 713 | |
709 | 714 | echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
710 | 715 | |
711 | - }else{ |
|
716 | + } else{ |
|
712 | 717 | $value = ''; |
713 | 718 | $hide_cat_sort =''; |
714 | 719 | if (isset($field_info->cat_sort)) { |
715 | 720 | $value = esc_attr($field_info->cat_sort); |
716 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
721 | + } elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
717 | 722 | $value = $cf['defaults']['cat_sort']; |
718 | 723 | $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
719 | 724 | } |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | global $post_type; |
19 | 19 | |
20 | 20 | if (!isset($field_info->post_type)) { |
21 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
21 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
22 | 22 | } else |
23 | - $post_type = $field_info->post_type; |
|
23 | + $post_type = $field_info->post_type; |
|
24 | 24 | |
25 | 25 | //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){ |
26 | 26 | // $cf_arr = geodir_custom_fields_predefined($post_type); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $field_admin_title = ''; |
50 | 50 | if (isset($field_info->admin_title)) |
51 | - $field_admin_title = $field_info->admin_title; |
|
51 | + $field_admin_title = $field_info->admin_title; |
|
52 | 52 | |
53 | 53 | $default = isset($field_info->is_admin) ? $field_info->is_admin : ''; |
54 | 54 | |
@@ -68,17 +68,17 @@ discard block |
||
68 | 68 | //print_r($field_info); |
69 | 69 | |
70 | 70 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) { |
71 | - $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
|
71 | + $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
|
72 | 72 | }elseif(isset($cf['icon']) && $cf['icon']){ |
73 | - $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>'; |
|
73 | + $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>'; |
|
74 | 74 | }else{ |
75 | - $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
75 | + $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if(isset($cf['name']) && $cf['name']){ |
79 | - $field_type_name = $cf['name']; |
|
79 | + $field_type_name = $cf['name']; |
|
80 | 80 | }else{ |
81 | - $field_type_name = $field_type; |
|
81 | + $field_type_name = $field_type; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | ?> |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | ondblclick="show_hide('field_frm<?php echo $result_str; ?>')"> |
89 | 89 | <?php |
90 | 90 | |
91 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
92 | - ?> |
|
91 | + $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
92 | + ?> |
|
93 | 93 | |
94 | 94 | <?php if ($default): ?> |
95 | 95 | <div title="<?php _e('Default field, should not be removed.', 'geodirectory'); ?>" class="handlediv move gd-default-remove"><i class="fa fa-times" aria-hidden="true"></i></div> |
@@ -98,37 +98,37 @@ discard block |
||
98 | 98 | onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')" |
99 | 99 | class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div> |
100 | 100 | <?php endif; |
101 | - if ($field_type == 'fieldset') { |
|
102 | - ?> |
|
101 | + if ($field_type == 'fieldset') { |
|
102 | + ?> |
|
103 | 103 | <i class="fa fa-long-arrow-left " aria-hidden="true"></i> |
104 | 104 | <i class="fa fa-long-arrow-right " aria-hidden="true"></i> |
105 | 105 | <b style="cursor:pointer;" |
106 | 106 | onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b> |
107 | 107 | <?php |
108 | - } else {echo $field_icon; |
|
109 | - ?> |
|
108 | + } else {echo $field_icon; |
|
109 | + ?> |
|
110 | 110 | <b style="cursor:pointer;" |
111 | 111 | onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b> |
112 | 112 | <?php |
113 | - } |
|
114 | - ?> |
|
113 | + } |
|
114 | + ?> |
|
115 | 115 | </div> |
116 | 116 | |
117 | 117 | <form><!-- we need to wrap in a fom so we can use radio buttons with same name --> |
118 | 118 | <div id="field_frm<?php echo $result_str; ?>" class="field_frm" |
119 | 119 | style="display:<?php if ($field_ins_upd == 'submit') { |
120 | - echo 'block;'; |
|
121 | - } else { |
|
122 | - echo 'none;'; |
|
123 | - } ?>"> |
|
120 | + echo 'block;'; |
|
121 | + } else { |
|
122 | + echo 'none;'; |
|
123 | + } ?>"> |
|
124 | 124 | <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/> |
125 | 125 | <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/> |
126 | 126 | <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/> |
127 | 127 | <input type="hidden" name="field_type_key" id="field_type_key" value="<?php echo $field_type_key; ?>"/> |
128 | 128 | <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/> |
129 | 129 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) { |
130 | - echo $field_info->data_type; |
|
131 | - } ?>"/> |
|
130 | + echo $field_info->data_type; |
|
131 | + } ?>"/> |
|
132 | 132 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
133 | 133 | |
134 | 134 | <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
@@ -140,37 +140,37 @@ discard block |
||
140 | 140 | |
141 | 141 | <?php |
142 | 142 | |
143 | - // data_type |
|
144 | - if(has_filter("geodir_cfa_data_type_{$field_type}")){ |
|
143 | + // data_type |
|
144 | + if(has_filter("geodir_cfa_data_type_{$field_type}")){ |
|
145 | 145 | |
146 | - echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
|
146 | + echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
|
147 | 147 | |
148 | - }else{ |
|
149 | - $value = ''; |
|
150 | - if (isset($field_info->data_type)) { |
|
151 | - $value = esc_attr($field_info->data_type); |
|
152 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
153 | - $value = $cf['defaults']['data_type']; |
|
154 | - } |
|
155 | - ?> |
|
148 | + }else{ |
|
149 | + $value = ''; |
|
150 | + if (isset($field_info->data_type)) { |
|
151 | + $value = esc_attr($field_info->data_type); |
|
152 | + }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
153 | + $value = $cf['defaults']['data_type']; |
|
154 | + } |
|
155 | + ?> |
|
156 | 156 | <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/> |
157 | 157 | <?php |
158 | - } |
|
158 | + } |
|
159 | 159 | |
160 | 160 | |
161 | - // admin_title |
|
162 | - if(has_filter("geodir_cfa_admin_title_{$field_type}")){ |
|
161 | + // admin_title |
|
162 | + if(has_filter("geodir_cfa_admin_title_{$field_type}")){ |
|
163 | 163 | |
164 | - echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
164 | + echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
165 | 165 | |
166 | - }else{ |
|
167 | - $value = ''; |
|
168 | - if (isset($field_info->admin_title)) { |
|
169 | - $value = esc_attr($field_info->admin_title); |
|
170 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
171 | - $value = $cf['defaults']['admin_title']; |
|
172 | - } |
|
173 | - ?> |
|
166 | + }else{ |
|
167 | + $value = ''; |
|
168 | + if (isset($field_info->admin_title)) { |
|
169 | + $value = esc_attr($field_info->admin_title); |
|
170 | + }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
171 | + $value = $cf['defaults']['admin_title']; |
|
172 | + } |
|
173 | + ?> |
|
174 | 174 | <li> |
175 | 175 | <label for="admin_title" class="gd-cf-tooltip-wrap"> |
176 | 176 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Admin title :', 'geodirectory'); ?> |
@@ -184,22 +184,22 @@ discard block |
||
184 | 184 | </div> |
185 | 185 | </li> |
186 | 186 | <?php |
187 | - } |
|
187 | + } |
|
188 | 188 | |
189 | 189 | |
190 | - // site_title |
|
191 | - if(has_filter("geodir_cfa_site_title_{$field_type}")){ |
|
190 | + // site_title |
|
191 | + if(has_filter("geodir_cfa_site_title_{$field_type}")){ |
|
192 | 192 | |
193 | - echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
193 | + echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
194 | 194 | |
195 | - }else{ |
|
196 | - $value = ''; |
|
197 | - if (isset($field_info->site_title)) { |
|
198 | - $value = esc_attr($field_info->site_title); |
|
199 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
200 | - $value = $cf['defaults']['site_title']; |
|
201 | - } |
|
202 | - ?> |
|
195 | + }else{ |
|
196 | + $value = ''; |
|
197 | + if (isset($field_info->site_title)) { |
|
198 | + $value = esc_attr($field_info->site_title); |
|
199 | + }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
200 | + $value = $cf['defaults']['site_title']; |
|
201 | + } |
|
202 | + ?> |
|
203 | 203 | <li> |
204 | 204 | <label for="site_title" class="gd-cf-tooltip-wrap"> <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend title :', 'geodirectory'); ?> |
205 | 205 | <div class="gdcf-tooltip"> |
@@ -212,22 +212,22 @@ discard block |
||
212 | 212 | </div> |
213 | 213 | </li> |
214 | 214 | <?php |
215 | - } |
|
215 | + } |
|
216 | 216 | |
217 | 217 | |
218 | - // admin_desc |
|
219 | - if(has_filter("geodir_cfa_admin_desc_{$field_type}")){ |
|
218 | + // admin_desc |
|
219 | + if(has_filter("geodir_cfa_admin_desc_{$field_type}")){ |
|
220 | 220 | |
221 | - echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
|
221 | + echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
|
222 | 222 | |
223 | - }else{ |
|
224 | - $value = ''; |
|
225 | - if (isset($field_info->admin_desc)) { |
|
226 | - $value = esc_attr($field_info->admin_desc); |
|
227 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
228 | - $value = $cf['defaults']['admin_desc']; |
|
229 | - } |
|
230 | - ?> |
|
223 | + }else{ |
|
224 | + $value = ''; |
|
225 | + if (isset($field_info->admin_desc)) { |
|
226 | + $value = esc_attr($field_info->admin_desc); |
|
227 | + }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
228 | + $value = $cf['defaults']['admin_desc']; |
|
229 | + } |
|
230 | + ?> |
|
231 | 231 | <li> |
232 | 232 | <label for="admin_desc" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend description :', 'geodirectory'); ?> |
233 | 233 | <div class="gdcf-tooltip"> |
@@ -239,23 +239,23 @@ discard block |
||
239 | 239 | </div> |
240 | 240 | </li> |
241 | 241 | <?php |
242 | - } |
|
242 | + } |
|
243 | 243 | |
244 | 244 | |
245 | 245 | |
246 | - // htmlvar_name |
|
247 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
246 | + // htmlvar_name |
|
247 | + if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
248 | 248 | |
249 | - echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
249 | + echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
250 | 250 | |
251 | - }else{ |
|
252 | - $value = ''; |
|
253 | - if (isset($field_info->htmlvar_name)) { |
|
254 | - $value = esc_attr($field_info->htmlvar_name); |
|
255 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
256 | - $value = $cf['defaults']['htmlvar_name']; |
|
257 | - } |
|
258 | - ?> |
|
251 | + }else{ |
|
252 | + $value = ''; |
|
253 | + if (isset($field_info->htmlvar_name)) { |
|
254 | + $value = esc_attr($field_info->htmlvar_name); |
|
255 | + }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
256 | + $value = $cf['defaults']['htmlvar_name']; |
|
257 | + } |
|
258 | + ?> |
|
259 | 259 | <li> |
260 | 260 | <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');?> |
261 | 261 | <div class="gdcf-tooltip"> |
@@ -265,29 +265,29 @@ discard block |
||
265 | 265 | <div class="gd-cf-input-wrap"> |
266 | 266 | <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');?>" |
267 | 267 | value="<?php if ($value) { |
268 | - echo preg_replace('/geodir_/', '', $value, 1); |
|
269 | - }?>" <?php if ($default) { |
|
270 | - echo 'readonly="readonly"'; |
|
271 | - }?> /> |
|
268 | + echo preg_replace('/geodir_/', '', $value, 1); |
|
269 | + }?>" <?php if ($default) { |
|
270 | + echo 'readonly="readonly"'; |
|
271 | + }?> /> |
|
272 | 272 | </div> |
273 | 273 | </li> |
274 | 274 | <?php |
275 | - } |
|
275 | + } |
|
276 | 276 | |
277 | 277 | |
278 | - // is_active |
|
279 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
278 | + // is_active |
|
279 | + if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
280 | 280 | |
281 | - echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
281 | + echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
282 | 282 | |
283 | - }else{ |
|
284 | - $value = ''; |
|
285 | - if (isset($field_info->is_active)) { |
|
286 | - $value = esc_attr($field_info->is_active); |
|
287 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
288 | - $value = $cf['defaults']['is_active']; |
|
289 | - } |
|
290 | - ?> |
|
283 | + }else{ |
|
284 | + $value = ''; |
|
285 | + if (isset($field_info->is_active)) { |
|
286 | + $value = esc_attr($field_info->is_active); |
|
287 | + }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
288 | + $value = $cf['defaults']['is_active']; |
|
289 | + } |
|
290 | + ?> |
|
291 | 291 | <li <?php echo $field_display; ?>> |
292 | 292 | <label for="is_active" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active :', 'geodirectory'); ?> |
293 | 293 | <div class="gdcf-tooltip"> |
@@ -298,35 +298,35 @@ discard block |
||
298 | 298 | |
299 | 299 | <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
300 | 300 | <?php if ($value == '1') { |
301 | - echo 'checked'; |
|
302 | - } ?>/> |
|
301 | + echo 'checked'; |
|
302 | + } ?>/> |
|
303 | 303 | <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
304 | 304 | |
305 | 305 | <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
306 | 306 | <?php if ($value == '0' || !$value) { |
307 | - echo 'checked'; |
|
308 | - } ?>/> |
|
307 | + echo 'checked'; |
|
308 | + } ?>/> |
|
309 | 309 | <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
310 | 310 | |
311 | 311 | </div> |
312 | 312 | </li> |
313 | 313 | <?php |
314 | - } |
|
314 | + } |
|
315 | 315 | |
316 | 316 | |
317 | - // for_admin_use |
|
318 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
317 | + // for_admin_use |
|
318 | + if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
319 | 319 | |
320 | - echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
320 | + echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
321 | 321 | |
322 | - }else{ |
|
323 | - $value = ''; |
|
324 | - if (isset($field_info->for_admin_use)) { |
|
325 | - $value = esc_attr($field_info->for_admin_use); |
|
326 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
327 | - $value = $cf['defaults']['for_admin_use']; |
|
328 | - } |
|
329 | - ?> |
|
322 | + }else{ |
|
323 | + $value = ''; |
|
324 | + if (isset($field_info->for_admin_use)) { |
|
325 | + $value = esc_attr($field_info->for_admin_use); |
|
326 | + }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
327 | + $value = $cf['defaults']['for_admin_use']; |
|
328 | + } |
|
329 | + ?> |
|
330 | 330 | <li> |
331 | 331 | <label for="for_admin_use" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('For admin use only? :', 'geodirectory'); ?> |
332 | 332 | <div class="gdcf-tooltip"> |
@@ -337,47 +337,47 @@ discard block |
||
337 | 337 | |
338 | 338 | <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled" value="1" |
339 | 339 | <?php if ($value == '1') { |
340 | - echo 'checked'; |
|
341 | - } ?>/> |
|
340 | + echo 'checked'; |
|
341 | + } ?>/> |
|
342 | 342 | <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
343 | 343 | |
344 | 344 | <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0" |
345 | 345 | <?php if ($value == '0' || !$value) { |
346 | - echo 'checked'; |
|
347 | - } ?>/> |
|
346 | + echo 'checked'; |
|
347 | + } ?>/> |
|
348 | 348 | <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
349 | 349 | |
350 | 350 | </div> |
351 | 351 | </li> |
352 | 352 | <?php |
353 | - } |
|
353 | + } |
|
354 | 354 | |
355 | 355 | |
356 | - // default_value |
|
357 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
356 | + // default_value |
|
357 | + if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
358 | 358 | |
359 | - echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
359 | + echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
360 | 360 | |
361 | - }else{ |
|
362 | - $value = ''; |
|
363 | - if (isset($field_info->default_value)) { |
|
364 | - $value = esc_attr($field_info->default_value); |
|
365 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
366 | - $value = $cf['defaults']['default_value']; |
|
367 | - } |
|
368 | - ?> |
|
361 | + }else{ |
|
362 | + $value = ''; |
|
363 | + if (isset($field_info->default_value)) { |
|
364 | + $value = esc_attr($field_info->default_value); |
|
365 | + }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
366 | + $value = $cf['defaults']['default_value']; |
|
367 | + } |
|
368 | + ?> |
|
369 | 369 | <li> |
370 | 370 | <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?> |
371 | 371 | <div class="gdcf-tooltip"> |
372 | 372 | <?php |
373 | - if ($field_type == 'checkbox') { |
|
374 | - _e('Should the checkbox be checked by default?', 'geodirectory'); |
|
375 | - } else if ($field_type == 'email') { |
|
376 | - _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory'); |
|
377 | - } else { |
|
378 | - _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory'); |
|
379 | - } |
|
380 | - ?> |
|
373 | + if ($field_type == 'checkbox') { |
|
374 | + _e('Should the checkbox be checked by default?', 'geodirectory'); |
|
375 | + } else if ($field_type == 'email') { |
|
376 | + _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory'); |
|
377 | + } else { |
|
378 | + _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory'); |
|
379 | + } |
|
380 | + ?> |
|
381 | 381 | </div> |
382 | 382 | </label> |
383 | 383 | <div class="gd-cf-input-wrap"> |
@@ -394,22 +394,22 @@ discard block |
||
394 | 394 | </div> |
395 | 395 | </li> |
396 | 396 | <?php |
397 | - } |
|
397 | + } |
|
398 | 398 | |
399 | 399 | |
400 | - // show_in |
|
401 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
400 | + // show_in |
|
401 | + if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
402 | 402 | |
403 | - echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
403 | + echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
404 | 404 | |
405 | - }else{ |
|
406 | - $value = ''; |
|
407 | - if (isset($field_info->show_in)) { |
|
408 | - $value = esc_attr($field_info->show_in); |
|
409 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
410 | - $value = esc_attr($cf['defaults']['show_in']); |
|
411 | - } |
|
412 | - ?> |
|
405 | + }else{ |
|
406 | + $value = ''; |
|
407 | + if (isset($field_info->show_in)) { |
|
408 | + $value = esc_attr($field_info->show_in); |
|
409 | + }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
410 | + $value = esc_attr($cf['defaults']['show_in']); |
|
411 | + } |
|
412 | + ?> |
|
413 | 413 | <li> |
414 | 414 | <label for="show_in" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show in what locations?:', 'geodirectory'); ?> |
415 | 415 | <div class="gdcf-tooltip"> |
@@ -420,41 +420,41 @@ discard block |
||
420 | 420 | |
421 | 421 | <?php |
422 | 422 | |
423 | - /* |
|
423 | + /* |
|
424 | 424 | * We wrap the key values in [] so we can search the DB easier with a LIKE query. |
425 | 425 | */ |
426 | - $show_in_locations = array( |
|
427 | - "[detail]" => __("Details page sidebar", 'geodirectory'), |
|
428 | - "[moreinfo]" => __("More info tab", 'geodirectory'), |
|
429 | - "[listing]" => __("Listings page", 'geodirectory'), |
|
430 | - "[owntab]" => __("Details page own tab", 'geodirectory'), |
|
431 | - "[mapbubble]" => __("Map bubble", 'geodirectory'), |
|
432 | - ); |
|
433 | - |
|
434 | - /** |
|
435 | - * Filter the locations array for where to display custom fields. |
|
436 | - * |
|
437 | - * @since 1.6.6 |
|
438 | - * @param array $show_in_locations The array of locations and descriptions. |
|
439 | - * @param object $field_info The field being displayed info. |
|
440 | - * @param string $field_info The type of field. |
|
441 | - */ |
|
442 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
443 | - |
|
444 | - |
|
445 | - // remove some locations for some field types |
|
446 | - |
|
447 | - // don't show new tab option for some types |
|
448 | - if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) { |
|
449 | - }else{ |
|
450 | - unset($show_in_locations['[owntab]']); |
|
451 | - } |
|
452 | - |
|
453 | - if(!$display_on_listing){ |
|
454 | - unset($show_in_locations['[listings]']); |
|
455 | - } |
|
456 | - |
|
457 | - ?> |
|
426 | + $show_in_locations = array( |
|
427 | + "[detail]" => __("Details page sidebar", 'geodirectory'), |
|
428 | + "[moreinfo]" => __("More info tab", 'geodirectory'), |
|
429 | + "[listing]" => __("Listings page", 'geodirectory'), |
|
430 | + "[owntab]" => __("Details page own tab", 'geodirectory'), |
|
431 | + "[mapbubble]" => __("Map bubble", 'geodirectory'), |
|
432 | + ); |
|
433 | + |
|
434 | + /** |
|
435 | + * Filter the locations array for where to display custom fields. |
|
436 | + * |
|
437 | + * @since 1.6.6 |
|
438 | + * @param array $show_in_locations The array of locations and descriptions. |
|
439 | + * @param object $field_info The field being displayed info. |
|
440 | + * @param string $field_info The type of field. |
|
441 | + */ |
|
442 | + $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
443 | + |
|
444 | + |
|
445 | + // remove some locations for some field types |
|
446 | + |
|
447 | + // don't show new tab option for some types |
|
448 | + if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) { |
|
449 | + }else{ |
|
450 | + unset($show_in_locations['[owntab]']); |
|
451 | + } |
|
452 | + |
|
453 | + if(!$display_on_listing){ |
|
454 | + unset($show_in_locations['[listings]']); |
|
455 | + } |
|
456 | + |
|
457 | + ?> |
|
458 | 458 | |
459 | 459 | <select multiple="multiple" name="show_in[]" |
460 | 460 | id="show_in" |
@@ -464,38 +464,38 @@ discard block |
||
464 | 464 | option-ajaxchosen="false"> |
465 | 465 | <?php |
466 | 466 | |
467 | - $show_in_values = explode(',',$value); |
|
467 | + $show_in_values = explode(',',$value); |
|
468 | 468 | |
469 | - foreach( $show_in_locations as $key => $val){ |
|
470 | - $selected = ''; |
|
469 | + foreach( $show_in_locations as $key => $val){ |
|
470 | + $selected = ''; |
|
471 | 471 | |
472 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
473 | - $selected = 'selected'; |
|
474 | - } |
|
472 | + if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
473 | + $selected = 'selected'; |
|
474 | + } |
|
475 | 475 | |
476 | - ?> |
|
476 | + ?> |
|
477 | 477 | <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
478 | 478 | <?php |
479 | - } |
|
480 | - ?> |
|
479 | + } |
|
480 | + ?> |
|
481 | 481 | </select> |
482 | 482 | </div> |
483 | 483 | </li> |
484 | 484 | <?php |
485 | - } |
|
485 | + } |
|
486 | 486 | |
487 | 487 | |
488 | - // advanced_editor |
|
489 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
488 | + // advanced_editor |
|
489 | + if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
490 | 490 | |
491 | - echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
491 | + echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
492 | 492 | |
493 | - } |
|
493 | + } |
|
494 | 494 | |
495 | 495 | |
496 | 496 | |
497 | 497 | |
498 | - ?> |
|
498 | + ?> |
|
499 | 499 | |
500 | 500 | |
501 | 501 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
@@ -508,38 +508,38 @@ discard block |
||
508 | 508 | |
509 | 509 | <?php |
510 | 510 | |
511 | - $pricearr = array(); |
|
512 | - if (isset($field_info->packages) && $field_info->packages != '') { |
|
513 | - $pricearr = explode(',', trim($field_info->packages, ',')); |
|
514 | - } else { |
|
515 | - $package_info = array(); |
|
511 | + $pricearr = array(); |
|
512 | + if (isset($field_info->packages) && $field_info->packages != '') { |
|
513 | + $pricearr = explode(',', trim($field_info->packages, ',')); |
|
514 | + } else { |
|
515 | + $package_info = array(); |
|
516 | 516 | |
517 | - $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
518 | - $pricearr[] = $package_info->pid; |
|
519 | - } |
|
517 | + $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
518 | + $pricearr[] = $package_info->pid; |
|
519 | + } |
|
520 | 520 | |
521 | - ob_start() |
|
522 | - ?> |
|
521 | + ob_start() |
|
522 | + ?> |
|
523 | 523 | |
524 | 524 | <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple"> |
525 | 525 | <?php |
526 | - if (!empty($pricearr)) { |
|
527 | - foreach ($pricearr as $val) { |
|
528 | - ?> |
|
526 | + if (!empty($pricearr)) { |
|
527 | + foreach ($pricearr as $val) { |
|
528 | + ?> |
|
529 | 529 | <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php |
530 | - } |
|
531 | - } |
|
532 | - ?> |
|
530 | + } |
|
531 | + } |
|
532 | + ?> |
|
533 | 533 | </select> |
534 | 534 | |
535 | 535 | <?php |
536 | - $html = ob_get_clean(); |
|
536 | + $html = ob_get_clean(); |
|
537 | 537 | |
538 | 538 | /** |
539 | 539 | * Filter the price packages list. |
540 | 540 | * |
541 | 541 | * Filter the price packages list in custom field form in admin |
542 | - * custom fields settings. |
|
542 | + * custom fields settings. |
|
543 | 543 | * |
544 | 544 | * @since 1.0.0 |
545 | 545 | * |
@@ -548,25 +548,25 @@ discard block |
||
548 | 548 | */ |
549 | 549 | echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info); |
550 | 550 | |
551 | - ?> |
|
551 | + ?> |
|
552 | 552 | |
553 | 553 | |
554 | 554 | |
555 | 555 | <?php |
556 | 556 | |
557 | - // is_required |
|
558 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
557 | + // is_required |
|
558 | + if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
559 | 559 | |
560 | - echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
560 | + echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
561 | 561 | |
562 | - }else{ |
|
563 | - $value = ''; |
|
564 | - if (isset($field_info->is_required)) { |
|
565 | - $value = esc_attr($field_info->is_required); |
|
566 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
567 | - $value = $cf['defaults']['is_required']; |
|
568 | - } |
|
569 | - ?> |
|
562 | + }else{ |
|
563 | + $value = ''; |
|
564 | + if (isset($field_info->is_required)) { |
|
565 | + $value = esc_attr($field_info->is_required); |
|
566 | + }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
567 | + $value = $cf['defaults']['is_required']; |
|
568 | + } |
|
569 | + ?> |
|
570 | 570 | <li> |
571 | 571 | <label for="is_required" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is required :', 'geodirectory'); ?> |
572 | 572 | <div class="gdcf-tooltip"> |
@@ -578,14 +578,14 @@ discard block |
||
578 | 578 | |
579 | 579 | <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled" value="1" |
580 | 580 | <?php if ($value == '1') { |
581 | - echo 'checked'; |
|
582 | - } ?>/> |
|
581 | + echo 'checked'; |
|
582 | + } ?>/> |
|
583 | 583 | <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> |
584 | 584 | |
585 | 585 | <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0" |
586 | 586 | <?php if ($value == '0' || !$value) { |
587 | - echo 'checked'; |
|
588 | - } ?>/> |
|
587 | + echo 'checked'; |
|
588 | + } ?>/> |
|
589 | 589 | <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> |
590 | 590 | |
591 | 591 | </div> |
@@ -593,21 +593,21 @@ discard block |
||
593 | 593 | </li> |
594 | 594 | |
595 | 595 | <?php |
596 | - } |
|
596 | + } |
|
597 | 597 | |
598 | - // required_msg |
|
599 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
598 | + // required_msg |
|
599 | + if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
600 | 600 | |
601 | - echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
601 | + echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
602 | 602 | |
603 | - }else{ |
|
604 | - $value = ''; |
|
605 | - if (isset($field_info->required_msg)) { |
|
606 | - $value = esc_attr($field_info->required_msg); |
|
607 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
608 | - $value = $cf['defaults']['required_msg']; |
|
609 | - } |
|
610 | - ?> |
|
603 | + }else{ |
|
604 | + $value = ''; |
|
605 | + if (isset($field_info->required_msg)) { |
|
606 | + $value = esc_attr($field_info->required_msg); |
|
607 | + }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
608 | + $value = $cf['defaults']['required_msg']; |
|
609 | + } |
|
610 | + ?> |
|
611 | 611 | <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;'";}?>> |
612 | 612 | <label for="required_msg" class="gd-cf-tooltip-wrap"> |
613 | 613 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?> |
@@ -621,38 +621,38 @@ discard block |
||
621 | 621 | </div> |
622 | 622 | </li> |
623 | 623 | <?php |
624 | - } |
|
624 | + } |
|
625 | 625 | |
626 | 626 | |
627 | - // required_msg |
|
628 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
627 | + // required_msg |
|
628 | + if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
629 | 629 | |
630 | - echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
630 | + echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
631 | 631 | |
632 | - } |
|
632 | + } |
|
633 | 633 | |
634 | 634 | |
635 | - // extra_fields |
|
636 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
635 | + // extra_fields |
|
636 | + if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
637 | 637 | |
638 | - echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
638 | + echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
639 | 639 | |
640 | - } |
|
640 | + } |
|
641 | 641 | |
642 | 642 | |
643 | - // field_icon |
|
644 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
643 | + // field_icon |
|
644 | + if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
645 | 645 | |
646 | - echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
646 | + echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
647 | 647 | |
648 | - }else{ |
|
649 | - $value = ''; |
|
650 | - if (isset($field_info->field_icon)) { |
|
651 | - $value = esc_attr($field_info->field_icon); |
|
652 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
653 | - $value = $cf['defaults']['field_icon']; |
|
654 | - } |
|
655 | - ?> |
|
648 | + }else{ |
|
649 | + $value = ''; |
|
650 | + if (isset($field_info->field_icon)) { |
|
651 | + $value = esc_attr($field_info->field_icon); |
|
652 | + }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
653 | + $value = $cf['defaults']['field_icon']; |
|
654 | + } |
|
655 | + ?> |
|
656 | 656 | <li> |
657 | 657 | <h3><?php echo __('Custom css', 'geodirectory'); ?></h3> |
658 | 658 | |
@@ -670,22 +670,22 @@ discard block |
||
670 | 670 | |
671 | 671 | </li> |
672 | 672 | <?php |
673 | - } |
|
673 | + } |
|
674 | 674 | |
675 | 675 | |
676 | - // css_class |
|
677 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
676 | + // css_class |
|
677 | + if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
678 | 678 | |
679 | - echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
679 | + echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
680 | 680 | |
681 | - }else{ |
|
682 | - $value = ''; |
|
683 | - if (isset($field_info->css_class)) { |
|
684 | - $value = esc_attr($field_info->css_class); |
|
685 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
686 | - $value = $cf['defaults']['css_class']; |
|
687 | - } |
|
688 | - ?> |
|
681 | + }else{ |
|
682 | + $value = ''; |
|
683 | + if (isset($field_info->css_class)) { |
|
684 | + $value = esc_attr($field_info->css_class); |
|
685 | + }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
686 | + $value = $cf['defaults']['css_class']; |
|
687 | + } |
|
688 | + ?> |
|
689 | 689 | <li> |
690 | 690 | |
691 | 691 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
@@ -698,47 +698,47 @@ discard block |
||
698 | 698 | <div class="gd-cf-input-wrap"> |
699 | 699 | <input type="text" name="css_class" id="css_class" |
700 | 700 | value="<?php if (isset($field_info->css_class)) { |
701 | - echo esc_attr($field_info->css_class); |
|
702 | - }?>"/> |
|
701 | + echo esc_attr($field_info->css_class); |
|
702 | + }?>"/> |
|
703 | 703 | </div> |
704 | 704 | </li> |
705 | 705 | <?php |
706 | - } |
|
706 | + } |
|
707 | 707 | |
708 | 708 | |
709 | - // cat_sort |
|
710 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
709 | + // cat_sort |
|
710 | + if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
711 | 711 | |
712 | - echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
712 | + echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
713 | 713 | |
714 | - }else{ |
|
715 | - $value = ''; |
|
716 | - $hide_cat_sort =''; |
|
717 | - if (isset($field_info->cat_sort)) { |
|
718 | - $value = esc_attr($field_info->cat_sort); |
|
719 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
720 | - $value = $cf['defaults']['cat_sort']; |
|
721 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
722 | - } |
|
714 | + }else{ |
|
715 | + $value = ''; |
|
716 | + $hide_cat_sort =''; |
|
717 | + if (isset($field_info->cat_sort)) { |
|
718 | + $value = esc_attr($field_info->cat_sort); |
|
719 | + }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
720 | + $value = $cf['defaults']['cat_sort']; |
|
721 | + $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
722 | + } |
|
723 | 723 | |
724 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
725 | - ?> |
|
724 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
725 | + ?> |
|
726 | 726 | <li <?php echo $hide_cat_sort ;?>> |
727 | 727 | <h3><?php |
728 | - /** |
|
729 | - * Filter the section title. |
|
730 | - * |
|
731 | - * Filter the section title in custom field form in admin |
|
732 | - * custom fields settings. |
|
733 | - * |
|
734 | - * @since 1.0.0 |
|
735 | - * |
|
736 | - * @param string $title Title of the section. |
|
737 | - * @param string $field_type Current field type. |
|
738 | - */ |
|
739 | - echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type); |
|
740 | - |
|
741 | - ?></h3> |
|
728 | + /** |
|
729 | + * Filter the section title. |
|
730 | + * |
|
731 | + * Filter the section title in custom field form in admin |
|
732 | + * custom fields settings. |
|
733 | + * |
|
734 | + * @since 1.0.0 |
|
735 | + * |
|
736 | + * @param string $title Title of the section. |
|
737 | + * @param string $field_type Current field type. |
|
738 | + */ |
|
739 | + echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type); |
|
740 | + |
|
741 | + ?></h3> |
|
742 | 742 | <label for="cat_sort" class="gd-cf-tooltip-wrap"> |
743 | 743 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?> |
744 | 744 | <div class="gdcf-tooltip"> |
@@ -750,42 +750,42 @@ discard block |
||
750 | 750 | |
751 | 751 | <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled" value="1" |
752 | 752 | <?php if ($value == '1') { |
753 | - echo 'checked'; |
|
754 | - } ?>/> |
|
753 | + echo 'checked'; |
|
754 | + } ?>/> |
|
755 | 755 | <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
756 | 756 | |
757 | 757 | <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0" |
758 | 758 | <?php if (!$value) { |
759 | - echo 'checked'; |
|
760 | - } ?>/> |
|
759 | + echo 'checked'; |
|
760 | + } ?>/> |
|
761 | 761 | <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
762 | 762 | |
763 | 763 | </div> |
764 | 764 | </li> |
765 | 765 | <?php |
766 | - } |
|
767 | - |
|
768 | - |
|
769 | - |
|
770 | - switch ($field_type): |
|
771 | - case 'html': |
|
772 | - case 'file': |
|
773 | - case 'url': |
|
774 | - case 'fieldset': |
|
775 | - break; |
|
776 | - default: |
|
777 | - |
|
778 | - /** |
|
779 | - * Called at the end of the advanced custom fields settings page loop. |
|
780 | - * |
|
781 | - * Can be used to add or deal with different settings types. |
|
782 | - * |
|
783 | - * @since 1.0.0 |
|
784 | - * @since 1.6.6 $cf param added. |
|
785 | - * @param object $field_info The current fields info. |
|
786 | - * @param array $cf The custom field settings |
|
787 | - */ |
|
788 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
766 | + } |
|
767 | + |
|
768 | + |
|
769 | + |
|
770 | + switch ($field_type): |
|
771 | + case 'html': |
|
772 | + case 'file': |
|
773 | + case 'url': |
|
774 | + case 'fieldset': |
|
775 | + break; |
|
776 | + default: |
|
777 | + |
|
778 | + /** |
|
779 | + * Called at the end of the advanced custom fields settings page loop. |
|
780 | + * |
|
781 | + * Can be used to add or deal with different settings types. |
|
782 | + * |
|
783 | + * @since 1.0.0 |
|
784 | + * @since 1.6.6 $cf param added. |
|
785 | + * @param object $field_info The current fields info. |
|
786 | + * @param array $cf The custom field settings |
|
787 | + */ |
|
788 | + do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
789 | 789 | |
790 | 790 | |
791 | 791 | <?php endswitch; ?> |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | $cf = (isset($cf_arr[$field_type_key])) ? $cf_arr[$field_type_key] : ''; |
40 | 40 | |
41 | 41 | |
42 | -if(isset($field_info->extra_fields)){$extra_fields = $field_info->extra_fields;} |
|
42 | +if (isset($field_info->extra_fields)) {$extra_fields = $field_info->extra_fields; } |
|
43 | 43 | $field_info = stripslashes_deep($field_info); // strip slashes from labels |
44 | -if(isset($field_info->extra_fields)){$field_info->extra_fields = $extra_fields;} |
|
44 | +if (isset($field_info->extra_fields)) {$field_info->extra_fields = $extra_fields; } |
|
45 | 45 | |
46 | 46 | |
47 | -$nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
47 | +$nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
48 | 48 | |
49 | 49 | $field_admin_title = ''; |
50 | 50 | if (isset($field_info->admin_title)) |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | |
70 | 70 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) { |
71 | 71 | $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
72 | -}elseif(isset($cf['icon']) && $cf['icon']){ |
|
72 | +}elseif (isset($cf['icon']) && $cf['icon']) { |
|
73 | 73 | $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>'; |
74 | -}else{ |
|
74 | +} else { |
|
75 | 75 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
76 | 76 | } |
77 | 77 | |
78 | -if(isset($cf['name']) && $cf['name']){ |
|
78 | +if (isset($cf['name']) && $cf['name']) { |
|
79 | 79 | $field_type_name = $cf['name']; |
80 | -}else{ |
|
80 | +} else { |
|
81 | 81 | $field_type_name = $field_type; |
82 | 82 | } |
83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | ondblclick="show_hide('field_frm<?php echo $result_str; ?>')"> |
89 | 89 | <?php |
90 | 90 | |
91 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
91 | + $nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
92 | 92 | ?> |
93 | 93 | |
94 | 94 | <?php if ($default): ?> |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | <i class="fa fa-long-arrow-left " aria-hidden="true"></i> |
104 | 104 | <i class="fa fa-long-arrow-right " aria-hidden="true"></i> |
105 | 105 | <b style="cursor:pointer;" |
106 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b> |
|
106 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b> |
|
107 | 107 | <?php |
108 | 108 | } else {echo $field_icon; |
109 | 109 | ?> |
110 | 110 | <b style="cursor:pointer;" |
111 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b> |
|
111 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type_name.')'); ?></b> |
|
112 | 112 | <?php |
113 | 113 | } |
114 | 114 | ?> |
@@ -131,43 +131,43 @@ discard block |
||
131 | 131 | } ?>"/> |
132 | 132 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
133 | 133 | |
134 | - <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
|
135 | - <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
136 | - <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
137 | - <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : '';?>" /> |
|
134 | + <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : ''; ?>" /><?php // show in sidebar value?> |
|
135 | + <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
136 | + <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
137 | + <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : ''; ?>" /> |
|
138 | 138 | |
139 | 139 | <ul class="widefat post fixed" border="0" style="width:100%;"> |
140 | 140 | |
141 | 141 | <?php |
142 | 142 | |
143 | 143 | // data_type |
144 | - if(has_filter("geodir_cfa_data_type_{$field_type}")){ |
|
144 | + if (has_filter("geodir_cfa_data_type_{$field_type}")) { |
|
145 | 145 | |
146 | - echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
|
146 | + echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info); |
|
147 | 147 | |
148 | - }else{ |
|
148 | + } else { |
|
149 | 149 | $value = ''; |
150 | 150 | if (isset($field_info->data_type)) { |
151 | 151 | $value = esc_attr($field_info->data_type); |
152 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
152 | + }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) { |
|
153 | 153 | $value = $cf['defaults']['data_type']; |
154 | 154 | } |
155 | 155 | ?> |
156 | - <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/> |
|
156 | + <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/> |
|
157 | 157 | <?php |
158 | 158 | } |
159 | 159 | |
160 | 160 | |
161 | 161 | // admin_title |
162 | - if(has_filter("geodir_cfa_admin_title_{$field_type}")){ |
|
162 | + if (has_filter("geodir_cfa_admin_title_{$field_type}")) { |
|
163 | 163 | |
164 | - echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
164 | + echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info); |
|
165 | 165 | |
166 | - }else{ |
|
166 | + } else { |
|
167 | 167 | $value = ''; |
168 | 168 | if (isset($field_info->admin_title)) { |
169 | 169 | $value = esc_attr($field_info->admin_title); |
170 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
170 | + }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) { |
|
171 | 171 | $value = $cf['defaults']['admin_title']; |
172 | 172 | } |
173 | 173 | ?> |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | </label> |
181 | 181 | <div class="gd-cf-input-wrap"> |
182 | 182 | <input type="text" name="admin_title" id="admin_title" |
183 | - value="<?php echo $value;?>"/> |
|
183 | + value="<?php echo $value; ?>"/> |
|
184 | 184 | </div> |
185 | 185 | </li> |
186 | 186 | <?php |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | |
190 | 190 | // site_title |
191 | - if(has_filter("geodir_cfa_site_title_{$field_type}")){ |
|
191 | + if (has_filter("geodir_cfa_site_title_{$field_type}")) { |
|
192 | 192 | |
193 | - echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
193 | + echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info); |
|
194 | 194 | |
195 | - }else{ |
|
195 | + } else { |
|
196 | 196 | $value = ''; |
197 | 197 | if (isset($field_info->site_title)) { |
198 | 198 | $value = esc_attr($field_info->site_title); |
199 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
199 | + }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) { |
|
200 | 200 | $value = $cf['defaults']['site_title']; |
201 | 201 | } |
202 | 202 | ?> |
@@ -216,15 +216,15 @@ discard block |
||
216 | 216 | |
217 | 217 | |
218 | 218 | // admin_desc |
219 | - if(has_filter("geodir_cfa_admin_desc_{$field_type}")){ |
|
219 | + if (has_filter("geodir_cfa_admin_desc_{$field_type}")) { |
|
220 | 220 | |
221 | - echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
|
221 | + echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info); |
|
222 | 222 | |
223 | - }else{ |
|
223 | + } else { |
|
224 | 224 | $value = ''; |
225 | 225 | if (isset($field_info->admin_desc)) { |
226 | 226 | $value = esc_attr($field_info->admin_desc); |
227 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
227 | + }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) { |
|
228 | 228 | $value = $cf['defaults']['admin_desc']; |
229 | 229 | } |
230 | 230 | ?> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | </div> |
236 | 236 | </label> |
237 | 237 | <div class="gd-cf-input-wrap"> |
238 | - <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/> |
|
238 | + <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/> |
|
239 | 239 | </div> |
240 | 240 | </li> |
241 | 241 | <?php |
@@ -244,26 +244,26 @@ discard block |
||
244 | 244 | |
245 | 245 | |
246 | 246 | // htmlvar_name |
247 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
247 | + if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) { |
|
248 | 248 | |
249 | - echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
249 | + echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info); |
|
250 | 250 | |
251 | - }else{ |
|
251 | + } else { |
|
252 | 252 | $value = ''; |
253 | 253 | if (isset($field_info->htmlvar_name)) { |
254 | 254 | $value = esc_attr($field_info->htmlvar_name); |
255 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
255 | + }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) { |
|
256 | 256 | $value = $cf['defaults']['htmlvar_name']; |
257 | 257 | } |
258 | 258 | ?> |
259 | 259 | <li> |
260 | - <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');?> |
|
260 | + <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'); ?> |
|
261 | 261 | <div class="gdcf-tooltip"> |
262 | 262 | <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?> |
263 | 263 | </div> |
264 | 264 | </label> |
265 | 265 | <div class="gd-cf-input-wrap"> |
266 | - <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');?>" |
|
266 | + <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'); ?>" |
|
267 | 267 | value="<?php if ($value) { |
268 | 268 | echo preg_replace('/geodir_/', '', $value, 1); |
269 | 269 | }?>" <?php if ($default) { |
@@ -276,15 +276,15 @@ discard block |
||
276 | 276 | |
277 | 277 | |
278 | 278 | // is_active |
279 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
279 | + if (has_filter("geodir_cfa_is_active_{$field_type}")) { |
|
280 | 280 | |
281 | - echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
281 | + echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info); |
|
282 | 282 | |
283 | - }else{ |
|
283 | + } else { |
|
284 | 284 | $value = ''; |
285 | 285 | if (isset($field_info->is_active)) { |
286 | 286 | $value = esc_attr($field_info->is_active); |
287 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
287 | + }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) { |
|
288 | 288 | $value = $cf['defaults']['is_active']; |
289 | 289 | } |
290 | 290 | ?> |
@@ -296,17 +296,17 @@ discard block |
||
296 | 296 | </label> |
297 | 297 | <div class="gd-cf-input-wrap gd-switch"> |
298 | 298 | |
299 | - <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
|
299 | + <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled" value="1" |
|
300 | 300 | <?php if ($value == '1') { |
301 | 301 | echo 'checked'; |
302 | 302 | } ?>/> |
303 | - <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
303 | + <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
304 | 304 | |
305 | - <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
|
305 | + <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0" |
|
306 | 306 | <?php if ($value == '0' || !$value) { |
307 | 307 | echo 'checked'; |
308 | 308 | } ?>/> |
309 | - <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
309 | + <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
310 | 310 | |
311 | 311 | </div> |
312 | 312 | </li> |
@@ -315,15 +315,15 @@ discard block |
||
315 | 315 | |
316 | 316 | |
317 | 317 | // for_admin_use |
318 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
318 | + if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) { |
|
319 | 319 | |
320 | - echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
320 | + echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info); |
|
321 | 321 | |
322 | - }else{ |
|
322 | + } else { |
|
323 | 323 | $value = ''; |
324 | 324 | if (isset($field_info->for_admin_use)) { |
325 | 325 | $value = esc_attr($field_info->for_admin_use); |
326 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
326 | + }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) { |
|
327 | 327 | $value = $cf['defaults']['for_admin_use']; |
328 | 328 | } |
329 | 329 | ?> |
@@ -335,17 +335,17 @@ discard block |
||
335 | 335 | </label> |
336 | 336 | <div class="gd-cf-input-wrap gd-switch"> |
337 | 337 | |
338 | - <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
338 | + <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
339 | 339 | <?php if ($value == '1') { |
340 | 340 | echo 'checked'; |
341 | 341 | } ?>/> |
342 | - <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
342 | + <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
343 | 343 | |
344 | - <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
344 | + <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
345 | 345 | <?php if ($value == '0' || !$value) { |
346 | 346 | echo 'checked'; |
347 | 347 | } ?>/> |
348 | - <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
348 | + <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
349 | 349 | |
350 | 350 | </div> |
351 | 351 | </li> |
@@ -354,20 +354,20 @@ discard block |
||
354 | 354 | |
355 | 355 | |
356 | 356 | // default_value |
357 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
357 | + if (has_filter("geodir_cfa_default_value_{$field_type}")) { |
|
358 | 358 | |
359 | - echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
359 | + echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info); |
|
360 | 360 | |
361 | - }else{ |
|
361 | + } else { |
|
362 | 362 | $value = ''; |
363 | 363 | if (isset($field_info->default_value)) { |
364 | 364 | $value = esc_attr($field_info->default_value); |
365 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
365 | + }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) { |
|
366 | 366 | $value = $cf['defaults']['default_value']; |
367 | 367 | } |
368 | 368 | ?> |
369 | 369 | <li> |
370 | - <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?> |
|
370 | + <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?> |
|
371 | 371 | <div class="gdcf-tooltip"> |
372 | 372 | <?php |
373 | 373 | if ($field_type == 'checkbox') { |
@@ -384,12 +384,12 @@ discard block |
||
384 | 384 | <?php if ($field_type == 'checkbox') { ?> |
385 | 385 | <select name="default_value" id="default_value"> |
386 | 386 | <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option> |
387 | - <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
387 | + <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
388 | 388 | </select> |
389 | 389 | <?php } else if ($field_type == 'email') { ?> |
390 | - <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
390 | + <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
391 | 391 | <?php } else { ?> |
392 | - <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
392 | + <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
393 | 393 | <?php } ?> |
394 | 394 | </div> |
395 | 395 | </li> |
@@ -398,15 +398,15 @@ discard block |
||
398 | 398 | |
399 | 399 | |
400 | 400 | // show_in |
401 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
401 | + if (has_filter("geodir_cfa_show_in_{$field_type}")) { |
|
402 | 402 | |
403 | - echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
403 | + echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info); |
|
404 | 404 | |
405 | - }else{ |
|
405 | + } else { |
|
406 | 406 | $value = ''; |
407 | 407 | if (isset($field_info->show_in)) { |
408 | 408 | $value = esc_attr($field_info->show_in); |
409 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
409 | + }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) { |
|
410 | 410 | $value = esc_attr($cf['defaults']['show_in']); |
411 | 411 | } |
412 | 412 | ?> |
@@ -439,18 +439,18 @@ discard block |
||
439 | 439 | * @param object $field_info The field being displayed info. |
440 | 440 | * @param string $field_info The type of field. |
441 | 441 | */ |
442 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
442 | + $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type); |
|
443 | 443 | |
444 | 444 | |
445 | 445 | // remove some locations for some field types |
446 | 446 | |
447 | 447 | // don't show new tab option for some types |
448 | - if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) { |
|
449 | - }else{ |
|
448 | + if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) { |
|
449 | + } else { |
|
450 | 450 | unset($show_in_locations['[owntab]']); |
451 | 451 | } |
452 | 452 | |
453 | - if(!$display_on_listing){ |
|
453 | + if (!$display_on_listing) { |
|
454 | 454 | unset($show_in_locations['[listings]']); |
455 | 455 | } |
456 | 456 | |
@@ -464,17 +464,17 @@ discard block |
||
464 | 464 | option-ajaxchosen="false"> |
465 | 465 | <?php |
466 | 466 | |
467 | - $show_in_values = explode(',',$value); |
|
467 | + $show_in_values = explode(',', $value); |
|
468 | 468 | |
469 | - foreach( $show_in_locations as $key => $val){ |
|
469 | + foreach ($show_in_locations as $key => $val) { |
|
470 | 470 | $selected = ''; |
471 | 471 | |
472 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
472 | + if (is_array($show_in_values) && in_array($key, $show_in_values)) { |
|
473 | 473 | $selected = 'selected'; |
474 | 474 | } |
475 | 475 | |
476 | 476 | ?> |
477 | - <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
|
477 | + <option value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option> |
|
478 | 478 | <?php |
479 | 479 | } |
480 | 480 | ?> |
@@ -486,9 +486,9 @@ discard block |
||
486 | 486 | |
487 | 487 | |
488 | 488 | // advanced_editor |
489 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
489 | + if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) { |
|
490 | 490 | |
491 | - echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
491 | + echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info); |
|
492 | 492 | |
493 | 493 | } |
494 | 494 | |
@@ -499,10 +499,10 @@ discard block |
||
499 | 499 | |
500 | 500 | |
501 | 501 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
502 | - <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/> |
|
502 | + <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/> |
|
503 | 503 | |
504 | 504 | <?php // we dont need to show the sort order ?> |
505 | - <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);} ?>"/> |
|
505 | + <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); } ?>"/> |
|
506 | 506 | |
507 | 507 | |
508 | 508 | |
@@ -555,15 +555,15 @@ discard block |
||
555 | 555 | <?php |
556 | 556 | |
557 | 557 | // is_required |
558 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
558 | + if (has_filter("geodir_cfa_is_required_{$field_type}")) { |
|
559 | 559 | |
560 | - echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
560 | + echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info); |
|
561 | 561 | |
562 | - }else{ |
|
562 | + } else { |
|
563 | 563 | $value = ''; |
564 | 564 | if (isset($field_info->is_required)) { |
565 | 565 | $value = esc_attr($field_info->is_required); |
566 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
566 | + }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) { |
|
567 | 567 | $value = $cf['defaults']['is_required']; |
568 | 568 | } |
569 | 569 | ?> |
@@ -576,17 +576,17 @@ discard block |
||
576 | 576 | |
577 | 577 | <div class="gd-cf-input-wrap gd-switch"> |
578 | 578 | |
579 | - <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled" value="1" |
|
579 | + <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled" value="1" |
|
580 | 580 | <?php if ($value == '1') { |
581 | 581 | echo 'checked'; |
582 | 582 | } ?>/> |
583 | - <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> |
|
583 | + <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> |
|
584 | 584 | |
585 | - <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0" |
|
585 | + <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0" |
|
586 | 586 | <?php if ($value == '0' || !$value) { |
587 | 587 | echo 'checked'; |
588 | 588 | } ?>/> |
589 | - <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> |
|
589 | + <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> |
|
590 | 590 | |
591 | 591 | </div> |
592 | 592 | |
@@ -596,19 +596,19 @@ discard block |
||
596 | 596 | } |
597 | 597 | |
598 | 598 | // required_msg |
599 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
599 | + if (has_filter("geodir_cfa_required_msg_{$field_type}")) { |
|
600 | 600 | |
601 | - echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
601 | + echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info); |
|
602 | 602 | |
603 | - }else{ |
|
603 | + } else { |
|
604 | 604 | $value = ''; |
605 | 605 | if (isset($field_info->required_msg)) { |
606 | 606 | $value = esc_attr($field_info->required_msg); |
607 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
607 | + }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) { |
|
608 | 608 | $value = $cf['defaults']['required_msg']; |
609 | 609 | } |
610 | 610 | ?> |
611 | - <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;'";}?>> |
|
611 | + <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;'"; }?>> |
|
612 | 612 | <label for="required_msg" class="gd-cf-tooltip-wrap"> |
613 | 613 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?> |
614 | 614 | <div class="gdcf-tooltip"> |
@@ -625,31 +625,31 @@ discard block |
||
625 | 625 | |
626 | 626 | |
627 | 627 | // required_msg |
628 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
628 | + if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) { |
|
629 | 629 | |
630 | - echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
630 | + echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info); |
|
631 | 631 | |
632 | 632 | } |
633 | 633 | |
634 | 634 | |
635 | 635 | // extra_fields |
636 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
636 | + if (has_filter("geodir_cfa_extra_fields_{$field_type}")) { |
|
637 | 637 | |
638 | - echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
638 | + echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info); |
|
639 | 639 | |
640 | 640 | } |
641 | 641 | |
642 | 642 | |
643 | 643 | // field_icon |
644 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
644 | + if (has_filter("geodir_cfa_field_icon_{$field_type}")) { |
|
645 | 645 | |
646 | - echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
646 | + echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info); |
|
647 | 647 | |
648 | - }else{ |
|
648 | + } else { |
|
649 | 649 | $value = ''; |
650 | 650 | if (isset($field_info->field_icon)) { |
651 | 651 | $value = esc_attr($field_info->field_icon); |
652 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
652 | + }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) { |
|
653 | 653 | $value = $cf['defaults']['field_icon']; |
654 | 654 | } |
655 | 655 | ?> |
@@ -660,12 +660,12 @@ discard block |
||
660 | 660 | <label for="field_icon" class="gd-cf-tooltip-wrap"> |
661 | 661 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?> |
662 | 662 | <div class="gdcf-tooltip"> |
663 | - <?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');?> |
|
663 | + <?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'); ?> |
|
664 | 664 | </div> |
665 | 665 | </label> |
666 | 666 | <div class="gd-cf-input-wrap"> |
667 | 667 | <input type="text" name="field_icon" id="field_icon" |
668 | - value="<?php echo $value;?>"/> |
|
668 | + value="<?php echo $value; ?>"/> |
|
669 | 669 | </div> |
670 | 670 | |
671 | 671 | </li> |
@@ -674,15 +674,15 @@ discard block |
||
674 | 674 | |
675 | 675 | |
676 | 676 | // css_class |
677 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
677 | + if (has_filter("geodir_cfa_css_class_{$field_type}")) { |
|
678 | 678 | |
679 | - echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
679 | + echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info); |
|
680 | 680 | |
681 | - }else{ |
|
681 | + } else { |
|
682 | 682 | $value = ''; |
683 | 683 | if (isset($field_info->css_class)) { |
684 | 684 | $value = esc_attr($field_info->css_class); |
685 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
685 | + }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) { |
|
686 | 686 | $value = $cf['defaults']['css_class']; |
687 | 687 | } |
688 | 688 | ?> |
@@ -691,8 +691,8 @@ discard block |
||
691 | 691 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
692 | 692 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?> |
693 | 693 | <div class="gdcf-tooltip"> |
694 | - <?php _e('Enter custom css class for field custom style.', 'geodirectory');?> |
|
695 | - <?php if($field_type=='multiselect'){_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory');}?> |
|
694 | + <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?> |
|
695 | + <?php if ($field_type == 'multiselect') {_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory'); }?> |
|
696 | 696 | </div> |
697 | 697 | </label> |
698 | 698 | <div class="gd-cf-input-wrap"> |
@@ -707,23 +707,23 @@ discard block |
||
707 | 707 | |
708 | 708 | |
709 | 709 | // cat_sort |
710 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
710 | + if (has_filter("geodir_cfa_cat_sort_{$field_type}")) { |
|
711 | 711 | |
712 | - echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
712 | + echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info); |
|
713 | 713 | |
714 | - }else{ |
|
714 | + } else { |
|
715 | 715 | $value = ''; |
716 | - $hide_cat_sort =''; |
|
716 | + $hide_cat_sort = ''; |
|
717 | 717 | if (isset($field_info->cat_sort)) { |
718 | 718 | $value = esc_attr($field_info->cat_sort); |
719 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
719 | + }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) { |
|
720 | 720 | $value = $cf['defaults']['cat_sort']; |
721 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
721 | + $hide_cat_sort = ($value === false) ? "style='display:none;'" : ''; |
|
722 | 722 | } |
723 | 723 | |
724 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
724 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : ''; |
|
725 | 725 | ?> |
726 | - <li <?php echo $hide_cat_sort ;?>> |
|
726 | + <li <?php echo $hide_cat_sort; ?>> |
|
727 | 727 | <h3><?php |
728 | 728 | /** |
729 | 729 | * Filter the section title. |
@@ -742,23 +742,23 @@ discard block |
||
742 | 742 | <label for="cat_sort" class="gd-cf-tooltip-wrap"> |
743 | 743 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?> |
744 | 744 | <div class="gdcf-tooltip"> |
745 | - <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?> |
|
745 | + <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?> |
|
746 | 746 | </div> |
747 | 747 | </label> |
748 | 748 | |
749 | 749 | <div class="gd-cf-input-wrap gd-switch"> |
750 | 750 | |
751 | - <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled" value="1" |
|
751 | + <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled" value="1" |
|
752 | 752 | <?php if ($value == '1') { |
753 | 753 | echo 'checked'; |
754 | 754 | } ?>/> |
755 | - <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
755 | + <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
756 | 756 | |
757 | - <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0" |
|
757 | + <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0" |
|
758 | 758 | <?php if (!$value) { |
759 | 759 | echo 'checked'; |
760 | 760 | } ?>/> |
761 | - <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
761 | + <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
762 | 762 | |
763 | 763 | </div> |
764 | 764 | </li> |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | * @param object $field_info The current fields info. |
786 | 786 | * @param array $cf The custom field settings |
787 | 787 | */ |
788 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
788 | + do_action('geodir_advance_custom_fields', $field_info, $cf); ?> |
|
789 | 789 | |
790 | 790 | |
791 | 791 | <?php endswitch; ?> |
@@ -797,10 +797,10 @@ discard block |
||
797 | 797 | <h3></h3> |
798 | 798 | </label> |
799 | 799 | <div class="gd-cf-input-wrap"> |
800 | - <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>" |
|
800 | + <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>" |
|
801 | 801 | onclick="save_field('<?php echo esc_attr($result_str); ?>')"/> |
802 | 802 | <?php if (!$default): ?> |
803 | - <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>" |
|
803 | + <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>" |
|
804 | 804 | onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')" |
805 | 805 | class="button"/></a> |
806 | 806 | <?php endif; ?> |
@@ -353,7 +353,7 @@ |
||
353 | 353 | |
354 | 354 | if(!$cpt_left){ |
355 | 355 | $cpt_left = "gd-cpt-flat"; |
356 | - }else{ |
|
356 | + } else{ |
|
357 | 357 | $cpt_left = ''; |
358 | 358 | } |
359 | 359 |
@@ -17,370 +17,370 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function geodir_custom_fields_predefined($post_type=''){ |
19 | 19 | |
20 | - $custom_fields = array(); |
|
21 | - |
|
22 | - |
|
23 | - // price |
|
24 | - $custom_fields['price'] = array( // The key value should be unique and not contain any spaces. |
|
25 | - 'field_type' => 'text', |
|
26 | - 'class' => 'gd-price', |
|
27 | - 'icon' => 'fa fa-usd', |
|
28 | - 'name' => __('Price', 'geodirectory'), |
|
29 | - 'description' => __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'), |
|
30 | - 'defaults' => array( |
|
31 | - 'data_type' => 'FLOAT', |
|
32 | - 'decimal_point' => '2', |
|
33 | - 'admin_title' => 'Price', |
|
34 | - 'site_title' => 'Price', |
|
35 | - 'admin_desc' => 'Enter the price in $ (no currency symbol)', |
|
36 | - 'htmlvar_name' => 'price', |
|
37 | - 'is_active' => true, |
|
38 | - 'for_admin_use' => false, |
|
39 | - 'default_value' => '', |
|
40 | - 'show_in' => '[detail],[listing]', |
|
41 | - 'is_required' => false, |
|
42 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
43 | - 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
44 | - 'required_msg' => '', |
|
45 | - 'field_icon' => 'fa fa-usd', |
|
46 | - 'css_class' => '', |
|
47 | - 'cat_sort' => true, |
|
48 | - 'cat_filter' => true, |
|
49 | - 'extra_fields' => array( |
|
50 | - 'is_price' => 1, |
|
51 | - 'thousand_separator' => 'comma', |
|
52 | - 'decimal_separator' => 'period', |
|
53 | - 'decimal_display' => 'if', |
|
54 | - 'currency_symbol' => '$', |
|
55 | - 'currency_symbol_placement' => 'left' |
|
56 | - ) |
|
57 | - ) |
|
58 | - ); |
|
59 | - |
|
60 | - // property status |
|
61 | - $custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces. |
|
62 | - 'field_type' => 'select', |
|
63 | - 'class' => 'gd-property-status', |
|
64 | - 'icon' => 'fa fa-home', |
|
65 | - 'name' => __('Property Status', 'geodirectory'), |
|
66 | - 'description' => __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'), |
|
67 | - 'defaults' => array( |
|
68 | - 'data_type' => 'VARCHAR', |
|
69 | - 'admin_title' => 'Property Status', |
|
70 | - 'site_title' => 'Property Status', |
|
71 | - 'admin_desc' => 'Enter the status of the property.', |
|
72 | - 'htmlvar_name' => 'property_status', |
|
73 | - 'is_active' => true, |
|
74 | - 'for_admin_use' => false, |
|
75 | - 'default_value' => '', |
|
76 | - 'show_in' => '[detail],[listing]', |
|
77 | - 'is_required' => true, |
|
78 | - 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
79 | - 'validation_pattern' => '', |
|
80 | - 'validation_msg' => '', |
|
81 | - 'required_msg' => '', |
|
82 | - 'field_icon' => 'fa fa-home', |
|
83 | - 'css_class' => '', |
|
84 | - 'cat_sort' => true, |
|
85 | - 'cat_filter' => true |
|
86 | - ) |
|
87 | - ); |
|
88 | - |
|
89 | - // property furnishing |
|
90 | - $custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces. |
|
91 | - 'field_type' => 'select', |
|
92 | - 'class' => 'gd-property-furnishing', |
|
93 | - 'icon' => 'fa fa-home', |
|
94 | - 'name' => __('Property Furnishing', 'geodirectory'), |
|
95 | - 'description' => __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'), |
|
96 | - 'defaults' => array( |
|
97 | - 'data_type' => 'VARCHAR', |
|
98 | - 'admin_title' => 'Furnishing', |
|
99 | - 'site_title' => 'Furnishing', |
|
100 | - 'admin_desc' => 'Enter the furnishing status of the property.', |
|
101 | - 'htmlvar_name' => 'property_furnishing', |
|
102 | - 'is_active' => true, |
|
103 | - 'for_admin_use' => false, |
|
104 | - 'default_value' => '', |
|
105 | - 'show_in' => '[detail],[listing]', |
|
106 | - 'is_required' => true, |
|
107 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
108 | - 'validation_pattern' => '', |
|
109 | - 'validation_msg' => '', |
|
110 | - 'required_msg' => '', |
|
111 | - 'field_icon' => 'fa fa-th-large', |
|
112 | - 'css_class' => '', |
|
113 | - 'cat_sort' => true, |
|
114 | - 'cat_filter' => true |
|
115 | - ) |
|
116 | - ); |
|
117 | - |
|
118 | - // property type |
|
119 | - $custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces. |
|
120 | - 'field_type' => 'select', |
|
121 | - 'class' => 'gd-property-type', |
|
122 | - 'icon' => 'fa fa-home', |
|
123 | - 'name' => __('Property Type', 'geodirectory'), |
|
124 | - 'description' => __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'), |
|
125 | - 'defaults' => array( |
|
126 | - 'data_type' => 'VARCHAR', |
|
127 | - 'admin_title' => 'Property Type', |
|
128 | - 'site_title' => 'Property Type', |
|
129 | - 'admin_desc' => 'Select the property type.', |
|
130 | - 'htmlvar_name' => 'property_type', |
|
131 | - 'is_active' => true, |
|
132 | - 'for_admin_use' => false, |
|
133 | - 'default_value' => '', |
|
134 | - 'show_in' => '[detail],[listing]', |
|
135 | - 'is_required' => true, |
|
136 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
137 | - 'validation_pattern' => '', |
|
138 | - 'validation_msg' => '', |
|
139 | - 'required_msg' => '', |
|
140 | - 'field_icon' => 'fa fa-home', |
|
141 | - 'css_class' => '', |
|
142 | - 'cat_sort' => true, |
|
143 | - 'cat_filter' => true |
|
144 | - ) |
|
145 | - ); |
|
146 | - |
|
147 | - // property bedrooms |
|
148 | - $custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces. |
|
149 | - 'field_type' => 'select', |
|
150 | - 'class' => 'gd-property-bedrooms', |
|
151 | - 'icon' => 'fa fa-home', |
|
152 | - 'name' => __('Property Bedrooms', 'geodirectory'), |
|
153 | - 'description' => __('Adds a select input for the number of bedrooms.', 'geodirectory'), |
|
154 | - 'defaults' => array( |
|
155 | - 'data_type' => 'VARCHAR', |
|
156 | - 'admin_title' => 'Property Bedrooms', |
|
157 | - 'site_title' => 'Bedrooms', |
|
158 | - 'admin_desc' => 'Select the number of bedrooms', |
|
159 | - 'htmlvar_name' => 'property_bedrooms', |
|
160 | - 'is_active' => true, |
|
161 | - 'for_admin_use' => false, |
|
162 | - 'default_value' => '', |
|
163 | - 'show_in' => '[detail],[listing]', |
|
164 | - 'is_required' => true, |
|
165 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
166 | - 'validation_pattern' => '', |
|
167 | - 'validation_msg' => '', |
|
168 | - 'required_msg' => '', |
|
169 | - 'field_icon' => 'fa fa-bed', |
|
170 | - 'css_class' => '', |
|
171 | - 'cat_sort' => true, |
|
172 | - 'cat_filter' => true |
|
173 | - ) |
|
174 | - ); |
|
175 | - |
|
176 | - // property bathrooms |
|
177 | - $custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces. |
|
178 | - 'field_type' => 'select', |
|
179 | - 'class' => 'gd-property-bathrooms', |
|
180 | - 'icon' => 'fa fa-home', |
|
181 | - 'name' => __('Property Bathrooms', 'geodirectory'), |
|
182 | - 'description' => __('Adds a select input for the number of bathrooms.', 'geodirectory'), |
|
183 | - 'defaults' => array( |
|
184 | - 'data_type' => 'VARCHAR', |
|
185 | - 'admin_title' => 'Property Bathrooms', |
|
186 | - 'site_title' => 'Bathrooms', |
|
187 | - 'admin_desc' => 'Select the number of bathrooms', |
|
188 | - 'htmlvar_name' => 'property_bathrooms', |
|
189 | - 'is_active' => true, |
|
190 | - 'for_admin_use' => false, |
|
191 | - 'default_value' => '', |
|
192 | - 'show_in' => '[detail],[listing]', |
|
193 | - 'is_required' => true, |
|
194 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
195 | - 'validation_pattern' => '', |
|
196 | - 'validation_msg' => '', |
|
197 | - 'required_msg' => '', |
|
198 | - 'field_icon' => 'fa fa-bold', |
|
199 | - 'css_class' => '', |
|
200 | - 'cat_sort' => true, |
|
201 | - 'cat_filter' => true |
|
202 | - ) |
|
203 | - ); |
|
204 | - |
|
205 | - // property area |
|
206 | - $custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces. |
|
207 | - 'field_type' => 'text', |
|
208 | - 'class' => 'gd-area', |
|
209 | - 'icon' => 'fa fa-home', |
|
210 | - 'name' => __('Property Area', 'geodirectory'), |
|
211 | - 'description' => __('Adds a input for the property area.', 'geodirectory'), |
|
212 | - 'defaults' => array( |
|
213 | - 'data_type' => 'FLOAT', |
|
214 | - 'admin_title' => 'Property Area', |
|
215 | - 'site_title' => 'Area (Sq Ft)', |
|
216 | - 'admin_desc' => 'Enter the Sq Ft value for the property', |
|
217 | - 'htmlvar_name' => 'property_area', |
|
218 | - 'is_active' => true, |
|
219 | - 'for_admin_use' => false, |
|
220 | - 'default_value' => '', |
|
221 | - 'show_in' => '[detail],[listing]', |
|
222 | - 'is_required' => false, |
|
223 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
224 | - 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
225 | - 'required_msg' => '', |
|
226 | - 'field_icon' => 'fa fa-area-chart', |
|
227 | - 'css_class' => '', |
|
228 | - 'cat_sort' => true, |
|
229 | - 'cat_filter' => true |
|
230 | - ) |
|
231 | - ); |
|
232 | - |
|
233 | - // property features |
|
234 | - $custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces. |
|
235 | - 'field_type' => 'multiselect', |
|
236 | - 'class' => 'gd-property-features', |
|
237 | - 'icon' => 'fa fa-home', |
|
238 | - 'name' => __('Property Features', 'geodirectory'), |
|
239 | - 'description' => __('Adds a select input for the property features.', 'geodirectory'), |
|
240 | - 'defaults' => array( |
|
241 | - 'data_type' => 'VARCHAR', |
|
242 | - 'admin_title' => 'Property Features', |
|
243 | - 'site_title' => 'Features', |
|
244 | - 'admin_desc' => 'Select the property features.', |
|
245 | - 'htmlvar_name' => 'property_features', |
|
246 | - 'is_active' => true, |
|
247 | - 'for_admin_use' => false, |
|
248 | - 'default_value' => '', |
|
249 | - 'show_in' => '[detail],[listing]', |
|
250 | - 'is_required' => true, |
|
251 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
252 | - 'validation_pattern' => '', |
|
253 | - 'validation_msg' => '', |
|
254 | - 'required_msg' => '', |
|
255 | - 'field_icon' => 'fa fa-plus-square', |
|
256 | - 'css_class' => '', |
|
257 | - 'cat_sort' => true, |
|
258 | - 'cat_filter' => true |
|
259 | - ) |
|
260 | - ); |
|
261 | - |
|
262 | - // Twitter feed |
|
263 | - $custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces. |
|
264 | - 'field_type' => 'text', |
|
265 | - 'class' => 'gd-twitter', |
|
266 | - 'icon' => 'fa fa-twitter', |
|
267 | - 'name' => __('Twitter feed', 'geodirectory'), |
|
268 | - 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
269 | - 'defaults' => array( |
|
270 | - 'data_type' => 'VARCHAR', |
|
271 | - 'admin_title' => 'Twitter', |
|
272 | - 'site_title' => 'Twitter', |
|
273 | - 'admin_desc' => 'Enter your Twitter username', |
|
274 | - 'htmlvar_name' => 'twitterusername', |
|
275 | - 'is_active' => true, |
|
276 | - 'for_admin_use' => false, |
|
277 | - 'default_value' => '', |
|
278 | - 'show_in' => '[detail],[owntab]', |
|
279 | - 'is_required' => false, |
|
280 | - 'validation_pattern' => '^[A-Za-z0-9_]{1,32}$', |
|
281 | - 'validation_msg' => 'Please enter a valid twitter username.', |
|
282 | - 'required_msg' => '', |
|
283 | - 'field_icon' => 'fa fa-twitter', |
|
284 | - 'css_class' => '', |
|
285 | - 'cat_sort' => false, |
|
286 | - 'cat_filter' => false |
|
287 | - ) |
|
288 | - ); |
|
289 | - |
|
290 | - // Get directions link |
|
291 | - $custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces. |
|
292 | - 'field_type' => 'text', |
|
293 | - 'class' => 'gd-get-directions', |
|
294 | - 'icon' => 'fa fa-location-arrow', |
|
295 | - 'name' => __('Get Directions Link', 'geodirectory'), |
|
296 | - 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
297 | - 'defaults' => array( |
|
298 | - 'data_type' => 'VARCHAR', |
|
299 | - 'admin_title' => 'Get Directions', |
|
300 | - 'site_title' => 'Get Directions', |
|
301 | - 'admin_desc' => '', |
|
302 | - 'htmlvar_name' => 'get_directions', |
|
303 | - 'is_active' => true, |
|
304 | - 'for_admin_use' => true, |
|
305 | - 'default_value' => 'Get Directions', |
|
306 | - 'show_in' => '[detail],[listing]', |
|
307 | - 'is_required' => false, |
|
308 | - 'validation_pattern' => '', |
|
309 | - 'validation_msg' => '', |
|
310 | - 'required_msg' => '', |
|
311 | - 'field_icon' => 'fa fa-location-arrow', |
|
312 | - 'css_class' => '', |
|
313 | - 'cat_sort' => false, |
|
314 | - 'cat_filter' => false |
|
315 | - ) |
|
316 | - ); |
|
317 | - |
|
318 | - |
|
319 | - // JOB TYPE CF |
|
320 | - |
|
321 | - // job type |
|
322 | - $custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces. |
|
323 | - 'field_type' => 'select', |
|
324 | - 'class' => 'gd-job-type', |
|
325 | - 'icon' => 'fa fa-briefcase', |
|
326 | - 'name' => __('Job Type', 'geodirectory'), |
|
327 | - 'description' => __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'), |
|
328 | - 'defaults' => array( |
|
329 | - 'data_type' => 'VARCHAR', |
|
330 | - 'admin_title' => __('Job Type', 'geodirectory'), |
|
331 | - 'site_title' => __('Job Type','geodirectory'), |
|
332 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
333 | - 'htmlvar_name' => 'job_type', |
|
334 | - 'is_active' => true, |
|
335 | - 'for_admin_use' => false, |
|
336 | - 'default_value' => '', |
|
337 | - 'show_in' => '[detail],[listing]', |
|
338 | - 'is_required' => true, |
|
339 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
340 | - 'validation_pattern' => '', |
|
341 | - 'validation_msg' => '', |
|
342 | - 'required_msg' => '', |
|
343 | - 'field_icon' => 'fa fa-briefcase', |
|
344 | - 'css_class' => '', |
|
345 | - 'cat_sort' => true, |
|
346 | - 'cat_filter' => true |
|
347 | - ) |
|
348 | - ); |
|
349 | - |
|
350 | - // job sector |
|
351 | - $custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces. |
|
352 | - 'field_type' => 'select', |
|
353 | - 'class' => 'gd-job-type', |
|
354 | - 'icon' => 'fa fa-briefcase', |
|
355 | - 'name' => __('Job Sector', 'geodirectory'), |
|
356 | - 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
|
357 | - 'defaults' => array( |
|
358 | - 'data_type' => 'VARCHAR', |
|
359 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
360 | - 'site_title' => __('Job Sector','geodirectory'), |
|
361 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
362 | - 'htmlvar_name' => 'job_sector', |
|
363 | - 'is_active' => true, |
|
364 | - 'for_admin_use' => false, |
|
365 | - 'default_value' => '', |
|
366 | - 'show_in' => '[detail]', |
|
367 | - 'is_required' => true, |
|
368 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
369 | - 'validation_pattern' => '', |
|
370 | - 'validation_msg' => '', |
|
371 | - 'required_msg' => '', |
|
372 | - 'field_icon' => 'fa fa-briefcase', |
|
373 | - 'css_class' => '', |
|
374 | - 'cat_sort' => true, |
|
375 | - 'cat_filter' => true |
|
376 | - ) |
|
377 | - ); |
|
378 | - |
|
379 | - |
|
380 | - /** |
|
381 | - * @see `geodir_custom_fields` |
|
382 | - */ |
|
383 | - return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
20 | + $custom_fields = array(); |
|
21 | + |
|
22 | + |
|
23 | + // price |
|
24 | + $custom_fields['price'] = array( // The key value should be unique and not contain any spaces. |
|
25 | + 'field_type' => 'text', |
|
26 | + 'class' => 'gd-price', |
|
27 | + 'icon' => 'fa fa-usd', |
|
28 | + 'name' => __('Price', 'geodirectory'), |
|
29 | + 'description' => __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'), |
|
30 | + 'defaults' => array( |
|
31 | + 'data_type' => 'FLOAT', |
|
32 | + 'decimal_point' => '2', |
|
33 | + 'admin_title' => 'Price', |
|
34 | + 'site_title' => 'Price', |
|
35 | + 'admin_desc' => 'Enter the price in $ (no currency symbol)', |
|
36 | + 'htmlvar_name' => 'price', |
|
37 | + 'is_active' => true, |
|
38 | + 'for_admin_use' => false, |
|
39 | + 'default_value' => '', |
|
40 | + 'show_in' => '[detail],[listing]', |
|
41 | + 'is_required' => false, |
|
42 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
43 | + 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
44 | + 'required_msg' => '', |
|
45 | + 'field_icon' => 'fa fa-usd', |
|
46 | + 'css_class' => '', |
|
47 | + 'cat_sort' => true, |
|
48 | + 'cat_filter' => true, |
|
49 | + 'extra_fields' => array( |
|
50 | + 'is_price' => 1, |
|
51 | + 'thousand_separator' => 'comma', |
|
52 | + 'decimal_separator' => 'period', |
|
53 | + 'decimal_display' => 'if', |
|
54 | + 'currency_symbol' => '$', |
|
55 | + 'currency_symbol_placement' => 'left' |
|
56 | + ) |
|
57 | + ) |
|
58 | + ); |
|
59 | + |
|
60 | + // property status |
|
61 | + $custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces. |
|
62 | + 'field_type' => 'select', |
|
63 | + 'class' => 'gd-property-status', |
|
64 | + 'icon' => 'fa fa-home', |
|
65 | + 'name' => __('Property Status', 'geodirectory'), |
|
66 | + 'description' => __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'), |
|
67 | + 'defaults' => array( |
|
68 | + 'data_type' => 'VARCHAR', |
|
69 | + 'admin_title' => 'Property Status', |
|
70 | + 'site_title' => 'Property Status', |
|
71 | + 'admin_desc' => 'Enter the status of the property.', |
|
72 | + 'htmlvar_name' => 'property_status', |
|
73 | + 'is_active' => true, |
|
74 | + 'for_admin_use' => false, |
|
75 | + 'default_value' => '', |
|
76 | + 'show_in' => '[detail],[listing]', |
|
77 | + 'is_required' => true, |
|
78 | + 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
79 | + 'validation_pattern' => '', |
|
80 | + 'validation_msg' => '', |
|
81 | + 'required_msg' => '', |
|
82 | + 'field_icon' => 'fa fa-home', |
|
83 | + 'css_class' => '', |
|
84 | + 'cat_sort' => true, |
|
85 | + 'cat_filter' => true |
|
86 | + ) |
|
87 | + ); |
|
88 | + |
|
89 | + // property furnishing |
|
90 | + $custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces. |
|
91 | + 'field_type' => 'select', |
|
92 | + 'class' => 'gd-property-furnishing', |
|
93 | + 'icon' => 'fa fa-home', |
|
94 | + 'name' => __('Property Furnishing', 'geodirectory'), |
|
95 | + 'description' => __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'), |
|
96 | + 'defaults' => array( |
|
97 | + 'data_type' => 'VARCHAR', |
|
98 | + 'admin_title' => 'Furnishing', |
|
99 | + 'site_title' => 'Furnishing', |
|
100 | + 'admin_desc' => 'Enter the furnishing status of the property.', |
|
101 | + 'htmlvar_name' => 'property_furnishing', |
|
102 | + 'is_active' => true, |
|
103 | + 'for_admin_use' => false, |
|
104 | + 'default_value' => '', |
|
105 | + 'show_in' => '[detail],[listing]', |
|
106 | + 'is_required' => true, |
|
107 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
108 | + 'validation_pattern' => '', |
|
109 | + 'validation_msg' => '', |
|
110 | + 'required_msg' => '', |
|
111 | + 'field_icon' => 'fa fa-th-large', |
|
112 | + 'css_class' => '', |
|
113 | + 'cat_sort' => true, |
|
114 | + 'cat_filter' => true |
|
115 | + ) |
|
116 | + ); |
|
117 | + |
|
118 | + // property type |
|
119 | + $custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces. |
|
120 | + 'field_type' => 'select', |
|
121 | + 'class' => 'gd-property-type', |
|
122 | + 'icon' => 'fa fa-home', |
|
123 | + 'name' => __('Property Type', 'geodirectory'), |
|
124 | + 'description' => __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'), |
|
125 | + 'defaults' => array( |
|
126 | + 'data_type' => 'VARCHAR', |
|
127 | + 'admin_title' => 'Property Type', |
|
128 | + 'site_title' => 'Property Type', |
|
129 | + 'admin_desc' => 'Select the property type.', |
|
130 | + 'htmlvar_name' => 'property_type', |
|
131 | + 'is_active' => true, |
|
132 | + 'for_admin_use' => false, |
|
133 | + 'default_value' => '', |
|
134 | + 'show_in' => '[detail],[listing]', |
|
135 | + 'is_required' => true, |
|
136 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
137 | + 'validation_pattern' => '', |
|
138 | + 'validation_msg' => '', |
|
139 | + 'required_msg' => '', |
|
140 | + 'field_icon' => 'fa fa-home', |
|
141 | + 'css_class' => '', |
|
142 | + 'cat_sort' => true, |
|
143 | + 'cat_filter' => true |
|
144 | + ) |
|
145 | + ); |
|
146 | + |
|
147 | + // property bedrooms |
|
148 | + $custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces. |
|
149 | + 'field_type' => 'select', |
|
150 | + 'class' => 'gd-property-bedrooms', |
|
151 | + 'icon' => 'fa fa-home', |
|
152 | + 'name' => __('Property Bedrooms', 'geodirectory'), |
|
153 | + 'description' => __('Adds a select input for the number of bedrooms.', 'geodirectory'), |
|
154 | + 'defaults' => array( |
|
155 | + 'data_type' => 'VARCHAR', |
|
156 | + 'admin_title' => 'Property Bedrooms', |
|
157 | + 'site_title' => 'Bedrooms', |
|
158 | + 'admin_desc' => 'Select the number of bedrooms', |
|
159 | + 'htmlvar_name' => 'property_bedrooms', |
|
160 | + 'is_active' => true, |
|
161 | + 'for_admin_use' => false, |
|
162 | + 'default_value' => '', |
|
163 | + 'show_in' => '[detail],[listing]', |
|
164 | + 'is_required' => true, |
|
165 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
166 | + 'validation_pattern' => '', |
|
167 | + 'validation_msg' => '', |
|
168 | + 'required_msg' => '', |
|
169 | + 'field_icon' => 'fa fa-bed', |
|
170 | + 'css_class' => '', |
|
171 | + 'cat_sort' => true, |
|
172 | + 'cat_filter' => true |
|
173 | + ) |
|
174 | + ); |
|
175 | + |
|
176 | + // property bathrooms |
|
177 | + $custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces. |
|
178 | + 'field_type' => 'select', |
|
179 | + 'class' => 'gd-property-bathrooms', |
|
180 | + 'icon' => 'fa fa-home', |
|
181 | + 'name' => __('Property Bathrooms', 'geodirectory'), |
|
182 | + 'description' => __('Adds a select input for the number of bathrooms.', 'geodirectory'), |
|
183 | + 'defaults' => array( |
|
184 | + 'data_type' => 'VARCHAR', |
|
185 | + 'admin_title' => 'Property Bathrooms', |
|
186 | + 'site_title' => 'Bathrooms', |
|
187 | + 'admin_desc' => 'Select the number of bathrooms', |
|
188 | + 'htmlvar_name' => 'property_bathrooms', |
|
189 | + 'is_active' => true, |
|
190 | + 'for_admin_use' => false, |
|
191 | + 'default_value' => '', |
|
192 | + 'show_in' => '[detail],[listing]', |
|
193 | + 'is_required' => true, |
|
194 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
195 | + 'validation_pattern' => '', |
|
196 | + 'validation_msg' => '', |
|
197 | + 'required_msg' => '', |
|
198 | + 'field_icon' => 'fa fa-bold', |
|
199 | + 'css_class' => '', |
|
200 | + 'cat_sort' => true, |
|
201 | + 'cat_filter' => true |
|
202 | + ) |
|
203 | + ); |
|
204 | + |
|
205 | + // property area |
|
206 | + $custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces. |
|
207 | + 'field_type' => 'text', |
|
208 | + 'class' => 'gd-area', |
|
209 | + 'icon' => 'fa fa-home', |
|
210 | + 'name' => __('Property Area', 'geodirectory'), |
|
211 | + 'description' => __('Adds a input for the property area.', 'geodirectory'), |
|
212 | + 'defaults' => array( |
|
213 | + 'data_type' => 'FLOAT', |
|
214 | + 'admin_title' => 'Property Area', |
|
215 | + 'site_title' => 'Area (Sq Ft)', |
|
216 | + 'admin_desc' => 'Enter the Sq Ft value for the property', |
|
217 | + 'htmlvar_name' => 'property_area', |
|
218 | + 'is_active' => true, |
|
219 | + 'for_admin_use' => false, |
|
220 | + 'default_value' => '', |
|
221 | + 'show_in' => '[detail],[listing]', |
|
222 | + 'is_required' => false, |
|
223 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
224 | + 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
225 | + 'required_msg' => '', |
|
226 | + 'field_icon' => 'fa fa-area-chart', |
|
227 | + 'css_class' => '', |
|
228 | + 'cat_sort' => true, |
|
229 | + 'cat_filter' => true |
|
230 | + ) |
|
231 | + ); |
|
232 | + |
|
233 | + // property features |
|
234 | + $custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces. |
|
235 | + 'field_type' => 'multiselect', |
|
236 | + 'class' => 'gd-property-features', |
|
237 | + 'icon' => 'fa fa-home', |
|
238 | + 'name' => __('Property Features', 'geodirectory'), |
|
239 | + 'description' => __('Adds a select input for the property features.', 'geodirectory'), |
|
240 | + 'defaults' => array( |
|
241 | + 'data_type' => 'VARCHAR', |
|
242 | + 'admin_title' => 'Property Features', |
|
243 | + 'site_title' => 'Features', |
|
244 | + 'admin_desc' => 'Select the property features.', |
|
245 | + 'htmlvar_name' => 'property_features', |
|
246 | + 'is_active' => true, |
|
247 | + 'for_admin_use' => false, |
|
248 | + 'default_value' => '', |
|
249 | + 'show_in' => '[detail],[listing]', |
|
250 | + 'is_required' => true, |
|
251 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
252 | + 'validation_pattern' => '', |
|
253 | + 'validation_msg' => '', |
|
254 | + 'required_msg' => '', |
|
255 | + 'field_icon' => 'fa fa-plus-square', |
|
256 | + 'css_class' => '', |
|
257 | + 'cat_sort' => true, |
|
258 | + 'cat_filter' => true |
|
259 | + ) |
|
260 | + ); |
|
261 | + |
|
262 | + // Twitter feed |
|
263 | + $custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces. |
|
264 | + 'field_type' => 'text', |
|
265 | + 'class' => 'gd-twitter', |
|
266 | + 'icon' => 'fa fa-twitter', |
|
267 | + 'name' => __('Twitter feed', 'geodirectory'), |
|
268 | + 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
269 | + 'defaults' => array( |
|
270 | + 'data_type' => 'VARCHAR', |
|
271 | + 'admin_title' => 'Twitter', |
|
272 | + 'site_title' => 'Twitter', |
|
273 | + 'admin_desc' => 'Enter your Twitter username', |
|
274 | + 'htmlvar_name' => 'twitterusername', |
|
275 | + 'is_active' => true, |
|
276 | + 'for_admin_use' => false, |
|
277 | + 'default_value' => '', |
|
278 | + 'show_in' => '[detail],[owntab]', |
|
279 | + 'is_required' => false, |
|
280 | + 'validation_pattern' => '^[A-Za-z0-9_]{1,32}$', |
|
281 | + 'validation_msg' => 'Please enter a valid twitter username.', |
|
282 | + 'required_msg' => '', |
|
283 | + 'field_icon' => 'fa fa-twitter', |
|
284 | + 'css_class' => '', |
|
285 | + 'cat_sort' => false, |
|
286 | + 'cat_filter' => false |
|
287 | + ) |
|
288 | + ); |
|
289 | + |
|
290 | + // Get directions link |
|
291 | + $custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces. |
|
292 | + 'field_type' => 'text', |
|
293 | + 'class' => 'gd-get-directions', |
|
294 | + 'icon' => 'fa fa-location-arrow', |
|
295 | + 'name' => __('Get Directions Link', 'geodirectory'), |
|
296 | + 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
297 | + 'defaults' => array( |
|
298 | + 'data_type' => 'VARCHAR', |
|
299 | + 'admin_title' => 'Get Directions', |
|
300 | + 'site_title' => 'Get Directions', |
|
301 | + 'admin_desc' => '', |
|
302 | + 'htmlvar_name' => 'get_directions', |
|
303 | + 'is_active' => true, |
|
304 | + 'for_admin_use' => true, |
|
305 | + 'default_value' => 'Get Directions', |
|
306 | + 'show_in' => '[detail],[listing]', |
|
307 | + 'is_required' => false, |
|
308 | + 'validation_pattern' => '', |
|
309 | + 'validation_msg' => '', |
|
310 | + 'required_msg' => '', |
|
311 | + 'field_icon' => 'fa fa-location-arrow', |
|
312 | + 'css_class' => '', |
|
313 | + 'cat_sort' => false, |
|
314 | + 'cat_filter' => false |
|
315 | + ) |
|
316 | + ); |
|
317 | + |
|
318 | + |
|
319 | + // JOB TYPE CF |
|
320 | + |
|
321 | + // job type |
|
322 | + $custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces. |
|
323 | + 'field_type' => 'select', |
|
324 | + 'class' => 'gd-job-type', |
|
325 | + 'icon' => 'fa fa-briefcase', |
|
326 | + 'name' => __('Job Type', 'geodirectory'), |
|
327 | + 'description' => __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'), |
|
328 | + 'defaults' => array( |
|
329 | + 'data_type' => 'VARCHAR', |
|
330 | + 'admin_title' => __('Job Type', 'geodirectory'), |
|
331 | + 'site_title' => __('Job Type','geodirectory'), |
|
332 | + 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
333 | + 'htmlvar_name' => 'job_type', |
|
334 | + 'is_active' => true, |
|
335 | + 'for_admin_use' => false, |
|
336 | + 'default_value' => '', |
|
337 | + 'show_in' => '[detail],[listing]', |
|
338 | + 'is_required' => true, |
|
339 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
340 | + 'validation_pattern' => '', |
|
341 | + 'validation_msg' => '', |
|
342 | + 'required_msg' => '', |
|
343 | + 'field_icon' => 'fa fa-briefcase', |
|
344 | + 'css_class' => '', |
|
345 | + 'cat_sort' => true, |
|
346 | + 'cat_filter' => true |
|
347 | + ) |
|
348 | + ); |
|
349 | + |
|
350 | + // job sector |
|
351 | + $custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces. |
|
352 | + 'field_type' => 'select', |
|
353 | + 'class' => 'gd-job-type', |
|
354 | + 'icon' => 'fa fa-briefcase', |
|
355 | + 'name' => __('Job Sector', 'geodirectory'), |
|
356 | + 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
|
357 | + 'defaults' => array( |
|
358 | + 'data_type' => 'VARCHAR', |
|
359 | + 'admin_title' => __('Job Sector','geodirectory'), |
|
360 | + 'site_title' => __('Job Sector','geodirectory'), |
|
361 | + 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
362 | + 'htmlvar_name' => 'job_sector', |
|
363 | + 'is_active' => true, |
|
364 | + 'for_admin_use' => false, |
|
365 | + 'default_value' => '', |
|
366 | + 'show_in' => '[detail]', |
|
367 | + 'is_required' => true, |
|
368 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
369 | + 'validation_pattern' => '', |
|
370 | + 'validation_msg' => '', |
|
371 | + 'required_msg' => '', |
|
372 | + 'field_icon' => 'fa fa-briefcase', |
|
373 | + 'css_class' => '', |
|
374 | + 'cat_sort' => true, |
|
375 | + 'cat_filter' => true |
|
376 | + ) |
|
377 | + ); |
|
378 | + |
|
379 | + |
|
380 | + /** |
|
381 | + * @see `geodir_custom_fields` |
|
382 | + */ |
|
383 | + return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | |
@@ -395,32 +395,32 @@ discard block |
||
395 | 395 | * @return string The html to output. |
396 | 396 | */ |
397 | 397 | function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){ |
398 | - global $post; |
|
398 | + global $post; |
|
399 | 399 | |
400 | 400 | |
401 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
401 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
402 | 402 | |
403 | - $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
403 | + $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
404 | 404 | |
405 | - $field_icon = geodir_field_icon_proccess($cf); |
|
406 | - if (strpos($field_icon, 'http') !== false) { |
|
407 | - $field_icon_af = ''; |
|
408 | - } elseif ($field_icon == '') { |
|
409 | - $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
410 | - } else { |
|
411 | - $field_icon_af = $field_icon; |
|
412 | - $field_icon = ''; |
|
413 | - } |
|
405 | + $field_icon = geodir_field_icon_proccess($cf); |
|
406 | + if (strpos($field_icon, 'http') !== false) { |
|
407 | + $field_icon_af = ''; |
|
408 | + } elseif ($field_icon == '') { |
|
409 | + $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
410 | + } else { |
|
411 | + $field_icon_af = $field_icon; |
|
412 | + $field_icon = ''; |
|
413 | + } |
|
414 | 414 | |
415 | 415 | |
416 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
416 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
417 | 417 | |
418 | - $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
|
419 | - $html .= '</div>'; |
|
418 | + $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
|
419 | + $html .= '</div>'; |
|
420 | 420 | |
421 | - endif; |
|
421 | + endif; |
|
422 | 422 | |
423 | - return $html; |
|
423 | + return $html; |
|
424 | 424 | } |
425 | 425 | add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3); |
426 | 426 | |
@@ -435,36 +435,36 @@ discard block |
||
435 | 435 | * @return string The html to output. |
436 | 436 | */ |
437 | 437 | function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) { |
438 | - global $post; |
|
438 | + global $post; |
|
439 | 439 | |
440 | 440 | |
441 | - if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
441 | + if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
442 | 442 | |
443 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
444 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
445 | - $field_icon_af = ''; |
|
446 | - } elseif ( $field_icon == '' ) { |
|
447 | - $field_icon_af = '<i class="fa fa-location-arrow"></i>'; |
|
448 | - } else { |
|
449 | - $field_icon_af = $field_icon; |
|
450 | - $field_icon = ''; |
|
451 | - } |
|
443 | + $field_icon = geodir_field_icon_proccess( $cf ); |
|
444 | + if ( strpos( $field_icon, 'http' ) !== false ) { |
|
445 | + $field_icon_af = ''; |
|
446 | + } elseif ( $field_icon == '' ) { |
|
447 | + $field_icon_af = '<i class="fa fa-location-arrow"></i>'; |
|
448 | + } else { |
|
449 | + $field_icon_af = $field_icon; |
|
450 | + $field_icon = ''; |
|
451 | + } |
|
452 | 452 | |
453 | - $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' ); |
|
453 | + $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' ); |
|
454 | 454 | |
455 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
455 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
456 | 456 | |
457 | - if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
458 | - $html .= $field_icon_af; |
|
459 | - } |
|
457 | + if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
458 | + $html .= $field_icon_af; |
|
459 | + } |
|
460 | 460 | |
461 | - $html .= '<a href="https://www.google.com/maps/dir//\'' . $post->post_latitude . ',' . $post->post_longitude . '\'/" target="_blank" >' . $link_text . '</a>'; |
|
462 | - $html .= '</div>'; |
|
461 | + $html .= '<a href="https://www.google.com/maps/dir//\'' . $post->post_latitude . ',' . $post->post_longitude . '\'/" target="_blank" >' . $link_text . '</a>'; |
|
462 | + $html .= '</div>'; |
|
463 | 463 | |
464 | - }else{ |
|
465 | - $html =''; |
|
466 | - } |
|
464 | + }else{ |
|
465 | + $html =''; |
|
466 | + } |
|
467 | 467 | |
468 | - return $html; |
|
468 | + return $html; |
|
469 | 469 | } |
470 | 470 | add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @package GeoDirectory |
16 | 16 | * @see `geodir_custom_field_save` for array details. |
17 | 17 | */ |
18 | -function geodir_custom_fields_predefined($post_type=''){ |
|
18 | +function geodir_custom_fields_predefined($post_type = '') { |
|
19 | 19 | |
20 | 20 | $custom_fields = array(); |
21 | 21 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'default_value' => '', |
76 | 76 | 'show_in' => '[detail],[listing]', |
77 | 77 | 'is_required' => true, |
78 | - 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
78 | + 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let', 'geodirectory'), |
|
79 | 79 | 'validation_pattern' => '', |
80 | 80 | 'validation_msg' => '', |
81 | 81 | 'required_msg' => '', |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'default_value' => '', |
105 | 105 | 'show_in' => '[detail],[listing]', |
106 | 106 | 'is_required' => true, |
107 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
107 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'), |
|
108 | 108 | 'validation_pattern' => '', |
109 | 109 | 'validation_msg' => '', |
110 | 110 | 'required_msg' => '', |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'default_value' => '', |
134 | 134 | 'show_in' => '[detail],[listing]', |
135 | 135 | 'is_required' => true, |
136 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
136 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage', 'geodirectory'), |
|
137 | 137 | 'validation_pattern' => '', |
138 | 138 | 'validation_msg' => '', |
139 | 139 | 'required_msg' => '', |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'default_value' => '', |
163 | 163 | 'show_in' => '[detail],[listing]', |
164 | 164 | 'is_required' => true, |
165 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
165 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
166 | 166 | 'validation_pattern' => '', |
167 | 167 | 'validation_msg' => '', |
168 | 168 | 'required_msg' => '', |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | 'default_value' => '', |
192 | 192 | 'show_in' => '[detail],[listing]', |
193 | 193 | 'is_required' => true, |
194 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
194 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
195 | 195 | 'validation_pattern' => '', |
196 | 196 | 'validation_msg' => '', |
197 | 197 | 'required_msg' => '', |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | 'default_value' => '', |
249 | 249 | 'show_in' => '[detail],[listing]', |
250 | 250 | 'is_required' => true, |
251 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
251 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'), |
|
252 | 252 | 'validation_pattern' => '', |
253 | 253 | 'validation_msg' => '', |
254 | 254 | 'required_msg' => '', |
@@ -328,15 +328,15 @@ discard block |
||
328 | 328 | 'defaults' => array( |
329 | 329 | 'data_type' => 'VARCHAR', |
330 | 330 | 'admin_title' => __('Job Type', 'geodirectory'), |
331 | - 'site_title' => __('Job Type','geodirectory'), |
|
332 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
331 | + 'site_title' => __('Job Type', 'geodirectory'), |
|
332 | + 'admin_desc' => __('Select the type of job.', 'geodirectory'), |
|
333 | 333 | 'htmlvar_name' => 'job_type', |
334 | 334 | 'is_active' => true, |
335 | 335 | 'for_admin_use' => false, |
336 | 336 | 'default_value' => '', |
337 | 337 | 'show_in' => '[detail],[listing]', |
338 | 338 | 'is_required' => true, |
339 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
339 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other', 'geodirectory'), |
|
340 | 340 | 'validation_pattern' => '', |
341 | 341 | 'validation_msg' => '', |
342 | 342 | 'required_msg' => '', |
@@ -356,16 +356,16 @@ discard block |
||
356 | 356 | 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
357 | 357 | 'defaults' => array( |
358 | 358 | 'data_type' => 'VARCHAR', |
359 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
360 | - 'site_title' => __('Job Sector','geodirectory'), |
|
361 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
359 | + 'admin_title' => __('Job Sector', 'geodirectory'), |
|
360 | + 'site_title' => __('Job Sector', 'geodirectory'), |
|
361 | + 'admin_desc' => __('Select the job sector.', 'geodirectory'), |
|
362 | 362 | 'htmlvar_name' => 'job_sector', |
363 | 363 | 'is_active' => true, |
364 | 364 | 'for_admin_use' => false, |
365 | 365 | 'default_value' => '', |
366 | 366 | 'show_in' => '[detail]', |
367 | 367 | 'is_required' => true, |
368 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
368 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies', 'geodirectory'), |
|
369 | 369 | 'validation_pattern' => '', |
370 | 370 | 'validation_msg' => '', |
371 | 371 | 'required_msg' => '', |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | /** |
381 | 381 | * @see `geodir_custom_fields` |
382 | 382 | */ |
383 | - return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
383 | + return apply_filters('geodir_custom_fields_predefined', $custom_fields, $post_type); |
|
384 | 384 | } |
385 | 385 | |
386 | 386 | |
@@ -394,11 +394,11 @@ discard block |
||
394 | 394 | * @since 1.6.9 |
395 | 395 | * @return string The html to output. |
396 | 396 | */ |
397 | -function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){ |
|
397 | +function geodir_predefined_custom_field_output_twitter_feed($html, $location, $cf) { |
|
398 | 398 | global $post; |
399 | 399 | |
400 | 400 | |
401 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
401 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
402 | 402 | |
403 | 403 | $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
404 | 404 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | |
416 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
416 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">'; |
|
417 | 417 | |
418 | 418 | $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
419 | 419 | $html .= '</div>'; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | |
423 | 423 | return $html; |
424 | 424 | } |
425 | -add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3); |
|
425 | +add_filter('geodir_custom_field_output_text_key_twitter_feed', 'geodir_predefined_custom_field_output_twitter_feed', 10, 3); |
|
426 | 426 | |
427 | 427 | /** |
428 | 428 | * Filter the get_directions custom field output to show a link. |
@@ -434,37 +434,37 @@ discard block |
||
434 | 434 | * @since 1.6.9 |
435 | 435 | * @return string The html to output. |
436 | 436 | */ |
437 | -function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) { |
|
437 | +function geodir_predefined_custom_field_output_get_directions($html, $location, $cf) { |
|
438 | 438 | global $post; |
439 | 439 | |
440 | 440 | |
441 | - if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
441 | + if (isset($post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset($post->post_latitude) && $post->post_latitude) { |
|
442 | 442 | |
443 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
444 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
443 | + $field_icon = geodir_field_icon_proccess($cf); |
|
444 | + if (strpos($field_icon, 'http') !== false) { |
|
445 | 445 | $field_icon_af = ''; |
446 | - } elseif ( $field_icon == '' ) { |
|
446 | + } elseif ($field_icon == '') { |
|
447 | 447 | $field_icon_af = '<i class="fa fa-location-arrow"></i>'; |
448 | 448 | } else { |
449 | 449 | $field_icon_af = $field_icon; |
450 | 450 | $field_icon = ''; |
451 | 451 | } |
452 | 452 | |
453 | - $link_text = isset( $post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __( 'Get Directions', 'geodirectory' ); |
|
453 | + $link_text = isset($post->{$cf['default_value']} ) ? $post->{$cf['default_value']} : __('Get Directions', 'geodirectory'); |
|
454 | 454 | |
455 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
455 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">'; |
|
456 | 456 | |
457 | - if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
457 | + if (isset($cf['field_icon']) && $cf['field_icon']) { |
|
458 | 458 | $html .= $field_icon_af; |
459 | 459 | } |
460 | 460 | |
461 | - $html .= '<a href="https://www.google.com/maps/dir//\'' . $post->post_latitude . ',' . $post->post_longitude . '\'/" target="_blank" >' . $link_text . '</a>'; |
|
461 | + $html .= '<a href="https://www.google.com/maps/dir//\''.$post->post_latitude.','.$post->post_longitude.'\'/" target="_blank" >'.$link_text.'</a>'; |
|
462 | 462 | $html .= '</div>'; |
463 | 463 | |
464 | - }else{ |
|
465 | - $html =''; |
|
464 | + } else { |
|
465 | + $html = ''; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | return $html; |
469 | 469 | } |
470 | -add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3); |
|
470 | +add_filter('geodir_custom_field_output_text_key_get_directions', 'geodir_predefined_custom_field_output_get_directions', 10, 3); |
@@ -2270,7 +2270,7 @@ discard block |
||
2270 | 2270 | |
2271 | 2271 | if ( $new_style ) { |
2272 | 2272 | $default_search_button_label = '<i class="fa fa-search" aria-hidden="true"></i>'; |
2273 | - }else{ |
|
2273 | + } else{ |
|
2274 | 2274 | $default_search_button_label = 'Search'; |
2275 | 2275 | } |
2276 | 2276 | if ( get_option( 'geodir_search_button_label' ) && get_option( 'geodir_search_button_label' ) != 'Search' ) { |
@@ -2297,7 +2297,7 @@ discard block |
||
2297 | 2297 | if ( $new_style ) { |
2298 | 2298 | ?> |
2299 | 2299 | <button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e( $default_search_button_label ,'geodirectory'); ?></button> |
2300 | -<?php }else{?> |
|
2300 | +<?php } else{?> |
|
2301 | 2301 | <input type="button" value="<?php esc_attr_e( $default_search_button_label ); ?>" |
2302 | 2302 | class="geodir_submit_search <?php echo $fa_class; ?>"/> |
2303 | 2303 | <?php } |
@@ -2349,16 +2349,16 @@ discard block |
||
2349 | 2349 | if ( $new_style ) { |
2350 | 2350 | echo "</div>"; |
2351 | 2351 | } |
2352 | - }else{ |
|
2352 | + } else{ |
|
2353 | 2353 | if(! empty( $post_types )){ |
2354 | 2354 | echo '<input type="hidden" name="stype" value="' . key( $post_types ) . '" />'; |
2355 | - }else{ |
|
2355 | + } else{ |
|
2356 | 2356 | echo '<input type="hidden" name="stype" value="gd_place" />'; |
2357 | 2357 | } |
2358 | 2358 | |
2359 | 2359 | } |
2360 | 2360 | |
2361 | - }elseif ( ! empty( $post_types ) ) { |
|
2361 | + } elseif ( ! empty( $post_types ) ) { |
|
2362 | 2362 | echo '<input type="hidden" name="stype" value="' . key( $post_types ) . '" />'; |
2363 | 2363 | } |
2364 | 2364 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * @param object|string $post The post object. |
162 | 162 | * @param string $post_type The post type. |
163 | 163 | * |
164 | - * @return object Returns filtered package info as an object. |
|
164 | + * @return string Returns filtered package info as an object. |
|
165 | 165 | */ |
166 | 166 | function geodir_post_package_info( $package_info, $post = '', $post_type = '' ) { |
167 | 167 | $package_info['pid'] = 0; |
@@ -2489,7 +2489,7 @@ discard block |
||
2489 | 2489 | * |
2490 | 2490 | * @since 1.5.0 |
2491 | 2491 | * |
2492 | - * @return True if WPML is active else False. |
|
2492 | + * @return boolean if WPML is active else False. |
|
2493 | 2493 | */ |
2494 | 2494 | function geodir_is_wpml() { |
2495 | 2495 | if (function_exists('icl_object_id')) { |
@@ -2620,7 +2620,7 @@ discard block |
||
2620 | 2620 | * @param int $master_post_id Original Post ID. |
2621 | 2621 | * @param int $tr_post_id Translation Post ID. |
2622 | 2622 | * @param string $lang Language code for translating post. |
2623 | - * @return bool True for success, False for fail. |
|
2623 | + * @return boolean|null True for success, False for fail. |
|
2624 | 2624 | */ |
2625 | 2625 | function geodir_icl_duplicate_taxonomies($master_post_id, $tr_post_id, $lang) { |
2626 | 2626 | global $sitepress, $wpdb; |
@@ -2362,10 +2362,10 @@ discard block |
||
2362 | 2362 | ?> |
2363 | 2363 | <input class="search_text" name="s" |
2364 | 2364 | value="<?php if ( isset( $_REQUEST['s'] ) && trim( $_REQUEST['s'] ) != '' ) { |
2365 | - echo esc_attr( stripslashes_deep( $_REQUEST['s'] ) ); |
|
2366 | - } else { |
|
2367 | - echo $default_search_for_text; |
|
2368 | - } ?>" type="text" |
|
2365 | + echo esc_attr( stripslashes_deep( $_REQUEST['s'] ) ); |
|
2366 | + } else { |
|
2367 | + echo $default_search_for_text; |
|
2368 | + } ?>" type="text" |
|
2369 | 2369 | onblur="if (this.value.trim() == '') {this.value = '<?php echo esc_sql( $default_search_for_text ); ?>';}" |
2370 | 2370 | onfocus="if (this.value == '<?php echo esc_sql( $default_search_for_text ); ?>') {this.value = '';}" |
2371 | 2371 | onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);"> |
@@ -2492,11 +2492,11 @@ discard block |
||
2492 | 2492 | * @return True if WPML is active else False. |
2493 | 2493 | */ |
2494 | 2494 | function geodir_is_wpml() { |
2495 | - if (function_exists('icl_object_id')) { |
|
2496 | - return true; |
|
2497 | - } |
|
2495 | + if (function_exists('icl_object_id')) { |
|
2496 | + return true; |
|
2497 | + } |
|
2498 | 2498 | |
2499 | - return false; |
|
2499 | + return false; |
|
2500 | 2500 | } |
2501 | 2501 | |
2502 | 2502 | /** |
@@ -2511,9 +2511,9 @@ discard block |
||
2511 | 2511 | * @return Language code. |
2512 | 2512 | */ |
2513 | 2513 | function geodir_get_language_for_element($element_id, $element_type) { |
2514 | - global $sitepress; |
|
2514 | + global $sitepress; |
|
2515 | 2515 | |
2516 | - return $sitepress->get_language_for_element($element_id, $element_type); |
|
2516 | + return $sitepress->get_language_for_element($element_id, $element_type); |
|
2517 | 2517 | } |
2518 | 2518 | |
2519 | 2519 | /** |
@@ -2528,25 +2528,25 @@ discard block |
||
2528 | 2528 | * @param int $tr_post_id Translation Post ID. |
2529 | 2529 | */ |
2530 | 2530 | function geodir_icl_make_duplicate($master_post_id, $lang, $postarr, $tr_post_id) { |
2531 | - global $sitepress; |
|
2531 | + global $sitepress; |
|
2532 | 2532 | |
2533 | - $post_type = get_post_type($master_post_id); |
|
2533 | + $post_type = get_post_type($master_post_id); |
|
2534 | 2534 | |
2535 | - if (in_array($post_type, geodir_get_posttypes())) { |
|
2536 | - // Duplicate post details |
|
2537 | - geodir_icl_duplicate_post_details($master_post_id, $tr_post_id, $lang); |
|
2535 | + if (in_array($post_type, geodir_get_posttypes())) { |
|
2536 | + // Duplicate post details |
|
2537 | + geodir_icl_duplicate_post_details($master_post_id, $tr_post_id, $lang); |
|
2538 | 2538 | |
2539 | - // Duplicate taxonomies |
|
2540 | - geodir_icl_duplicate_taxonomies($master_post_id, $tr_post_id, $lang); |
|
2539 | + // Duplicate taxonomies |
|
2540 | + geodir_icl_duplicate_taxonomies($master_post_id, $tr_post_id, $lang); |
|
2541 | 2541 | |
2542 | - // Duplicate post images |
|
2543 | - geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang); |
|
2542 | + // Duplicate post images |
|
2543 | + geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang); |
|
2544 | 2544 | |
2545 | - // Sync post reviews |
|
2546 | - if ($sitepress->get_setting('sync_comments_on_duplicates')) { |
|
2547 | - geodir_wpml_duplicate_post_reviews($master_post_id, $tr_post_id, $lang); |
|
2548 | - } |
|
2549 | - } |
|
2545 | + // Sync post reviews |
|
2546 | + if ($sitepress->get_setting('sync_comments_on_duplicates')) { |
|
2547 | + geodir_wpml_duplicate_post_reviews($master_post_id, $tr_post_id, $lang); |
|
2548 | + } |
|
2549 | + } |
|
2550 | 2550 | } |
2551 | 2551 | add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 ); |
2552 | 2552 | |
@@ -2563,17 +2563,17 @@ discard block |
||
2563 | 2563 | * @return bool True for success, False for fail. |
2564 | 2564 | */ |
2565 | 2565 | function geodir_wpml_duplicate_post_reviews($master_post_id, $tr_post_id, $lang) { |
2566 | - global $wpdb; |
|
2566 | + global $wpdb; |
|
2567 | 2567 | |
2568 | - $reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A); |
|
2568 | + $reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A); |
|
2569 | 2569 | |
2570 | - if (!empty($reviews)) { |
|
2571 | - foreach ($reviews as $review) { |
|
2572 | - geodir_wpml_duplicate_post_review($review['comment_id'], $master_post_id, $tr_post_id, $lang); |
|
2573 | - } |
|
2574 | - } |
|
2570 | + if (!empty($reviews)) { |
|
2571 | + foreach ($reviews as $review) { |
|
2572 | + geodir_wpml_duplicate_post_review($review['comment_id'], $master_post_id, $tr_post_id, $lang); |
|
2573 | + } |
|
2574 | + } |
|
2575 | 2575 | |
2576 | - return false; |
|
2576 | + return false; |
|
2577 | 2577 | } |
2578 | 2578 | |
2579 | 2579 | /** |
@@ -2590,23 +2590,23 @@ discard block |
||
2590 | 2590 | * @return bool True for success, False for fail. |
2591 | 2591 | */ |
2592 | 2592 | function geodir_icl_duplicate_post_details($master_post_id, $tr_post_id, $lang) { |
2593 | - global $wpdb, $plugin_prefix; |
|
2593 | + global $wpdb, $plugin_prefix; |
|
2594 | 2594 | |
2595 | - $post_type = get_post_type($master_post_id); |
|
2596 | - $post_table = $plugin_prefix . $post_type . '_detail'; |
|
2595 | + $post_type = get_post_type($master_post_id); |
|
2596 | + $post_table = $plugin_prefix . $post_type . '_detail'; |
|
2597 | 2597 | |
2598 | - $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id)); |
|
2599 | - $data = (array)$wpdb->get_row($query); |
|
2598 | + $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id)); |
|
2599 | + $data = (array)$wpdb->get_row($query); |
|
2600 | 2600 | |
2601 | - if ( !empty( $data ) ) { |
|
2602 | - $data['post_id'] = $tr_post_id; |
|
2603 | - unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
2601 | + if ( !empty( $data ) ) { |
|
2602 | + $data['post_id'] = $tr_post_id; |
|
2603 | + unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
2604 | 2604 | |
2605 | - $wpdb->update($post_table, $data, array('post_id' => $tr_post_id)); |
|
2606 | - return true; |
|
2607 | - } |
|
2605 | + $wpdb->update($post_table, $data, array('post_id' => $tr_post_id)); |
|
2606 | + return true; |
|
2607 | + } |
|
2608 | 2608 | |
2609 | - return false; |
|
2609 | + return false; |
|
2610 | 2610 | } |
2611 | 2611 | |
2612 | 2612 | /** |
@@ -2623,40 +2623,40 @@ discard block |
||
2623 | 2623 | * @return bool True for success, False for fail. |
2624 | 2624 | */ |
2625 | 2625 | function geodir_icl_duplicate_taxonomies($master_post_id, $tr_post_id, $lang) { |
2626 | - global $sitepress, $wpdb; |
|
2627 | - $post_type = get_post_type($master_post_id); |
|
2626 | + global $sitepress, $wpdb; |
|
2627 | + $post_type = get_post_type($master_post_id); |
|
2628 | 2628 | |
2629 | - remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language |
|
2629 | + remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language |
|
2630 | 2630 | |
2631 | - $taxonomies = get_object_taxonomies($post_type); |
|
2632 | - foreach ($taxonomies as $taxonomy) { |
|
2633 | - $terms = get_the_terms($master_post_id, $taxonomy); |
|
2634 | - $terms_array = array(); |
|
2631 | + $taxonomies = get_object_taxonomies($post_type); |
|
2632 | + foreach ($taxonomies as $taxonomy) { |
|
2633 | + $terms = get_the_terms($master_post_id, $taxonomy); |
|
2634 | + $terms_array = array(); |
|
2635 | 2635 | |
2636 | - if ($terms) { |
|
2637 | - foreach ($terms as $term) { |
|
2638 | - $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang); |
|
2636 | + if ($terms) { |
|
2637 | + foreach ($terms as $term) { |
|
2638 | + $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang); |
|
2639 | 2639 | |
2640 | - if (!is_null($tr_id)){ |
|
2641 | - // not using get_term - unfiltered get_term |
|
2642 | - $translated_term = $wpdb->get_row($wpdb->prepare(" |
|
2640 | + if (!is_null($tr_id)){ |
|
2641 | + // not using get_term - unfiltered get_term |
|
2642 | + $translated_term = $wpdb->get_row($wpdb->prepare(" |
|
2643 | 2643 | SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $taxonomy)); |
2644 | 2644 | |
2645 | - $terms_array[] = $translated_term->term_id; |
|
2646 | - } |
|
2647 | - } |
|
2645 | + $terms_array[] = $translated_term->term_id; |
|
2646 | + } |
|
2647 | + } |
|
2648 | 2648 | |
2649 | - if (!is_taxonomy_hierarchical($taxonomy)){ |
|
2650 | - $terms_array = array_unique( array_map( 'intval', $terms_array ) ); |
|
2651 | - } |
|
2649 | + if (!is_taxonomy_hierarchical($taxonomy)){ |
|
2650 | + $terms_array = array_unique( array_map( 'intval', $terms_array ) ); |
|
2651 | + } |
|
2652 | 2652 | |
2653 | - wp_set_post_terms($tr_post_id, $terms_array, $taxonomy); |
|
2653 | + wp_set_post_terms($tr_post_id, $terms_array, $taxonomy); |
|
2654 | 2654 | |
2655 | - if ($taxonomy == $post_type . 'category') { |
|
2656 | - geodir_set_postcat_structure($tr_post_id, $post_type . 'category'); |
|
2657 | - } |
|
2658 | - } |
|
2659 | - } |
|
2655 | + if ($taxonomy == $post_type . 'category') { |
|
2656 | + geodir_set_postcat_structure($tr_post_id, $post_type . 'category'); |
|
2657 | + } |
|
2658 | + } |
|
2659 | + } |
|
2660 | 2660 | } |
2661 | 2661 | |
2662 | 2662 | /** |
@@ -2672,29 +2672,29 @@ discard block |
||
2672 | 2672 | * @return bool True for success, False for fail. |
2673 | 2673 | */ |
2674 | 2674 | function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) { |
2675 | - global $wpdb; |
|
2675 | + global $wpdb; |
|
2676 | 2676 | |
2677 | - $query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
2678 | - $wpdb->query($query); |
|
2677 | + $query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
2678 | + $wpdb->query($query); |
|
2679 | 2679 | |
2680 | - $query = $wpdb->prepare("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id)); |
|
2681 | - $post_images = $wpdb->get_results($query); |
|
2680 | + $query = $wpdb->prepare("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id)); |
|
2681 | + $post_images = $wpdb->get_results($query); |
|
2682 | 2682 | |
2683 | - if ( !empty( $post_images ) ) { |
|
2684 | - foreach ( $post_images as $post_image) { |
|
2685 | - $image_data = (array)$post_image; |
|
2686 | - unset($image_data['ID']); |
|
2687 | - $image_data['post_id'] = $tr_post_id; |
|
2683 | + if ( !empty( $post_images ) ) { |
|
2684 | + foreach ( $post_images as $post_image) { |
|
2685 | + $image_data = (array)$post_image; |
|
2686 | + unset($image_data['ID']); |
|
2687 | + $image_data['post_id'] = $tr_post_id; |
|
2688 | 2688 | |
2689 | - $wpdb->insert(GEODIR_ATTACHMENT_TABLE, $image_data); |
|
2689 | + $wpdb->insert(GEODIR_ATTACHMENT_TABLE, $image_data); |
|
2690 | 2690 | |
2691 | - geodir_set_wp_featured_image($tr_post_id); |
|
2692 | - } |
|
2691 | + geodir_set_wp_featured_image($tr_post_id); |
|
2692 | + } |
|
2693 | 2693 | |
2694 | - return true; |
|
2695 | - } |
|
2694 | + return true; |
|
2695 | + } |
|
2696 | 2696 | |
2697 | - return false; |
|
2697 | + return false; |
|
2698 | 2698 | } |
2699 | 2699 | |
2700 | 2700 | |
@@ -2713,59 +2713,59 @@ discard block |
||
2713 | 2713 | * @return bool True for success, False for fail. |
2714 | 2714 | */ |
2715 | 2715 | function geodir_wpml_duplicate_post_review($master_comment_id, $master_post_id, $tr_post_id, $lang) { |
2716 | - global $wpdb, $plugin_prefix; |
|
2717 | - |
|
2718 | - $review = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A); |
|
2719 | - |
|
2720 | - if (empty($review)) { |
|
2721 | - return false; |
|
2722 | - } |
|
2723 | - if ($review['post_id'] != $master_post_id) { |
|
2724 | - $wpdb->query($wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id)); |
|
2725 | - geodir_update_postrating($master_post_id, $post_type); |
|
2726 | - } |
|
2727 | - |
|
2728 | - $tr_comment_id = geodir_wpml_duplicate_comment_exists($tr_post_id, $master_comment_id); |
|
2729 | - |
|
2730 | - if (empty($tr_comment_id)) { |
|
2731 | - return false; |
|
2732 | - } |
|
2733 | - |
|
2734 | - $post_type = get_post_type($master_post_id); |
|
2735 | - $post_table = $plugin_prefix . $post_type . '_detail'; |
|
2736 | - |
|
2737 | - $translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM " . $post_table . " WHERE post_id = %d", $tr_post_id), ARRAY_A); |
|
2738 | - if (empty($translated_post)) { |
|
2739 | - return false; |
|
2740 | - } |
|
2741 | - |
|
2742 | - $review['comment_id'] = $tr_comment_id; |
|
2743 | - $review['post_id'] = $tr_post_id; |
|
2744 | - $review['post_title'] = $translated_post['post_title']; |
|
2745 | - $review['post_city'] = $translated_post['post_city']; |
|
2746 | - $review['post_region'] = $translated_post['post_region']; |
|
2747 | - $review['post_country'] = $translated_post['post_country']; |
|
2748 | - $review['post_latitude'] = $translated_post['post_latitude']; |
|
2749 | - $review['post_longitude'] = $translated_post['post_longitude']; |
|
2750 | - |
|
2751 | - if (isset($review['id'])) { |
|
2752 | - unset($review['id']); |
|
2753 | - } |
|
2754 | - |
|
2755 | - $tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id)); |
|
2756 | - |
|
2757 | - if ($tr_review_id) { // update review |
|
2758 | - $wpdb->update(GEODIR_REVIEW_TABLE, $review, array('id' => $$tr_review_id)); |
|
2759 | - } else { // insert review |
|
2760 | - $wpdb->insert(GEODIR_REVIEW_TABLE, $review); |
|
2761 | - $tr_review_id = $wpdb->insert_id; |
|
2762 | - } |
|
2763 | - |
|
2764 | - if ($tr_post_id) { |
|
2765 | - geodir_update_postrating($tr_post_id, $post_type); |
|
2766 | - } |
|
2767 | - |
|
2768 | - return $tr_review_id; |
|
2716 | + global $wpdb, $plugin_prefix; |
|
2717 | + |
|
2718 | + $review = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A); |
|
2719 | + |
|
2720 | + if (empty($review)) { |
|
2721 | + return false; |
|
2722 | + } |
|
2723 | + if ($review['post_id'] != $master_post_id) { |
|
2724 | + $wpdb->query($wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id)); |
|
2725 | + geodir_update_postrating($master_post_id, $post_type); |
|
2726 | + } |
|
2727 | + |
|
2728 | + $tr_comment_id = geodir_wpml_duplicate_comment_exists($tr_post_id, $master_comment_id); |
|
2729 | + |
|
2730 | + if (empty($tr_comment_id)) { |
|
2731 | + return false; |
|
2732 | + } |
|
2733 | + |
|
2734 | + $post_type = get_post_type($master_post_id); |
|
2735 | + $post_table = $plugin_prefix . $post_type . '_detail'; |
|
2736 | + |
|
2737 | + $translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM " . $post_table . " WHERE post_id = %d", $tr_post_id), ARRAY_A); |
|
2738 | + if (empty($translated_post)) { |
|
2739 | + return false; |
|
2740 | + } |
|
2741 | + |
|
2742 | + $review['comment_id'] = $tr_comment_id; |
|
2743 | + $review['post_id'] = $tr_post_id; |
|
2744 | + $review['post_title'] = $translated_post['post_title']; |
|
2745 | + $review['post_city'] = $translated_post['post_city']; |
|
2746 | + $review['post_region'] = $translated_post['post_region']; |
|
2747 | + $review['post_country'] = $translated_post['post_country']; |
|
2748 | + $review['post_latitude'] = $translated_post['post_latitude']; |
|
2749 | + $review['post_longitude'] = $translated_post['post_longitude']; |
|
2750 | + |
|
2751 | + if (isset($review['id'])) { |
|
2752 | + unset($review['id']); |
|
2753 | + } |
|
2754 | + |
|
2755 | + $tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id)); |
|
2756 | + |
|
2757 | + if ($tr_review_id) { // update review |
|
2758 | + $wpdb->update(GEODIR_REVIEW_TABLE, $review, array('id' => $$tr_review_id)); |
|
2759 | + } else { // insert review |
|
2760 | + $wpdb->insert(GEODIR_REVIEW_TABLE, $review); |
|
2761 | + $tr_review_id = $wpdb->insert_id; |
|
2762 | + } |
|
2763 | + |
|
2764 | + if ($tr_post_id) { |
|
2765 | + geodir_update_postrating($tr_post_id, $post_type); |
|
2766 | + } |
|
2767 | + |
|
2768 | + return $tr_review_id; |
|
2769 | 2769 | } |
2770 | 2770 | |
2771 | 2771 | /** |
@@ -2780,36 +2780,36 @@ discard block |
||
2780 | 2780 | * @param int $comment_id The Comment ID. |
2781 | 2781 | */ |
2782 | 2782 | function gepdir_wpml_sync_comment($comment_id) { |
2783 | - global $wpdb, $sitepress, $gd_wpml_posttypes; |
|
2784 | - |
|
2785 | - if (empty($gd_post_types)) { |
|
2786 | - $gd_wpml_posttypes = geodir_get_posttypes(); |
|
2787 | - } |
|
2788 | - |
|
2789 | - $comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->comments} WHERE comment_ID=%d", $comment_id), ARRAY_A); |
|
2790 | - if (empty($comment)) { |
|
2791 | - return; |
|
2792 | - } |
|
2793 | - |
|
2794 | - $post_id = $comment['comment_post_ID']; |
|
2795 | - $post_type = $post_id ? get_post_type($post_id) : NULL; |
|
2796 | - |
|
2797 | - if (!($post_type && in_array($post_type, $gd_wpml_posttypes))) { |
|
2798 | - return; |
|
2799 | - } |
|
2800 | - |
|
2801 | - $post_duplicates = $sitepress->get_duplicates($post_id); |
|
2802 | - if (empty($post_duplicates)) { |
|
2803 | - return; |
|
2804 | - } |
|
2805 | - |
|
2806 | - foreach ($post_duplicates as $lang => $dup_post_id) { |
|
2807 | - if (empty($comment['comment_parent'])) { |
|
2808 | - geodir_wpml_duplicate_post_review($comment_id, $post_id, $dup_post_id, $lang); |
|
2809 | - } |
|
2810 | - } |
|
2783 | + global $wpdb, $sitepress, $gd_wpml_posttypes; |
|
2784 | + |
|
2785 | + if (empty($gd_post_types)) { |
|
2786 | + $gd_wpml_posttypes = geodir_get_posttypes(); |
|
2787 | + } |
|
2788 | + |
|
2789 | + $comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->comments} WHERE comment_ID=%d", $comment_id), ARRAY_A); |
|
2790 | + if (empty($comment)) { |
|
2791 | + return; |
|
2792 | + } |
|
2793 | + |
|
2794 | + $post_id = $comment['comment_post_ID']; |
|
2795 | + $post_type = $post_id ? get_post_type($post_id) : NULL; |
|
2796 | + |
|
2797 | + if (!($post_type && in_array($post_type, $gd_wpml_posttypes))) { |
|
2798 | + return; |
|
2799 | + } |
|
2800 | + |
|
2801 | + $post_duplicates = $sitepress->get_duplicates($post_id); |
|
2802 | + if (empty($post_duplicates)) { |
|
2803 | + return; |
|
2804 | + } |
|
2805 | + |
|
2806 | + foreach ($post_duplicates as $lang => $dup_post_id) { |
|
2807 | + if (empty($comment['comment_parent'])) { |
|
2808 | + geodir_wpml_duplicate_post_review($comment_id, $post_id, $dup_post_id, $lang); |
|
2809 | + } |
|
2810 | + } |
|
2811 | 2811 | |
2812 | - return true; |
|
2812 | + return true; |
|
2813 | 2813 | } |
2814 | 2814 | |
2815 | 2815 | /** |
@@ -2824,11 +2824,11 @@ discard block |
||
2824 | 2824 | * @return int The duplicate comment ID. |
2825 | 2825 | */ |
2826 | 2826 | function geodir_wpml_duplicate_comment_exists($dup_post_id, $original_cid) { |
2827 | - global $wpdb; |
|
2827 | + global $wpdb; |
|
2828 | 2828 | |
2829 | - $duplicate = $wpdb->get_var( |
|
2830 | - $wpdb->prepare( |
|
2831 | - " SELECT comm.comment_ID |
|
2829 | + $duplicate = $wpdb->get_var( |
|
2830 | + $wpdb->prepare( |
|
2831 | + " SELECT comm.comment_ID |
|
2832 | 2832 | FROM {$wpdb->comments} comm |
2833 | 2833 | JOIN {$wpdb->commentmeta} cm |
2834 | 2834 | ON comm.comment_ID = cm.comment_id |
@@ -2836,10 +2836,10 @@ discard block |
||
2836 | 2836 | AND cm.meta_key = '_icl_duplicate_of' |
2837 | 2837 | AND cm.meta_value = %d |
2838 | 2838 | LIMIT 1", |
2839 | - $dup_post_id, |
|
2840 | - $original_cid |
|
2841 | - ) |
|
2842 | - ); |
|
2839 | + $dup_post_id, |
|
2840 | + $original_cid |
|
2841 | + ) |
|
2842 | + ); |
|
2843 | 2843 | |
2844 | - return $duplicate; |
|
2844 | + return $duplicate; |
|
2845 | 2845 | } |
2846 | 2846 | \ No newline at end of file |
@@ -52,31 +52,31 @@ discard block |
||
52 | 52 | jQuery(listSel).children('li').switchClass('gridview_onehalf gridview_onethird gridview_onefourth', 'gridview_onefifth', 600); |
53 | 53 | } |
54 | 54 | |
55 | - jQuery.post("<?php echo geodir_get_ajax_url();?>&gd_listing_view=" + val, function (data) { |
|
55 | + jQuery.post("<?php echo geodir_get_ajax_url(); ?>&gd_listing_view=" + val, function (data) { |
|
56 | 56 | //alert(data ); |
57 | 57 | }); |
58 | 58 | } |
59 | 59 | </script> |
60 | 60 | <div class="geodir-list-view-select"> |
61 | 61 | <select name="gd_list_view" id="gd_list_view" onchange="geodir_list_view_select(this);"> |
62 | - <?php $listing_view = (int) $gd_session->get( 'gd_listing_view' ); ?> |
|
63 | - <option value=""><?php _e( 'View:', 'geodirectory' ); ?></option> |
|
62 | + <?php $listing_view = (int) $gd_session->get('gd_listing_view'); ?> |
|
63 | + <option value=""><?php _e('View:', 'geodirectory'); ?></option> |
|
64 | 64 | <option |
65 | - value="1" <?php selected( 1, $listing_view ); ?>><?php _e( 'View: List', 'geodirectory' ); ?></option> |
|
65 | + value="1" <?php selected(1, $listing_view); ?>><?php _e('View: List', 'geodirectory'); ?></option> |
|
66 | 66 | <option |
67 | - value="2" <?php selected( 2, $listing_view ); ?>><?php _e( 'View: Grid 2', 'geodirectory' ); ?></option> |
|
67 | + value="2" <?php selected(2, $listing_view); ?>><?php _e('View: Grid 2', 'geodirectory'); ?></option> |
|
68 | 68 | <option |
69 | - value="3" <?php selected( 3, $listing_view ); ?>><?php _e( 'View: Grid 3', 'geodirectory' ); ?></option> |
|
69 | + value="3" <?php selected(3, $listing_view); ?>><?php _e('View: Grid 3', 'geodirectory'); ?></option> |
|
70 | 70 | <option |
71 | - value="4" <?php selected( 4, $listing_view ); ?>><?php _e( 'View: Grid 4', 'geodirectory' ); ?></option> |
|
71 | + value="4" <?php selected(4, $listing_view); ?>><?php _e('View: Grid 4', 'geodirectory'); ?></option> |
|
72 | 72 | <option |
73 | - value="5" <?php selected( 5, $listing_view ); ?>><?php _e( 'View: Grid 5', 'geodirectory' ); ?></option> |
|
73 | + value="5" <?php selected(5, $listing_view); ?>><?php _e('View: Grid 5', 'geodirectory'); ?></option> |
|
74 | 74 | </select> |
75 | 75 | </div> |
76 | 76 | <?php |
77 | 77 | } |
78 | 78 | |
79 | -add_action( 'geodir_before_listing', 'geodir_list_view_select', 100 ); |
|
79 | +add_action('geodir_before_listing', 'geodir_list_view_select', 100); |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Limit the listing excerpt. |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | * @global object $post The current post object. |
92 | 92 | * @return string The modified excerpt. |
93 | 93 | */ |
94 | -function geodir_max_excerpt( $charlength ) { |
|
94 | +function geodir_max_excerpt($charlength) { |
|
95 | 95 | global $post; |
96 | - if ( $charlength == '0' ) { |
|
96 | + if ($charlength == '0') { |
|
97 | 97 | return; |
98 | 98 | } |
99 | 99 | $out = ''; |
@@ -101,46 +101,46 @@ discard block |
||
101 | 101 | $temp_post = $post; |
102 | 102 | $excerpt = get_the_excerpt(); |
103 | 103 | |
104 | - $charlength ++; |
|
105 | - $excerpt_more = function_exists( 'geodirf_excerpt_more' ) ? geodirf_excerpt_more( '' ) : geodir_excerpt_more( '' ); |
|
106 | - if ( mb_strlen( $excerpt ) > $charlength ) { |
|
107 | - if ( mb_strlen( $excerpt_more ) > 0 && mb_strpos( $excerpt, $excerpt_more ) !== false ) { |
|
108 | - $excut = - ( mb_strlen( $excerpt_more ) ); |
|
109 | - $subex = mb_substr( $excerpt, 0, $excut ); |
|
110 | - if ( $charlength > 0 && mb_strlen( $subex ) > $charlength ) { |
|
111 | - $subex = mb_substr( $subex, 0, $charlength ); |
|
104 | + $charlength++; |
|
105 | + $excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more(''); |
|
106 | + if (mb_strlen($excerpt) > $charlength) { |
|
107 | + if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) { |
|
108 | + $excut = - (mb_strlen($excerpt_more)); |
|
109 | + $subex = mb_substr($excerpt, 0, $excut); |
|
110 | + if ($charlength > 0 && mb_strlen($subex) > $charlength) { |
|
111 | + $subex = mb_substr($subex, 0, $charlength); |
|
112 | 112 | } |
113 | 113 | $out .= $subex; |
114 | 114 | } else { |
115 | - $subex = mb_substr( $excerpt, 0, $charlength - 5 ); |
|
116 | - $exwords = explode( ' ', $subex ); |
|
117 | - $excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) ); |
|
118 | - if ( $excut < 0 ) { |
|
119 | - $out .= mb_substr( $subex, 0, $excut ); |
|
115 | + $subex = mb_substr($excerpt, 0, $charlength - 5); |
|
116 | + $exwords = explode(' ', $subex); |
|
117 | + $excut = - (mb_strlen($exwords[count($exwords) - 1])); |
|
118 | + if ($excut < 0) { |
|
119 | + $out .= mb_substr($subex, 0, $excut); |
|
120 | 120 | } else { |
121 | 121 | $out .= $subex; |
122 | 122 | } |
123 | 123 | } |
124 | - $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">'; |
|
124 | + $out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">'; |
|
125 | 125 | /** |
126 | 126 | * Filter excerpt read more text. |
127 | 127 | * |
128 | 128 | * @since 1.0.0 |
129 | 129 | */ |
130 | - $out .= apply_filters( 'geodir_max_excerpt_end', __( 'Read more [...]', 'geodirectory' ) ); |
|
130 | + $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory')); |
|
131 | 131 | $out .= '</a>'; |
132 | 132 | |
133 | 133 | } else { |
134 | - if ( mb_strlen( $excerpt_more ) > 0 && mb_strpos( $excerpt, $excerpt_more ) !== false ) { |
|
135 | - $excut = - ( mb_strlen( $excerpt_more ) ); |
|
136 | - $out .= mb_substr( $excerpt, 0, $excut ); |
|
137 | - $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">'; |
|
134 | + if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) { |
|
135 | + $excut = - (mb_strlen($excerpt_more)); |
|
136 | + $out .= mb_substr($excerpt, 0, $excut); |
|
137 | + $out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">'; |
|
138 | 138 | /** |
139 | 139 | * Filter excerpt read more text. |
140 | 140 | * |
141 | 141 | * @since 1.0.0 |
142 | 142 | */ |
143 | - $out .= apply_filters( 'geodir_max_excerpt_end', __( 'Read more [...]', 'geodirectory' ) ); |
|
143 | + $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory')); |
|
144 | 144 | $out .= '</a>'; |
145 | 145 | } else { |
146 | 146 | $out .= $excerpt; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * |
164 | 164 | * @return object Returns filtered package info as an object. |
165 | 165 | */ |
166 | -function geodir_post_package_info( $package_info, $post = '', $post_type = '' ) { |
|
166 | +function geodir_post_package_info($package_info, $post = '', $post_type = '') { |
|
167 | 167 | $package_info['pid'] = 0; |
168 | 168 | $package_info['days'] = 0; |
169 | 169 | $package_info['amount'] = 0; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @param object|string $post The post object. |
193 | 193 | * @param string $post_type The post type. |
194 | 194 | */ |
195 | - return (object) apply_filters( 'geodir_post_package_info', $package_info, $post, $post_type ); |
|
195 | + return (object) apply_filters('geodir_post_package_info', $package_info, $post, $post_type); |
|
196 | 196 | |
197 | 197 | } |
198 | 198 | |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | * |
221 | 221 | * } |
222 | 222 | */ |
223 | -function geodir_send_inquiry( $request ) { |
|
223 | +function geodir_send_inquiry($request) { |
|
224 | 224 | global $wpdb; |
225 | 225 | |
226 | 226 | // strip slashes from text |
227 | - $request = ! empty( $request ) ? stripslashes_deep( $request ) : $request; |
|
227 | + $request = !empty($request) ? stripslashes_deep($request) : $request; |
|
228 | 228 | |
229 | 229 | $yourname = $request['inq_name']; |
230 | 230 | $youremail = $request['inq_email']; |
@@ -235,26 +235,26 @@ discard block |
||
235 | 235 | $author_id = ''; |
236 | 236 | $post_title = ''; |
237 | 237 | |
238 | - if ( $request['pid'] ) { |
|
238 | + if ($request['pid']) { |
|
239 | 239 | |
240 | 240 | $productinfosql = $wpdb->prepare( |
241 | 241 | "select ID,post_author,post_title from $wpdb->posts where ID =%d", |
242 | - array( $request['pid'] ) |
|
242 | + array($request['pid']) |
|
243 | 243 | ); |
244 | - $productinfo = $wpdb->get_row( $productinfosql ); |
|
244 | + $productinfo = $wpdb->get_row($productinfosql); |
|
245 | 245 | |
246 | 246 | $author_id = $productinfo->post_author; |
247 | 247 | $post_title = $productinfo->post_title; |
248 | 248 | } |
249 | 249 | |
250 | - $post_title = '<a href="' . get_permalink( $pid ) . '">' . $post_title . '</a>'; |
|
250 | + $post_title = '<a href="'.get_permalink($pid).'">'.$post_title.'</a>'; |
|
251 | 251 | |
252 | - $user_info = get_userdata( $author_id ); |
|
253 | - $to_email = geodir_get_post_meta( $pid, 'geodir_email', true ); |
|
254 | - $to_name = geodir_get_client_name( $author_id ); |
|
252 | + $user_info = get_userdata($author_id); |
|
253 | + $to_email = geodir_get_post_meta($pid, 'geodir_email', true); |
|
254 | + $to_name = geodir_get_client_name($author_id); |
|
255 | 255 | |
256 | - if ( $to_email == '' ) { |
|
257 | - $to_email = get_option( 'admin_email' ); |
|
256 | + if ($to_email == '') { |
|
257 | + $to_email = get_option('admin_email'); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | * } |
276 | 276 | * @param string $type The form type, default: `Enquiry`. |
277 | 277 | */ |
278 | - do_action( 'geodir_after_send_enquiry', $request, 'Enquiry' ); |
|
278 | + do_action('geodir_after_send_enquiry', $request, 'Enquiry'); |
|
279 | 279 | |
280 | 280 | $client_message = $frnd_comments; |
281 | - $client_message .= '<br>' . __( 'From :', 'geodirectory' ) . ' ' . $yourname . '<br>' . __( 'Phone :', 'geodirectory' ) . ' ' . $inq_phone . '<br>' . __( 'Email :', 'geodirectory' ) . ' ' . $youremail . '<br><br>' . __( 'Sent from', 'geodirectory' ) . ' - <b><a href="' . trailingslashit( home_url() ) . '">' . get_option( 'blogname' ) . '</a></b>.'; |
|
281 | + $client_message .= '<br>'.__('From :', 'geodirectory').' '.$yourname.'<br>'.__('Phone :', 'geodirectory').' '.$inq_phone.'<br>'.__('Email :', 'geodirectory').' '.$youremail.'<br><br>'.__('Sent from', 'geodirectory').' - <b><a href="'.trailingslashit(home_url()).'">'.get_option('blogname').'</a></b>.'; |
|
282 | 282 | /** |
283 | 283 | * Filter client message text. |
284 | 284 | * |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | * |
287 | 287 | * @param string $client_message Client message text. |
288 | 288 | */ |
289 | - $client_message = apply_filters( 'geodir_inquiry_email_msg', $client_message ); |
|
289 | + $client_message = apply_filters('geodir_inquiry_email_msg', $client_message); |
|
290 | 290 | |
291 | 291 | /** |
292 | 292 | * Called before the send enquiry email is sent. |
@@ -305,12 +305,12 @@ discard block |
||
305 | 305 | * |
306 | 306 | * } |
307 | 307 | */ |
308 | - do_action( 'geodir_before_send_enquiry_email', $request ); |
|
309 | - if ( $to_email ) { |
|
308 | + do_action('geodir_before_send_enquiry_email', $request); |
|
309 | + if ($to_email) { |
|
310 | 310 | // strip slashes message |
311 | - $client_message = stripslashes_deep( $client_message ); |
|
311 | + $client_message = stripslashes_deep($client_message); |
|
312 | 312 | |
313 | - geodir_sendEmail( $youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid'] );//To client email |
|
313 | + geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']); //To client email |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -330,12 +330,12 @@ discard block |
||
330 | 330 | * |
331 | 331 | * } |
332 | 332 | */ |
333 | - do_action( 'geodir_after_send_enquiry_email', $request ); |
|
334 | - $url = get_permalink( $pid ); |
|
335 | - if ( strstr( $url, '?' ) ) { |
|
336 | - $url = $url . "&send_inquiry=success"; |
|
333 | + do_action('geodir_after_send_enquiry_email', $request); |
|
334 | + $url = get_permalink($pid); |
|
335 | + if (strstr($url, '?')) { |
|
336 | + $url = $url."&send_inquiry=success"; |
|
337 | 337 | } else { |
338 | - $url = $url . "?send_inquiry=success"; |
|
338 | + $url = $url."?send_inquiry=success"; |
|
339 | 339 | } |
340 | 340 | /** |
341 | 341 | * Filter redirect url after the send enquiry email is sent. |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | * |
345 | 345 | * @param string $url Redirect url. |
346 | 346 | */ |
347 | - $url = apply_filters( 'geodir_send_enquiry_after_submit_redirect', $url ); |
|
348 | - wp_redirect( $url ); |
|
347 | + $url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url); |
|
348 | + wp_redirect($url); |
|
349 | 349 | gd_die(); |
350 | 350 | |
351 | 351 | } |
@@ -374,11 +374,11 @@ discard block |
||
374 | 374 | * } |
375 | 375 | * @global object $wpdb WordPress Database object. |
376 | 376 | */ |
377 | -function geodir_send_friend( $request ) { |
|
377 | +function geodir_send_friend($request) { |
|
378 | 378 | global $wpdb; |
379 | 379 | |
380 | 380 | // strip slashes from text |
381 | - $request = ! empty( $request ) ? stripslashes_deep( $request ) : $request; |
|
381 | + $request = !empty($request) ? stripslashes_deep($request) : $request; |
|
382 | 382 | |
383 | 383 | $yourname = $request['yourname']; |
384 | 384 | $youremail = $request['youremail']; |
@@ -387,13 +387,13 @@ discard block |
||
387 | 387 | $pid = $request['pid']; |
388 | 388 | $to_email = $request['to_email']; |
389 | 389 | $to_name = $request['to_name']; |
390 | - if ( $request['pid'] ) { |
|
390 | + if ($request['pid']) { |
|
391 | 391 | $productinfosql = $wpdb->prepare( |
392 | 392 | "select ID,post_title from $wpdb->posts where ID =%d", |
393 | - array( $request['pid'] ) |
|
393 | + array($request['pid']) |
|
394 | 394 | ); |
395 | - $productinfo = $wpdb->get_results( $productinfosql ); |
|
396 | - foreach ( $productinfo as $productinfoObj ) { |
|
395 | + $productinfo = $wpdb->get_results($productinfosql); |
|
396 | + foreach ($productinfo as $productinfoObj) { |
|
397 | 397 | $post_title = $productinfoObj->post_title; |
398 | 398 | } |
399 | 399 | } |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | * |
418 | 418 | * } |
419 | 419 | */ |
420 | - do_action( 'geodir_before_send_to_friend_email', $request ); |
|
421 | - geodir_sendEmail( $youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid'] );//To client email |
|
420 | + do_action('geodir_before_send_to_friend_email', $request); |
|
421 | + geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']); //To client email |
|
422 | 422 | |
423 | 423 | /** |
424 | 424 | * Called after the send to friend email is sent. |
@@ -439,13 +439,13 @@ discard block |
||
439 | 439 | * |
440 | 440 | * } |
441 | 441 | */ |
442 | - do_action( 'geodir_after_send_to_friend_email', $request ); |
|
442 | + do_action('geodir_after_send_to_friend_email', $request); |
|
443 | 443 | |
444 | - $url = get_permalink( $pid ); |
|
445 | - if ( strstr( $url, '?' ) ) { |
|
446 | - $url = $url . "&sendtofrnd=success"; |
|
444 | + $url = get_permalink($pid); |
|
445 | + if (strstr($url, '?')) { |
|
446 | + $url = $url."&sendtofrnd=success"; |
|
447 | 447 | } else { |
448 | - $url = $url . "?sendtofrnd=success"; |
|
448 | + $url = $url."?sendtofrnd=success"; |
|
449 | 449 | } |
450 | 450 | /** |
451 | 451 | * Filter redirect url after the send to friend email is sent. |
@@ -454,8 +454,8 @@ discard block |
||
454 | 454 | * |
455 | 455 | * @param string $url Redirect url. |
456 | 456 | */ |
457 | - $url = apply_filters( 'geodir_send_to_friend_after_submit_redirect', $url ); |
|
458 | - wp_redirect( $url ); |
|
457 | + $url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url); |
|
458 | + wp_redirect($url); |
|
459 | 459 | gd_die(); |
460 | 460 | } |
461 | 461 | |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | * |
470 | 470 | * @param string $hash_key |
471 | 471 | */ |
472 | -function geodir_before_tab_content( $hash_key ) { |
|
473 | - switch ( $hash_key ) { |
|
472 | +function geodir_before_tab_content($hash_key) { |
|
473 | + switch ($hash_key) { |
|
474 | 474 | case 'post_info' : |
475 | 475 | echo '<div class="geodir-company_info field-group">'; |
476 | 476 | break; |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | * |
481 | 481 | * @since 1.0.0 |
482 | 482 | */ |
483 | - echo ' <div id="' . apply_filters( 'geodir_post_gallery_id', 'geodir-post-gallery' ) . '" class="clearfix" >'; |
|
483 | + echo ' <div id="'.apply_filters('geodir_post_gallery_id', 'geodir-post-gallery').'" class="clearfix" >'; |
|
484 | 484 | break; |
485 | 485 | case 'reviews' : |
486 | 486 | echo '<div id="reviews-wrap" class="clearfix"> '; |
@@ -504,8 +504,8 @@ discard block |
||
504 | 504 | * |
505 | 505 | * @param string $hash_key |
506 | 506 | */ |
507 | -function geodir_after_tab_content( $hash_key ) { |
|
508 | - switch ( $hash_key ) { |
|
507 | +function geodir_after_tab_content($hash_key) { |
|
508 | + switch ($hash_key) { |
|
509 | 509 | case 'post_info' : |
510 | 510 | echo '</div>'; |
511 | 511 | break; |
@@ -536,25 +536,25 @@ discard block |
||
536 | 536 | * @global object $wpdb WordPress Database object. |
537 | 537 | * @return bool|null|string Returns default sort results, when the post type is valid. Otherwise returns false. |
538 | 538 | */ |
539 | -function geodir_get_posts_default_sort( $post_type ) { |
|
539 | +function geodir_get_posts_default_sort($post_type) { |
|
540 | 540 | |
541 | 541 | global $wpdb; |
542 | 542 | |
543 | - if ( $post_type != '' ) { |
|
543 | + if ($post_type != '') { |
|
544 | 544 | |
545 | 545 | $all_postypes = geodir_get_posttypes(); |
546 | 546 | |
547 | - if ( ! in_array( $post_type, $all_postypes ) ) { |
|
547 | + if (!in_array($post_type, $all_postypes)) { |
|
548 | 548 | return false; |
549 | 549 | } |
550 | 550 | |
551 | - $sort_field_info = $wpdb->get_var( $wpdb->prepare( "select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type= %s and is_active=%d and is_default=%d", array( |
|
551 | + $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type= %s and is_active=%d and is_default=%d", array( |
|
552 | 552 | $post_type, |
553 | 553 | 1, |
554 | 554 | 1 |
555 | - ) ) ); |
|
555 | + ))); |
|
556 | 556 | |
557 | - if ( ! empty( $sort_field_info ) ) { |
|
557 | + if (!empty($sort_field_info)) { |
|
558 | 558 | return $sort_field_info; |
559 | 559 | } |
560 | 560 | |
@@ -574,20 +574,20 @@ discard block |
||
574 | 574 | * @global object $wpdb WordPress Database object. |
575 | 575 | * @return bool|mixed|void Returns sort results, when the post type is valid. Otherwise returns false. |
576 | 576 | */ |
577 | -function geodir_get_sort_options( $post_type ) { |
|
577 | +function geodir_get_sort_options($post_type) { |
|
578 | 578 | global $wpdb; |
579 | 579 | |
580 | - if ( $post_type != '' ) { |
|
580 | + if ($post_type != '') { |
|
581 | 581 | $all_postypes = geodir_get_posttypes(); |
582 | 582 | |
583 | - if ( ! in_array( $post_type, $all_postypes ) ) { |
|
583 | + if (!in_array($post_type, $all_postypes)) { |
|
584 | 584 | return false; |
585 | 585 | } |
586 | 586 | |
587 | - $sort_field_info = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array( |
|
587 | + $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array( |
|
588 | 588 | $post_type, |
589 | 589 | 1 |
590 | - ) ) ); |
|
590 | + ))); |
|
591 | 591 | |
592 | 592 | /** |
593 | 593 | * Filter post sort options. |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | * @param array $sort_field_info Unfiltered sort field array. |
598 | 598 | * @param string $post_type Post type. |
599 | 599 | */ |
600 | - return apply_filters( 'geodir_get_sort_options', $sort_field_info, $post_type ); |
|
600 | + return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type); |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | } |
@@ -618,63 +618,63 @@ discard block |
||
618 | 618 | * |
619 | 619 | * @since 1.4.4 |
620 | 620 | */ |
621 | - if ( is_search() ) { |
|
621 | + if (is_search()) { |
|
622 | 622 | return; |
623 | 623 | } |
624 | 624 | |
625 | 625 | $sort_by = ''; |
626 | 626 | |
627 | - if ( isset( $_REQUEST['sort_by'] ) ) { |
|
627 | + if (isset($_REQUEST['sort_by'])) { |
|
628 | 628 | $sort_by = $_REQUEST['sort_by']; |
629 | 629 | } |
630 | 630 | |
631 | 631 | $gd_post_type = geodir_get_current_posttype(); |
632 | 632 | |
633 | - $sort_options = geodir_get_sort_options( $gd_post_type ); |
|
633 | + $sort_options = geodir_get_sort_options($gd_post_type); |
|
634 | 634 | |
635 | 635 | |
636 | 636 | $sort_field_options = ''; |
637 | 637 | |
638 | - if ( ! empty( $sort_options ) ) { |
|
639 | - foreach ( $sort_options as $sort ) { |
|
640 | - $sort = stripslashes_deep( $sort ); // strip slashes |
|
638 | + if (!empty($sort_options)) { |
|
639 | + foreach ($sort_options as $sort) { |
|
640 | + $sort = stripslashes_deep($sort); // strip slashes |
|
641 | 641 | |
642 | - $label = __( $sort->site_title, 'geodirectory' ); |
|
642 | + $label = __($sort->site_title, 'geodirectory'); |
|
643 | 643 | |
644 | - if ( $sort->field_type == 'random' ) { |
|
644 | + if ($sort->field_type == 'random') { |
|
645 | 645 | $key = $sort->field_type; |
646 | - ( $sort_by == $key || ( $sort->is_default == '1' && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = ''; |
|
647 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>'; |
|
646 | + ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
647 | + $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>'; |
|
648 | 648 | } |
649 | 649 | |
650 | - if ( $sort->htmlvar_name == 'comment_count' ) { |
|
650 | + if ($sort->htmlvar_name == 'comment_count') { |
|
651 | 651 | $sort->htmlvar_name = 'rating_count'; |
652 | 652 | } |
653 | 653 | |
654 | - if ( $sort->sort_asc ) { |
|
655 | - $key = $sort->htmlvar_name . '_asc'; |
|
654 | + if ($sort->sort_asc) { |
|
655 | + $key = $sort->htmlvar_name.'_asc'; |
|
656 | 656 | $label = $sort->site_title; |
657 | - if ( $sort->asc_title ) { |
|
657 | + if ($sort->asc_title) { |
|
658 | 658 | $label = $sort->asc_title; |
659 | 659 | } |
660 | - ( $sort_by == $key || ( $sort->is_default == '1' && $sort->default_order == $key && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = ''; |
|
661 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>'; |
|
660 | + ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
661 | + $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>'; |
|
662 | 662 | } |
663 | 663 | |
664 | - if ( $sort->sort_desc ) { |
|
665 | - $key = $sort->htmlvar_name . '_desc'; |
|
664 | + if ($sort->sort_desc) { |
|
665 | + $key = $sort->htmlvar_name.'_desc'; |
|
666 | 666 | $label = $sort->site_title; |
667 | - if ( $sort->desc_title ) { |
|
667 | + if ($sort->desc_title) { |
|
668 | 668 | $label = $sort->desc_title; |
669 | 669 | } |
670 | - ( $sort_by == $key || ( $sort->is_default == '1' && $sort->default_order == $key && ! isset( $_REQUEST['sort_by'] ) ) ) ? $selected = 'selected="selected"' : $selected = ''; |
|
671 | - $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg( 'sort_by', $key ) ) . '">' . __( $label, 'geodirectory' ) . '</option>'; |
|
670 | + ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = ''; |
|
671 | + $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>'; |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | } |
675 | 675 | } |
676 | 676 | |
677 | - if ( $sort_field_options != '' ) { |
|
677 | + if ($sort_field_options != '') { |
|
678 | 678 | |
679 | 679 | ?> |
680 | 680 | |
@@ -683,9 +683,9 @@ discard block |
||
683 | 683 | <select name="sort_by" id="sort_by" onchange="javascript:window.location=this.value;"> |
684 | 684 | |
685 | 685 | <option |
686 | - value="<?php echo esc_url( add_query_arg( 'sort_by', '' ) ); ?>" <?php if ( $sort_by == '' ) { |
|
686 | + value="<?php echo esc_url(add_query_arg('sort_by', '')); ?>" <?php if ($sort_by == '') { |
|
687 | 687 | echo 'selected="selected"'; |
688 | - } ?>><?php _e( 'Sort By', 'geodirectory' ); ?></option><?php |
|
688 | + } ?>><?php _e('Sort By', 'geodirectory'); ?></option><?php |
|
689 | 689 | |
690 | 690 | echo $sort_field_options; ?> |
691 | 691 | |
@@ -713,9 +713,9 @@ discard block |
||
713 | 713 | * |
714 | 714 | * @return string Returns the section title. |
715 | 715 | */ |
716 | -function geodir_advance_customfields_heading( $title, $field_type ) { |
|
716 | +function geodir_advance_customfields_heading($title, $field_type) { |
|
717 | 717 | |
718 | - if ( in_array( $field_type, array( 'multiselect', 'textarea', 'taxonomy' ) ) ) { |
|
718 | + if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) { |
|
719 | 719 | $title = ''; |
720 | 720 | } |
721 | 721 | |
@@ -737,19 +737,19 @@ discard block |
||
737 | 737 | * @global object $gd_session GeoDirectory Session object. |
738 | 738 | * @return string Returns related posts html. |
739 | 739 | */ |
740 | -function geodir_related_posts_display( $request ) { |
|
741 | - if ( ! empty( $request ) ) { |
|
742 | - $before_title = ( isset( $request['before_title'] ) && ! empty( $request['before_title'] ) ) ? $request['before_title'] : ''; |
|
743 | - $after_title = ( isset( $request['after_title'] ) && ! empty( $request['after_title'] ) ) ? $request['after_title'] : ''; |
|
744 | - |
|
745 | - $title = ( isset( $request['title'] ) && ! empty( $request['title'] ) ) ? $request['title'] : __( 'Related Listings', 'geodirectory' ); |
|
746 | - $post_number = ( isset( $request['post_number'] ) && ! empty( $request['post_number'] ) ) ? $request['post_number'] : '5'; |
|
747 | - $relate_to = ( isset( $request['relate_to'] ) && ! empty( $request['relate_to'] ) ) ? $request['relate_to'] : 'category'; |
|
748 | - $layout = ( isset( $request['layout'] ) && ! empty( $request['layout'] ) ) ? $request['layout'] : 'gridview_onehalf'; |
|
749 | - $add_location_filter = ( isset( $request['add_location_filter'] ) && ! empty( $request['add_location_filter'] ) ) ? $request['add_location_filter'] : '0'; |
|
750 | - $listing_width = ( isset( $request['listing_width'] ) && ! empty( $request['listing_width'] ) ) ? $request['listing_width'] : ''; |
|
751 | - $list_sort = ( isset( $request['list_sort'] ) && ! empty( $request['list_sort'] ) ) ? $request['list_sort'] : 'latest'; |
|
752 | - $character_count = ( isset( $request['character_count'] ) && ! empty( $request['character_count'] ) ) ? $request['character_count'] : ''; |
|
740 | +function geodir_related_posts_display($request) { |
|
741 | + if (!empty($request)) { |
|
742 | + $before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : ''; |
|
743 | + $after_title = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : ''; |
|
744 | + |
|
745 | + $title = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory'); |
|
746 | + $post_number = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5'; |
|
747 | + $relate_to = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category'; |
|
748 | + $layout = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf'; |
|
749 | + $add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0'; |
|
750 | + $listing_width = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : ''; |
|
751 | + $list_sort = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest'; |
|
752 | + $character_count = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : ''; |
|
753 | 753 | |
754 | 754 | global $wpdb, $post, $gd_session, $related_nearest, $related_parent_lat, $related_parent_lon; |
755 | 755 | $related_parent_lat = !empty($post->post_latitude) ? $post->post_latitude : ''; |
@@ -757,10 +757,10 @@ discard block |
||
757 | 757 | $arr_detail_page_tabs = geodir_detail_page_tabs_list(); |
758 | 758 | |
759 | 759 | $related_listing_array = array(); |
760 | - if ( get_option( 'geodir_add_related_listing_posttypes' ) ) { |
|
761 | - $related_listing_array = get_option( 'geodir_add_related_listing_posttypes' ); |
|
760 | + if (get_option('geodir_add_related_listing_posttypes')) { |
|
761 | + $related_listing_array = get_option('geodir_add_related_listing_posttypes'); |
|
762 | 762 | } |
763 | - if ( isset($post->post_type) && in_array( $post->post_type, $related_listing_array ) ) { |
|
763 | + if (isset($post->post_type) && in_array($post->post_type, $related_listing_array)) { |
|
764 | 764 | $arr_detail_page_tabs['related_listing']['is_display'] = true; |
765 | 765 | } |
766 | 766 | |
@@ -772,90 +772,90 @@ discard block |
||
772 | 772 | $tax_field = 'id'; |
773 | 773 | $category = array(); |
774 | 774 | |
775 | - if ( isset( $_REQUEST['backandedit'] ) ) { |
|
776 | - $post = (object) $gd_session->get( 'listing' ); |
|
775 | + if (isset($_REQUEST['backandedit'])) { |
|
776 | + $post = (object) $gd_session->get('listing'); |
|
777 | 777 | $post_type = $post->listing_type; |
778 | - if ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) { |
|
778 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
779 | 779 | $post_id = $_REQUEST['pid']; |
780 | 780 | } |
781 | - } elseif ( isset( $_REQUEST['pid'] ) && $_REQUEST['pid'] != '' ) { |
|
782 | - $post = geodir_get_post_info( $_REQUEST['pid'] ); |
|
781 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
782 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
783 | 783 | $post_type = $post->post_type; |
784 | 784 | $post_id = $_REQUEST['pid']; |
785 | - } elseif ( isset( $post->post_type ) && $post->post_type != '' ) { |
|
785 | + } elseif (isset($post->post_type) && $post->post_type != '') { |
|
786 | 786 | $post_type = $post->post_type; |
787 | 787 | $post_id = $post->ID; |
788 | 788 | } |
789 | 789 | |
790 | - if ( $relate_to == 'category' ) { |
|
790 | + if ($relate_to == 'category') { |
|
791 | 791 | |
792 | - $category_taxonomy = $post_type . $relate_to; |
|
793 | - if ( isset( $post->{$category_taxonomy} ) && $post->{$category_taxonomy} != '' ) { |
|
794 | - $category = explode( ',', trim( $post->{$category_taxonomy}, ',' ) ); |
|
792 | + $category_taxonomy = $post_type.$relate_to; |
|
793 | + if (isset($post->{$category_taxonomy} ) && $post->{$category_taxonomy} != '') { |
|
794 | + $category = explode(',', trim($post->{$category_taxonomy}, ',')); |
|
795 | 795 | } |
796 | 796 | |
797 | - } elseif ( $relate_to == 'tags' ) { |
|
797 | + } elseif ($relate_to == 'tags') { |
|
798 | 798 | |
799 | - $category_taxonomy = $post_type . '_' . $relate_to; |
|
800 | - if ( $post->post_tags != '' ) { |
|
801 | - $category = explode( ',', trim( $post->post_tags, ',' ) ); |
|
799 | + $category_taxonomy = $post_type.'_'.$relate_to; |
|
800 | + if ($post->post_tags != '') { |
|
801 | + $category = explode(',', trim($post->post_tags, ',')); |
|
802 | 802 | } |
803 | 803 | $tax_field = 'name'; |
804 | 804 | } |
805 | 805 | |
806 | 806 | /* --- return false in invalid request --- */ |
807 | - if ( empty( $category ) ) { |
|
807 | + if (empty($category)) { |
|
808 | 808 | return false; |
809 | 809 | } |
810 | 810 | |
811 | 811 | $all_postypes = geodir_get_posttypes(); |
812 | 812 | |
813 | - if ( ! in_array( $post_type, $all_postypes ) ) { |
|
813 | + if (!in_array($post_type, $all_postypes)) { |
|
814 | 814 | return false; |
815 | 815 | } |
816 | 816 | |
817 | 817 | /* --- return false in invalid request --- */ |
818 | 818 | |
819 | 819 | $location_url = ''; |
820 | - if ( $add_location_filter != '0' ) { |
|
820 | + if ($add_location_filter != '0') { |
|
821 | 821 | $location_url = array(); |
822 | - $geodir_show_location_url = get_option( 'geodir_show_location_url' ); |
|
822 | + $geodir_show_location_url = get_option('geodir_show_location_url'); |
|
823 | 823 | |
824 | - $gd_city = get_query_var( 'gd_city' ); |
|
824 | + $gd_city = get_query_var('gd_city'); |
|
825 | 825 | |
826 | - if ( $gd_city ) { |
|
827 | - $gd_country = get_query_var( 'gd_country' ); |
|
828 | - $gd_region = get_query_var( 'gd_region' ); |
|
826 | + if ($gd_city) { |
|
827 | + $gd_country = get_query_var('gd_country'); |
|
828 | + $gd_region = get_query_var('gd_region'); |
|
829 | 829 | } else { |
830 | 830 | $location = geodir_get_default_location(); |
831 | 831 | |
832 | - $gd_country = isset( $location->country_slug ) ? $location->country_slug : ''; |
|
833 | - $gd_region = isset( $location->region_slug ) ? $location->region_slug : ''; |
|
834 | - $gd_city = isset( $location->city_slug ) ? $location->city_slug : ''; |
|
832 | + $gd_country = isset($location->country_slug) ? $location->country_slug : ''; |
|
833 | + $gd_region = isset($location->region_slug) ? $location->region_slug : ''; |
|
834 | + $gd_city = isset($location->city_slug) ? $location->city_slug : ''; |
|
835 | 835 | } |
836 | 836 | |
837 | - if ( $geodir_show_location_url == 'all' ) { |
|
837 | + if ($geodir_show_location_url == 'all') { |
|
838 | 838 | $location_url[] = $gd_country; |
839 | 839 | $location_url[] = $gd_region; |
840 | - } else if ( $geodir_show_location_url == 'country_city' ) { |
|
840 | + } else if ($geodir_show_location_url == 'country_city') { |
|
841 | 841 | $location_url[] = $gd_country; |
842 | - } else if ( $geodir_show_location_url == 'region_city' ) { |
|
842 | + } else if ($geodir_show_location_url == 'region_city') { |
|
843 | 843 | $location_url[] = $gd_region; |
844 | 844 | } |
845 | 845 | |
846 | 846 | $location_url[] = $gd_city; |
847 | 847 | |
848 | - $location_url = implode( '/', $location_url ); |
|
848 | + $location_url = implode('/', $location_url); |
|
849 | 849 | } |
850 | 850 | |
851 | 851 | |
852 | - if ( ! empty( $category ) ) { |
|
852 | + if (!empty($category)) { |
|
853 | 853 | global $geodir_add_location_url; |
854 | 854 | $geodir_add_location_url = '0'; |
855 | - if ( $add_location_filter != '0' ) { |
|
855 | + if ($add_location_filter != '0') { |
|
856 | 856 | $geodir_add_location_url = '1'; |
857 | 857 | } |
858 | - $viewall_url = get_term_link( (int) $category[0], $post_type . $category_taxonomy ); |
|
858 | + $viewall_url = get_term_link((int) $category[0], $post_type.$category_taxonomy); |
|
859 | 859 | $geodir_add_location_url = null; |
860 | 860 | } |
861 | 861 | ob_start(); |
@@ -865,24 +865,24 @@ discard block |
||
865 | 865 | <div class="geodir_locations geodir_location_listing"> |
866 | 866 | |
867 | 867 | <?php |
868 | - if ( isset( $request['is_widget'] ) && $request['is_widget'] == '1' ) { |
|
868 | + if (isset($request['is_widget']) && $request['is_widget'] == '1') { |
|
869 | 869 | /** geodir_before_title filter Documented in geodirectory_widgets.php */ |
870 | - $before_title = isset( $before_title ) ? $before_title : apply_filters( 'geodir_before_title', '<h3 class="widget-title">' ); |
|
870 | + $before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">'); |
|
871 | 871 | /** geodir_after_title filter Documented in geodirectory_widgets.php */ |
872 | - $after_title = isset( $after_title ) ? $after_title : apply_filters( 'geodir_after_title', '</h3>' ); |
|
872 | + $after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>'); |
|
873 | 873 | ?> |
874 | 874 | <div class="location_list_heading clearfix"> |
875 | - <?php echo $before_title . $title . $after_title; ?> |
|
875 | + <?php echo $before_title.$title.$after_title; ?> |
|
876 | 876 | </div> |
877 | 877 | <?php |
878 | 878 | } |
879 | 879 | $query_args = array( |
880 | 880 | 'posts_per_page' => $post_number, |
881 | 881 | 'is_geodir_loop' => true, |
882 | - 'gd_location' => ( $add_location_filter ) ? true : false, |
|
882 | + 'gd_location' => ($add_location_filter) ? true : false, |
|
883 | 883 | 'post_type' => $post_type, |
884 | 884 | 'order_by' => $list_sort, |
885 | - 'post__not_in' => array( $post_id ), |
|
885 | + 'post__not_in' => array($post_id), |
|
886 | 886 | 'excerpt_length' => $character_count, |
887 | 887 | 'related_listings' => $is_display |
888 | 888 | ); |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | 'terms' => $category |
894 | 894 | ); |
895 | 895 | |
896 | - $query_args['tax_query'] = array( $tax_query ); |
|
896 | + $query_args['tax_query'] = array($tax_query); |
|
897 | 897 | |
898 | 898 | global $gridview_columns, $post; |
899 | 899 | |
@@ -905,21 +905,21 @@ discard block |
||
905 | 905 | * @param array $query_args The query array. |
906 | 906 | * @param array $request Related posts request array. |
907 | 907 | */ |
908 | - $query_args = apply_filters( 'geodir_related_posts_widget_query_args', $query_args, $request ); |
|
908 | + $query_args = apply_filters('geodir_related_posts_widget_query_args', $query_args, $request); |
|
909 | 909 | |
910 | - query_posts( $query_args ); |
|
910 | + query_posts($query_args); |
|
911 | 911 | |
912 | - if ( strstr( $layout, 'gridview' ) ) { |
|
913 | - $listing_view_exp = explode( '_', $layout ); |
|
912 | + if (strstr($layout, 'gridview')) { |
|
913 | + $listing_view_exp = explode('_', $layout); |
|
914 | 914 | $gridview_columns = $layout; |
915 | 915 | $layout = $listing_view_exp[0]; |
916 | - } else if ( $layout == 'list' ) { |
|
916 | + } else if ($layout == 'list') { |
|
917 | 917 | $gridview_columns = ''; |
918 | 918 | } |
919 | 919 | $related_posts = true; |
920 | 920 | |
921 | 921 | $related_nearest = false; |
922 | - if ( $list_sort == 'nearest' ) { |
|
922 | + if ($list_sort == 'nearest') { |
|
923 | 923 | $related_nearest = true; |
924 | 924 | } |
925 | 925 | |
@@ -929,14 +929,14 @@ discard block |
||
929 | 929 | * |
930 | 930 | * @since 1.0.0 |
931 | 931 | */ |
932 | - $template = apply_filters( "geodir_template_part-related-listing-listview", geodir_locate_template( 'listing-listview' ) ); |
|
932 | + $template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview')); |
|
933 | 933 | |
934 | 934 | /** |
935 | 935 | * Includes related listing listview template. |
936 | 936 | * |
937 | 937 | * @since 1.0.0 |
938 | 938 | */ |
939 | - include( $template ); |
|
939 | + include($template); |
|
940 | 940 | |
941 | 941 | wp_reset_query(); |
942 | 942 | $post = $origi_post; |
@@ -964,12 +964,12 @@ discard block |
||
964 | 964 | function geodir_category_count_script() { |
965 | 965 | global $geodir_post_category_str; |
966 | 966 | |
967 | - if ( ! empty( $geodir_post_category_str ) ) { |
|
968 | - $geodir_post_category_str = serialize( $geodir_post_category_str ); |
|
967 | + if (!empty($geodir_post_category_str)) { |
|
968 | + $geodir_post_category_str = serialize($geodir_post_category_str); |
|
969 | 969 | } |
970 | 970 | |
971 | - $all_var['post_category_array'] = html_entity_decode( (string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8' ); |
|
972 | - $script = "var post_category_array = " . json_encode( $all_var ) . ';'; |
|
971 | + $all_var['post_category_array'] = html_entity_decode((string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8'); |
|
972 | + $script = "var post_category_array = ".json_encode($all_var).';'; |
|
973 | 973 | echo '<script>'; |
974 | 974 | echo $script; |
975 | 975 | echo '</script>'; |
@@ -984,8 +984,8 @@ discard block |
||
984 | 984 | * @return string Returns the default language. |
985 | 985 | */ |
986 | 986 | function geodir_get_map_default_language() { |
987 | - $geodir_default_map_language = get_option( 'geodir_default_map_language' ); |
|
988 | - if ( empty( $geodir_default_map_language ) ) { |
|
987 | + $geodir_default_map_language = get_option('geodir_default_map_language'); |
|
988 | + if (empty($geodir_default_map_language)) { |
|
989 | 989 | $geodir_default_map_language = 'en'; |
990 | 990 | } |
991 | 991 | |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | * |
997 | 997 | * @param string $geodir_default_map_language Default map language. |
998 | 998 | */ |
999 | - return apply_filters( 'geodir_default_map_language', $geodir_default_map_language ); |
|
999 | + return apply_filters('geodir_default_map_language', $geodir_default_map_language); |
|
1000 | 1000 | } |
1001 | 1001 | |
1002 | 1002 | /** |
@@ -1007,7 +1007,7 @@ discard block |
||
1007 | 1007 | * @return string Returns the api key. |
1008 | 1008 | */ |
1009 | 1009 | function geodir_get_map_api_key() { |
1010 | - $key = get_option( 'geodir_google_api_key' ); |
|
1010 | + $key = get_option('geodir_google_api_key'); |
|
1011 | 1011 | |
1012 | 1012 | /** |
1013 | 1013 | * Filter Google maps api key. |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | * |
1017 | 1017 | * @param string $key Google maps api key. |
1018 | 1018 | */ |
1019 | - return apply_filters( 'geodir_google_api_key', $key ); |
|
1019 | + return apply_filters('geodir_google_api_key', $key); |
|
1020 | 1020 | } |
1021 | 1021 | |
1022 | 1022 | |
@@ -1035,20 +1035,20 @@ discard block |
||
1035 | 1035 | global $wp, $post, $wp_query, $wpdb, $geodir_addon_list; |
1036 | 1036 | |
1037 | 1037 | $is_geodir_page = geodir_is_geodir_page(); |
1038 | - if ( ! $is_geodir_page ) { |
|
1038 | + if (!$is_geodir_page) { |
|
1039 | 1039 | return; |
1040 | 1040 | }// if non GD page, bail |
1041 | 1041 | |
1042 | 1042 | $use_gd_meta = true; |
1043 | - if ( class_exists( 'WPSEO_Frontend' ) || class_exists( 'All_in_One_SEO_Pack' ) ) { |
|
1043 | + if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) { |
|
1044 | 1044 | $use_gd_meta = false; |
1045 | 1045 | |
1046 | - if ( geodir_is_page( 'search' ) ) { |
|
1046 | + if (geodir_is_page('search')) { |
|
1047 | 1047 | $use_gd_meta = true; |
1048 | 1048 | } |
1049 | 1049 | } |
1050 | 1050 | |
1051 | - if ( ! $use_gd_meta ) { |
|
1051 | + if (!$use_gd_meta) { |
|
1052 | 1052 | return; |
1053 | 1053 | }// bail if Yoast Wordpress SEO or All_in_One_SEO_Pack active. |
1054 | 1054 | |
@@ -1056,170 +1056,170 @@ discard block |
||
1056 | 1056 | |
1057 | 1057 | $all_postypes = geodir_get_posttypes(); |
1058 | 1058 | |
1059 | - $geodir_taxonomies = geodir_get_taxonomies( '', true ); |
|
1059 | + $geodir_taxonomies = geodir_get_taxonomies('', true); |
|
1060 | 1060 | |
1061 | 1061 | $meta_desc = ''; |
1062 | 1062 | $meta_key = ''; |
1063 | - if ( isset( $current_term->ID ) && $current_term->ID == geodir_location_page_id() ) { |
|
1063 | + if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) { |
|
1064 | 1064 | /** |
1065 | 1065 | * Filter SEO meta location description. |
1066 | 1066 | * |
1067 | 1067 | * @since 1.0.0 |
1068 | 1068 | */ |
1069 | - $meta_desc = apply_filters( 'geodir_seo_meta_location_description', '' ); |
|
1069 | + $meta_desc = apply_filters('geodir_seo_meta_location_description', ''); |
|
1070 | 1070 | $meta_desc .= ''; |
1071 | 1071 | } |
1072 | - if ( have_posts() && is_single() OR is_page() ) { |
|
1073 | - while ( have_posts() ) { |
|
1072 | + if (have_posts() && is_single() OR is_page()) { |
|
1073 | + while (have_posts()) { |
|
1074 | 1074 | the_post(); |
1075 | 1075 | |
1076 | - if ( has_excerpt() ) { |
|
1077 | - $out_excerpt = strip_tags( strip_shortcodes( get_the_excerpt() ) ); |
|
1078 | - if ( empty( $out_excerpt ) ) { |
|
1079 | - $out_excerpt = strip_tags( do_shortcode( get_the_excerpt() ) ); |
|
1076 | + if (has_excerpt()) { |
|
1077 | + $out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt())); |
|
1078 | + if (empty($out_excerpt)) { |
|
1079 | + $out_excerpt = strip_tags(do_shortcode(get_the_excerpt())); |
|
1080 | 1080 | } |
1081 | - $out_excerpt = str_replace( array( "\r\n", "\r", "\n" ), "", $out_excerpt ); |
|
1081 | + $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt); |
|
1082 | 1082 | } else { |
1083 | - $out_excerpt = str_replace( array( "\r\n", "\r", "\n" ), "", $post->post_content ); |
|
1084 | - $out_excerpt = strip_tags( strip_shortcodes( $out_excerpt ) ); |
|
1085 | - if ( empty( $out_excerpt ) ) { |
|
1086 | - $out_excerpt = strip_tags( do_shortcode( $out_excerpt ) ); // parse short code from content |
|
1083 | + $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content); |
|
1084 | + $out_excerpt = strip_tags(strip_shortcodes($out_excerpt)); |
|
1085 | + if (empty($out_excerpt)) { |
|
1086 | + $out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content |
|
1087 | 1087 | } |
1088 | - $out_excerpt = trim( wp_trim_words( $out_excerpt, 35, '' ), '.!?,;:-' ); |
|
1088 | + $out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-'); |
|
1089 | 1089 | } |
1090 | 1090 | |
1091 | 1091 | $meta_desc .= $out_excerpt; |
1092 | 1092 | } |
1093 | - } elseif ( ( is_category() || is_tag() ) && isset( $current_term->taxonomy ) && in_array( $current_term->taxonomy, $geodir_taxonomies ) ) { |
|
1094 | - if ( is_category() ) { |
|
1095 | - $meta_desc .= __( "Posts related to Category:", 'geodirectory' ) . " " . ucfirst( single_cat_title( "", false ) ); |
|
1096 | - } elseif ( is_tag() ) { |
|
1097 | - $meta_desc .= __( "Posts related to Tag:", 'geodirectory' ) . " " . ucfirst( single_tag_title( "", false ) ); |
|
1093 | + } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) { |
|
1094 | + if (is_category()) { |
|
1095 | + $meta_desc .= __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", false)); |
|
1096 | + } elseif (is_tag()) { |
|
1097 | + $meta_desc .= __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", false)); |
|
1098 | 1098 | } |
1099 | - } elseif ( isset( $current_term->taxonomy ) && in_array( $current_term->taxonomy, $geodir_taxonomies ) ) { |
|
1100 | - $meta_desc .= isset( $current_term->description ) ? $current_term->description : ''; |
|
1099 | + } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) { |
|
1100 | + $meta_desc .= isset($current_term->description) ? $current_term->description : ''; |
|
1101 | 1101 | } |
1102 | 1102 | |
1103 | 1103 | |
1104 | 1104 | $geodir_post_type = geodir_get_current_posttype(); |
1105 | - $geodir_post_type_info = get_post_type_object( $geodir_post_type ); |
|
1106 | - $geodir_is_page_listing = geodir_is_page( 'listing' ) ? true : false; |
|
1107 | - |
|
1108 | - $category_taxonomy = geodir_get_taxonomies( $geodir_post_type ); |
|
1109 | - $tag_taxonomy = geodir_get_taxonomies( $geodir_post_type, true ); |
|
1110 | - |
|
1111 | - $geodir_is_category = isset( $category_taxonomy[0] ) && get_query_var( $category_taxonomy[0] ) ? get_query_var( $category_taxonomy[0] ) : false; |
|
1112 | - $geodir_is_tag = isset( $tag_taxonomy[0] ) && get_query_var( $tag_taxonomy[0] ) ? true : false; |
|
1113 | - |
|
1114 | - $geodir_is_search = geodir_is_page( 'search' ) ? true : false; |
|
1115 | - $geodir_is_location = geodir_is_page( 'location' ) ? true : false; |
|
1116 | - $geodir_location_manager = isset( $geodir_addon_list['geodir_location_manager'] ) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false; |
|
1117 | - $godir_location_terms = geodir_get_current_location_terms( 'query_vars' ); |
|
1118 | - $gd_city = $geodir_location_manager && isset( $godir_location_terms['gd_city'] ) ? $godir_location_terms['gd_city'] : null; |
|
1119 | - $gd_region = $geodir_location_manager && isset( $godir_location_terms['gd_region'] ) ? $godir_location_terms['gd_region'] : null; |
|
1120 | - $gd_country = $geodir_location_manager && isset( $godir_location_terms['gd_country'] ) ? $godir_location_terms['gd_country'] : null; |
|
1121 | - $replace_location = __( 'Everywhere', 'geodirectory' ); |
|
1105 | + $geodir_post_type_info = get_post_type_object($geodir_post_type); |
|
1106 | + $geodir_is_page_listing = geodir_is_page('listing') ? true : false; |
|
1107 | + |
|
1108 | + $category_taxonomy = geodir_get_taxonomies($geodir_post_type); |
|
1109 | + $tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true); |
|
1110 | + |
|
1111 | + $geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false; |
|
1112 | + $geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false; |
|
1113 | + |
|
1114 | + $geodir_is_search = geodir_is_page('search') ? true : false; |
|
1115 | + $geodir_is_location = geodir_is_page('location') ? true : false; |
|
1116 | + $geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false; |
|
1117 | + $godir_location_terms = geodir_get_current_location_terms('query_vars'); |
|
1118 | + $gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : null; |
|
1119 | + $gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : null; |
|
1120 | + $gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : null; |
|
1121 | + $replace_location = __('Everywhere', 'geodirectory'); |
|
1122 | 1122 | $location_id = null; |
1123 | - if ( $geodir_location_manager ) { |
|
1124 | - $sql = $wpdb->prepare( "SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array( $gd_city ) ); |
|
1125 | - $location_id = (int) $wpdb->get_var( $sql ); |
|
1123 | + if ($geodir_location_manager) { |
|
1124 | + $sql = $wpdb->prepare("SELECT location_id FROM ".POST_LOCATION_TABLE." WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city)); |
|
1125 | + $location_id = (int) $wpdb->get_var($sql); |
|
1126 | 1126 | $location_type = geodir_what_is_current_location(); |
1127 | - if ( $location_type == 'city' ) { |
|
1128 | - $replace_location = geodir_get_current_location( array( 'what' => 'city', 'echo' => false ) ); |
|
1129 | - } elseif ( $location_type == 'region' ) { |
|
1130 | - $replace_location = geodir_get_current_location( array( 'what' => 'region', 'echo' => false ) ); |
|
1131 | - } elseif ( $location_type == 'country' ) { |
|
1132 | - $replace_location = geodir_get_current_location( array( 'what' => 'country', 'echo' => false ) ); |
|
1133 | - $replace_location = __( $replace_location, 'geodirectory' ); |
|
1127 | + if ($location_type == 'city') { |
|
1128 | + $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false)); |
|
1129 | + } elseif ($location_type == 'region') { |
|
1130 | + $replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false)); |
|
1131 | + } elseif ($location_type == 'country') { |
|
1132 | + $replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false)); |
|
1133 | + $replace_location = __($replace_location, 'geodirectory'); |
|
1134 | 1134 | } |
1135 | - $country = get_query_var( 'gd_country' ); |
|
1136 | - $region = get_query_var( 'gd_region' ); |
|
1137 | - $city = get_query_var( 'gd_city' ); |
|
1135 | + $country = get_query_var('gd_country'); |
|
1136 | + $region = get_query_var('gd_region'); |
|
1137 | + $city = get_query_var('gd_city'); |
|
1138 | 1138 | $current_location = ''; |
1139 | - if ( $country != '' ) { |
|
1140 | - $current_location = get_actual_location_name( 'country', $country, true ); |
|
1139 | + if ($country != '') { |
|
1140 | + $current_location = get_actual_location_name('country', $country, true); |
|
1141 | 1141 | } |
1142 | - if ( $region != '' ) { |
|
1143 | - $current_location = get_actual_location_name( 'region', $region ); |
|
1142 | + if ($region != '') { |
|
1143 | + $current_location = get_actual_location_name('region', $region); |
|
1144 | 1144 | } |
1145 | - if ( $city != '' ) { |
|
1146 | - $current_location = get_actual_location_name( 'city', $city ); |
|
1145 | + if ($city != '') { |
|
1146 | + $current_location = get_actual_location_name('city', $city); |
|
1147 | 1147 | } |
1148 | 1148 | $replace_location = $current_location != '' ? $current_location : $replace_location; |
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | $geodir_meta_keys = ''; |
1152 | 1152 | $geodir_meta_desc = ''; |
1153 | - if ( $is_geodir_page && ! empty( $geodir_post_type_info ) ) { |
|
1154 | - if ( $geodir_is_page_listing || $geodir_is_search || geodir_is_page( 'add-listing' ) ) { |
|
1155 | - $geodir_meta_keys = isset( $geodir_post_type_info->seo['meta_keyword'] ) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys; |
|
1153 | + if ($is_geodir_page && !empty($geodir_post_type_info)) { |
|
1154 | + if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) { |
|
1155 | + $geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys; |
|
1156 | 1156 | |
1157 | - $geodir_meta_desc = isset( $geodir_post_type_info->description ) ? $geodir_post_type_info->description : $geodir_meta_desc; |
|
1158 | - $geodir_meta_desc = isset( $geodir_post_type_info->seo['meta_description'] ) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc; |
|
1157 | + $geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc; |
|
1158 | + $geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc; |
|
1159 | 1159 | |
1160 | - if ( $geodir_is_category ) { |
|
1161 | - $category = $geodir_is_category ? get_term_by( 'slug', $geodir_is_category, $category_taxonomy[0] ) : null; |
|
1162 | - if ( isset( $category->term_id ) && ! empty( $category->term_id ) ) { |
|
1160 | + if ($geodir_is_category) { |
|
1161 | + $category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : null; |
|
1162 | + if (isset($category->term_id) && !empty($category->term_id)) { |
|
1163 | 1163 | $category_id = $category->term_id; |
1164 | - $category_desc = trim( $category->description ) != '' ? trim( $category->description ) : get_tax_meta( $category_id, 'ct_cat_top_desc', false, $geodir_post_type ); |
|
1165 | - if ( $location_id ) { |
|
1166 | - $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id; |
|
1167 | - $cat_loc_option = get_option( $option_name ); |
|
1168 | - |
|
1169 | - $gd_cat_loc_default = ! empty( $cat_loc_option ) && isset( $cat_loc_option['gd_cat_loc_default'] ) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false; |
|
1170 | - if ( ! $gd_cat_loc_default ) { |
|
1171 | - $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id; |
|
1172 | - $option = get_option( $option_name ); |
|
1173 | - $category_desc = isset( $option['gd_cat_loc_desc'] ) && trim( $option['gd_cat_loc_desc'] ) != '' ? trim( $option['gd_cat_loc_desc'] ) : $category_desc; |
|
1164 | + $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type); |
|
1165 | + if ($location_id) { |
|
1166 | + $option_name = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id; |
|
1167 | + $cat_loc_option = get_option($option_name); |
|
1168 | + |
|
1169 | + $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false; |
|
1170 | + if (!$gd_cat_loc_default) { |
|
1171 | + $option_name = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id.'_'.$location_id; |
|
1172 | + $option = get_option($option_name); |
|
1173 | + $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc; |
|
1174 | 1174 | } |
1175 | 1175 | } |
1176 | - $geodir_meta_desc = __( "Posts related to Category:", 'geodirectory' ) . " " . ucfirst( single_cat_title( "", false ) ) . '. ' . $category_desc; |
|
1176 | + $geodir_meta_desc = __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", false)).'. '.$category_desc; |
|
1177 | 1177 | } |
1178 | - } else if ( $geodir_is_tag ) { |
|
1179 | - $geodir_meta_desc = __( "Posts related to Tag:", 'geodirectory' ) . " " . ucfirst( single_tag_title( "", false ) ) . '. ' . $geodir_meta_desc; |
|
1178 | + } else if ($geodir_is_tag) { |
|
1179 | + $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", false)).'. '.$geodir_meta_desc; |
|
1180 | 1180 | } |
1181 | 1181 | } |
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | |
1185 | 1185 | $gd_page = ''; |
1186 | - if ( geodir_is_page( 'home' ) ) { |
|
1186 | + if (geodir_is_page('home')) { |
|
1187 | 1187 | $gd_page = 'home'; |
1188 | - $meta_desc = ( get_option( 'geodir_meta_desc_homepage' ) ) ? get_option( 'geodir_meta_desc_homepage' ) : $meta_desc; |
|
1189 | - } elseif ( geodir_is_page( 'detail' ) ) { |
|
1188 | + $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc; |
|
1189 | + } elseif (geodir_is_page('detail')) { |
|
1190 | 1190 | $gd_page = 'detail'; |
1191 | - $meta_desc = ( get_option( 'geodir_meta_desc_detail' ) ) ? get_option( 'geodir_meta_desc_detail' ) : $meta_desc; |
|
1192 | - } elseif ( geodir_is_page( 'pt' ) ) { |
|
1191 | + $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc; |
|
1192 | + } elseif (geodir_is_page('pt')) { |
|
1193 | 1193 | $gd_page = 'pt'; |
1194 | - $meta_desc = ( get_option( 'geodir_meta_desc_pt' ) ) ? get_option( 'geodir_meta_desc_pt' ) : $meta_desc; |
|
1195 | - } elseif ( geodir_is_page( 'listing' ) ) { |
|
1194 | + $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc; |
|
1195 | + } elseif (geodir_is_page('listing')) { |
|
1196 | 1196 | $gd_page = 'listing'; |
1197 | - $meta_desc = ( get_option( 'geodir_meta_desc_listing' ) ) ? get_option( 'geodir_meta_desc_listing' ) : $meta_desc; |
|
1198 | - } elseif ( geodir_is_page( 'location' ) ) { |
|
1197 | + $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc; |
|
1198 | + } elseif (geodir_is_page('location')) { |
|
1199 | 1199 | $gd_page = 'location'; |
1200 | - $meta_desc = ( get_option( 'geodir_meta_desc_location' ) ) ? get_option( 'geodir_meta_desc_location' ) : $meta_desc; |
|
1201 | - $meta_desc = apply_filters( 'geodir_seo_meta_location_description', $meta_desc ); |
|
1200 | + $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc; |
|
1201 | + $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc); |
|
1202 | 1202 | |
1203 | - } elseif ( geodir_is_page( 'search' ) ) { |
|
1203 | + } elseif (geodir_is_page('search')) { |
|
1204 | 1204 | $gd_page = 'search'; |
1205 | - $meta_desc = ( get_option( 'geodir_meta_desc_search' ) ) ? get_option( 'geodir_meta_desc_search' ) : $meta_desc; |
|
1206 | - } elseif ( geodir_is_page( 'add-listing' ) ) { |
|
1205 | + $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc; |
|
1206 | + } elseif (geodir_is_page('add-listing')) { |
|
1207 | 1207 | $gd_page = 'add-listing'; |
1208 | - $meta_desc = ( get_option( 'geodir_meta_desc_add-listing' ) ) ? get_option( 'geodir_meta_desc_add-listing' ) : $meta_desc; |
|
1209 | - } elseif ( geodir_is_page( 'author' ) ) { |
|
1208 | + $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc; |
|
1209 | + } elseif (geodir_is_page('author')) { |
|
1210 | 1210 | $gd_page = 'author'; |
1211 | - $meta_desc = ( get_option( 'geodir_meta_desc_author' ) ) ? get_option( 'geodir_meta_desc_author' ) : $meta_desc; |
|
1212 | - } elseif ( geodir_is_page( 'login' ) ) { |
|
1211 | + $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc; |
|
1212 | + } elseif (geodir_is_page('login')) { |
|
1213 | 1213 | $gd_page = 'login'; |
1214 | - $meta_desc = ( get_option( 'geodir_meta_desc_login' ) ) ? get_option( 'geodir_meta_desc_login' ) : $meta_desc; |
|
1215 | - } elseif ( geodir_is_page( 'listing-success' ) ) { |
|
1214 | + $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc; |
|
1215 | + } elseif (geodir_is_page('listing-success')) { |
|
1216 | 1216 | $gd_page = 'listing-success'; |
1217 | - $meta_desc = ( get_option( 'geodir_meta_desc_listing-success' ) ) ? get_option( 'geodir_meta_desc_listing-success' ) : $meta_desc; |
|
1217 | + $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc; |
|
1218 | 1218 | } |
1219 | 1219 | |
1220 | 1220 | |
1221 | - if ( $meta_desc ) { |
|
1222 | - $meta_desc = stripslashes_deep( $meta_desc ); |
|
1221 | + if ($meta_desc) { |
|
1222 | + $meta_desc = stripslashes_deep($meta_desc); |
|
1223 | 1223 | /** |
1224 | 1224 | * Filter page description to replace variables. |
1225 | 1225 | * |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | * @param string $title The page description including variables. |
1229 | 1229 | * @param string $gd_page The GeoDirectory page type if any. |
1230 | 1230 | */ |
1231 | - $meta_desc = apply_filters( 'geodir_seo_meta_description_pre', __( $meta_desc, 'geodirectory' ), $gd_page, '' ); |
|
1231 | + $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'), $gd_page, ''); |
|
1232 | 1232 | |
1233 | 1233 | /** |
1234 | 1234 | * Filter SEO meta description. |
@@ -1237,49 +1237,49 @@ discard block |
||
1237 | 1237 | * |
1238 | 1238 | * @param string $meta_desc Meta description content. |
1239 | 1239 | */ |
1240 | - echo apply_filters( 'geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc ); |
|
1240 | + echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="'.$meta_desc.'" />', $meta_desc); |
|
1241 | 1241 | } |
1242 | 1242 | |
1243 | 1243 | // meta keywords |
1244 | - if ( isset( $post->post_type ) && in_array( $post->post_type, $all_postypes ) ) { |
|
1245 | - $place_tags = wp_get_post_terms( $post->ID, $post->post_type . '_tags', array( "fields" => "names" ) ); |
|
1246 | - $place_cats = wp_get_post_terms( $post->ID, $post->post_type . 'category', array( "fields" => "names" ) ); |
|
1244 | + if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) { |
|
1245 | + $place_tags = wp_get_post_terms($post->ID, $post->post_type.'_tags', array("fields" => "names")); |
|
1246 | + $place_cats = wp_get_post_terms($post->ID, $post->post_type.'category', array("fields" => "names")); |
|
1247 | 1247 | |
1248 | - $meta_key .= implode( ", ", array_merge( (array) $place_cats, (array) $place_tags ) ); |
|
1248 | + $meta_key .= implode(", ", array_merge((array) $place_cats, (array) $place_tags)); |
|
1249 | 1249 | } else { |
1250 | 1250 | $posttags = get_the_tags(); |
1251 | - if ( $posttags ) { |
|
1252 | - foreach ( $posttags as $tag ) { |
|
1253 | - $meta_key .= $tag->name . ' '; |
|
1251 | + if ($posttags) { |
|
1252 | + foreach ($posttags as $tag) { |
|
1253 | + $meta_key .= $tag->name.' '; |
|
1254 | 1254 | } |
1255 | 1255 | } else { |
1256 | - $tags = get_tags( array( 'orderby' => 'count', 'order' => 'DESC' ) ); |
|
1256 | + $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC')); |
|
1257 | 1257 | $xt = 1; |
1258 | 1258 | |
1259 | - foreach ( $tags as $tag ) { |
|
1260 | - if ( $xt <= 20 ) { |
|
1261 | - $meta_key .= $tag->name . ", "; |
|
1259 | + foreach ($tags as $tag) { |
|
1260 | + if ($xt <= 20) { |
|
1261 | + $meta_key .= $tag->name.", "; |
|
1262 | 1262 | } |
1263 | 1263 | |
1264 | - $xt ++; |
|
1264 | + $xt++; |
|
1265 | 1265 | } |
1266 | 1266 | } |
1267 | 1267 | } |
1268 | 1268 | |
1269 | - $meta_key = $meta_key != '' ? rtrim( trim( $meta_key ), "," ) : $meta_key; |
|
1270 | - $geodir_meta_keys = $geodir_meta_keys != '' ? ( $meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys ) : $meta_key; |
|
1271 | - if ( $geodir_meta_keys != '' ) { |
|
1272 | - $geodir_meta_keys = strip_tags( $geodir_meta_keys ); |
|
1273 | - $geodir_meta_keys = esc_html( $geodir_meta_keys ); |
|
1274 | - $geodir_meta_keys = geodir_strtolower( $geodir_meta_keys ); |
|
1275 | - $geodir_meta_keys = wp_html_excerpt( $geodir_meta_keys, 1000, '' ); |
|
1276 | - $geodir_meta_keys = str_replace( '%location%', $replace_location, $geodir_meta_keys ); |
|
1269 | + $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key; |
|
1270 | + $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key.', '.$geodir_meta_keys : $geodir_meta_keys) : $meta_key; |
|
1271 | + if ($geodir_meta_keys != '') { |
|
1272 | + $geodir_meta_keys = strip_tags($geodir_meta_keys); |
|
1273 | + $geodir_meta_keys = esc_html($geodir_meta_keys); |
|
1274 | + $geodir_meta_keys = geodir_strtolower($geodir_meta_keys); |
|
1275 | + $geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, ''); |
|
1276 | + $geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys); |
|
1277 | 1277 | |
1278 | - $meta_key = rtrim( trim( $geodir_meta_keys ), "," ); |
|
1278 | + $meta_key = rtrim(trim($geodir_meta_keys), ","); |
|
1279 | 1279 | } |
1280 | 1280 | |
1281 | - if ( $meta_key ) { |
|
1282 | - $meta_key = stripslashes_deep( $meta_key ); |
|
1281 | + if ($meta_key) { |
|
1282 | + $meta_key = stripslashes_deep($meta_key); |
|
1283 | 1283 | /** |
1284 | 1284 | * Filter SEO meta keywords. |
1285 | 1285 | * |
@@ -1287,7 +1287,7 @@ discard block |
||
1287 | 1287 | * |
1288 | 1288 | * @param string $meta_desc Meta keywords. |
1289 | 1289 | */ |
1290 | - echo apply_filters( 'geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key ); |
|
1290 | + echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="'.$meta_key.'" />', $meta_key); |
|
1291 | 1291 | } |
1292 | 1292 | |
1293 | 1293 | } |
@@ -1307,8 +1307,8 @@ discard block |
||
1307 | 1307 | |
1308 | 1308 | $geodir_detail_page_tabs_array = geodir_detail_page_tabs_array(); |
1309 | 1309 | |
1310 | - foreach ( $geodir_detail_page_tabs_array as $key => $tabs_obj ) { |
|
1311 | - $geodir_detail_page_tabs_key_value_array[ $key ] = $tabs_obj['heading_text']; |
|
1310 | + foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) { |
|
1311 | + $geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text']; |
|
1312 | 1312 | } |
1313 | 1313 | |
1314 | 1314 | return $geodir_detail_page_tabs_key_value_array; |
@@ -1330,57 +1330,57 @@ discard block |
||
1330 | 1330 | * @since 1.0.0 |
1331 | 1331 | */ |
1332 | 1332 | $arr_tabs['post_profile'] = array( |
1333 | - 'heading_text' => __( 'Profile', 'geodirectory' ), |
|
1333 | + 'heading_text' => __('Profile', 'geodirectory'), |
|
1334 | 1334 | 'is_active_tab' => true, |
1335 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_profile' ), |
|
1335 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'), |
|
1336 | 1336 | 'tab_content' => '' |
1337 | 1337 | ); |
1338 | - $arr_tabs['post_info'] = array( |
|
1339 | - 'heading_text' => __( 'More Info', 'geodirectory' ), |
|
1338 | + $arr_tabs['post_info'] = array( |
|
1339 | + 'heading_text' => __('More Info', 'geodirectory'), |
|
1340 | 1340 | 'is_active_tab' => false, |
1341 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_info' ), |
|
1341 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'), |
|
1342 | 1342 | 'tab_content' => '' |
1343 | 1343 | ); |
1344 | 1344 | |
1345 | 1345 | $arr_tabs['post_images'] = array( |
1346 | - 'heading_text' => __( 'Photo', 'geodirectory' ), |
|
1346 | + 'heading_text' => __('Photo', 'geodirectory'), |
|
1347 | 1347 | 'is_active_tab' => false, |
1348 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_images' ), |
|
1348 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'), |
|
1349 | 1349 | 'tab_content' => '' |
1350 | 1350 | ); |
1351 | 1351 | |
1352 | 1352 | $arr_tabs['post_video'] = array( |
1353 | - 'heading_text' => __( 'Video', 'geodirectory' ), |
|
1353 | + 'heading_text' => __('Video', 'geodirectory'), |
|
1354 | 1354 | 'is_active_tab' => false, |
1355 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_video' ), |
|
1355 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'), |
|
1356 | 1356 | 'tab_content' => '' |
1357 | 1357 | ); |
1358 | 1358 | |
1359 | 1359 | $arr_tabs['special_offers'] = array( |
1360 | - 'heading_text' => __( 'Special Offers', 'geodirectory' ), |
|
1360 | + 'heading_text' => __('Special Offers', 'geodirectory'), |
|
1361 | 1361 | 'is_active_tab' => false, |
1362 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'special_offers' ), |
|
1362 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'), |
|
1363 | 1363 | 'tab_content' => '' |
1364 | 1364 | ); |
1365 | 1365 | |
1366 | 1366 | $arr_tabs['post_map'] = array( |
1367 | - 'heading_text' => __( 'Map', 'geodirectory' ), |
|
1367 | + 'heading_text' => __('Map', 'geodirectory'), |
|
1368 | 1368 | 'is_active_tab' => false, |
1369 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'post_map' ), |
|
1369 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'), |
|
1370 | 1370 | 'tab_content' => '' |
1371 | 1371 | ); |
1372 | 1372 | |
1373 | 1373 | $arr_tabs['reviews'] = array( |
1374 | - 'heading_text' => __( 'Reviews', 'geodirectory' ), |
|
1374 | + 'heading_text' => __('Reviews', 'geodirectory'), |
|
1375 | 1375 | 'is_active_tab' => false, |
1376 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'reviews' ), |
|
1376 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'), |
|
1377 | 1377 | 'tab_content' => 'review display' |
1378 | 1378 | ); |
1379 | 1379 | |
1380 | 1380 | $arr_tabs['related_listing'] = array( |
1381 | - 'heading_text' => __( 'Related Listing', 'geodirectory' ), |
|
1381 | + 'heading_text' => __('Related Listing', 'geodirectory'), |
|
1382 | 1382 | 'is_active_tab' => false, |
1383 | - 'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'related_listing' ), |
|
1383 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'), |
|
1384 | 1384 | 'tab_content' => '' |
1385 | 1385 | ); |
1386 | 1386 | |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | * |
1390 | 1390 | * @since 1.0.0 |
1391 | 1391 | */ |
1392 | - return apply_filters( 'geodir_detail_page_tab_list_extend', $arr_tabs ); |
|
1392 | + return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs); |
|
1393 | 1393 | |
1394 | 1394 | |
1395 | 1395 | } |
@@ -1403,13 +1403,13 @@ discard block |
||
1403 | 1403 | * @return mixed|array Tabs array. |
1404 | 1404 | */ |
1405 | 1405 | function geodir_detail_page_tabs_list() { |
1406 | - $tabs_excluded = get_option( 'geodir_detail_page_tabs_excluded' ); |
|
1406 | + $tabs_excluded = get_option('geodir_detail_page_tabs_excluded'); |
|
1407 | 1407 | $tabs_array = geodir_detail_page_tabs_array(); |
1408 | 1408 | |
1409 | - if ( ! empty( $tabs_excluded ) ) { |
|
1410 | - foreach ( $tabs_excluded as $tab ) { |
|
1411 | - if ( array_key_exists( $tab, $tabs_array ) ) { |
|
1412 | - unset( $tabs_array[ $tab ] ); |
|
1409 | + if (!empty($tabs_excluded)) { |
|
1410 | + foreach ($tabs_excluded as $tab) { |
|
1411 | + if (array_key_exists($tab, $tabs_array)) { |
|
1412 | + unset($tabs_array[$tab]); |
|
1413 | 1413 | } |
1414 | 1414 | } |
1415 | 1415 | } |
@@ -1433,58 +1433,58 @@ discard block |
||
1433 | 1433 | function geodir_show_detail_page_tabs() { |
1434 | 1434 | global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields, $preview; |
1435 | 1435 | |
1436 | - $post_id = ! empty( $post ) && isset( $post->ID ) ? (int) $post->ID : 0; |
|
1437 | - $request_post_id = ! empty( $_REQUEST['p'] ) ? (int) $_REQUEST['p'] : 0; |
|
1438 | - $is_backend_preview = ( is_single() && ! empty( $_REQUEST['post_type'] ) && ! empty( $_REQUEST['preview'] ) && ! empty( $_REQUEST['p'] ) ) && is_super_admin() ? true : false; // skip if preview from backend |
|
1436 | + $post_id = !empty($post) && isset($post->ID) ? (int) $post->ID : 0; |
|
1437 | + $request_post_id = !empty($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0; |
|
1438 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
1439 | 1439 | |
1440 | - if ( $is_backend_preview && ! $post_id > 0 && $request_post_id > 0 ) { |
|
1441 | - $post = geodir_get_post_info( $request_post_id ); |
|
1442 | - setup_postdata( $post ); |
|
1440 | + if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) { |
|
1441 | + $post = geodir_get_post_info($request_post_id); |
|
1442 | + setup_postdata($post); |
|
1443 | 1443 | } |
1444 | 1444 | |
1445 | - $geodir_post_detail_fields = geodir_show_listing_info( 'moreinfo' ); |
|
1445 | + $geodir_post_detail_fields = geodir_show_listing_info('moreinfo'); |
|
1446 | 1446 | |
1447 | 1447 | |
1448 | - if ( geodir_is_page( 'detail' ) ) { |
|
1449 | - $video = geodir_get_video( $post->ID ); |
|
1450 | - $special_offers = geodir_get_special_offers( $post->ID ); |
|
1448 | + if (geodir_is_page('detail')) { |
|
1449 | + $video = geodir_get_video($post->ID); |
|
1450 | + $special_offers = geodir_get_special_offers($post->ID); |
|
1451 | 1451 | $related_listing_array = array(); |
1452 | - if ( get_option( 'geodir_add_related_listing_posttypes' ) ) { |
|
1453 | - $related_listing_array = get_option( 'geodir_add_related_listing_posttypes' ); |
|
1452 | + if (get_option('geodir_add_related_listing_posttypes')) { |
|
1453 | + $related_listing_array = get_option('geodir_add_related_listing_posttypes'); |
|
1454 | 1454 | } |
1455 | 1455 | |
1456 | 1456 | |
1457 | - $excluded_tabs = get_option( 'geodir_detail_page_tabs_excluded' ); |
|
1458 | - if ( ! $excluded_tabs ) { |
|
1457 | + $excluded_tabs = get_option('geodir_detail_page_tabs_excluded'); |
|
1458 | + if (!$excluded_tabs) { |
|
1459 | 1459 | $excluded_tabs = array(); |
1460 | 1460 | } |
1461 | 1461 | |
1462 | 1462 | $related_listing = ''; |
1463 | - if ( in_array( $post->post_type, $related_listing_array ) && ! in_array( 'related_listing', $excluded_tabs ) ) { |
|
1463 | + if (in_array($post->post_type, $related_listing_array) && !in_array('related_listing', $excluded_tabs)) { |
|
1464 | 1464 | $request = array( |
1465 | - 'post_number' => get_option( 'geodir_related_post_count' ), |
|
1466 | - 'relate_to' => get_option( 'geodir_related_post_relate_to' ), |
|
1467 | - 'layout' => get_option( 'geodir_related_post_listing_view' ), |
|
1468 | - 'add_location_filter' => get_option( 'geodir_related_post_location_filter' ), |
|
1469 | - 'list_sort' => get_option( 'geodir_related_post_sortby' ), |
|
1470 | - 'character_count' => get_option( 'geodir_related_post_excerpt' ) |
|
1465 | + 'post_number' => get_option('geodir_related_post_count'), |
|
1466 | + 'relate_to' => get_option('geodir_related_post_relate_to'), |
|
1467 | + 'layout' => get_option('geodir_related_post_listing_view'), |
|
1468 | + 'add_location_filter' => get_option('geodir_related_post_location_filter'), |
|
1469 | + 'list_sort' => get_option('geodir_related_post_sortby'), |
|
1470 | + 'character_count' => get_option('geodir_related_post_excerpt') |
|
1471 | 1471 | ); |
1472 | 1472 | |
1473 | - if ( $post->post_type == 'gd_event' && defined( 'GDEVENTS_VERSION' ) ) { |
|
1474 | - $related_listing = geodir_get_detail_page_related_events( $request ); |
|
1473 | + if ($post->post_type == 'gd_event' && defined('GDEVENTS_VERSION')) { |
|
1474 | + $related_listing = geodir_get_detail_page_related_events($request); |
|
1475 | 1475 | } else { |
1476 | - $related_listing = geodir_related_posts_display( $request ); |
|
1476 | + $related_listing = geodir_related_posts_display($request); |
|
1477 | 1477 | } |
1478 | 1478 | |
1479 | 1479 | } |
1480 | 1480 | |
1481 | - $post_images = geodir_get_images( $post->ID, 'thumbnail' ); |
|
1481 | + $post_images = geodir_get_images($post->ID, 'thumbnail'); |
|
1482 | 1482 | $thumb_image = ''; |
1483 | - if ( ! empty( $post_images ) ) { |
|
1484 | - foreach ( $post_images as $image ) { |
|
1485 | - $caption = ( ! empty( $image->caption ) ) ? $image->caption : ''; |
|
1486 | - $thumb_image .= '<a href="' . $image->src . '" title="' . $caption . '">'; |
|
1487 | - $thumb_image .= geodir_show_image( $image, 'thumbnail', true, false ); |
|
1483 | + if (!empty($post_images)) { |
|
1484 | + foreach ($post_images as $image) { |
|
1485 | + $caption = (!empty($image->caption)) ? $image->caption : ''; |
|
1486 | + $thumb_image .= '<a href="'.$image->src.'" title="'.$caption.'">'; |
|
1487 | + $thumb_image .= geodir_show_image($image, 'thumbnail', true, false); |
|
1488 | 1488 | $thumb_image .= '</a>'; |
1489 | 1489 | } |
1490 | 1490 | } |
@@ -1493,11 +1493,11 @@ discard block |
||
1493 | 1493 | $map_args['map_canvas_name'] = 'detail_page_map_canvas'; |
1494 | 1494 | $map_args['width'] = '600'; |
1495 | 1495 | $map_args['height'] = '300'; |
1496 | - if ( $post->post_mapzoom ) { |
|
1497 | - $map_args['zoom'] = '' . $post->post_mapzoom . ''; |
|
1496 | + if ($post->post_mapzoom) { |
|
1497 | + $map_args['zoom'] = ''.$post->post_mapzoom.''; |
|
1498 | 1498 | } |
1499 | 1499 | $map_args['autozoom'] = false; |
1500 | - $map_args['scrollwheel'] = ( get_option( 'geodir_add_listing_mouse_scroll' ) ) ? 0 : 1; |
|
1500 | + $map_args['scrollwheel'] = (get_option('geodir_add_listing_mouse_scroll')) ? 0 : 1; |
|
1501 | 1501 | $map_args['child_collapse'] = '0'; |
1502 | 1502 | $map_args['enable_cat_filters'] = false; |
1503 | 1503 | $map_args['enable_text_search'] = false; |
@@ -1506,43 +1506,43 @@ discard block |
||
1506 | 1506 | $map_args['enable_jason_on_load'] = true; |
1507 | 1507 | $map_args['enable_map_direction'] = true; |
1508 | 1508 | $map_args['map_class_name'] = 'geodir-map-detail-page'; |
1509 | - $map_args['maptype'] = ( ! empty( $post->post_mapview ) ) ? $post->post_mapview : 'ROADMAP'; |
|
1510 | - } else if ( geodir_is_page( 'preview' ) ) { |
|
1511 | - $video = isset( $post->geodir_video ) ? $post->geodir_video : ''; |
|
1512 | - $special_offers = isset( $post->geodir_special_offers ) ? $post->geodir_special_offers : ''; |
|
1509 | + $map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP'; |
|
1510 | + } else if (geodir_is_page('preview')) { |
|
1511 | + $video = isset($post->geodir_video) ? $post->geodir_video : ''; |
|
1512 | + $special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : ''; |
|
1513 | 1513 | |
1514 | - if ( isset( $post->post_images ) ) { |
|
1515 | - $post->post_images = trim( $post->post_images, "," ); |
|
1514 | + if (isset($post->post_images)) { |
|
1515 | + $post->post_images = trim($post->post_images, ","); |
|
1516 | 1516 | } |
1517 | 1517 | |
1518 | - if ( isset( $post->post_images ) && ! empty( $post->post_images ) ) { |
|
1519 | - $post_images = explode( ",", $post->post_images ); |
|
1518 | + if (isset($post->post_images) && !empty($post->post_images)) { |
|
1519 | + $post_images = explode(",", $post->post_images); |
|
1520 | 1520 | } |
1521 | 1521 | |
1522 | 1522 | $thumb_image = ''; |
1523 | - if ( ! empty( $post_images ) ) { |
|
1524 | - foreach ( $post_images as $image ) { |
|
1525 | - if ( $image != '' ) { |
|
1526 | - $thumb_image .= '<a href="' . $image . '">'; |
|
1527 | - $thumb_image .= geodir_show_image( array( 'src' => $image ), 'thumbnail', true, false ); |
|
1523 | + if (!empty($post_images)) { |
|
1524 | + foreach ($post_images as $image) { |
|
1525 | + if ($image != '') { |
|
1526 | + $thumb_image .= '<a href="'.$image.'">'; |
|
1527 | + $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false); |
|
1528 | 1528 | $thumb_image .= '</a>'; |
1529 | 1529 | } |
1530 | 1530 | } |
1531 | 1531 | } |
1532 | 1532 | |
1533 | 1533 | global $map_jason; |
1534 | - $marker_json = $post->marker_json != '' ? json_decode( $post->marker_json, true ) : array(); |
|
1535 | - $marker_icon = ( ! empty( $marker_json ) && ! empty( $marker_json['i'] ) ) ? $marker_json['i'] : ''; |
|
1536 | - $icon_size = geodir_get_marker_size( $marker_icon ); |
|
1534 | + $marker_json = $post->marker_json != '' ? json_decode($post->marker_json, true) : array(); |
|
1535 | + $marker_icon = (!empty($marker_json) && !empty($marker_json['i'])) ? $marker_json['i'] : ''; |
|
1536 | + $icon_size = geodir_get_marker_size($marker_icon); |
|
1537 | 1537 | $marker_json['w'] = $icon_size['w']; |
1538 | 1538 | $marker_json['h'] = $icon_size['h']; |
1539 | - $map_jason[] = json_encode( $marker_json ); |
|
1539 | + $map_jason[] = json_encode($marker_json); |
|
1540 | 1540 | |
1541 | - $address_latitude = isset( $post->post_latitude ) ? $post->post_latitude : ''; |
|
1542 | - $address_longitude = isset( $post->post_longitude ) ? $post->post_longitude : ''; |
|
1543 | - $mapview = isset( $post->post_mapview ) ? $post->post_mapview : ''; |
|
1544 | - $mapzoom = isset( $post->post_mapzoom ) ? $post->post_mapzoom : ''; |
|
1545 | - if ( ! $mapzoom ) { |
|
1541 | + $address_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
1542 | + $address_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
1543 | + $mapview = isset($post->post_mapview) ? $post->post_mapview : ''; |
|
1544 | + $mapzoom = isset($post->post_mapzoom) ? $post->post_mapzoom : ''; |
|
1545 | + if (!$mapzoom) { |
|
1546 | 1546 | $mapzoom = 12; |
1547 | 1547 | } |
1548 | 1548 | |
@@ -1565,37 +1565,37 @@ discard block |
||
1565 | 1565 | $map_args['map_class_name'] = 'geodir-map-preview-page'; |
1566 | 1566 | } |
1567 | 1567 | |
1568 | - $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user |
|
1568 | + $arr_detail_page_tabs = geodir_detail_page_tabs_list(); // get this sooner so we can get the active tab for the user |
|
1569 | 1569 | |
1570 | 1570 | $active_tab = ''; |
1571 | 1571 | $active_tab_name = ''; |
1572 | 1572 | $default_tab = ''; |
1573 | 1573 | $default_tab_name = ''; |
1574 | - foreach ( $arr_detail_page_tabs as $tab_index => $tabs ) { |
|
1575 | - if ( isset( $tabs['is_active_tab'] ) && $tabs['is_active_tab'] && ! empty( $tabs['is_display'] ) && isset( $tabs['heading_text'] ) && $tabs['heading_text'] ) { |
|
1574 | + foreach ($arr_detail_page_tabs as $tab_index => $tabs) { |
|
1575 | + if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) { |
|
1576 | 1576 | $active_tab = $tab_index; |
1577 | - $active_tab_name = __( $tabs['heading_text'], 'geodirectory' ); |
|
1577 | + $active_tab_name = __($tabs['heading_text'], 'geodirectory'); |
|
1578 | 1578 | } |
1579 | 1579 | |
1580 | - if ( $default_tab === '' && ! empty( $tabs['is_display'] ) && ! empty( $tabs['heading_text'] ) ) { |
|
1580 | + if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) { |
|
1581 | 1581 | $default_tab = $tab_index; |
1582 | - $default_tab_name = __( $tabs['heading_text'], 'geodirectory' ); |
|
1582 | + $default_tab_name = __($tabs['heading_text'], 'geodirectory'); |
|
1583 | 1583 | } |
1584 | 1584 | } |
1585 | 1585 | |
1586 | - if ( $active_tab === '' && $default_tab !== '' ) { // Make first tab acs a active tab if not any tab is active. |
|
1587 | - if ( isset( $arr_detail_page_tabs[ $active_tab ] ) && isset( $arr_detail_page_tabs[ $active_tab ]['is_active_tab'] ) ) { |
|
1588 | - $arr_detail_page_tabs[ $active_tab ]['is_active_tab'] = false; |
|
1586 | + if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active. |
|
1587 | + if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) { |
|
1588 | + $arr_detail_page_tabs[$active_tab]['is_active_tab'] = false; |
|
1589 | 1589 | } |
1590 | 1590 | |
1591 | - $arr_detail_page_tabs[ $default_tab ]['is_active_tab'] = true; |
|
1591 | + $arr_detail_page_tabs[$default_tab]['is_active_tab'] = true; |
|
1592 | 1592 | $active_tab = $default_tab; |
1593 | 1593 | $active_tab_name = $default_tab_name; |
1594 | 1594 | } |
1595 | - $tab_list = ( get_option( 'geodir_disable_tabs', false ) ) ? true : false; |
|
1595 | + $tab_list = (get_option('geodir_disable_tabs', false)) ? true : false; |
|
1596 | 1596 | ?> |
1597 | 1597 | <div class="geodir-tabs" id="gd-tabs" style="position:relative;"> |
1598 | - <?php if ( ! $tab_list ){ ?> |
|
1598 | + <?php if (!$tab_list) { ?> |
|
1599 | 1599 | <div id="geodir-tab-mobile-menu"> |
1600 | 1600 | <i class="fa fa-bars"></i> |
1601 | 1601 | <span class="geodir-mobile-active-tab"><?php echo $active_tab_name; ?></span> |
@@ -1610,26 +1610,26 @@ discard block |
||
1610 | 1610 | * @since 1.0.0 |
1611 | 1611 | * @see 'geodir_after_tab_list' |
1612 | 1612 | */ |
1613 | - do_action( 'geodir_before_tab_list' ); ?> |
|
1613 | + do_action('geodir_before_tab_list'); ?> |
|
1614 | 1614 | <?php |
1615 | 1615 | |
1616 | - foreach ( $arr_detail_page_tabs as $tab_index => $detail_page_tab ) { |
|
1617 | - if ( $detail_page_tab['is_display'] ) { |
|
1616 | + foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) { |
|
1617 | + if ($detail_page_tab['is_display']) { |
|
1618 | 1618 | |
1619 | - if ( ! $tab_list ) { |
|
1619 | + if (!$tab_list) { |
|
1620 | 1620 | ?> |
1621 | 1621 | <dt></dt> <!-- added to comply with validation --> |
1622 | - <dd <?php if ( $detail_page_tab['is_active_tab'] ){ ?>class="geodir-tab-active"<?php } ?> ><a |
|
1622 | + <dd <?php if ($detail_page_tab['is_active_tab']) { ?>class="geodir-tab-active"<?php } ?> ><a |
|
1623 | 1623 | data-tab="#<?php echo $tab_index; ?>" |
1624 | - data-status="enable"><?php _e( $detail_page_tab['heading_text'], 'geodirectory' ); ?></a> |
|
1624 | + data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a> |
|
1625 | 1625 | </dd> |
1626 | 1626 | <?php |
1627 | 1627 | } |
1628 | 1628 | ob_start() // start tab content buffering |
1629 | 1629 | ?> |
1630 | 1630 | <li id="<?php echo $tab_index; ?>Tab"> |
1631 | - <?php if ( $tab_list ) { |
|
1632 | - $tab_title = '<span class="gd-tab-list-title" ><a href="#' . $tab_index . '">' . __( $detail_page_tab['heading_text'], 'geodirectory' ) . '</a></span><hr />'; |
|
1631 | + <?php if ($tab_list) { |
|
1632 | + $tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'], 'geodirectory').'</a></span><hr />'; |
|
1633 | 1633 | /** |
1634 | 1634 | * Filter the tab list title html. |
1635 | 1635 | * |
@@ -1639,7 +1639,7 @@ discard block |
||
1639 | 1639 | * @param string $tab_index The tab index type. |
1640 | 1640 | * @param array $detail_page_tab The array of values including title text. |
1641 | 1641 | */ |
1642 | - echo apply_filters( 'geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab ); |
|
1642 | + echo apply_filters('geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab); |
|
1643 | 1643 | } ?> |
1644 | 1644 | <div id="<?php echo $tab_index; ?>" class="hash-offset"></div> |
1645 | 1645 | <?php |
@@ -1650,7 +1650,7 @@ discard block |
||
1650 | 1650 | * |
1651 | 1651 | * @param string $tab_index The tab name ID. |
1652 | 1652 | */ |
1653 | - do_action( 'geodir_before_tab_content', $tab_index ); |
|
1653 | + do_action('geodir_before_tab_content', $tab_index); |
|
1654 | 1654 | |
1655 | 1655 | /** |
1656 | 1656 | * Called before the details tab content is output per tab. |
@@ -1660,21 +1660,21 @@ discard block |
||
1660 | 1660 | * @since 1.0.0 |
1661 | 1661 | * @todo do we need this if we have the hook above? 'geodir_before_tab_content' |
1662 | 1662 | */ |
1663 | - do_action( 'geodir_before_' . $tab_index . '_tab_content' ); |
|
1663 | + do_action('geodir_before_'.$tab_index.'_tab_content'); |
|
1664 | 1664 | /// write a code to generate content of each tab |
1665 | - switch ( $tab_index ) { |
|
1665 | + switch ($tab_index) { |
|
1666 | 1666 | case 'post_profile': |
1667 | 1667 | /** |
1668 | 1668 | * Called before the listing description content on the details page tab. |
1669 | 1669 | * |
1670 | 1670 | * @since 1.0.0 |
1671 | 1671 | */ |
1672 | - do_action( 'geodir_before_description_on_listing_detail' ); |
|
1673 | - if ( geodir_is_page( 'detail' ) ) { |
|
1672 | + do_action('geodir_before_description_on_listing_detail'); |
|
1673 | + if (geodir_is_page('detail')) { |
|
1674 | 1674 | the_content(); |
1675 | 1675 | } else { |
1676 | 1676 | /** This action is documented in geodirectory_template_actions.php */ |
1677 | - echo apply_filters( 'the_content', stripslashes( $post->post_desc ) ); |
|
1677 | + echo apply_filters('the_content', stripslashes($post->post_desc)); |
|
1678 | 1678 | } |
1679 | 1679 | |
1680 | 1680 | /** |
@@ -1682,7 +1682,7 @@ discard block |
||
1682 | 1682 | * |
1683 | 1683 | * @since 1.0.0 |
1684 | 1684 | */ |
1685 | - do_action( 'geodir_after_description_on_listing_detail' ); |
|
1685 | + do_action('geodir_after_description_on_listing_detail'); |
|
1686 | 1686 | break; |
1687 | 1687 | case 'post_info': |
1688 | 1688 | echo $geodir_post_detail_fields; |
@@ -1692,32 +1692,32 @@ discard block |
||
1692 | 1692 | break; |
1693 | 1693 | case 'post_video': |
1694 | 1694 | // some browsers hide $_POST data if used for embeds so we repalce with a placeholder |
1695 | - if ( $preview ) { |
|
1696 | - if ( $video ) { |
|
1697 | - echo "<span class='gd-video-embed-preview' ><p class='gd-video-preview-text'><i class=\"fa fa-video-camera\" aria-hidden=\"true\"></i><br />" . __( 'Video Preview Placeholder', 'geodirectory' ) . "</p></span>"; |
|
1695 | + if ($preview) { |
|
1696 | + if ($video) { |
|
1697 | + echo "<span class='gd-video-embed-preview' ><p class='gd-video-preview-text'><i class=\"fa fa-video-camera\" aria-hidden=\"true\"></i><br />".__('Video Preview Placeholder', 'geodirectory')."</p></span>"; |
|
1698 | 1698 | } |
1699 | 1699 | } else { |
1700 | 1700 | |
1701 | 1701 | // stop payment manager filtering content length |
1702 | - $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' ); |
|
1703 | - if ( false !== $filter_priority ) { |
|
1704 | - remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority ); |
|
1702 | + $filter_priority = has_filter('the_content', 'geodir_payments_the_content'); |
|
1703 | + if (false !== $filter_priority) { |
|
1704 | + remove_filter('the_content', 'geodir_payments_the_content', $filter_priority); |
|
1705 | 1705 | } |
1706 | 1706 | |
1707 | 1707 | /** This action is documented in geodirectory_template_actions.php */ |
1708 | - echo apply_filters( 'the_content', stripslashes( $video ) );// we apply the_content filter so oembed works also; |
|
1708 | + echo apply_filters('the_content', stripslashes($video)); // we apply the_content filter so oembed works also; |
|
1709 | 1709 | |
1710 | - if ( false !== $filter_priority ) { |
|
1711 | - add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority ); |
|
1710 | + if (false !== $filter_priority) { |
|
1711 | + add_filter('the_content', 'geodir_payments_the_content', $filter_priority); |
|
1712 | 1712 | } |
1713 | 1713 | } |
1714 | 1714 | break; |
1715 | 1715 | case 'special_offers': |
1716 | - echo apply_filters( 'gd_special_offers_content', wpautop( stripslashes( $special_offers ) ) ); |
|
1716 | + echo apply_filters('gd_special_offers_content', wpautop(stripslashes($special_offers))); |
|
1717 | 1717 | |
1718 | 1718 | break; |
1719 | 1719 | case 'post_map': |
1720 | - geodir_draw_map( $map_args ); |
|
1720 | + geodir_draw_map($map_args); |
|
1721 | 1721 | break; |
1722 | 1722 | case 'reviews': |
1723 | 1723 | comments_template(); |
@@ -1726,7 +1726,7 @@ discard block |
||
1726 | 1726 | echo $related_listing; |
1727 | 1727 | break; |
1728 | 1728 | default: { |
1729 | - if ( ( isset( $post->{$tab_index} ) || ( ! isset( $post->{$tab_index} ) && ( strpos( $tab_index, 'gd_tab_' ) !== false || $tab_index == 'link_business' ) ) ) && ! empty( $detail_page_tab['tab_content'] ) ) { |
|
1729 | + if ((isset($post->{$tab_index} ) || (!isset($post->{$tab_index} ) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) { |
|
1730 | 1730 | echo $detail_page_tab['tab_content']; |
1731 | 1731 | } |
1732 | 1732 | } |
@@ -1738,7 +1738,7 @@ discard block |
||
1738 | 1738 | * |
1739 | 1739 | * @since 1.0.0 |
1740 | 1740 | */ |
1741 | - do_action( 'geodir_after_tab_content', $tab_index ); |
|
1741 | + do_action('geodir_after_tab_content', $tab_index); |
|
1742 | 1742 | |
1743 | 1743 | /** |
1744 | 1744 | * Called after the details tab content is output per tab. |
@@ -1748,7 +1748,7 @@ discard block |
||
1748 | 1748 | * @since 1.0.0 |
1749 | 1749 | * @todo do we need this if we have the hook above? 'geodir_after_tab_content' |
1750 | 1750 | */ |
1751 | - do_action( 'geodir_after_' . $tab_index . '_tab_content' ); |
|
1751 | + do_action('geodir_after_'.$tab_index.'_tab_content'); |
|
1752 | 1752 | ?> </li> |
1753 | 1753 | <?php |
1754 | 1754 | /** |
@@ -1756,7 +1756,7 @@ discard block |
||
1756 | 1756 | * |
1757 | 1757 | * @since 1.0.0 |
1758 | 1758 | */ |
1759 | - $arr_detail_page_tabs[ $tab_index ]['tab_content'] = apply_filters( "geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean() ); |
|
1759 | + $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_".$detail_page_tab['tab_content']."_tab_content", ob_get_clean()); |
|
1760 | 1760 | } // end of if for is_display |
1761 | 1761 | }// end of foreach |
1762 | 1762 | |
@@ -1766,14 +1766,14 @@ discard block |
||
1766 | 1766 | * @since 1.0.0 |
1767 | 1767 | * @see 'geodir_before_tab_list' |
1768 | 1768 | */ |
1769 | - do_action( 'geodir_after_tab_list' ); |
|
1769 | + do_action('geodir_after_tab_list'); |
|
1770 | 1770 | ?> |
1771 | - <?php if ( ! $tab_list ){ ?></dl><?php } ?> |
|
1772 | - <ul class="geodir-tabs-content entry-content <?php if ( $tab_list ) { ?>geodir-tabs-list<?php } ?>" |
|
1771 | + <?php if (!$tab_list) { ?></dl><?php } ?> |
|
1772 | + <ul class="geodir-tabs-content entry-content <?php if ($tab_list) { ?>geodir-tabs-list<?php } ?>" |
|
1773 | 1773 | style="position:relative;"> |
1774 | 1774 | <?php |
1775 | - foreach ( $arr_detail_page_tabs as $detail_page_tab ) { |
|
1776 | - if ( $detail_page_tab['is_display'] && ! empty( $detail_page_tab['tab_content'] ) ) { |
|
1775 | + foreach ($arr_detail_page_tabs as $detail_page_tab) { |
|
1776 | + if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) { |
|
1777 | 1777 | echo $detail_page_tab['tab_content']; |
1778 | 1778 | }// end of if |
1779 | 1779 | }// end of foreach |
@@ -1783,11 +1783,11 @@ discard block |
||
1783 | 1783 | * |
1784 | 1784 | * @since 1.0.0 |
1785 | 1785 | */ |
1786 | - do_action( 'geodir_add_tab_content' ); ?> |
|
1786 | + do_action('geodir_add_tab_content'); ?> |
|
1787 | 1787 | </ul> |
1788 | 1788 | <!--gd-tabs-content ul end--> |
1789 | 1789 | </div> |
1790 | - <?php if ( ! $tab_list ) { ?> |
|
1790 | + <?php if (!$tab_list) { ?> |
|
1791 | 1791 | <script> |
1792 | 1792 | if (window.location.hash && window.location.hash.indexOf('&') === -1 && jQuery(window.location.hash + 'Tab').length) { |
1793 | 1793 | hashVal = window.location.hash; |
@@ -1819,31 +1819,31 @@ discard block |
||
1819 | 1819 | * |
1820 | 1820 | * @return mixed Image file. |
1821 | 1821 | */ |
1822 | -function geodir_exif( $file ) { |
|
1823 | - if ( empty( $file ) || ! is_array( $file ) ) { |
|
1822 | +function geodir_exif($file) { |
|
1823 | + if (empty($file) || !is_array($file)) { |
|
1824 | 1824 | return $file; |
1825 | 1825 | } |
1826 | 1826 | |
1827 | - $file_path = ! empty( $file['tmp_name'] ) ? sanitize_text_field( $file['tmp_name'] ) : ''; |
|
1828 | - if ( ! ( $file_path && file_exists( $file_path ) ) ) { |
|
1827 | + $file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : ''; |
|
1828 | + if (!($file_path && file_exists($file_path))) { |
|
1829 | 1829 | return $file; |
1830 | 1830 | } |
1831 | 1831 | $file['file'] = $file_path; |
1832 | 1832 | |
1833 | - if ( ! file_is_valid_image( $file_path ) ) { |
|
1833 | + if (!file_is_valid_image($file_path)) { |
|
1834 | 1834 | return $file; // Bail if file is not an image. |
1835 | 1835 | } |
1836 | 1836 | |
1837 | - if ( ! function_exists( 'wp_get_image_editor' ) ) { |
|
1837 | + if (!function_exists('wp_get_image_editor')) { |
|
1838 | 1838 | return $file; |
1839 | 1839 | } |
1840 | 1840 | |
1841 | 1841 | $mime_type = $file['type']; |
1842 | 1842 | $exif = array(); |
1843 | - if ( $mime_type == 'image/jpeg' && function_exists( 'exif_read_data' ) ) { |
|
1843 | + if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) { |
|
1844 | 1844 | try { |
1845 | - $exif = exif_read_data( $file_path ); |
|
1846 | - } catch ( Exception $e ) { |
|
1845 | + $exif = exif_read_data($file_path); |
|
1846 | + } catch (Exception $e) { |
|
1847 | 1847 | $exif = array(); |
1848 | 1848 | } |
1849 | 1849 | } |
@@ -1852,13 +1852,13 @@ discard block |
||
1852 | 1852 | $flip = false; |
1853 | 1853 | $modify = false; |
1854 | 1854 | $orientation = 0; |
1855 | - if ( ! empty( $exif ) && isset( $exif['Orientation'] ) ) { |
|
1856 | - switch ( (int) $exif['Orientation'] ) { |
|
1855 | + if (!empty($exif) && isset($exif['Orientation'])) { |
|
1856 | + switch ((int) $exif['Orientation']) { |
|
1857 | 1857 | case 1: |
1858 | 1858 | // do nothing |
1859 | 1859 | break; |
1860 | 1860 | case 2: |
1861 | - $flip = array( false, true ); |
|
1861 | + $flip = array(false, true); |
|
1862 | 1862 | $modify = true; |
1863 | 1863 | break; |
1864 | 1864 | case 3: |
@@ -1867,13 +1867,13 @@ discard block |
||
1867 | 1867 | $modify = true; |
1868 | 1868 | break; |
1869 | 1869 | case 4: |
1870 | - $flip = array( true, false ); |
|
1870 | + $flip = array(true, false); |
|
1871 | 1871 | $modify = true; |
1872 | 1872 | break; |
1873 | 1873 | case 5: |
1874 | 1874 | $orientation = - 90; |
1875 | 1875 | $rotate = true; |
1876 | - $flip = array( false, true ); |
|
1876 | + $flip = array(false, true); |
|
1877 | 1877 | $modify = true; |
1878 | 1878 | break; |
1879 | 1879 | case 6: |
@@ -1884,7 +1884,7 @@ discard block |
||
1884 | 1884 | case 7: |
1885 | 1885 | $orientation = - 270; |
1886 | 1886 | $rotate = true; |
1887 | - $flip = array( false, true ); |
|
1887 | + $flip = array(false, true); |
|
1888 | 1888 | $modify = true; |
1889 | 1889 | break; |
1890 | 1890 | case 8: |
@@ -1910,31 +1910,31 @@ discard block |
||
1910 | 1910 | * @param int|null $quality Image Compression quality between 1-100% scale. Default null. |
1911 | 1911 | * @param string $quality Image mime type. |
1912 | 1912 | */ |
1913 | - $quality = apply_filters( 'geodir_image_upload_set_quality', $quality, $mime_type ); |
|
1914 | - if ( $quality !== null ) { |
|
1913 | + $quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type); |
|
1914 | + if ($quality !== null) { |
|
1915 | 1915 | $modify = true; |
1916 | 1916 | } |
1917 | 1917 | |
1918 | - if ( ! $modify ) { |
|
1918 | + if (!$modify) { |
|
1919 | 1919 | return $file; // no change |
1920 | 1920 | } |
1921 | 1921 | |
1922 | - $image = wp_get_image_editor( $file_path ); |
|
1923 | - if ( ! is_wp_error( $image ) ) { |
|
1924 | - if ( $rotate ) { |
|
1925 | - $image->rotate( $orientation ); |
|
1922 | + $image = wp_get_image_editor($file_path); |
|
1923 | + if (!is_wp_error($image)) { |
|
1924 | + if ($rotate) { |
|
1925 | + $image->rotate($orientation); |
|
1926 | 1926 | } |
1927 | 1927 | |
1928 | - if ( ! empty( $flip ) ) { |
|
1929 | - $image->flip( $flip[0], $flip[1] ); |
|
1928 | + if (!empty($flip)) { |
|
1929 | + $image->flip($flip[0], $flip[1]); |
|
1930 | 1930 | } |
1931 | 1931 | |
1932 | - if ( $quality !== null ) { |
|
1933 | - $image->set_quality( (int) $quality ); |
|
1932 | + if ($quality !== null) { |
|
1933 | + $image->set_quality((int) $quality); |
|
1934 | 1934 | } |
1935 | 1935 | |
1936 | - $result = $image->save( $file_path ); |
|
1937 | - if ( ! is_wp_error( $result ) ) { |
|
1936 | + $result = $image->save($file_path); |
|
1937 | + if (!is_wp_error($result)) { |
|
1938 | 1938 | $file['file'] = $result['path']; |
1939 | 1939 | $file['tmp_name'] = $result['path']; |
1940 | 1940 | } |
@@ -1961,7 +1961,7 @@ discard block |
||
1961 | 1961 | * |
1962 | 1962 | * @return string Returns the recent reviews html. |
1963 | 1963 | */ |
1964 | -function geodir_get_recent_reviews( $g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false ) { |
|
1964 | +function geodir_get_recent_reviews($g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false) { |
|
1965 | 1965 | global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session; |
1966 | 1966 | $tablecomments = $wpdb->comments; |
1967 | 1967 | $tableposts = $wpdb->posts; |
@@ -1971,28 +1971,28 @@ discard block |
||
1971 | 1971 | $region_filter = ''; |
1972 | 1972 | $country_filter = ''; |
1973 | 1973 | |
1974 | - if ( $gd_session->get( 'gd_multi_location' ) ) { |
|
1975 | - if ( $gd_ses_country = $gd_session->get( 'gd_country' ) ) { |
|
1976 | - $country_filter = $wpdb->prepare( " AND r.post_country=%s ", str_replace( "-", " ", $gd_ses_country ) ); |
|
1974 | + if ($gd_session->get('gd_multi_location')) { |
|
1975 | + if ($gd_ses_country = $gd_session->get('gd_country')) { |
|
1976 | + $country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country)); |
|
1977 | 1977 | } |
1978 | 1978 | |
1979 | - if ( $gd_ses_region = $gd_session->get( 'gd_region' ) ) { |
|
1980 | - $region_filter = $wpdb->prepare( " AND r.post_region=%s ", str_replace( "-", " ", $gd_ses_region ) ); |
|
1979 | + if ($gd_ses_region = $gd_session->get('gd_region')) { |
|
1980 | + $region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region)); |
|
1981 | 1981 | } |
1982 | 1982 | |
1983 | - if ( $gd_ses_city = $gd_session->get( 'gd_city' ) ) { |
|
1984 | - $city_filter = $wpdb->prepare( " AND r.post_city=%s ", str_replace( "-", " ", $gd_ses_city ) ); |
|
1983 | + if ($gd_ses_city = $gd_session->get('gd_city')) { |
|
1984 | + $city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city)); |
|
1985 | 1985 | } |
1986 | 1986 | } |
1987 | 1987 | |
1988 | 1988 | $review_table = GEODIR_REVIEW_TABLE; |
1989 | 1989 | $request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments"; |
1990 | 1990 | |
1991 | - $comments = $wpdb->get_results( $request ); |
|
1991 | + $comments = $wpdb->get_results($request); |
|
1992 | 1992 | |
1993 | - foreach ( $comments as $comment ) { |
|
1993 | + foreach ($comments as $comment) { |
|
1994 | 1994 | // Set the extra comment info needed. |
1995 | - $comment_extra = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID" ); |
|
1995 | + $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"); |
|
1996 | 1996 | //echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"; |
1997 | 1997 | $comment->comment_content = $comment_extra->comment_content; |
1998 | 1998 | $comment->comment_author = $comment_extra->comment_author; |
@@ -2000,75 +2000,75 @@ discard block |
||
2000 | 2000 | |
2001 | 2001 | $comment_id = ''; |
2002 | 2002 | $comment_id = $comment->comment_ID; |
2003 | - $comment_content = strip_tags( $comment->comment_content ); |
|
2003 | + $comment_content = strip_tags($comment->comment_content); |
|
2004 | 2004 | |
2005 | - $comment_content = preg_replace( '#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content ); |
|
2005 | + $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content); |
|
2006 | 2006 | |
2007 | - $permalink = get_permalink( $comment->ID ) . "#comment-" . $comment->comment_ID; |
|
2007 | + $permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID; |
|
2008 | 2008 | $comment_author_email = $comment->comment_author_email; |
2009 | 2009 | $comment_post_ID = $comment->post_id; |
2010 | 2010 | |
2011 | 2011 | $na = true; |
2012 | - if ( function_exists( 'icl_object_id' ) && icl_object_id( $comment_post_ID, $comment->post_type, true ) ) { |
|
2013 | - $comment_post_ID2 = icl_object_id( $comment_post_ID, $comment->post_type, false ); |
|
2014 | - if ( $comment_post_ID == $comment_post_ID2 ) { |
|
2012 | + if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) { |
|
2013 | + $comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false); |
|
2014 | + if ($comment_post_ID == $comment_post_ID2) { |
|
2015 | 2015 | } else { |
2016 | 2016 | $na = false; |
2017 | 2017 | } |
2018 | 2018 | } |
2019 | 2019 | |
2020 | - $post_title = get_the_title( $comment_post_ID ); |
|
2021 | - $permalink = get_permalink( $comment_post_ID ); |
|
2022 | - $comment_permalink = $permalink . "#comment-" . $comment->comment_ID; |
|
2023 | - $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __( 'Read more', 'geodirectory' ) . '</a>'; |
|
2020 | + $post_title = get_the_title($comment_post_ID); |
|
2021 | + $permalink = get_permalink($comment_post_ID); |
|
2022 | + $comment_permalink = $permalink."#comment-".$comment->comment_ID; |
|
2023 | + $read_more = '<a class="comment_excerpt" href="'.$comment_permalink.'">'.__('Read more', 'geodirectory').'</a>'; |
|
2024 | 2024 | |
2025 | - $comment_content_length = strlen( $comment_content ); |
|
2026 | - if ( $comment_content_length > $comment_lenth ) { |
|
2027 | - $comment_excerpt = mb_substr( $comment_content, 0, $comment_lenth ) . '... ' . $read_more; |
|
2025 | + $comment_content_length = strlen($comment_content); |
|
2026 | + if ($comment_content_length > $comment_lenth) { |
|
2027 | + $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth).'... '.$read_more; |
|
2028 | 2028 | } else { |
2029 | 2029 | $comment_excerpt = $comment_content; |
2030 | 2030 | } |
2031 | 2031 | |
2032 | - if ( $comment->user_id ) { |
|
2033 | - $user_profile_url = get_author_posts_url( $comment->user_id ); |
|
2032 | + if ($comment->user_id) { |
|
2033 | + $user_profile_url = get_author_posts_url($comment->user_id); |
|
2034 | 2034 | } else { |
2035 | 2035 | $user_profile_url = ''; |
2036 | 2036 | } |
2037 | 2037 | |
2038 | - if ( $comment_id && $na ) { |
|
2038 | + if ($comment_id && $na) { |
|
2039 | 2039 | $comments_echo .= '<li class="clearfix">'; |
2040 | - $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">"; |
|
2041 | - if ( function_exists( 'get_avatar' ) ) { |
|
2042 | - if ( ! isset( $comment->comment_type ) ) { |
|
2043 | - if ( $user_profile_url ) { |
|
2044 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
2040 | + $comments_echo .= "<span class=\"li".$comment_id." geodir_reviewer_image\">"; |
|
2041 | + if (function_exists('get_avatar')) { |
|
2042 | + if (!isset($comment->comment_type)) { |
|
2043 | + if ($user_profile_url) { |
|
2044 | + $comments_echo .= '<a href="'.$user_profile_url.'">'; |
|
2045 | 2045 | } |
2046 | - $comments_echo .= get_avatar( $comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' ); |
|
2047 | - if ( $user_profile_url ) { |
|
2046 | + $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png'); |
|
2047 | + if ($user_profile_url) { |
|
2048 | 2048 | $comments_echo .= '</a>'; |
2049 | 2049 | } |
2050 | - } elseif ( ( isset( $comment->comment_type ) && $comment->comment_type == 'trackback' ) || ( isset( $comment->comment_type ) && $comment->comment_type == 'pingback' ) ) { |
|
2051 | - if ( $user_profile_url ) { |
|
2052 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
2050 | + } elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) { |
|
2051 | + if ($user_profile_url) { |
|
2052 | + $comments_echo .= '<a href="'.$user_profile_url.'">'; |
|
2053 | 2053 | } |
2054 | - $comments_echo .= get_avatar( $comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' ); |
|
2054 | + $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png'); |
|
2055 | 2055 | } |
2056 | - } elseif ( function_exists( 'gravatar' ) ) { |
|
2057 | - if ( $user_profile_url ) { |
|
2058 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
2056 | + } elseif (function_exists('gravatar')) { |
|
2057 | + if ($user_profile_url) { |
|
2058 | + $comments_echo .= '<a href="'.$user_profile_url.'">'; |
|
2059 | 2059 | } |
2060 | 2060 | $comments_echo .= "<img src=\""; |
2061 | - if ( '' == $comment->comment_type ) { |
|
2062 | - $comments_echo .= gravatar( $comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' ); |
|
2063 | - if ( $user_profile_url ) { |
|
2061 | + if ('' == $comment->comment_type) { |
|
2062 | + $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png'); |
|
2063 | + if ($user_profile_url) { |
|
2064 | 2064 | $comments_echo .= '</a>'; |
2065 | 2065 | } |
2066 | - } elseif ( ( 'trackback' == $comment->comment_type ) || ( 'pingback' == $comment->comment_type ) ) { |
|
2067 | - if ( $user_profile_url ) { |
|
2068 | - $comments_echo .= '<a href="' . $user_profile_url . '">'; |
|
2066 | + } elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) { |
|
2067 | + if ($user_profile_url) { |
|
2068 | + $comments_echo .= '<a href="'.$user_profile_url.'">'; |
|
2069 | 2069 | } |
2070 | - $comments_echo .= gravatar( $comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png' ); |
|
2071 | - if ( $user_profile_url ) { |
|
2070 | + $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png'); |
|
2071 | + if ($user_profile_url) { |
|
2072 | 2072 | $comments_echo .= '</a>'; |
2073 | 2073 | } |
2074 | 2074 | } |
@@ -2078,17 +2078,17 @@ discard block |
||
2078 | 2078 | $comments_echo .= "</span>\n"; |
2079 | 2079 | |
2080 | 2080 | $comments_echo .= '<span class="geodir_reviewer_content">'; |
2081 | - if ( $comment->user_id ) { |
|
2082 | - $comments_echo .= '<a href="' . get_author_posts_url( $comment->user_id ) . '">'; |
|
2081 | + if ($comment->user_id) { |
|
2082 | + $comments_echo .= '<a href="'.get_author_posts_url($comment->user_id).'">'; |
|
2083 | 2083 | } |
2084 | - $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> '; |
|
2085 | - if ( $comment->user_id ) { |
|
2084 | + $comments_echo .= '<span class="geodir_reviewer_author">'.$comment->comment_author.'</span> '; |
|
2085 | + if ($comment->user_id) { |
|
2086 | 2086 | $comments_echo .= '</a>'; |
2087 | 2087 | } |
2088 | - $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __( 'reviewed', 'geodirectory' ) . '</span> '; |
|
2089 | - $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>'; |
|
2090 | - $comments_echo .= geodir_get_rating_stars( $comment->overall_rating, $comment_post_ID ); |
|
2091 | - $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . ''; |
|
2088 | + $comments_echo .= '<span class="geodir_reviewer_reviewed">'.__('reviewed', 'geodirectory').'</span> '; |
|
2089 | + $comments_echo .= '<a href="'.$permalink.'" class="geodir_reviewer_title">'.$post_title.'</a>'; |
|
2090 | + $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID); |
|
2091 | + $comments_echo .= '<p class="geodir_reviewer_text">'.$comment_excerpt.''; |
|
2092 | 2092 | //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt); |
2093 | 2093 | $comments_echo .= '</p>'; |
2094 | 2094 | |
@@ -2108,25 +2108,25 @@ discard block |
||
2108 | 2108 | * @return array Returns post categories as an array. |
2109 | 2109 | */ |
2110 | 2110 | function geodir_home_map_cats_key_value_array() { |
2111 | - $post_types = geodir_get_posttypes( 'object' ); |
|
2111 | + $post_types = geodir_get_posttypes('object'); |
|
2112 | 2112 | |
2113 | 2113 | $return = array(); |
2114 | - if ( ! empty( $post_types ) ) { |
|
2115 | - foreach ( $post_types as $key => $post_type ) { |
|
2116 | - $cpt_name = __( $post_type->labels->singular_name, 'geodirectory' ); |
|
2117 | - $post_type_name = sprintf( __( '%s Categories', 'geodirectory' ), $cpt_name ); |
|
2118 | - $taxonomies = geodir_get_taxonomies( $key ); |
|
2119 | - $cat_taxonomy = ! empty( $taxonomies[0] ) ? $taxonomies[0] : null; |
|
2120 | - $cat_terms = $cat_taxonomy ? get_terms( $cat_taxonomy ) : null; |
|
2121 | - |
|
2122 | - if ( ! empty( $cat_terms ) ) { |
|
2123 | - $return[ 'optgroup_start-' . $key ] = $post_type_name; |
|
2124 | - |
|
2125 | - foreach ( $cat_terms as $cat_term ) { |
|
2126 | - $return[ $key . '_' . $cat_term->term_id ] = $cat_term->name; |
|
2114 | + if (!empty($post_types)) { |
|
2115 | + foreach ($post_types as $key => $post_type) { |
|
2116 | + $cpt_name = __($post_type->labels->singular_name, 'geodirectory'); |
|
2117 | + $post_type_name = sprintf(__('%s Categories', 'geodirectory'), $cpt_name); |
|
2118 | + $taxonomies = geodir_get_taxonomies($key); |
|
2119 | + $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : null; |
|
2120 | + $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : null; |
|
2121 | + |
|
2122 | + if (!empty($cat_terms)) { |
|
2123 | + $return['optgroup_start-'.$key] = $post_type_name; |
|
2124 | + |
|
2125 | + foreach ($cat_terms as $cat_term) { |
|
2126 | + $return[$key.'_'.$cat_term->term_id] = $cat_term->name; |
|
2127 | 2127 | } |
2128 | 2128 | |
2129 | - $return[ 'optgroup_end-' . $key ] = $post_type_name; |
|
2129 | + $return['optgroup_end-'.$key] = $post_type_name; |
|
2130 | 2130 | } |
2131 | 2131 | } |
2132 | 2132 | } |
@@ -2142,14 +2142,14 @@ discard block |
||
2142 | 2142 | * @package GeoDirectory |
2143 | 2143 | */ |
2144 | 2144 | function geodir_twitter_tweet_button() { |
2145 | - if ( isset( $_GET['gde'] ) ) { |
|
2146 | - $link = '?url=' . urlencode( geodir_curPageURL() ); |
|
2145 | + if (isset($_GET['gde'])) { |
|
2146 | + $link = '?url='.urlencode(geodir_curPageURL()); |
|
2147 | 2147 | } else { |
2148 | 2148 | $link = ''; |
2149 | 2149 | } |
2150 | 2150 | ?> |
2151 | 2151 | <a href="http://twitter.com/share<?php echo $link; ?>" |
2152 | - class="twitter-share-button"><?php _e( 'Tweet', 'geodirectory' ); ?></a> |
|
2152 | + class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a> |
|
2153 | 2153 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
2154 | 2154 | <?php |
2155 | 2155 | } |
@@ -2166,10 +2166,10 @@ discard block |
||
2166 | 2166 | function geodir_fb_like_button() { |
2167 | 2167 | global $post; |
2168 | 2168 | ?> |
2169 | - <iframe <?php if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) ) { |
|
2169 | + <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) { |
|
2170 | 2170 | echo 'allowtransparency="true"'; |
2171 | 2171 | } ?> class="facebook" |
2172 | - src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode( get_permalink( $post->ID ) ); ?>&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light" |
|
2172 | + src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light" |
|
2173 | 2173 | style="border:none; overflow:hidden; width:100px; height:20px"></iframe> |
2174 | 2174 | <?php |
2175 | 2175 | } |
@@ -2200,7 +2200,7 @@ discard block |
||
2200 | 2200 | |
2201 | 2201 | |
2202 | 2202 | function geodir_listing_bounce_map_pin_on_hover() { |
2203 | - if ( get_option( 'geodir_listing_hover_bounce_map_pin', true ) ) { |
|
2203 | + if (get_option('geodir_listing_hover_bounce_map_pin', true)) { |
|
2204 | 2204 | ?> |
2205 | 2205 | <script> |
2206 | 2206 | jQuery(function ($) { |
@@ -2223,44 +2223,44 @@ discard block |
||
2223 | 2223 | } |
2224 | 2224 | } |
2225 | 2225 | |
2226 | -add_action( 'geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10 ); |
|
2226 | +add_action('geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10); |
|
2227 | 2227 | |
2228 | -add_action( 'geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1 ); |
|
2229 | -function geodir_output_favourite_html_listings( $post_id ) { |
|
2230 | - geodir_favourite_html( '', $post_id ); |
|
2228 | +add_action('geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1); |
|
2229 | +function geodir_output_favourite_html_listings($post_id) { |
|
2230 | + geodir_favourite_html('', $post_id); |
|
2231 | 2231 | } |
2232 | 2232 | |
2233 | -add_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2 ); |
|
2234 | -function geodir_output_pinpoint_html_listings( $post_id, $post ) { |
|
2233 | +add_action('geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2); |
|
2234 | +function geodir_output_pinpoint_html_listings($post_id, $post) { |
|
2235 | 2235 | global $wp_query; |
2236 | 2236 | |
2237 | 2237 | $show_pin_point = $wp_query->is_main_query(); |
2238 | 2238 | |
2239 | - if ( ! empty( $show_pin_point ) && is_active_widget( false, "", "geodir_map_v3_listing_map" ) ) { |
|
2240 | - $term_icon_url = get_tax_meta( $post->default_category, 'ct_cat_icon', false, $post->post_type ); |
|
2241 | - $marker_icon = isset( $term_icon_url['src'] ) ? $term_icon_url['src'] : get_option( 'geodir_default_marker_icon' ); |
|
2239 | + if (!empty($show_pin_point) && is_active_widget(false, "", "geodir_map_v3_listing_map")) { |
|
2240 | + $term_icon_url = get_tax_meta($post->default_category, 'ct_cat_icon', false, $post->post_type); |
|
2241 | + $marker_icon = isset($term_icon_url['src']) ? $term_icon_url['src'] : get_option('geodir_default_marker_icon'); |
|
2242 | 2242 | ?> |
2243 | 2243 | <span class="geodir-pinpoint" |
2244 | - style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters( 'geodir_listing_listview_pinpoint_inner_content', '', 'listing' ); ?></span> |
|
2244 | + style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters('geodir_listing_listview_pinpoint_inner_content', '', 'listing'); ?></span> |
|
2245 | 2245 | <a class="geodir-pinpoint-link" href="javascript:void(0)" |
2246 | 2246 | onclick="openMarker('listing_map_canvas' ,'<?php echo $post->ID; ?>')" |
2247 | 2247 | onmouseover="animate_marker('listing_map_canvas' ,'<?php echo $post->ID; ?>')" |
2248 | - onmouseout="stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')"><?php _e( 'Pinpoint', 'geodirectory' ); ?></a> |
|
2248 | + onmouseout="stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')"><?php _e('Pinpoint', 'geodirectory'); ?></a> |
|
2249 | 2249 | <?php |
2250 | 2250 | } |
2251 | 2251 | } |
2252 | 2252 | |
2253 | 2253 | function geodir_search_form_submit_button() { |
2254 | 2254 | |
2255 | - $new_style = get_option( 'geodir_show_search_old_search_from' ) ? false : true; |
|
2255 | + $new_style = get_option('geodir_show_search_old_search_from') ? false : true; |
|
2256 | 2256 | |
2257 | - if ( $new_style ) { |
|
2257 | + if ($new_style) { |
|
2258 | 2258 | $default_search_button_label = '<i class="fa fa-search" aria-hidden="true"></i>'; |
2259 | - }else{ |
|
2259 | + } else { |
|
2260 | 2260 | $default_search_button_label = 'Search'; |
2261 | 2261 | } |
2262 | - if ( get_option( 'geodir_search_button_label' ) && get_option( 'geodir_search_button_label' ) != 'Search' ) { |
|
2263 | - $default_search_button_label = __( get_option( 'geodir_search_button_label' ), 'geodirectory' ); |
|
2262 | + if (get_option('geodir_search_button_label') && get_option('geodir_search_button_label') != 'Search') { |
|
2263 | + $default_search_button_label = __(get_option('geodir_search_button_label'), 'geodirectory'); |
|
2264 | 2264 | } |
2265 | 2265 | |
2266 | 2266 | /** |
@@ -2272,78 +2272,78 @@ discard block |
||
2272 | 2272 | * |
2273 | 2273 | * @param string $default_search_button_label The current search button text. |
2274 | 2274 | */ |
2275 | - $default_search_button_label = apply_filters( 'geodir_search_default_search_button_text', $default_search_button_label ); |
|
2275 | + $default_search_button_label = apply_filters('geodir_search_default_search_button_text', $default_search_button_label); |
|
2276 | 2276 | |
2277 | 2277 | $fa_class = ''; |
2278 | - if ( strpos( $default_search_button_label, '&#' ) !== false ) { |
|
2278 | + if (strpos($default_search_button_label, '&#') !== false) { |
|
2279 | 2279 | $fa_class = 'fa'; |
2280 | 2280 | } |
2281 | 2281 | |
2282 | 2282 | |
2283 | - if ( $new_style ) { |
|
2283 | + if ($new_style) { |
|
2284 | 2284 | ?> |
2285 | - <button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e( $default_search_button_label ,'geodirectory'); ?></button> |
|
2286 | -<?php }else{?> |
|
2287 | - <input type="button" value="<?php esc_attr_e( $default_search_button_label ); ?>" |
|
2285 | + <button class="geodir_submit_search <?php echo $fa_class; ?>"><?php _e($default_search_button_label, 'geodirectory'); ?></button> |
|
2286 | +<?php } else {?> |
|
2287 | + <input type="button" value="<?php esc_attr_e($default_search_button_label); ?>" |
|
2288 | 2288 | class="geodir_submit_search <?php echo $fa_class; ?>"/> |
2289 | 2289 | <?php } |
2290 | 2290 | } |
2291 | 2291 | |
2292 | -add_action( 'geodir_before_search_button', 'geodir_search_form_submit_button', 5000 ); |
|
2292 | +add_action('geodir_before_search_button', 'geodir_search_form_submit_button', 5000); |
|
2293 | 2293 | |
2294 | 2294 | function geodir_search_form_post_type_input() { |
2295 | 2295 | global $geodir_search_post_type; |
2296 | - $post_types = apply_filters( 'geodir_search_form_post_types', geodir_get_posttypes( 'object' ) ); |
|
2296 | + $post_types = apply_filters('geodir_search_form_post_types', geodir_get_posttypes('object')); |
|
2297 | 2297 | $curr_post_type = $geodir_search_post_type; |
2298 | 2298 | |
2299 | - if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) { |
|
2299 | + if (!empty($post_types) && count((array) $post_types) > 1) { |
|
2300 | 2300 | |
2301 | - foreach ( $post_types as $post_type => $info ){ |
|
2301 | + foreach ($post_types as $post_type => $info) { |
|
2302 | 2302 | global $wpdb; |
2303 | - $has_posts = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type ) ); |
|
2304 | - if ( ! $has_posts ) { |
|
2303 | + $has_posts = $wpdb->get_row($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type)); |
|
2304 | + if (!$has_posts) { |
|
2305 | 2305 | unset($post_types->{$post_type}); |
2306 | 2306 | } |
2307 | 2307 | } |
2308 | 2308 | |
2309 | - if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) { |
|
2309 | + if (!empty($post_types) && count((array) $post_types) > 1) { |
|
2310 | 2310 | |
2311 | - $new_style = get_option( 'geodir_show_search_old_search_from' ) ? false : true; |
|
2312 | - if ( $new_style ) { |
|
2311 | + $new_style = get_option('geodir_show_search_old_search_from') ? false : true; |
|
2312 | + if ($new_style) { |
|
2313 | 2313 | echo "<div class='gd-search-input-wrapper gd-search-field-cpt'>"; |
2314 | 2314 | } |
2315 | 2315 | ?> |
2316 | 2316 | <select name="stype" class="search_by_post"> |
2317 | - <?php foreach ( $post_types as $post_type => $info ): |
|
2317 | + <?php foreach ($post_types as $post_type => $info): |
|
2318 | 2318 | global $wpdb; |
2319 | 2319 | ?> |
2320 | 2320 | |
2321 | - <option data-label="<?php echo get_post_type_archive_link( $post_type ); ?>" |
|
2322 | - value="<?php echo $post_type; ?>" <?php if ( isset( $_REQUEST['stype'] ) ) { |
|
2323 | - if ( $post_type == $_REQUEST['stype'] ) { |
|
2321 | + <option data-label="<?php echo get_post_type_archive_link($post_type); ?>" |
|
2322 | + value="<?php echo $post_type; ?>" <?php if (isset($_REQUEST['stype'])) { |
|
2323 | + if ($post_type == $_REQUEST['stype']) { |
|
2324 | 2324 | echo 'selected="selected"'; |
2325 | 2325 | } |
2326 | - } elseif ( $curr_post_type == $post_type ) { |
|
2326 | + } elseif ($curr_post_type == $post_type) { |
|
2327 | 2327 | echo 'selected="selected"'; |
2328 | - } ?>><?php _e( ucfirst( $info->labels->name ), 'geodirectory' ); ?></option> |
|
2328 | + } ?>><?php _e(ucfirst($info->labels->name), 'geodirectory'); ?></option> |
|
2329 | 2329 | |
2330 | 2330 | <?php endforeach; ?> |
2331 | 2331 | </select> |
2332 | 2332 | <?php |
2333 | - if ( $new_style ) { |
|
2333 | + if ($new_style) { |
|
2334 | 2334 | echo "</div>"; |
2335 | 2335 | } |
2336 | - }else{ |
|
2337 | - if(! empty( $post_types )){ |
|
2338 | - $pt_arr = (array)$post_types; |
|
2339 | - echo '<input type="hidden" name="stype" value="' . key( $pt_arr ) . '" />'; |
|
2340 | - }else{ |
|
2336 | + } else { |
|
2337 | + if (!empty($post_types)) { |
|
2338 | + $pt_arr = (array) $post_types; |
|
2339 | + echo '<input type="hidden" name="stype" value="'.key($pt_arr).'" />'; |
|
2340 | + } else { |
|
2341 | 2341 | echo '<input type="hidden" name="stype" value="gd_place" />'; |
2342 | 2342 | } |
2343 | 2343 | |
2344 | 2344 | } |
2345 | 2345 | |
2346 | - }elseif ( ! empty( $post_types ) ) { |
|
2346 | + }elseif (!empty($post_types)) { |
|
2347 | 2347 | echo '<input type="hidden" name="stype" value="gd_place" />'; |
2348 | 2348 | } |
2349 | 2349 | } |
@@ -2351,26 +2351,26 @@ discard block |
||
2351 | 2351 | function geodir_search_form_search_input() { |
2352 | 2352 | |
2353 | 2353 | $default_search_for_text = SEARCH_FOR_TEXT; |
2354 | - if ( get_option( 'geodir_search_field_default_text' ) ) { |
|
2355 | - $default_search_for_text = __( get_option( 'geodir_search_field_default_text' ), 'geodirectory' ); |
|
2354 | + if (get_option('geodir_search_field_default_text')) { |
|
2355 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
2356 | 2356 | } |
2357 | 2357 | |
2358 | 2358 | $new_style = get_option('geodir_show_search_old_search_from') ? false : true; |
2359 | - if($new_style){ |
|
2359 | + if ($new_style) { |
|
2360 | 2360 | echo "<div class='gd-search-input-wrapper gd-search-field-search'>"; |
2361 | 2361 | } |
2362 | 2362 | ?> |
2363 | 2363 | <input class="search_text" name="s" |
2364 | - value="<?php if ( isset( $_REQUEST['s'] ) && trim( $_REQUEST['s'] ) != '' ) { |
|
2365 | - echo esc_attr( stripslashes_deep( $_REQUEST['s'] ) ); |
|
2364 | + value="<?php if (isset($_REQUEST['s']) && trim($_REQUEST['s']) != '') { |
|
2365 | + echo esc_attr(stripslashes_deep($_REQUEST['s'])); |
|
2366 | 2366 | } else { |
2367 | 2367 | echo $default_search_for_text; |
2368 | 2368 | } ?>" type="text" |
2369 | - onblur="if (this.value.trim() == '') {this.value = '<?php echo esc_sql( $default_search_for_text ); ?>';}" |
|
2370 | - onfocus="if (this.value == '<?php echo esc_sql( $default_search_for_text ); ?>') {this.value = '';}" |
|
2369 | + onblur="if (this.value.trim() == '') {this.value = '<?php echo esc_sql($default_search_for_text); ?>';}" |
|
2370 | + onfocus="if (this.value == '<?php echo esc_sql($default_search_for_text); ?>') {this.value = '';}" |
|
2371 | 2371 | onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);"> |
2372 | 2372 | <?php |
2373 | - if($new_style){ |
|
2373 | + if ($new_style) { |
|
2374 | 2374 | echo "</div>"; |
2375 | 2375 | } |
2376 | 2376 | } |
@@ -2378,12 +2378,12 @@ discard block |
||
2378 | 2378 | function geodir_search_form_near_input() { |
2379 | 2379 | |
2380 | 2380 | $default_near_text = NEAR_TEXT; |
2381 | - if ( get_option( 'geodir_near_field_default_text' ) ) { |
|
2382 | - $default_near_text = __( get_option( 'geodir_near_field_default_text' ), 'geodirectory' ); |
|
2381 | + if (get_option('geodir_near_field_default_text')) { |
|
2382 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
2383 | 2383 | } |
2384 | 2384 | |
2385 | - if ( isset( $_REQUEST['snear'] ) && $_REQUEST['snear'] != '' ) { |
|
2386 | - $near = esc_attr( stripslashes_deep( $_REQUEST['snear'] ) ); |
|
2385 | + if (isset($_REQUEST['snear']) && $_REQUEST['snear'] != '') { |
|
2386 | + $near = esc_attr(stripslashes_deep($_REQUEST['snear'])); |
|
2387 | 2387 | } else { |
2388 | 2388 | $near = $default_near_text; |
2389 | 2389 | } |
@@ -2397,7 +2397,7 @@ discard block |
||
2397 | 2397 | * @since 1.6.9 |
2398 | 2398 | * @param string $curr_post_type The current post type. |
2399 | 2399 | */ |
2400 | - $near_input_extra = apply_filters('geodir_near_input_extra','',$curr_post_type); |
|
2400 | + $near_input_extra = apply_filters('geodir_near_input_extra', '', $curr_post_type); |
|
2401 | 2401 | |
2402 | 2402 | |
2403 | 2403 | /** |
@@ -2410,7 +2410,7 @@ discard block |
||
2410 | 2410 | * @param string $near The current near value. |
2411 | 2411 | * @param string $default_near_text The default near value. |
2412 | 2412 | */ |
2413 | - $near = apply_filters( 'geodir_search_near_text', $near, $default_near_text ); |
|
2413 | + $near = apply_filters('geodir_search_near_text', $near, $default_near_text); |
|
2414 | 2414 | /** |
2415 | 2415 | * Filter the default "Near" text value for the search form. |
2416 | 2416 | * |
@@ -2421,7 +2421,7 @@ discard block |
||
2421 | 2421 | * @param string $near The current near value. |
2422 | 2422 | * @param string $default_near_text The default near value. |
2423 | 2423 | */ |
2424 | - $default_near_text = apply_filters( 'geodir_search_default_near_text', $default_near_text, $near ); |
|
2424 | + $default_near_text = apply_filters('geodir_search_default_near_text', $default_near_text, $near); |
|
2425 | 2425 | /** |
2426 | 2426 | * Filter the class for the near search input. |
2427 | 2427 | * |
@@ -2429,10 +2429,10 @@ discard block |
||
2429 | 2429 | * |
2430 | 2430 | * @param string $class The class for the HTML near input, default is blank. |
2431 | 2431 | */ |
2432 | - $near_class = apply_filters( 'geodir_search_near_class', '' ); |
|
2432 | + $near_class = apply_filters('geodir_search_near_class', ''); |
|
2433 | 2433 | |
2434 | 2434 | $new_style = get_option('geodir_show_search_old_search_from') ? false : true; |
2435 | - if($new_style){ |
|
2435 | + if ($new_style) { |
|
2436 | 2436 | echo "<div class='gd-search-input-wrapper gd-search-field-near' $near_input_extra>"; |
2437 | 2437 | |
2438 | 2438 | do_action('geodir_before_near_input'); |
@@ -2440,30 +2440,30 @@ discard block |
||
2440 | 2440 | |
2441 | 2441 | ?> |
2442 | 2442 | <input name="snear" class="snear <?php echo $near_class; ?>" type="text" value="<?php echo $near; ?>" |
2443 | - onblur="if (this.value.trim() == '') {this.value = ('<?php echo esc_sql( $near ); ?>' != '' ? '<?php echo esc_sql( $near ); ?>' : '<?php echo $default_near_text; ?>');}" |
|
2444 | - onfocus="if (this.value == '<?php echo $default_near_text; ?>' || this.value =='<?php echo esc_sql( $near ); ?>') {this.value = '';}" |
|
2445 | - onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);" <?php echo $near_input_extra;?>/> |
|
2443 | + onblur="if (this.value.trim() == '') {this.value = ('<?php echo esc_sql($near); ?>' != '' ? '<?php echo esc_sql($near); ?>' : '<?php echo $default_near_text; ?>');}" |
|
2444 | + onfocus="if (this.value == '<?php echo $default_near_text; ?>' || this.value =='<?php echo esc_sql($near); ?>') {this.value = '';}" |
|
2445 | + onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);" <?php echo $near_input_extra; ?>/> |
|
2446 | 2446 | <?php |
2447 | - if($new_style){ |
|
2447 | + if ($new_style) { |
|
2448 | 2448 | do_action('geodir_after_near_input'); |
2449 | 2449 | |
2450 | 2450 | echo "</div>"; |
2451 | 2451 | } |
2452 | 2452 | } |
2453 | 2453 | |
2454 | -add_action( 'geodir_search_form_inputs', 'geodir_search_form_post_type_input', 10 ); |
|
2455 | -add_action( 'geodir_search_form_inputs', 'geodir_search_form_search_input', 20 ); |
|
2456 | -add_action( 'geodir_search_form_inputs', 'geodir_search_form_near_input', 30 ); |
|
2454 | +add_action('geodir_search_form_inputs', 'geodir_search_form_post_type_input', 10); |
|
2455 | +add_action('geodir_search_form_inputs', 'geodir_search_form_search_input', 20); |
|
2456 | +add_action('geodir_search_form_inputs', 'geodir_search_form_near_input', 30); |
|
2457 | 2457 | |
2458 | -function geodir_get_search_post_type($pt=''){ |
|
2458 | +function geodir_get_search_post_type($pt = '') { |
|
2459 | 2459 | global $geodir_search_post_type; |
2460 | 2460 | |
2461 | - if($pt!=''){return $geodir_search_post_type = $pt;} |
|
2462 | - if(!empty($geodir_search_post_type)){ return $geodir_search_post_type;} |
|
2461 | + if ($pt != '') {return $geodir_search_post_type = $pt; } |
|
2462 | + if (!empty($geodir_search_post_type)) { return $geodir_search_post_type; } |
|
2463 | 2463 | |
2464 | 2464 | $geodir_search_post_type = geodir_get_current_posttype(); |
2465 | 2465 | |
2466 | - if(!$geodir_search_post_type) { |
|
2466 | + if (!$geodir_search_post_type) { |
|
2467 | 2467 | $geodir_search_post_type = geodir_get_default_posttype(); |
2468 | 2468 | } |
2469 | 2469 | |
@@ -2471,7 +2471,7 @@ discard block |
||
2471 | 2471 | return $geodir_search_post_type; |
2472 | 2472 | } |
2473 | 2473 | |
2474 | -function geodir_search_form(){ |
|
2474 | +function geodir_search_form() { |
|
2475 | 2475 | |
2476 | 2476 | geodir_get_search_post_type(); |
2477 | 2477 | |
@@ -2481,8 +2481,8 @@ discard block |
||
2481 | 2481 | die(); |
2482 | 2482 | } |
2483 | 2483 | |
2484 | -add_action( 'wp_ajax_geodir_search_form', 'geodir_search_form' ); |
|
2485 | -add_action( 'wp_ajax_nopriv_geodir_search_form', 'geodir_search_form' ); |
|
2484 | +add_action('wp_ajax_geodir_search_form', 'geodir_search_form'); |
|
2485 | +add_action('wp_ajax_nopriv_geodir_search_form', 'geodir_search_form'); |
|
2486 | 2486 | |
2487 | 2487 | /** |
2488 | 2488 | * Check wpml active or not. |
@@ -2548,7 +2548,7 @@ discard block |
||
2548 | 2548 | } |
2549 | 2549 | } |
2550 | 2550 | } |
2551 | -add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 ); |
|
2551 | +add_filter('icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4); |
|
2552 | 2552 | |
2553 | 2553 | /** |
2554 | 2554 | * Duplicate post reviews for WPML translation post. |
@@ -2565,7 +2565,7 @@ discard block |
||
2565 | 2565 | function geodir_wpml_duplicate_post_reviews($master_post_id, $tr_post_id, $lang) { |
2566 | 2566 | global $wpdb; |
2567 | 2567 | |
2568 | - $reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A); |
|
2568 | + $reviews = $wpdb->get_results($wpdb->prepare("SELECT comment_id FROM ".GEODIR_REVIEW_TABLE." WHERE post_id=%d ORDER BY id ASC", $master_post_id), ARRAY_A); |
|
2569 | 2569 | |
2570 | 2570 | if (!empty($reviews)) { |
2571 | 2571 | foreach ($reviews as $review) { |
@@ -2593,14 +2593,14 @@ discard block |
||
2593 | 2593 | global $wpdb, $plugin_prefix; |
2594 | 2594 | |
2595 | 2595 | $post_type = get_post_type($master_post_id); |
2596 | - $post_table = $plugin_prefix . $post_type . '_detail'; |
|
2596 | + $post_table = $plugin_prefix.$post_type.'_detail'; |
|
2597 | 2597 | |
2598 | - $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id)); |
|
2599 | - $data = (array)$wpdb->get_row($query); |
|
2598 | + $query = $wpdb->prepare("SELECT * FROM ".$post_table." WHERE post_id = %d", array($master_post_id)); |
|
2599 | + $data = (array) $wpdb->get_row($query); |
|
2600 | 2600 | |
2601 | - if ( !empty( $data ) ) { |
|
2601 | + if (!empty($data)) { |
|
2602 | 2602 | $data['post_id'] = $tr_post_id; |
2603 | - unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
2603 | + unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type.'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
2604 | 2604 | |
2605 | 2605 | $wpdb->update($post_table, $data, array('post_id' => $tr_post_id)); |
2606 | 2606 | return true; |
@@ -2626,7 +2626,7 @@ discard block |
||
2626 | 2626 | global $sitepress, $wpdb; |
2627 | 2627 | $post_type = get_post_type($master_post_id); |
2628 | 2628 | |
2629 | - remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language |
|
2629 | + remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language |
|
2630 | 2630 | |
2631 | 2631 | $taxonomies = get_object_taxonomies($post_type); |
2632 | 2632 | foreach ($taxonomies as $taxonomy) { |
@@ -2635,9 +2635,9 @@ discard block |
||
2635 | 2635 | |
2636 | 2636 | if ($terms) { |
2637 | 2637 | foreach ($terms as $term) { |
2638 | - $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang); |
|
2638 | + $tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang); |
|
2639 | 2639 | |
2640 | - if (!is_null($tr_id)){ |
|
2640 | + if (!is_null($tr_id)) { |
|
2641 | 2641 | // not using get_term - unfiltered get_term |
2642 | 2642 | $translated_term = $wpdb->get_row($wpdb->prepare(" |
2643 | 2643 | SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $taxonomy)); |
@@ -2646,14 +2646,14 @@ discard block |
||
2646 | 2646 | } |
2647 | 2647 | } |
2648 | 2648 | |
2649 | - if (!is_taxonomy_hierarchical($taxonomy)){ |
|
2650 | - $terms_array = array_unique( array_map( 'intval', $terms_array ) ); |
|
2649 | + if (!is_taxonomy_hierarchical($taxonomy)) { |
|
2650 | + $terms_array = array_unique(array_map('intval', $terms_array)); |
|
2651 | 2651 | } |
2652 | 2652 | |
2653 | 2653 | wp_set_post_terms($tr_post_id, $terms_array, $taxonomy); |
2654 | 2654 | |
2655 | - if ($taxonomy == $post_type . 'category') { |
|
2656 | - geodir_set_postcat_structure($tr_post_id, $post_type . 'category'); |
|
2655 | + if ($taxonomy == $post_type.'category') { |
|
2656 | + geodir_set_postcat_structure($tr_post_id, $post_type.'category'); |
|
2657 | 2657 | } |
2658 | 2658 | } |
2659 | 2659 | } |
@@ -2674,15 +2674,15 @@ discard block |
||
2674 | 2674 | function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) { |
2675 | 2675 | global $wpdb; |
2676 | 2676 | |
2677 | - $query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
2677 | + $query = $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
2678 | 2678 | $wpdb->query($query); |
2679 | 2679 | |
2680 | - $query = $wpdb->prepare("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id)); |
|
2680 | + $query = $wpdb->prepare("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id)); |
|
2681 | 2681 | $post_images = $wpdb->get_results($query); |
2682 | 2682 | |
2683 | - if ( !empty( $post_images ) ) { |
|
2684 | - foreach ( $post_images as $post_image) { |
|
2685 | - $image_data = (array)$post_image; |
|
2683 | + if (!empty($post_images)) { |
|
2684 | + foreach ($post_images as $post_image) { |
|
2685 | + $image_data = (array) $post_image; |
|
2686 | 2686 | unset($image_data['ID']); |
2687 | 2687 | $image_data['post_id'] = $tr_post_id; |
2688 | 2688 | |
@@ -2715,13 +2715,13 @@ discard block |
||
2715 | 2715 | function geodir_wpml_duplicate_post_review($master_comment_id, $master_post_id, $tr_post_id, $lang) { |
2716 | 2716 | global $wpdb, $plugin_prefix; |
2717 | 2717 | |
2718 | - $review = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A); |
|
2718 | + $review = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d ORDER BY id ASC", $master_comment_id), ARRAY_A); |
|
2719 | 2719 | |
2720 | 2720 | if (empty($review)) { |
2721 | 2721 | return false; |
2722 | 2722 | } |
2723 | 2723 | if ($review['post_id'] != $master_post_id) { |
2724 | - $wpdb->query($wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id)); |
|
2724 | + $wpdb->query($wpdb->prepare("UPDATE ".GEODIR_REVIEW_TABLE." SET post_id=%d WHERE comment_id=%d", $master_post_id, $master_comment_id)); |
|
2725 | 2725 | geodir_update_postrating($master_post_id, $post_type); |
2726 | 2726 | } |
2727 | 2727 | |
@@ -2732,9 +2732,9 @@ discard block |
||
2732 | 2732 | } |
2733 | 2733 | |
2734 | 2734 | $post_type = get_post_type($master_post_id); |
2735 | - $post_table = $plugin_prefix . $post_type . '_detail'; |
|
2735 | + $post_table = $plugin_prefix.$post_type.'_detail'; |
|
2736 | 2736 | |
2737 | - $translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM " . $post_table . " WHERE post_id = %d", $tr_post_id), ARRAY_A); |
|
2737 | + $translated_post = $wpdb->get_row($wpdb->prepare("SELECT post_title, post_latitude, post_longitude, post_city, post_region, post_country FROM ".$post_table." WHERE post_id = %d", $tr_post_id), ARRAY_A); |
|
2738 | 2738 | if (empty($translated_post)) { |
2739 | 2739 | return false; |
2740 | 2740 | } |
@@ -2752,7 +2752,7 @@ discard block |
||
2752 | 2752 | unset($review['id']); |
2753 | 2753 | } |
2754 | 2754 | |
2755 | - $tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id)); |
|
2755 | + $tr_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d AND post_id=%d ORDER BY id ASC", $tr_comment_id, $tr_post_id)); |
|
2756 | 2756 | |
2757 | 2757 | if ($tr_review_id) { // update review |
2758 | 2758 | $wpdb->update(GEODIR_REVIEW_TABLE, $review, array('id' => $$tr_review_id)); |
@@ -10,21 +10,21 @@ |
||
10 | 10 | |
11 | 11 | // Exit if accessed directly. |
12 | 12 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
13 | - exit; |
|
13 | + exit; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | global $wpdb; |
17 | 17 | |
18 | 18 | if (get_option('geodir_un_geodirectory')) { |
19 | - $wpdb->hide_errors(); |
|
19 | + $wpdb->hide_errors(); |
|
20 | 20 | |
21 | - /* |
|
21 | + /* |
|
22 | 22 | if (!defined('GEODIRECTORY_VERSION')) { |
23 | 23 | // Load plugin file. |
24 | 24 | include_once('geodirectory.php'); |
25 | 25 | } |
26 | 26 | */ |
27 | 27 | |
28 | - // Delete default data. |
|
29 | - delete_option('geodir_default_data_installed'); |
|
28 | + // Delete default data. |
|
29 | + delete_option('geodir_default_data_installed'); |
|
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -9,7 +9,7 @@ |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // Exit if accessed directly. |
12 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
12 | +if (!defined('WP_UNINSTALL_PLUGIN')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 |
@@ -15,296 +15,296 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function geodir_register_sidebar() |
17 | 17 | { |
18 | - global $geodir_sidebars; |
|
19 | - |
|
20 | - if (function_exists('register_sidebar')) { |
|
21 | - /*===========================*/ |
|
22 | - /* Home page sidebars start*/ |
|
23 | - /*===========================*/ |
|
24 | - |
|
25 | - /** |
|
26 | - * Filter the `$before_widget` widget opening HTML tag. |
|
27 | - * |
|
28 | - * @since 1.0.0 |
|
29 | - * @param string $var The HTML string to filter. Default = '<section id="%1$s" class="widget geodir-widget %2$s">'. |
|
30 | - * @see 'geodir_after_widget' |
|
31 | - */ |
|
32 | - $before_widget = apply_filters('geodir_before_widget', '<section id="%1$s" class="widget geodir-widget %2$s">'); |
|
33 | - /** |
|
34 | - * Filter the `$after_widget` widget closing HTML tag. |
|
35 | - * |
|
36 | - * @since 1.0.0 |
|
37 | - * @param string $var The HTML string to filter. Default = '</section>'. |
|
38 | - * @see 'geodir_before_widget' |
|
39 | - */ |
|
40 | - $after_widget = apply_filters('geodir_after_widget', '</section>'); |
|
41 | - /** |
|
42 | - * Filter the `$before_title` widget title opening HTML tag. |
|
43 | - * |
|
44 | - * @since 1.0.0 |
|
45 | - * @param string $var The HTML string to filter. Default = '<h3 class="widget-title">'. |
|
46 | - * @see 'geodir_after_title' |
|
47 | - */ |
|
48 | - $before_title = apply_filters('geodir_before_title', '<h3 class="widget-title">'); |
|
49 | - /** |
|
50 | - * Filter the `$after_title` widget title closing HTML tag. |
|
51 | - * |
|
52 | - * @since 1.0.0 |
|
53 | - * @param string $var The HTML string to filter. Default = '</h3>'. |
|
54 | - * @see 'geodir_before_title' |
|
55 | - */ |
|
56 | - $after_title = apply_filters('geodir_after_title', '</h3>'); |
|
57 | - |
|
58 | - if (get_option('geodir_show_home_top_section')) { |
|
59 | - register_sidebars(1, array('id' => 'geodir_home_top', 'name' => __('GD Home Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
60 | - |
|
61 | - $geodir_sidebars[] = 'geodir_home_top'; |
|
62 | - } |
|
63 | - |
|
64 | - if (get_option('geodir_show_home_contant_section')) { |
|
65 | - register_sidebars(1, array('id' => 'geodir_home_content', 'name' => __('GD Home Content Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
18 | + global $geodir_sidebars; |
|
66 | 19 | |
67 | - $geodir_sidebars[] = 'geodir_home_content'; |
|
68 | - } |
|
20 | + if (function_exists('register_sidebar')) { |
|
21 | + /*===========================*/ |
|
22 | + /* Home page sidebars start*/ |
|
23 | + /*===========================*/ |
|
69 | 24 | |
70 | - if (get_option('geodir_show_home_right_section')) { |
|
71 | - register_sidebars(1, array('id' => 'geodir_home_right', 'name' => __('GD Home Right Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
25 | + /** |
|
26 | + * Filter the `$before_widget` widget opening HTML tag. |
|
27 | + * |
|
28 | + * @since 1.0.0 |
|
29 | + * @param string $var The HTML string to filter. Default = '<section id="%1$s" class="widget geodir-widget %2$s">'. |
|
30 | + * @see 'geodir_after_widget' |
|
31 | + */ |
|
32 | + $before_widget = apply_filters('geodir_before_widget', '<section id="%1$s" class="widget geodir-widget %2$s">'); |
|
33 | + /** |
|
34 | + * Filter the `$after_widget` widget closing HTML tag. |
|
35 | + * |
|
36 | + * @since 1.0.0 |
|
37 | + * @param string $var The HTML string to filter. Default = '</section>'. |
|
38 | + * @see 'geodir_before_widget' |
|
39 | + */ |
|
40 | + $after_widget = apply_filters('geodir_after_widget', '</section>'); |
|
41 | + /** |
|
42 | + * Filter the `$before_title` widget title opening HTML tag. |
|
43 | + * |
|
44 | + * @since 1.0.0 |
|
45 | + * @param string $var The HTML string to filter. Default = '<h3 class="widget-title">'. |
|
46 | + * @see 'geodir_after_title' |
|
47 | + */ |
|
48 | + $before_title = apply_filters('geodir_before_title', '<h3 class="widget-title">'); |
|
49 | + /** |
|
50 | + * Filter the `$after_title` widget title closing HTML tag. |
|
51 | + * |
|
52 | + * @since 1.0.0 |
|
53 | + * @param string $var The HTML string to filter. Default = '</h3>'. |
|
54 | + * @see 'geodir_before_title' |
|
55 | + */ |
|
56 | + $after_title = apply_filters('geodir_after_title', '</h3>'); |
|
57 | + |
|
58 | + if (get_option('geodir_show_home_top_section')) { |
|
59 | + register_sidebars(1, array('id' => 'geodir_home_top', 'name' => __('GD Home Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
72 | 60 | |
73 | - $geodir_sidebars[] = 'geodir_home_right'; |
|
74 | - } |
|
61 | + $geodir_sidebars[] = 'geodir_home_top'; |
|
62 | + } |
|
75 | 63 | |
76 | - if (get_option('geodir_show_home_left_section')) { |
|
77 | - register_sidebars(1, array('id' => 'geodir_home_left', 'name' => __('GD Home Left Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
64 | + if (get_option('geodir_show_home_contant_section')) { |
|
65 | + register_sidebars(1, array('id' => 'geodir_home_content', 'name' => __('GD Home Content Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
78 | 66 | |
79 | - $geodir_sidebars[] = 'geodir_home_left'; |
|
80 | - } |
|
67 | + $geodir_sidebars[] = 'geodir_home_content'; |
|
68 | + } |
|
81 | 69 | |
82 | - if (get_option('geodir_show_home_bottom_section')) { |
|
83 | - register_sidebars(1, array('id' => 'geodir_home_bottom', 'name' => __('GD Home Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
70 | + if (get_option('geodir_show_home_right_section')) { |
|
71 | + register_sidebars(1, array('id' => 'geodir_home_right', 'name' => __('GD Home Right Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
84 | 72 | |
85 | - $geodir_sidebars[] = 'geodir_home_bottom'; |
|
86 | - } |
|
73 | + $geodir_sidebars[] = 'geodir_home_right'; |
|
74 | + } |
|
87 | 75 | |
88 | - /*===========================*/ |
|
89 | - /* Home page sidebars end*/ |
|
90 | - /*===========================*/ |
|
76 | + if (get_option('geodir_show_home_left_section')) { |
|
77 | + register_sidebars(1, array('id' => 'geodir_home_left', 'name' => __('GD Home Left Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
91 | 78 | |
92 | - /*===========================*/ |
|
93 | - /* Listing page sidebars start*/ |
|
94 | - /*===========================*/ |
|
79 | + $geodir_sidebars[] = 'geodir_home_left'; |
|
80 | + } |
|
95 | 81 | |
96 | - if (get_option('geodir_show_listing_top_section')) { |
|
97 | - register_sidebars(1, array('id' => 'geodir_listing_top', 'name' => __('GD Listing Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
82 | + if (get_option('geodir_show_home_bottom_section')) { |
|
83 | + register_sidebars(1, array('id' => 'geodir_home_bottom', 'name' => __('GD Home Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
98 | 84 | |
99 | - $geodir_sidebars[] = 'geodir_listing_top'; |
|
100 | - } |
|
85 | + $geodir_sidebars[] = 'geodir_home_bottom'; |
|
86 | + } |
|
101 | 87 | |
102 | - if (get_option('geodir_show_listing_left_section')) { |
|
103 | - register_sidebars(1, array('id' => 'geodir_listing_left_sidebar', 'name' => __('GD Listing Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
88 | + /*===========================*/ |
|
89 | + /* Home page sidebars end*/ |
|
90 | + /*===========================*/ |
|
104 | 91 | |
105 | - $geodir_sidebars[] = 'geodir_listing_left_sidebar'; |
|
106 | - } |
|
92 | + /*===========================*/ |
|
93 | + /* Listing page sidebars start*/ |
|
94 | + /*===========================*/ |
|
107 | 95 | |
108 | - if (get_option('geodir_show_listing_right_section')) { |
|
109 | - register_sidebars(1, array('id' => 'geodir_listing_right_sidebar', 'name' => __('GD Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
96 | + if (get_option('geodir_show_listing_top_section')) { |
|
97 | + register_sidebars(1, array('id' => 'geodir_listing_top', 'name' => __('GD Listing Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
110 | 98 | |
111 | - $geodir_sidebars[] = 'geodir_listing_right_sidebar'; |
|
112 | - } |
|
99 | + $geodir_sidebars[] = 'geodir_listing_top'; |
|
100 | + } |
|
113 | 101 | |
114 | - if (get_option('geodir_show_listing_bottom_section')) { |
|
115 | - register_sidebars(1, array('id' => 'geodir_listing_bottom', 'name' => __('GD Listing Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
102 | + if (get_option('geodir_show_listing_left_section')) { |
|
103 | + register_sidebars(1, array('id' => 'geodir_listing_left_sidebar', 'name' => __('GD Listing Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
116 | 104 | |
117 | - $geodir_sidebars[] = 'geodir_listing_bottom'; |
|
118 | - } |
|
105 | + $geodir_sidebars[] = 'geodir_listing_left_sidebar'; |
|
106 | + } |
|
119 | 107 | |
120 | - /*===========================*/ |
|
121 | - /* Listing page sidebars start*/ |
|
122 | - /*===========================*/ |
|
108 | + if (get_option('geodir_show_listing_right_section')) { |
|
109 | + register_sidebars(1, array('id' => 'geodir_listing_right_sidebar', 'name' => __('GD Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
123 | 110 | |
124 | - /*===========================*/ |
|
125 | - /* Search page sidebars start*/ |
|
126 | - /*===========================*/ |
|
111 | + $geodir_sidebars[] = 'geodir_listing_right_sidebar'; |
|
112 | + } |
|
127 | 113 | |
128 | - if (get_option('geodir_show_search_top_section')) { |
|
129 | - register_sidebars(1, array('id' => 'geodir_search_top', 'name' => __('GD Search Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
114 | + if (get_option('geodir_show_listing_bottom_section')) { |
|
115 | + register_sidebars(1, array('id' => 'geodir_listing_bottom', 'name' => __('GD Listing Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
130 | 116 | |
131 | - $geodir_sidebars[] = 'geodir_search_top'; |
|
132 | - } |
|
117 | + $geodir_sidebars[] = 'geodir_listing_bottom'; |
|
118 | + } |
|
133 | 119 | |
134 | - if (get_option('geodir_show_search_left_section')) { |
|
135 | - register_sidebars(1, array('id' => 'geodir_search_left_sidebar', 'name' => __('GD Search Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
120 | + /*===========================*/ |
|
121 | + /* Listing page sidebars start*/ |
|
122 | + /*===========================*/ |
|
136 | 123 | |
137 | - $geodir_sidebars[] = 'geodir_search_left_sidebar'; |
|
138 | - } |
|
124 | + /*===========================*/ |
|
125 | + /* Search page sidebars start*/ |
|
126 | + /*===========================*/ |
|
139 | 127 | |
140 | - if (get_option('geodir_show_search_right_section')) { |
|
141 | - register_sidebars(1, array('id' => 'geodir_search_right_sidebar', 'name' => __('GD Search Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
128 | + if (get_option('geodir_show_search_top_section')) { |
|
129 | + register_sidebars(1, array('id' => 'geodir_search_top', 'name' => __('GD Search Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
142 | 130 | |
143 | - $geodir_sidebars[] = 'geodir_search_right_sidebar'; |
|
144 | - } |
|
131 | + $geodir_sidebars[] = 'geodir_search_top'; |
|
132 | + } |
|
145 | 133 | |
146 | - if (get_option('geodir_show_search_bottom_section')) { |
|
147 | - register_sidebars(1, array('id' => 'geodir_search_bottom', 'name' => __('GD Search Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
134 | + if (get_option('geodir_show_search_left_section')) { |
|
135 | + register_sidebars(1, array('id' => 'geodir_search_left_sidebar', 'name' => __('GD Search Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
148 | 136 | |
149 | - $geodir_sidebars[] = 'geodir_search_bottom'; |
|
150 | - } |
|
137 | + $geodir_sidebars[] = 'geodir_search_left_sidebar'; |
|
138 | + } |
|
151 | 139 | |
152 | - /*===========================*/ |
|
153 | - /* Search page sidebars end*/ |
|
154 | - /*===========================*/ |
|
140 | + if (get_option('geodir_show_search_right_section')) { |
|
141 | + register_sidebars(1, array('id' => 'geodir_search_right_sidebar', 'name' => __('GD Search Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
155 | 142 | |
156 | - /*==================================*/ |
|
157 | - /* Detail/Single page sidebars start*/ |
|
158 | - /*==================================*/ |
|
159 | - if (get_option('geodir_show_detail_top_section')) { |
|
160 | - register_sidebars(1, array('id' => 'geodir_detail_top', 'name' => __('GD Detail Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
143 | + $geodir_sidebars[] = 'geodir_search_right_sidebar'; |
|
144 | + } |
|
161 | 145 | |
162 | - $geodir_sidebars[] = 'geodir_detail_top'; |
|
163 | - } |
|
146 | + if (get_option('geodir_show_search_bottom_section')) { |
|
147 | + register_sidebars(1, array('id' => 'geodir_search_bottom', 'name' => __('GD Search Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
164 | 148 | |
165 | - register_sidebars(1, array('id' => 'geodir_detail_sidebar', 'name' => __('GD Detail Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
149 | + $geodir_sidebars[] = 'geodir_search_bottom'; |
|
150 | + } |
|
166 | 151 | |
167 | - $geodir_sidebars[] = 'geodir_detail_sidebar'; |
|
152 | + /*===========================*/ |
|
153 | + /* Search page sidebars end*/ |
|
154 | + /*===========================*/ |
|
168 | 155 | |
169 | - if (get_option('geodir_show_detail_bottom_section')) { |
|
170 | - register_sidebars(1, array('id' => 'geodir_detail_bottom', 'name' => __('GD Detail Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
156 | + /*==================================*/ |
|
157 | + /* Detail/Single page sidebars start*/ |
|
158 | + /*==================================*/ |
|
159 | + if (get_option('geodir_show_detail_top_section')) { |
|
160 | + register_sidebars(1, array('id' => 'geodir_detail_top', 'name' => __('GD Detail Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
171 | 161 | |
172 | - $geodir_sidebars[] = 'geodir_detail_bottom'; |
|
173 | - } |
|
162 | + $geodir_sidebars[] = 'geodir_detail_top'; |
|
163 | + } |
|
174 | 164 | |
175 | - /*==================================*/ |
|
176 | - /* Detail/Single page sidebars end*/ |
|
177 | - /*==================================*/ |
|
165 | + register_sidebars(1, array('id' => 'geodir_detail_sidebar', 'name' => __('GD Detail Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
178 | 166 | |
179 | - /*==================================*/ |
|
180 | - /* Author page sidebars start */ |
|
181 | - /*==================================*/ |
|
167 | + $geodir_sidebars[] = 'geodir_detail_sidebar'; |
|
182 | 168 | |
183 | - if (get_option('geodir_show_author_top_section')) { |
|
184 | - register_sidebars(1, array('id' => 'geodir_author_top', 'name' => __('GD Author Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
169 | + if (get_option('geodir_show_detail_bottom_section')) { |
|
170 | + register_sidebars(1, array('id' => 'geodir_detail_bottom', 'name' => __('GD Detail Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
185 | 171 | |
186 | - $geodir_sidebars[] = 'geodir_author_top'; |
|
187 | - } |
|
172 | + $geodir_sidebars[] = 'geodir_detail_bottom'; |
|
173 | + } |
|
188 | 174 | |
189 | - if (get_option('geodir_show_author_left_section')) { |
|
190 | - register_sidebars(1, array('id' => 'geodir_author_left_sidebar', 'name' => __('GD Author Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
175 | + /*==================================*/ |
|
176 | + /* Detail/Single page sidebars end*/ |
|
177 | + /*==================================*/ |
|
191 | 178 | |
192 | - $geodir_sidebars[] = 'geodir_author_left_sidebar'; |
|
193 | - } |
|
179 | + /*==================================*/ |
|
180 | + /* Author page sidebars start */ |
|
181 | + /*==================================*/ |
|
194 | 182 | |
195 | - if (get_option('geodir_show_author_right_section')) { |
|
196 | - register_sidebars(1, array('id' => 'geodir_author_right_sidebar', 'name' => __('GD Author Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
183 | + if (get_option('geodir_show_author_top_section')) { |
|
184 | + register_sidebars(1, array('id' => 'geodir_author_top', 'name' => __('GD Author Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
197 | 185 | |
198 | - $geodir_sidebars[] = 'geodir_author_right_sidebar'; |
|
199 | - } |
|
186 | + $geodir_sidebars[] = 'geodir_author_top'; |
|
187 | + } |
|
200 | 188 | |
201 | - if (get_option('geodir_show_author_bottom_section')) { |
|
202 | - register_sidebars(1, array('id' => 'geodir_author_bottom', 'name' => __('GD Author Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
189 | + if (get_option('geodir_show_author_left_section')) { |
|
190 | + register_sidebars(1, array('id' => 'geodir_author_left_sidebar', 'name' => __('GD Author Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
203 | 191 | |
204 | - $geodir_sidebars[] = 'geodir_author_bottom'; |
|
205 | - } |
|
192 | + $geodir_sidebars[] = 'geodir_author_left_sidebar'; |
|
193 | + } |
|
206 | 194 | |
207 | - /*==================================*/ |
|
208 | - /* Author page sidebars end */ |
|
209 | - /*==================================*/ |
|
195 | + if (get_option('geodir_show_author_right_section')) { |
|
196 | + register_sidebars(1, array('id' => 'geodir_author_right_sidebar', 'name' => __('GD Author Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
210 | 197 | |
211 | - /*==================================*/ |
|
212 | - /* Add listing page sidebars start */ |
|
213 | - /*==================================*/ |
|
198 | + $geodir_sidebars[] = 'geodir_author_right_sidebar'; |
|
199 | + } |
|
214 | 200 | |
215 | - register_sidebars(1, array('id' => 'geodir_add_listing_sidebar', 'name' => __('GD Add Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
201 | + if (get_option('geodir_show_author_bottom_section')) { |
|
202 | + register_sidebars(1, array('id' => 'geodir_author_bottom', 'name' => __('GD Author Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
216 | 203 | |
217 | - $geodir_sidebars[] = 'geodir_add_listing_sidebar'; |
|
204 | + $geodir_sidebars[] = 'geodir_author_bottom'; |
|
205 | + } |
|
218 | 206 | |
219 | - /*==================================*/ |
|
220 | - /* Add listing page sidebars end */ |
|
221 | - /*==================================*/ |
|
207 | + /*==================================*/ |
|
208 | + /* Author page sidebars end */ |
|
209 | + /*==================================*/ |
|
222 | 210 | |
223 | - } |
|
211 | + /*==================================*/ |
|
212 | + /* Add listing page sidebars start */ |
|
213 | + /*==================================*/ |
|
214 | + |
|
215 | + register_sidebars(1, array('id' => 'geodir_add_listing_sidebar', 'name' => __('GD Add Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title)); |
|
216 | + |
|
217 | + $geodir_sidebars[] = 'geodir_add_listing_sidebar'; |
|
218 | + |
|
219 | + /*==================================*/ |
|
220 | + /* Add listing page sidebars end */ |
|
221 | + /*==================================*/ |
|
222 | + |
|
223 | + } |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | |
227 | 227 | if (!function_exists('register_geodir_widgets')) { |
228 | - /** |
|
229 | - * Registers all Widgets. |
|
230 | - * |
|
231 | - * @since 1.0.0 |
|
232 | - * @package GeoDirectory |
|
233 | - */ |
|
234 | - function register_geodir_widgets() |
|
235 | - { |
|
236 | - /** |
|
237 | - * Login Widget. |
|
238 | - * |
|
239 | - * @since 1.0.0 |
|
240 | - */ |
|
241 | - class geodir_loginwidget extends WP_Widget |
|
242 | - { |
|
243 | - /** |
|
244 | - * Register the login widget with WordPress. |
|
245 | - * |
|
246 | - * @since 1.0.0 |
|
247 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
248 | - */ |
|
249 | - public function __construct() { |
|
250 | - $widget_ops = array('classname' => 'geodir_loginbox', 'description' => __('Geodirectory Loginbox Widget', 'geodirectory')); |
|
251 | - parent::__construct( |
|
252 | - 'geodir_loginbox', // Base ID |
|
253 | - __('GD > Loginbox', 'geodirectory'), // Name |
|
254 | - $widget_ops// Args |
|
255 | - ); |
|
256 | - } |
|
257 | - |
|
258 | - /** |
|
259 | - * Front-end display content for login widget. |
|
260 | - * |
|
261 | - * @since 1.0.0 |
|
262 | - * @since 1.5.1 Declare function public. |
|
263 | - * |
|
264 | - * @param array $args Widget arguments. |
|
265 | - * @param array $instance Saved values from database. |
|
266 | - */ |
|
267 | - public function widget($args, $instance) |
|
268 | - { |
|
269 | - geodir_loginwidget_output($args, $instance); |
|
270 | - } |
|
271 | - |
|
272 | - /** |
|
273 | - * Sanitize login widget form values as they are saved. |
|
274 | - * |
|
275 | - * @since 1.0.0 |
|
276 | - * @since 1.5.1 Declare function public. |
|
277 | - * |
|
278 | - * @param array $new_instance Values just sent to be saved. |
|
279 | - * @param array $old_instance Previously saved values from database. |
|
280 | - * |
|
281 | - * @return array Updated safe values to be saved. |
|
282 | - */ |
|
283 | - public function update($new_instance, $old_instance) |
|
284 | - { |
|
285 | - //save the widget |
|
286 | - $instance = $old_instance; |
|
287 | - $instance['title'] = strip_tags($new_instance['title']); |
|
288 | - |
|
289 | - return $instance; |
|
290 | - } |
|
291 | - |
|
292 | - /** |
|
293 | - * Back-end login widget settings form. |
|
294 | - * |
|
295 | - * @since 1.0.0 |
|
296 | - * @since 1.5.1 Declare function public. |
|
297 | - * |
|
298 | - * @param array $instance Previously saved values from database. |
|
299 | - * @return string|void |
|
300 | - */ |
|
301 | - public function form($instance) |
|
302 | - { |
|
303 | - //widgetform in backend |
|
304 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
305 | - $title = strip_tags($instance['title']); |
|
306 | - |
|
307 | - ?> |
|
228 | + /** |
|
229 | + * Registers all Widgets. |
|
230 | + * |
|
231 | + * @since 1.0.0 |
|
232 | + * @package GeoDirectory |
|
233 | + */ |
|
234 | + function register_geodir_widgets() |
|
235 | + { |
|
236 | + /** |
|
237 | + * Login Widget. |
|
238 | + * |
|
239 | + * @since 1.0.0 |
|
240 | + */ |
|
241 | + class geodir_loginwidget extends WP_Widget |
|
242 | + { |
|
243 | + /** |
|
244 | + * Register the login widget with WordPress. |
|
245 | + * |
|
246 | + * @since 1.0.0 |
|
247 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
248 | + */ |
|
249 | + public function __construct() { |
|
250 | + $widget_ops = array('classname' => 'geodir_loginbox', 'description' => __('Geodirectory Loginbox Widget', 'geodirectory')); |
|
251 | + parent::__construct( |
|
252 | + 'geodir_loginbox', // Base ID |
|
253 | + __('GD > Loginbox', 'geodirectory'), // Name |
|
254 | + $widget_ops// Args |
|
255 | + ); |
|
256 | + } |
|
257 | + |
|
258 | + /** |
|
259 | + * Front-end display content for login widget. |
|
260 | + * |
|
261 | + * @since 1.0.0 |
|
262 | + * @since 1.5.1 Declare function public. |
|
263 | + * |
|
264 | + * @param array $args Widget arguments. |
|
265 | + * @param array $instance Saved values from database. |
|
266 | + */ |
|
267 | + public function widget($args, $instance) |
|
268 | + { |
|
269 | + geodir_loginwidget_output($args, $instance); |
|
270 | + } |
|
271 | + |
|
272 | + /** |
|
273 | + * Sanitize login widget form values as they are saved. |
|
274 | + * |
|
275 | + * @since 1.0.0 |
|
276 | + * @since 1.5.1 Declare function public. |
|
277 | + * |
|
278 | + * @param array $new_instance Values just sent to be saved. |
|
279 | + * @param array $old_instance Previously saved values from database. |
|
280 | + * |
|
281 | + * @return array Updated safe values to be saved. |
|
282 | + */ |
|
283 | + public function update($new_instance, $old_instance) |
|
284 | + { |
|
285 | + //save the widget |
|
286 | + $instance = $old_instance; |
|
287 | + $instance['title'] = strip_tags($new_instance['title']); |
|
288 | + |
|
289 | + return $instance; |
|
290 | + } |
|
291 | + |
|
292 | + /** |
|
293 | + * Back-end login widget settings form. |
|
294 | + * |
|
295 | + * @since 1.0.0 |
|
296 | + * @since 1.5.1 Declare function public. |
|
297 | + * |
|
298 | + * @param array $instance Previously saved values from database. |
|
299 | + * @return string|void |
|
300 | + */ |
|
301 | + public function form($instance) |
|
302 | + { |
|
303 | + //widgetform in backend |
|
304 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
305 | + $title = strip_tags($instance['title']); |
|
306 | + |
|
307 | + ?> |
|
308 | 308 | <p><label |
309 | 309 | for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title', 'geodirectory'); ?> |
310 | 310 | : <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
@@ -313,64 +313,64 @@ discard block |
||
313 | 313 | |
314 | 314 | |
315 | 315 | <?php |
316 | - } |
|
317 | - } |
|
318 | - |
|
319 | - register_widget('geodir_loginwidget'); |
|
320 | - |
|
321 | - |
|
322 | - /** |
|
323 | - * GeoDirectory Social Like Widget. |
|
324 | - * |
|
325 | - * @since 1.0.0 |
|
326 | - */ |
|
327 | - class geodir_social_like_widget extends WP_Widget |
|
328 | - { |
|
329 | - |
|
330 | - /** |
|
331 | - * Register the social like widget with WordPress. |
|
332 | - * |
|
333 | - * @since 1.0.0 |
|
334 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
335 | - */ |
|
336 | - public function __construct() { |
|
337 | - $widget_ops = array('classname' => 'geodir_social_like_widget', 'description' => __('GD > Twitter,Facebook and Google+ buttons', 'geodirectory')); |
|
338 | - parent::__construct( |
|
339 | - 'social_like_widget', // Base ID |
|
340 | - __('GD > Social Like', 'geodirectory'), // Name |
|
341 | - $widget_ops// Args |
|
342 | - ); |
|
343 | - } |
|
344 | - |
|
345 | - /** |
|
346 | - * Front-end display content for social like widget. |
|
347 | - * |
|
348 | - * @since 1.0.0 |
|
349 | - * @since 1.5.1 Declare function public. |
|
350 | - * |
|
351 | - * @param array $args Widget arguments. |
|
352 | - * @param array $instance Saved values from database. |
|
353 | - */ |
|
354 | - public function widget($args, $instance) |
|
355 | - { |
|
356 | - // prints the widget |
|
357 | - extract($args, EXTR_SKIP); |
|
358 | - |
|
359 | - /** |
|
360 | - * Filter the widget title text. |
|
361 | - * |
|
362 | - * @since 1.0.0 |
|
363 | - * @global object $current_user Current user object. |
|
364 | - * @param string $title The widget title text. |
|
365 | - */ |
|
366 | - $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); |
|
367 | - |
|
368 | - global $current_user, $post; |
|
369 | - echo $before_widget; |
|
370 | - ?> |
|
316 | + } |
|
317 | + } |
|
318 | + |
|
319 | + register_widget('geodir_loginwidget'); |
|
320 | + |
|
321 | + |
|
322 | + /** |
|
323 | + * GeoDirectory Social Like Widget. |
|
324 | + * |
|
325 | + * @since 1.0.0 |
|
326 | + */ |
|
327 | + class geodir_social_like_widget extends WP_Widget |
|
328 | + { |
|
329 | + |
|
330 | + /** |
|
331 | + * Register the social like widget with WordPress. |
|
332 | + * |
|
333 | + * @since 1.0.0 |
|
334 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
335 | + */ |
|
336 | + public function __construct() { |
|
337 | + $widget_ops = array('classname' => 'geodir_social_like_widget', 'description' => __('GD > Twitter,Facebook and Google+ buttons', 'geodirectory')); |
|
338 | + parent::__construct( |
|
339 | + 'social_like_widget', // Base ID |
|
340 | + __('GD > Social Like', 'geodirectory'), // Name |
|
341 | + $widget_ops// Args |
|
342 | + ); |
|
343 | + } |
|
344 | + |
|
345 | + /** |
|
346 | + * Front-end display content for social like widget. |
|
347 | + * |
|
348 | + * @since 1.0.0 |
|
349 | + * @since 1.5.1 Declare function public. |
|
350 | + * |
|
351 | + * @param array $args Widget arguments. |
|
352 | + * @param array $instance Saved values from database. |
|
353 | + */ |
|
354 | + public function widget($args, $instance) |
|
355 | + { |
|
356 | + // prints the widget |
|
357 | + extract($args, EXTR_SKIP); |
|
358 | + |
|
359 | + /** |
|
360 | + * Filter the widget title text. |
|
361 | + * |
|
362 | + * @since 1.0.0 |
|
363 | + * @global object $current_user Current user object. |
|
364 | + * @param string $title The widget title text. |
|
365 | + */ |
|
366 | + $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); |
|
367 | + |
|
368 | + global $current_user, $post; |
|
369 | + echo $before_widget; |
|
370 | + ?> |
|
371 | 371 | |
372 | 372 | <?php //if ( get_option('gd_tweet_button') ) { |
373 | - ?> |
|
373 | + ?> |
|
374 | 374 | |
375 | 375 | <a href="http://twitter.com/share" |
376 | 376 | class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a> |
@@ -378,23 +378,23 @@ discard block |
||
378 | 378 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
379 | 379 | |
380 | 380 | <?php //} |
381 | - ?> |
|
381 | + ?> |
|
382 | 382 | |
383 | 383 | <?php // if ( get_option('gd_facebook_button') ) { |
384 | - ?> |
|
384 | + ?> |
|
385 | 385 | |
386 | 386 | <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) { |
387 | - echo 'allowtransparency="true"'; |
|
388 | - }?> class="facebook" |
|
387 | + echo 'allowtransparency="true"'; |
|
388 | + }?> class="facebook" |
|
389 | 389 | src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(geodir_curPageURL()); ?>&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light" |
390 | 390 | style="border:none; overflow:hidden; width:100px; height:20px"></iframe> |
391 | 391 | |
392 | 392 | |
393 | 393 | <?php //} |
394 | - ?> |
|
394 | + ?> |
|
395 | 395 | |
396 | 396 | <?php //if ( get_option('gd_google_button') ) { |
397 | - ?> |
|
397 | + ?> |
|
398 | 398 | <script> |
399 | 399 | window.___gcfg = { |
400 | 400 | parsetags: 'explicit' |
@@ -408,118 +408,118 @@ discard block |
||
408 | 408 | "count": "true" |
409 | 409 | });</script> |
410 | 410 | <?php //} |
411 | - echo $after_widget; |
|
412 | - |
|
413 | - } |
|
414 | - |
|
415 | - /** |
|
416 | - * Sanitize social like widget form values as they are saved. |
|
417 | - * |
|
418 | - * @since 1.0.0 |
|
419 | - * @since 1.5.1 Declare function public. |
|
420 | - * |
|
421 | - * @param array $new_instance Values just sent to be saved. |
|
422 | - * @param array $old_instance Previously saved values from database. |
|
423 | - * |
|
424 | - * @return array Updated safe values to be saved. |
|
425 | - */ |
|
426 | - public function update($new_instance, $old_instance) |
|
427 | - { |
|
428 | - //save the widget |
|
429 | - $instance = $old_instance; |
|
430 | - $instance['title'] = strip_tags($new_instance['title']); |
|
431 | - return $instance; |
|
432 | - } |
|
433 | - |
|
434 | - /** |
|
435 | - * Back-end social like widget settings form. |
|
436 | - * |
|
437 | - * @since 1.0.0 |
|
438 | - * @since 1.5.1 Declare function public. |
|
439 | - * |
|
440 | - * @param array $instance Previously saved values from database. |
|
441 | - * @return string|void |
|
442 | - */ |
|
443 | - public function form($instance) |
|
444 | - { |
|
445 | - //widgetform in backend |
|
446 | - $instance = wp_parse_args((array)$instance, array('title' => '')); |
|
447 | - $title = strip_tags($instance['title']); |
|
448 | - ?> |
|
411 | + echo $after_widget; |
|
412 | + |
|
413 | + } |
|
414 | + |
|
415 | + /** |
|
416 | + * Sanitize social like widget form values as they are saved. |
|
417 | + * |
|
418 | + * @since 1.0.0 |
|
419 | + * @since 1.5.1 Declare function public. |
|
420 | + * |
|
421 | + * @param array $new_instance Values just sent to be saved. |
|
422 | + * @param array $old_instance Previously saved values from database. |
|
423 | + * |
|
424 | + * @return array Updated safe values to be saved. |
|
425 | + */ |
|
426 | + public function update($new_instance, $old_instance) |
|
427 | + { |
|
428 | + //save the widget |
|
429 | + $instance = $old_instance; |
|
430 | + $instance['title'] = strip_tags($new_instance['title']); |
|
431 | + return $instance; |
|
432 | + } |
|
433 | + |
|
434 | + /** |
|
435 | + * Back-end social like widget settings form. |
|
436 | + * |
|
437 | + * @since 1.0.0 |
|
438 | + * @since 1.5.1 Declare function public. |
|
439 | + * |
|
440 | + * @param array $instance Previously saved values from database. |
|
441 | + * @return string|void |
|
442 | + */ |
|
443 | + public function form($instance) |
|
444 | + { |
|
445 | + //widgetform in backend |
|
446 | + $instance = wp_parse_args((array)$instance, array('title' => '')); |
|
447 | + $title = strip_tags($instance['title']); |
|
448 | + ?> |
|
449 | 449 | <p>No settings for this widget</p> |
450 | 450 | |
451 | 451 | |
452 | 452 | <?php |
453 | - } |
|
454 | - } |
|
455 | - |
|
456 | - register_widget('geodir_social_like_widget'); |
|
457 | - |
|
458 | - |
|
459 | - /** |
|
460 | - * GeoDirectory Feedburner Subscribe widget. |
|
461 | - * |
|
462 | - * @since 1.0.0 |
|
463 | - */ |
|
464 | - class geodirsubscribeWidget extends WP_Widget |
|
465 | - { |
|
466 | - |
|
467 | - /** |
|
468 | - * Register the feedburner subscribe widget with WordPress. |
|
469 | - * |
|
470 | - * @since 1.0.0 |
|
471 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
472 | - */ |
|
473 | - public function __construct() { |
|
474 | - $widget_ops = array('classname' => 'geodir-subscribe', 'description' => __('GD > Google Feedburner Subscribe', 'geodirectory')); |
|
475 | - parent::__construct( |
|
476 | - 'widget_subscribeWidget', // Base ID |
|
477 | - __('GD > Subscribe', 'geodirectory'), // Name |
|
478 | - $widget_ops// Args |
|
479 | - ); |
|
480 | - } |
|
481 | - |
|
482 | - /** |
|
483 | - * Front-end display content for feedburner subscribe widget. |
|
484 | - * |
|
485 | - * @since 1.0.0 |
|
486 | - * @since 1.5.1 Declare function public. |
|
487 | - * |
|
488 | - * @param array $args Widget arguments. |
|
489 | - * @param array $instance Saved values from database. |
|
490 | - */ |
|
491 | - public function widget($args, $instance) |
|
492 | - { |
|
493 | - // prints the widget |
|
494 | - extract($args, EXTR_SKIP); |
|
495 | - |
|
496 | - /** |
|
497 | - * Filter the widget instance id. |
|
498 | - * |
|
499 | - * @since 1.0.0 |
|
500 | - * @param string $id The widget instance id. |
|
501 | - */ |
|
502 | - $id = empty($instance['id']) ? '' : apply_filters('widget_id', $instance['id']); |
|
503 | - |
|
504 | - /** This filter is documented in geodirectory_widgets.php */ |
|
505 | - $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
|
506 | - |
|
507 | - /** |
|
508 | - * Filter the widget text. |
|
509 | - * |
|
510 | - * @since 1.0.0 |
|
511 | - * @param string $text The widget text. |
|
512 | - */ |
|
513 | - $text = empty($instance['text']) ? '' : apply_filters('widget_text', $instance['text']); |
|
514 | - |
|
515 | - echo $before_widget; |
|
516 | - ?> |
|
453 | + } |
|
454 | + } |
|
455 | + |
|
456 | + register_widget('geodir_social_like_widget'); |
|
457 | + |
|
458 | + |
|
459 | + /** |
|
460 | + * GeoDirectory Feedburner Subscribe widget. |
|
461 | + * |
|
462 | + * @since 1.0.0 |
|
463 | + */ |
|
464 | + class geodirsubscribeWidget extends WP_Widget |
|
465 | + { |
|
466 | + |
|
467 | + /** |
|
468 | + * Register the feedburner subscribe widget with WordPress. |
|
469 | + * |
|
470 | + * @since 1.0.0 |
|
471 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
472 | + */ |
|
473 | + public function __construct() { |
|
474 | + $widget_ops = array('classname' => 'geodir-subscribe', 'description' => __('GD > Google Feedburner Subscribe', 'geodirectory')); |
|
475 | + parent::__construct( |
|
476 | + 'widget_subscribeWidget', // Base ID |
|
477 | + __('GD > Subscribe', 'geodirectory'), // Name |
|
478 | + $widget_ops// Args |
|
479 | + ); |
|
480 | + } |
|
481 | + |
|
482 | + /** |
|
483 | + * Front-end display content for feedburner subscribe widget. |
|
484 | + * |
|
485 | + * @since 1.0.0 |
|
486 | + * @since 1.5.1 Declare function public. |
|
487 | + * |
|
488 | + * @param array $args Widget arguments. |
|
489 | + * @param array $instance Saved values from database. |
|
490 | + */ |
|
491 | + public function widget($args, $instance) |
|
492 | + { |
|
493 | + // prints the widget |
|
494 | + extract($args, EXTR_SKIP); |
|
495 | + |
|
496 | + /** |
|
497 | + * Filter the widget instance id. |
|
498 | + * |
|
499 | + * @since 1.0.0 |
|
500 | + * @param string $id The widget instance id. |
|
501 | + */ |
|
502 | + $id = empty($instance['id']) ? '' : apply_filters('widget_id', $instance['id']); |
|
503 | + |
|
504 | + /** This filter is documented in geodirectory_widgets.php */ |
|
505 | + $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
|
506 | + |
|
507 | + /** |
|
508 | + * Filter the widget text. |
|
509 | + * |
|
510 | + * @since 1.0.0 |
|
511 | + * @param string $text The widget text. |
|
512 | + */ |
|
513 | + $text = empty($instance['text']) ? '' : apply_filters('widget_text', $instance['text']); |
|
514 | + |
|
515 | + echo $before_widget; |
|
516 | + ?> |
|
517 | 517 | |
518 | 518 | <?php echo $before_title . $title; ?> <a href="<?php if ($id) { |
519 | - echo 'http://feeds2.feedburner.com/' . $id; |
|
520 | - } else { |
|
521 | - bloginfo('rss_url'); |
|
522 | - } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
519 | + echo 'http://feeds2.feedburner.com/' . $id; |
|
520 | + } else { |
|
521 | + bloginfo('rss_url'); |
|
522 | + } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
523 | 523 | |
524 | 524 | <?php if ($text <> "") { ?> |
525 | 525 | |
@@ -544,57 +544,57 @@ discard block |
||
544 | 544 | </form> |
545 | 545 | |
546 | 546 | <?php |
547 | - echo $after_widget; |
|
547 | + echo $after_widget; |
|
548 | 548 | |
549 | - } |
|
549 | + } |
|
550 | 550 | |
551 | - /** |
|
552 | - * Sanitize feedburner subscribe widget form values as they are saved. |
|
553 | - * |
|
554 | - * @since 1.0.0 |
|
555 | - * @since 1.5.1 Declare function public. |
|
556 | - * |
|
557 | - * @param array $new_instance Values just sent to be saved. |
|
558 | - * @param array $old_instance Previously saved values from database. |
|
559 | - * |
|
560 | - * @return array Updated safe values to be saved. |
|
561 | - */ |
|
562 | - public function update($new_instance, $old_instance) |
|
563 | - { |
|
551 | + /** |
|
552 | + * Sanitize feedburner subscribe widget form values as they are saved. |
|
553 | + * |
|
554 | + * @since 1.0.0 |
|
555 | + * @since 1.5.1 Declare function public. |
|
556 | + * |
|
557 | + * @param array $new_instance Values just sent to be saved. |
|
558 | + * @param array $old_instance Previously saved values from database. |
|
559 | + * |
|
560 | + * @return array Updated safe values to be saved. |
|
561 | + */ |
|
562 | + public function update($new_instance, $old_instance) |
|
563 | + { |
|
564 | 564 | |
565 | - //save the widget |
|
566 | - $instance = $old_instance; |
|
567 | - $instance['id'] = strip_tags($new_instance['id']); |
|
568 | - $instance['title'] = ($new_instance['title']); |
|
569 | - $instance['text'] = ($new_instance['text']); |
|
565 | + //save the widget |
|
566 | + $instance = $old_instance; |
|
567 | + $instance['id'] = strip_tags($new_instance['id']); |
|
568 | + $instance['title'] = ($new_instance['title']); |
|
569 | + $instance['text'] = ($new_instance['text']); |
|
570 | 570 | |
571 | 571 | |
572 | - return $instance; |
|
573 | - } |
|
572 | + return $instance; |
|
573 | + } |
|
574 | 574 | |
575 | - /** |
|
576 | - * Back-end feedburner subscribe widget settings form. |
|
577 | - * |
|
578 | - * @since 1.0.0 |
|
579 | - * @since 1.5.1 Declare function public. |
|
580 | - * |
|
581 | - * @param array $instance Previously saved values from database. |
|
582 | - * @return string|void |
|
583 | - */ |
|
584 | - public function form($instance) |
|
585 | - { |
|
586 | - //widgetform in backend |
|
587 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => '')); |
|
575 | + /** |
|
576 | + * Back-end feedburner subscribe widget settings form. |
|
577 | + * |
|
578 | + * @since 1.0.0 |
|
579 | + * @since 1.5.1 Declare function public. |
|
580 | + * |
|
581 | + * @param array $instance Previously saved values from database. |
|
582 | + * @return string|void |
|
583 | + */ |
|
584 | + public function form($instance) |
|
585 | + { |
|
586 | + //widgetform in backend |
|
587 | + $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => '')); |
|
588 | 588 | |
589 | - $id = strip_tags($instance['id']); |
|
589 | + $id = strip_tags($instance['id']); |
|
590 | 590 | |
591 | - $title = strip_tags($instance['title']); |
|
591 | + $title = strip_tags($instance['title']); |
|
592 | 592 | |
593 | - $text = strip_tags($instance['text']); |
|
593 | + $text = strip_tags($instance['text']); |
|
594 | 594 | |
595 | 595 | |
596 | 596 | |
597 | - ?> |
|
597 | + ?> |
|
598 | 598 | <p><label |
599 | 599 | for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>: |
600 | 600 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
@@ -613,101 +613,101 @@ discard block |
||
613 | 613 | name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label> |
614 | 614 | </p> |
615 | 615 | <?php |
616 | - } |
|
617 | - } |
|
618 | - |
|
619 | - register_widget('geodirsubscribeWidget'); |
|
620 | - |
|
621 | - /** |
|
622 | - * GeoDirectory advertise widget. |
|
623 | - * |
|
624 | - * @since 1.0.0 |
|
625 | - */ |
|
626 | - class geodiradvtwidget extends WP_Widget |
|
627 | - { |
|
628 | - |
|
629 | - /** |
|
630 | - * Register the advertise widget with WordPress. |
|
631 | - * |
|
632 | - * @since 1.0.0 |
|
633 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
634 | - */ |
|
635 | - public function __construct() { |
|
636 | - $widget_ops = array('classname' => 'GeoDirectory Advertise', 'description' => __('GD > common advertise widget in sidebar, bottom section', 'geodirectory')); |
|
637 | - parent::__construct( |
|
638 | - 'advtwidget', // Base ID |
|
639 | - __('GD > Advertise', 'geodirectory'), // Name |
|
640 | - $widget_ops// Args |
|
641 | - ); |
|
642 | - } |
|
643 | - |
|
644 | - |
|
645 | - /** |
|
646 | - * Front-end display content for advertise widget. |
|
647 | - * |
|
648 | - * @since 1.0.0 |
|
649 | - * @since 1.5.1 Declare function public. |
|
650 | - * |
|
651 | - * @param array $args Widget arguments. |
|
652 | - * @param array $instance Saved values from database. |
|
653 | - */ |
|
654 | - public function widget($args, $instance) |
|
655 | - { |
|
656 | - |
|
657 | - // prints the widget |
|
658 | - |
|
659 | - extract($args, EXTR_SKIP); |
|
660 | - |
|
661 | - /** |
|
662 | - * Filter the description text. |
|
663 | - * |
|
664 | - * @since 1.0.0 |
|
665 | - * @param string $desc1 The widget description text. |
|
666 | - */ |
|
667 | - $desc1 = empty($instance['desc1']) ? ' ' : apply_filters('widget_desc1', $instance['desc1']); |
|
668 | - echo $before_widget; |
|
669 | - ?> |
|
616 | + } |
|
617 | + } |
|
618 | + |
|
619 | + register_widget('geodirsubscribeWidget'); |
|
620 | + |
|
621 | + /** |
|
622 | + * GeoDirectory advertise widget. |
|
623 | + * |
|
624 | + * @since 1.0.0 |
|
625 | + */ |
|
626 | + class geodiradvtwidget extends WP_Widget |
|
627 | + { |
|
628 | + |
|
629 | + /** |
|
630 | + * Register the advertise widget with WordPress. |
|
631 | + * |
|
632 | + * @since 1.0.0 |
|
633 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
634 | + */ |
|
635 | + public function __construct() { |
|
636 | + $widget_ops = array('classname' => 'GeoDirectory Advertise', 'description' => __('GD > common advertise widget in sidebar, bottom section', 'geodirectory')); |
|
637 | + parent::__construct( |
|
638 | + 'advtwidget', // Base ID |
|
639 | + __('GD > Advertise', 'geodirectory'), // Name |
|
640 | + $widget_ops// Args |
|
641 | + ); |
|
642 | + } |
|
643 | + |
|
644 | + |
|
645 | + /** |
|
646 | + * Front-end display content for advertise widget. |
|
647 | + * |
|
648 | + * @since 1.0.0 |
|
649 | + * @since 1.5.1 Declare function public. |
|
650 | + * |
|
651 | + * @param array $args Widget arguments. |
|
652 | + * @param array $instance Saved values from database. |
|
653 | + */ |
|
654 | + public function widget($args, $instance) |
|
655 | + { |
|
656 | + |
|
657 | + // prints the widget |
|
658 | + |
|
659 | + extract($args, EXTR_SKIP); |
|
660 | + |
|
661 | + /** |
|
662 | + * Filter the description text. |
|
663 | + * |
|
664 | + * @since 1.0.0 |
|
665 | + * @param string $desc1 The widget description text. |
|
666 | + */ |
|
667 | + $desc1 = empty($instance['desc1']) ? ' ' : apply_filters('widget_desc1', $instance['desc1']); |
|
668 | + echo $before_widget; |
|
669 | + ?> |
|
670 | 670 | <?php if ($desc1 <> "") { ?> |
671 | 671 | <?php echo $desc1; ?> |
672 | 672 | <?php } |
673 | - echo $after_widget; |
|
674 | - } |
|
675 | - |
|
676 | - /** |
|
677 | - * Sanitize advertise widget form values as they are saved. |
|
678 | - * |
|
679 | - * @since 1.0.0 |
|
680 | - * @since 1.5.1 Declare function public. |
|
681 | - * |
|
682 | - * @param array $new_instance Values just sent to be saved. |
|
683 | - * @param array $old_instance Previously saved values from database. |
|
684 | - * |
|
685 | - * @return array Updated safe values to be saved. |
|
686 | - */ |
|
687 | - public function update($new_instance, $old_instance) |
|
688 | - { |
|
689 | - //save the widget |
|
690 | - $instance = $old_instance; |
|
691 | - $instance['desc1'] = ($new_instance['desc1']); |
|
692 | - return $instance; |
|
693 | - } |
|
694 | - |
|
695 | - /** |
|
696 | - * Back-end advertise widget settings form. |
|
697 | - * |
|
698 | - * @since 1.0.0 |
|
699 | - * @since 1.5.1 Declare function public. |
|
700 | - * |
|
701 | - * @param array $instance Previously saved values from database. |
|
702 | - * @return string|void |
|
703 | - */ |
|
704 | - public function form($instance) |
|
705 | - { |
|
706 | - //widgetform in backend |
|
707 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
708 | - |
|
709 | - $desc1 = ($instance['desc1']); |
|
710 | - ?> |
|
673 | + echo $after_widget; |
|
674 | + } |
|
675 | + |
|
676 | + /** |
|
677 | + * Sanitize advertise widget form values as they are saved. |
|
678 | + * |
|
679 | + * @since 1.0.0 |
|
680 | + * @since 1.5.1 Declare function public. |
|
681 | + * |
|
682 | + * @param array $new_instance Values just sent to be saved. |
|
683 | + * @param array $old_instance Previously saved values from database. |
|
684 | + * |
|
685 | + * @return array Updated safe values to be saved. |
|
686 | + */ |
|
687 | + public function update($new_instance, $old_instance) |
|
688 | + { |
|
689 | + //save the widget |
|
690 | + $instance = $old_instance; |
|
691 | + $instance['desc1'] = ($new_instance['desc1']); |
|
692 | + return $instance; |
|
693 | + } |
|
694 | + |
|
695 | + /** |
|
696 | + * Back-end advertise widget settings form. |
|
697 | + * |
|
698 | + * @since 1.0.0 |
|
699 | + * @since 1.5.1 Declare function public. |
|
700 | + * |
|
701 | + * @param array $instance Previously saved values from database. |
|
702 | + * @return string|void |
|
703 | + */ |
|
704 | + public function form($instance) |
|
705 | + { |
|
706 | + //widgetform in backend |
|
707 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
708 | + |
|
709 | + $desc1 = ($instance['desc1']); |
|
710 | + ?> |
|
711 | 711 | <p><label |
712 | 712 | for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?> |
713 | 713 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>" |
@@ -715,65 +715,65 @@ discard block |
||
715 | 715 | </p> |
716 | 716 | |
717 | 717 | <?php |
718 | - } |
|
719 | - } |
|
720 | - |
|
721 | - register_widget('geodiradvtwidget'); |
|
722 | - |
|
723 | - /** |
|
724 | - * GeoDirectory Flickr widget. |
|
725 | - * |
|
726 | - * @since 1.0.0 |
|
727 | - */ |
|
728 | - class GeodirFlickrWidget extends WP_Widget |
|
729 | - { |
|
730 | - |
|
731 | - /** |
|
732 | - * Register the flickr widget with WordPress. |
|
733 | - * |
|
734 | - * @since 1.0.0 |
|
735 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
736 | - */ |
|
737 | - public function __construct() { |
|
738 | - $widget_ops = array('classname' => 'Geo Dir Flickr Photos ', 'description' => __('GD > Flickr Photos', 'geodirectory')); |
|
739 | - parent::__construct( |
|
740 | - 'widget_flickrwidget', // Base ID |
|
741 | - __('GD > Flickr Photos', 'geodirectory'), // Name |
|
742 | - $widget_ops// Args |
|
743 | - ); |
|
744 | - } |
|
745 | - |
|
746 | - /** |
|
747 | - * Front-end display content for flickr widget. |
|
748 | - * |
|
749 | - * @since 1.0.0 |
|
750 | - * @since 1.5.1 Declare function public. |
|
751 | - * |
|
752 | - * @param array $args Widget arguments. |
|
753 | - * @param array $instance Saved values from database. |
|
754 | - */ |
|
755 | - public function widget($args, $instance) |
|
756 | - { |
|
757 | - |
|
758 | - // prints the widget |
|
759 | - extract($args, EXTR_SKIP); |
|
760 | - |
|
761 | - echo $before_widget; |
|
762 | - |
|
763 | - /** This filter is documented in geodirectory_widgets.php */ |
|
764 | - $id = empty($instance['id']) ? ' ' : apply_filters('widget_id', $instance['id']); |
|
765 | - |
|
766 | - /** |
|
767 | - * Filter the widget number. |
|
768 | - * |
|
769 | - * This is used in the flicker widget to show how many images to show. |
|
770 | - * |
|
771 | - * @since 1.0.0 |
|
772 | - * @param string $number The image count. |
|
773 | - */ |
|
774 | - $number = empty($instance['number']) ? ' ' : apply_filters('widget_number', $instance['number']); |
|
775 | - echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title; |
|
776 | - ?> |
|
718 | + } |
|
719 | + } |
|
720 | + |
|
721 | + register_widget('geodiradvtwidget'); |
|
722 | + |
|
723 | + /** |
|
724 | + * GeoDirectory Flickr widget. |
|
725 | + * |
|
726 | + * @since 1.0.0 |
|
727 | + */ |
|
728 | + class GeodirFlickrWidget extends WP_Widget |
|
729 | + { |
|
730 | + |
|
731 | + /** |
|
732 | + * Register the flickr widget with WordPress. |
|
733 | + * |
|
734 | + * @since 1.0.0 |
|
735 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
736 | + */ |
|
737 | + public function __construct() { |
|
738 | + $widget_ops = array('classname' => 'Geo Dir Flickr Photos ', 'description' => __('GD > Flickr Photos', 'geodirectory')); |
|
739 | + parent::__construct( |
|
740 | + 'widget_flickrwidget', // Base ID |
|
741 | + __('GD > Flickr Photos', 'geodirectory'), // Name |
|
742 | + $widget_ops// Args |
|
743 | + ); |
|
744 | + } |
|
745 | + |
|
746 | + /** |
|
747 | + * Front-end display content for flickr widget. |
|
748 | + * |
|
749 | + * @since 1.0.0 |
|
750 | + * @since 1.5.1 Declare function public. |
|
751 | + * |
|
752 | + * @param array $args Widget arguments. |
|
753 | + * @param array $instance Saved values from database. |
|
754 | + */ |
|
755 | + public function widget($args, $instance) |
|
756 | + { |
|
757 | + |
|
758 | + // prints the widget |
|
759 | + extract($args, EXTR_SKIP); |
|
760 | + |
|
761 | + echo $before_widget; |
|
762 | + |
|
763 | + /** This filter is documented in geodirectory_widgets.php */ |
|
764 | + $id = empty($instance['id']) ? ' ' : apply_filters('widget_id', $instance['id']); |
|
765 | + |
|
766 | + /** |
|
767 | + * Filter the widget number. |
|
768 | + * |
|
769 | + * This is used in the flicker widget to show how many images to show. |
|
770 | + * |
|
771 | + * @since 1.0.0 |
|
772 | + * @param string $number The image count. |
|
773 | + */ |
|
774 | + $number = empty($instance['number']) ? ' ' : apply_filters('widget_number', $instance['number']); |
|
775 | + echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title; |
|
776 | + ?> |
|
777 | 777 | |
778 | 778 | <div class="geodir-flickr clearfix"> |
779 | 779 | |
@@ -784,45 +784,45 @@ discard block |
||
784 | 784 | |
785 | 785 | |
786 | 786 | <?php echo $after_widget; |
787 | - } |
|
788 | - |
|
789 | - /** |
|
790 | - * Sanitize flickr widget form values as they are saved. |
|
791 | - * |
|
792 | - * @since 1.0.0 |
|
793 | - * @since 1.5.1 Declare function public. |
|
794 | - * |
|
795 | - * @param array $new_instance Values just sent to be saved. |
|
796 | - * @param array $old_instance Previously saved values from database. |
|
797 | - * |
|
798 | - * @return array Updated safe values to be saved. |
|
799 | - */ |
|
800 | - public function update($new_instance, $old_instance) |
|
801 | - { |
|
802 | - //save the widget |
|
803 | - $instance = $old_instance; |
|
804 | - $instance['id'] = strip_tags($new_instance['id']); |
|
805 | - $instance['number'] = strip_tags($new_instance['number']); |
|
806 | - return $instance; |
|
807 | - } |
|
808 | - |
|
809 | - /** |
|
810 | - * Back-end flickr widget settings form. |
|
811 | - * |
|
812 | - * @since 1.0.0 |
|
813 | - * @since 1.5.1 Declare function public. |
|
814 | - * |
|
815 | - * @param array $instance Previously saved values from database. |
|
816 | - * @return string|void |
|
817 | - */ |
|
818 | - public function form($instance) |
|
819 | - { |
|
820 | - |
|
821 | - //widgetform in backend |
|
822 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => '')); |
|
823 | - $id = strip_tags($instance['id']); |
|
824 | - $number = strip_tags($instance['number']); |
|
825 | - ?> |
|
787 | + } |
|
788 | + |
|
789 | + /** |
|
790 | + * Sanitize flickr widget form values as they are saved. |
|
791 | + * |
|
792 | + * @since 1.0.0 |
|
793 | + * @since 1.5.1 Declare function public. |
|
794 | + * |
|
795 | + * @param array $new_instance Values just sent to be saved. |
|
796 | + * @param array $old_instance Previously saved values from database. |
|
797 | + * |
|
798 | + * @return array Updated safe values to be saved. |
|
799 | + */ |
|
800 | + public function update($new_instance, $old_instance) |
|
801 | + { |
|
802 | + //save the widget |
|
803 | + $instance = $old_instance; |
|
804 | + $instance['id'] = strip_tags($new_instance['id']); |
|
805 | + $instance['number'] = strip_tags($new_instance['number']); |
|
806 | + return $instance; |
|
807 | + } |
|
808 | + |
|
809 | + /** |
|
810 | + * Back-end flickr widget settings form. |
|
811 | + * |
|
812 | + * @since 1.0.0 |
|
813 | + * @since 1.5.1 Declare function public. |
|
814 | + * |
|
815 | + * @param array $instance Previously saved values from database. |
|
816 | + * @return string|void |
|
817 | + */ |
|
818 | + public function form($instance) |
|
819 | + { |
|
820 | + |
|
821 | + //widgetform in backend |
|
822 | + $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => '')); |
|
823 | + $id = strip_tags($instance['id']); |
|
824 | + $number = strip_tags($instance['number']); |
|
825 | + ?> |
|
826 | 826 | |
827 | 827 | <p> |
828 | 828 | <label |
@@ -843,99 +843,99 @@ discard block |
||
843 | 843 | </label> |
844 | 844 | </p> |
845 | 845 | <?php |
846 | - } |
|
847 | - } |
|
848 | - |
|
849 | - register_widget('GeodirFlickrWidget'); |
|
850 | - |
|
851 | - /** |
|
852 | - * GeoDirectory Twitter widget. |
|
853 | - * |
|
854 | - * @since 1.0.0 |
|
855 | - */ |
|
856 | - class geodir_twitter extends WP_Widget |
|
857 | - { |
|
858 | - /** |
|
859 | - * Register the Twitter widget with WordPress. |
|
860 | - * |
|
861 | - * @since 1.0.0 |
|
862 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
863 | - */ |
|
864 | - public function __construct() { |
|
865 | - $widget_ops = array('classname' => 'Twitter', 'description' => __('GD > Twitter Feed', 'geodirectory')); |
|
866 | - parent::__construct( |
|
867 | - 'widget_Twidget', // Base ID |
|
868 | - __('GD > Twitter', 'geodirectory'), // Name |
|
869 | - $widget_ops// Args |
|
870 | - ); |
|
871 | - } |
|
872 | - |
|
873 | - |
|
874 | - /** |
|
875 | - * Front-end display content for Twitter widget. |
|
876 | - * |
|
877 | - * @since 1.0.0 |
|
878 | - * @since 1.5.1 Declare function public. |
|
879 | - * |
|
880 | - * @param array $args Widget arguments. |
|
881 | - * @param array $instance Saved values from database. |
|
882 | - */ |
|
883 | - public function widget($args, $instance) |
|
884 | - { |
|
885 | - |
|
886 | - // prints the widget |
|
887 | - |
|
888 | - extract($args, EXTR_SKIP); |
|
889 | - |
|
890 | - /** |
|
891 | - * Filter the twitter widget description text. |
|
892 | - * |
|
893 | - * @since 1.0.0 |
|
894 | - * @param string $desc1 The widget description text. |
|
895 | - */ |
|
896 | - $desc1 = empty($instance['gd_tw_desc1']) ? ' ' : apply_filters('gd_tw_widget_desc1', $instance['gd_tw_desc1']); |
|
897 | - echo $before_widget; |
|
898 | - if ($desc1 <> "") { |
|
899 | - echo $desc1; |
|
900 | - } |
|
901 | - echo $after_widget; |
|
902 | - } |
|
903 | - |
|
904 | - /** |
|
905 | - * Sanitize twitter widget form values as they are saved. |
|
906 | - * |
|
907 | - * @since 1.0.0 |
|
908 | - * @since 1.5.1 Declare function public. |
|
909 | - * |
|
910 | - * @param array $new_instance Values just sent to be saved. |
|
911 | - * @param array $old_instance Previously saved values from database. |
|
912 | - * |
|
913 | - * @return array Updated safe values to be saved. |
|
914 | - */ |
|
915 | - public function update($new_instance, $old_instance) |
|
916 | - { |
|
917 | - //save the widget |
|
918 | - $instance = $old_instance; |
|
919 | - $instance['gd_tw_desc1'] = ($new_instance['gd_tw_desc1']); |
|
920 | - return $instance; |
|
921 | - } |
|
922 | - |
|
923 | - /** |
|
924 | - * Back-end twitter widget settings form. |
|
925 | - * |
|
926 | - * @since 1.0.0 |
|
927 | - * @since 1.5.1 Declare function public. |
|
928 | - * |
|
929 | - * @param array $instance Previously saved values from database. |
|
930 | - * @return string|void |
|
931 | - */ |
|
932 | - public function form($instance) |
|
933 | - { |
|
934 | - //widgetform in backend |
|
935 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => '')); |
|
936 | - |
|
937 | - $desc1 = ($instance['gd_tw_desc1']); |
|
938 | - ?> |
|
846 | + } |
|
847 | + } |
|
848 | + |
|
849 | + register_widget('GeodirFlickrWidget'); |
|
850 | + |
|
851 | + /** |
|
852 | + * GeoDirectory Twitter widget. |
|
853 | + * |
|
854 | + * @since 1.0.0 |
|
855 | + */ |
|
856 | + class geodir_twitter extends WP_Widget |
|
857 | + { |
|
858 | + /** |
|
859 | + * Register the Twitter widget with WordPress. |
|
860 | + * |
|
861 | + * @since 1.0.0 |
|
862 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
863 | + */ |
|
864 | + public function __construct() { |
|
865 | + $widget_ops = array('classname' => 'Twitter', 'description' => __('GD > Twitter Feed', 'geodirectory')); |
|
866 | + parent::__construct( |
|
867 | + 'widget_Twidget', // Base ID |
|
868 | + __('GD > Twitter', 'geodirectory'), // Name |
|
869 | + $widget_ops// Args |
|
870 | + ); |
|
871 | + } |
|
872 | + |
|
873 | + |
|
874 | + /** |
|
875 | + * Front-end display content for Twitter widget. |
|
876 | + * |
|
877 | + * @since 1.0.0 |
|
878 | + * @since 1.5.1 Declare function public. |
|
879 | + * |
|
880 | + * @param array $args Widget arguments. |
|
881 | + * @param array $instance Saved values from database. |
|
882 | + */ |
|
883 | + public function widget($args, $instance) |
|
884 | + { |
|
885 | + |
|
886 | + // prints the widget |
|
887 | + |
|
888 | + extract($args, EXTR_SKIP); |
|
889 | + |
|
890 | + /** |
|
891 | + * Filter the twitter widget description text. |
|
892 | + * |
|
893 | + * @since 1.0.0 |
|
894 | + * @param string $desc1 The widget description text. |
|
895 | + */ |
|
896 | + $desc1 = empty($instance['gd_tw_desc1']) ? ' ' : apply_filters('gd_tw_widget_desc1', $instance['gd_tw_desc1']); |
|
897 | + echo $before_widget; |
|
898 | + if ($desc1 <> "") { |
|
899 | + echo $desc1; |
|
900 | + } |
|
901 | + echo $after_widget; |
|
902 | + } |
|
903 | + |
|
904 | + /** |
|
905 | + * Sanitize twitter widget form values as they are saved. |
|
906 | + * |
|
907 | + * @since 1.0.0 |
|
908 | + * @since 1.5.1 Declare function public. |
|
909 | + * |
|
910 | + * @param array $new_instance Values just sent to be saved. |
|
911 | + * @param array $old_instance Previously saved values from database. |
|
912 | + * |
|
913 | + * @return array Updated safe values to be saved. |
|
914 | + */ |
|
915 | + public function update($new_instance, $old_instance) |
|
916 | + { |
|
917 | + //save the widget |
|
918 | + $instance = $old_instance; |
|
919 | + $instance['gd_tw_desc1'] = ($new_instance['gd_tw_desc1']); |
|
920 | + return $instance; |
|
921 | + } |
|
922 | + |
|
923 | + /** |
|
924 | + * Back-end twitter widget settings form. |
|
925 | + * |
|
926 | + * @since 1.0.0 |
|
927 | + * @since 1.5.1 Declare function public. |
|
928 | + * |
|
929 | + * @param array $instance Previously saved values from database. |
|
930 | + * @return string|void |
|
931 | + */ |
|
932 | + public function form($instance) |
|
933 | + { |
|
934 | + //widgetform in backend |
|
935 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => '')); |
|
936 | + |
|
937 | + $desc1 = ($instance['gd_tw_desc1']); |
|
938 | + ?> |
|
939 | 939 | <p><label |
940 | 940 | for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?> |
941 | 941 | <textarea class="widefat" rows="6" cols="20" |
@@ -944,179 +944,179 @@ discard block |
||
944 | 944 | </p> |
945 | 945 | |
946 | 946 | <?php |
947 | - } |
|
948 | - } |
|
949 | - |
|
950 | - register_widget('geodir_twitter'); |
|
951 | - |
|
952 | - /** |
|
953 | - * GeoDirectory Advanced Search widget. |
|
954 | - * |
|
955 | - * @since 1.0.0 |
|
956 | - */ |
|
957 | - class geodir_advance_search_widget extends WP_Widget |
|
958 | - { |
|
959 | - /** |
|
960 | - * Register the advanced search widget with WordPress. |
|
961 | - * |
|
962 | - * @since 1.0.0 |
|
963 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
964 | - */ |
|
965 | - public function __construct() { |
|
966 | - $widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'),'post_type'=>''); |
|
967 | - parent::__construct( |
|
968 | - 'geodir_advance_search', // Base ID |
|
969 | - __('GD > Search', 'geodirectory'), // Name |
|
970 | - $widget_ops// Args |
|
971 | - ); |
|
972 | - } |
|
973 | - |
|
974 | - |
|
975 | - /** |
|
976 | - * Front-end display content for advanced search widget. |
|
977 | - * |
|
978 | - * @since 1.0.0 |
|
979 | - * @since 1.5.1 Declare function public. |
|
980 | - * |
|
981 | - * @param array $args Widget arguments. |
|
982 | - * @param array $instance Saved values from database. |
|
983 | - */ |
|
984 | - public function widget($args, $instance) |
|
985 | - { |
|
986 | - /** |
|
987 | - * Filter the search widget arguments. |
|
988 | - * |
|
989 | - * @since 1.5.7 |
|
990 | - * @param array $args The widget arguments. |
|
991 | - * @param array $instance The widget instance. |
|
992 | - */ |
|
993 | - $args = apply_filters('widget_geodir_advance_search_args',$args,$instance); |
|
994 | - |
|
995 | - // prints the widget |
|
996 | - extract($args, EXTR_SKIP); |
|
997 | - |
|
998 | - if(isset($post_type) && $post_type){ |
|
999 | - geodir_get_search_post_type($post_type);// set the post type |
|
1000 | - }else{ |
|
1001 | - geodir_get_search_post_type();// set the post type |
|
1002 | - } |
|
1003 | - |
|
1004 | - echo $before_widget; |
|
1005 | - |
|
1006 | - /** This filter is documented in geodirectory_widgets.php */ |
|
1007 | - $title = empty($instance['title']) ? __('Search', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
|
1008 | - |
|
1009 | - geodir_get_template_part('listing', 'filter-form'); |
|
1010 | - |
|
1011 | - echo $after_widget; |
|
1012 | - |
|
1013 | - // after outputing the search reset the CPT |
|
1014 | - global $geodir_search_post_type; |
|
1015 | - $geodir_search_post_type = ''; |
|
1016 | - } |
|
1017 | - |
|
1018 | - /** |
|
1019 | - * Sanitize advanced search widget form values as they are saved. |
|
1020 | - * |
|
1021 | - * @since 1.0.0 |
|
1022 | - * @since 1.5.1 Declare function public. |
|
1023 | - * |
|
1024 | - * @param array $new_instance Values just sent to be saved. |
|
1025 | - * @param array $old_instance Previously saved values from database. |
|
1026 | - * |
|
1027 | - * @return array Updated safe values to be saved. |
|
1028 | - */ |
|
1029 | - public function update($new_instance, $old_instance) |
|
1030 | - { |
|
1031 | - //save the widget |
|
1032 | - //Nothing to save |
|
1033 | - return isset($instance) ? $instance : array(); |
|
1034 | - } |
|
1035 | - |
|
1036 | - /** |
|
1037 | - * Back-end advanced search widget settings form. |
|
1038 | - * |
|
1039 | - * @since 1.0.0 |
|
1040 | - * @since 1.5.1 Declare function public. |
|
1041 | - * |
|
1042 | - * @param array $instance Previously saved values from database. |
|
1043 | - * @return string|void |
|
1044 | - */ |
|
1045 | - public function form($instance) |
|
1046 | - { |
|
1047 | - //widgetform in backend |
|
1048 | - echo __("This is a search widget to show advance search for gedodirectory listings.", 'geodirectory'); |
|
1049 | - } |
|
1050 | - } |
|
1051 | - |
|
1052 | - register_widget('geodir_advance_search_widget'); |
|
1053 | - |
|
1054 | - |
|
1055 | - /** |
|
1056 | - * Contains all functions for popular widget. |
|
1057 | - * |
|
1058 | - * @since 1.0.0 |
|
1059 | - * @package GeoDirectory |
|
1060 | - */ |
|
1061 | - include_once('geodirectory-widgets/geodirectory_popular_widget.php'); |
|
1062 | - /** |
|
1063 | - * Contains all functions for listing slider widget. |
|
1064 | - * |
|
1065 | - * @since 1.0.0 |
|
1066 | - * @package GeoDirectory |
|
1067 | - */ |
|
1068 | - include_once('geodirectory-widgets/geodirectory_listing_slider_widget.php'); |
|
1069 | - /** |
|
1070 | - * Contains all functions for home map widget. |
|
1071 | - * |
|
1072 | - * @since 1.0.0 |
|
1073 | - * @package GeoDirectory |
|
1074 | - */ |
|
1075 | - include_once('geodirectory-widgets/home_map_widget.php'); |
|
1076 | - /** |
|
1077 | - * Contains all functions for listing map widget. |
|
1078 | - * |
|
1079 | - * @since 1.0.0 |
|
1080 | - * @package GeoDirectory |
|
1081 | - */ |
|
1082 | - include_once('geodirectory-widgets/listing_map_widget.php'); |
|
1083 | - /** |
|
1084 | - * Contains all functions for reviews widget. |
|
1085 | - * |
|
1086 | - * @since 1.0.0 |
|
1087 | - * @package GeoDirectory |
|
1088 | - */ |
|
1089 | - include_once('geodirectory-widgets/geodirectory_reviews_widget.php'); |
|
1090 | - /** |
|
1091 | - * Contains all functions for related listing widget. |
|
1092 | - * |
|
1093 | - * @since 1.0.0 |
|
1094 | - * @package GeoDirectory |
|
1095 | - */ |
|
1096 | - include_once('geodirectory-widgets/geodirectory_related_listing_widget.php'); |
|
1097 | - /** |
|
1098 | - * Contains all functions for bestof widget. |
|
1099 | - * |
|
1100 | - * @since 1.0.0 |
|
1101 | - * @package GeoDirectory |
|
1102 | - */ |
|
1103 | - include_once('geodirectory-widgets/geodirectory_bestof_widget.php'); |
|
947 | + } |
|
948 | + } |
|
949 | + |
|
950 | + register_widget('geodir_twitter'); |
|
951 | + |
|
952 | + /** |
|
953 | + * GeoDirectory Advanced Search widget. |
|
954 | + * |
|
955 | + * @since 1.0.0 |
|
956 | + */ |
|
957 | + class geodir_advance_search_widget extends WP_Widget |
|
958 | + { |
|
959 | + /** |
|
960 | + * Register the advanced search widget with WordPress. |
|
961 | + * |
|
962 | + * @since 1.0.0 |
|
963 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
964 | + */ |
|
965 | + public function __construct() { |
|
966 | + $widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'),'post_type'=>''); |
|
967 | + parent::__construct( |
|
968 | + 'geodir_advance_search', // Base ID |
|
969 | + __('GD > Search', 'geodirectory'), // Name |
|
970 | + $widget_ops// Args |
|
971 | + ); |
|
972 | + } |
|
973 | + |
|
974 | + |
|
975 | + /** |
|
976 | + * Front-end display content for advanced search widget. |
|
977 | + * |
|
978 | + * @since 1.0.0 |
|
979 | + * @since 1.5.1 Declare function public. |
|
980 | + * |
|
981 | + * @param array $args Widget arguments. |
|
982 | + * @param array $instance Saved values from database. |
|
983 | + */ |
|
984 | + public function widget($args, $instance) |
|
985 | + { |
|
986 | + /** |
|
987 | + * Filter the search widget arguments. |
|
988 | + * |
|
989 | + * @since 1.5.7 |
|
990 | + * @param array $args The widget arguments. |
|
991 | + * @param array $instance The widget instance. |
|
992 | + */ |
|
993 | + $args = apply_filters('widget_geodir_advance_search_args',$args,$instance); |
|
994 | + |
|
995 | + // prints the widget |
|
996 | + extract($args, EXTR_SKIP); |
|
997 | + |
|
998 | + if(isset($post_type) && $post_type){ |
|
999 | + geodir_get_search_post_type($post_type);// set the post type |
|
1000 | + }else{ |
|
1001 | + geodir_get_search_post_type();// set the post type |
|
1002 | + } |
|
1003 | + |
|
1004 | + echo $before_widget; |
|
1005 | + |
|
1006 | + /** This filter is documented in geodirectory_widgets.php */ |
|
1007 | + $title = empty($instance['title']) ? __('Search', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
|
1008 | + |
|
1009 | + geodir_get_template_part('listing', 'filter-form'); |
|
1010 | + |
|
1011 | + echo $after_widget; |
|
1012 | + |
|
1013 | + // after outputing the search reset the CPT |
|
1014 | + global $geodir_search_post_type; |
|
1015 | + $geodir_search_post_type = ''; |
|
1016 | + } |
|
1017 | + |
|
1018 | + /** |
|
1019 | + * Sanitize advanced search widget form values as they are saved. |
|
1020 | + * |
|
1021 | + * @since 1.0.0 |
|
1022 | + * @since 1.5.1 Declare function public. |
|
1023 | + * |
|
1024 | + * @param array $new_instance Values just sent to be saved. |
|
1025 | + * @param array $old_instance Previously saved values from database. |
|
1026 | + * |
|
1027 | + * @return array Updated safe values to be saved. |
|
1028 | + */ |
|
1029 | + public function update($new_instance, $old_instance) |
|
1030 | + { |
|
1031 | + //save the widget |
|
1032 | + //Nothing to save |
|
1033 | + return isset($instance) ? $instance : array(); |
|
1034 | + } |
|
1035 | + |
|
1036 | + /** |
|
1037 | + * Back-end advanced search widget settings form. |
|
1038 | + * |
|
1039 | + * @since 1.0.0 |
|
1040 | + * @since 1.5.1 Declare function public. |
|
1041 | + * |
|
1042 | + * @param array $instance Previously saved values from database. |
|
1043 | + * @return string|void |
|
1044 | + */ |
|
1045 | + public function form($instance) |
|
1046 | + { |
|
1047 | + //widgetform in backend |
|
1048 | + echo __("This is a search widget to show advance search for gedodirectory listings.", 'geodirectory'); |
|
1049 | + } |
|
1050 | + } |
|
1051 | + |
|
1052 | + register_widget('geodir_advance_search_widget'); |
|
1053 | + |
|
1054 | + |
|
1055 | + /** |
|
1056 | + * Contains all functions for popular widget. |
|
1057 | + * |
|
1058 | + * @since 1.0.0 |
|
1059 | + * @package GeoDirectory |
|
1060 | + */ |
|
1061 | + include_once('geodirectory-widgets/geodirectory_popular_widget.php'); |
|
1062 | + /** |
|
1063 | + * Contains all functions for listing slider widget. |
|
1064 | + * |
|
1065 | + * @since 1.0.0 |
|
1066 | + * @package GeoDirectory |
|
1067 | + */ |
|
1068 | + include_once('geodirectory-widgets/geodirectory_listing_slider_widget.php'); |
|
1069 | + /** |
|
1070 | + * Contains all functions for home map widget. |
|
1071 | + * |
|
1072 | + * @since 1.0.0 |
|
1073 | + * @package GeoDirectory |
|
1074 | + */ |
|
1075 | + include_once('geodirectory-widgets/home_map_widget.php'); |
|
1076 | + /** |
|
1077 | + * Contains all functions for listing map widget. |
|
1078 | + * |
|
1079 | + * @since 1.0.0 |
|
1080 | + * @package GeoDirectory |
|
1081 | + */ |
|
1082 | + include_once('geodirectory-widgets/listing_map_widget.php'); |
|
1083 | + /** |
|
1084 | + * Contains all functions for reviews widget. |
|
1085 | + * |
|
1086 | + * @since 1.0.0 |
|
1087 | + * @package GeoDirectory |
|
1088 | + */ |
|
1089 | + include_once('geodirectory-widgets/geodirectory_reviews_widget.php'); |
|
1090 | + /** |
|
1091 | + * Contains all functions for related listing widget. |
|
1092 | + * |
|
1093 | + * @since 1.0.0 |
|
1094 | + * @package GeoDirectory |
|
1095 | + */ |
|
1096 | + include_once('geodirectory-widgets/geodirectory_related_listing_widget.php'); |
|
1097 | + /** |
|
1098 | + * Contains all functions for bestof widget. |
|
1099 | + * |
|
1100 | + * @since 1.0.0 |
|
1101 | + * @package GeoDirectory |
|
1102 | + */ |
|
1103 | + include_once('geodirectory-widgets/geodirectory_bestof_widget.php'); |
|
1104 | + /** |
|
1105 | + * Contains all functions for cpt categories widget. |
|
1106 | + * |
|
1107 | + * @since 1.5.4 |
|
1108 | + * @package GeoDirectory |
|
1109 | + */ |
|
1110 | + include_once('geodirectory-widgets/geodirectory_cpt_categories_widget.php'); |
|
1104 | 1111 | /** |
1105 | - * Contains all functions for cpt categories widget. |
|
1106 | - * |
|
1107 | - * @since 1.5.4 |
|
1108 | - * @package GeoDirectory |
|
1109 | - */ |
|
1110 | - include_once('geodirectory-widgets/geodirectory_cpt_categories_widget.php'); |
|
1111 | - /** |
|
1112 | - * Contains all functions for features widget. |
|
1113 | - * |
|
1114 | - * @since 1.5.6 |
|
1115 | - * @package GeoDirectory |
|
1116 | - * @todo make the image field recurring |
|
1117 | - */ |
|
1118 | - include_once('geodirectory-widgets/geodirectory_features_widget.php'); |
|
1119 | - } |
|
1112 | + * Contains all functions for features widget. |
|
1113 | + * |
|
1114 | + * @since 1.5.6 |
|
1115 | + * @package GeoDirectory |
|
1116 | + * @todo make the image field recurring |
|
1117 | + */ |
|
1118 | + include_once('geodirectory-widgets/geodirectory_features_widget.php'); |
|
1119 | + } |
|
1120 | 1120 | |
1121 | 1121 | } |
1122 | 1122 |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | public function form($instance) |
302 | 302 | { |
303 | 303 | //widgetform in backend |
304 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
304 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
305 | 305 | $title = strip_tags($instance['title']); |
306 | 306 | |
307 | 307 | ?> |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | ?> |
374 | 374 | |
375 | 375 | <a href="http://twitter.com/share" |
376 | - class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a> |
|
376 | + class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a> |
|
377 | 377 | |
378 | 378 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
379 | 379 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | public function form($instance) |
444 | 444 | { |
445 | 445 | //widgetform in backend |
446 | - $instance = wp_parse_args((array)$instance, array('title' => '')); |
|
446 | + $instance = wp_parse_args((array) $instance, array('title' => '')); |
|
447 | 447 | $title = strip_tags($instance['title']); |
448 | 448 | ?> |
449 | 449 | <p>No settings for this widget</p> |
@@ -515,11 +515,11 @@ discard block |
||
515 | 515 | echo $before_widget; |
516 | 516 | ?> |
517 | 517 | |
518 | - <?php echo $before_title . $title; ?> <a href="<?php if ($id) { |
|
519 | - echo 'http://feeds2.feedburner.com/' . $id; |
|
518 | + <?php echo $before_title.$title; ?> <a href="<?php if ($id) { |
|
519 | + echo 'http://feeds2.feedburner.com/'.$id; |
|
520 | 520 | } else { |
521 | 521 | bloginfo('rss_url'); |
522 | - } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
522 | + } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title; ?> |
|
523 | 523 | |
524 | 524 | <?php if ($text <> "") { ?> |
525 | 525 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | public function form($instance) |
585 | 585 | { |
586 | 586 | //widgetform in backend |
587 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => '')); |
|
587 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => '')); |
|
588 | 588 | |
589 | 589 | $id = strip_tags($instance['id']); |
590 | 590 | |
@@ -596,19 +596,19 @@ discard block |
||
596 | 596 | |
597 | 597 | ?> |
598 | 598 | <p><label |
599 | - for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>: |
|
599 | + for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory'); ?>: |
|
600 | 600 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
601 | 601 | name="<?php echo $this->get_field_name('title'); ?>" type="text" |
602 | 602 | value="<?php echo esc_attr($title); ?>"/></label></p> |
603 | 603 | |
604 | 604 | <p><label |
605 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory');?> |
|
605 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory'); ?> |
|
606 | 606 | : <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>" |
607 | 607 | name="<?php echo $this->get_field_name('id'); ?>" type="text" |
608 | 608 | value="<?php echo esc_attr($id); ?>"/></label></p> |
609 | 609 | |
610 | 610 | <p><label |
611 | - for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory');?> |
|
611 | + for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory'); ?> |
|
612 | 612 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('text'); ?>" |
613 | 613 | name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label> |
614 | 614 | </p> |
@@ -704,12 +704,12 @@ discard block |
||
704 | 704 | public function form($instance) |
705 | 705 | { |
706 | 706 | //widgetform in backend |
707 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
707 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => '')); |
|
708 | 708 | |
709 | 709 | $desc1 = ($instance['desc1']); |
710 | 710 | ?> |
711 | 711 | <p><label |
712 | - for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?> |
|
712 | + for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory'); ?> |
|
713 | 713 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>" |
714 | 714 | name="<?php echo $this->get_field_name('desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label> |
715 | 715 | </p> |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | * @param string $number The image count. |
773 | 773 | */ |
774 | 774 | $number = empty($instance['number']) ? ' ' : apply_filters('widget_number', $instance['number']); |
775 | - echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title; |
|
775 | + echo $before_title.__('Photo Gallery', 'geodirectory').$after_title; |
|
776 | 776 | ?> |
777 | 777 | |
778 | 778 | <div class="geodir-flickr clearfix"> |
@@ -819,14 +819,14 @@ discard block |
||
819 | 819 | { |
820 | 820 | |
821 | 821 | //widgetform in backend |
822 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => '')); |
|
822 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'number' => '')); |
|
823 | 823 | $id = strip_tags($instance['id']); |
824 | 824 | $number = strip_tags($instance['number']); |
825 | 825 | ?> |
826 | 826 | |
827 | 827 | <p> |
828 | 828 | <label |
829 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory');?> |
|
829 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory'); ?> |
|
830 | 830 | (<a href="http://www.idgettr.com">idGettr</a>): |
831 | 831 | <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>" |
832 | 832 | name="<?php echo $this->get_field_name('id'); ?>" type="text" |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | |
837 | 837 | <p> |
838 | 838 | <label |
839 | - for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory');?> |
|
839 | + for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory'); ?> |
|
840 | 840 | <input class="widefat" id="<?php echo $this->get_field_id('number'); ?>" |
841 | 841 | name="<?php echo $this->get_field_name('number'); ?>" type="text" |
842 | 842 | value="<?php echo esc_attr($number); ?>"/> |
@@ -932,12 +932,12 @@ discard block |
||
932 | 932 | public function form($instance) |
933 | 933 | { |
934 | 934 | //widgetform in backend |
935 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => '')); |
|
935 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => '')); |
|
936 | 936 | |
937 | 937 | $desc1 = ($instance['gd_tw_desc1']); |
938 | 938 | ?> |
939 | 939 | <p><label |
940 | - for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?> |
|
940 | + for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory'); ?> |
|
941 | 941 | <textarea class="widefat" rows="6" cols="20" |
942 | 942 | id="<?php echo $this->get_field_id('gd_tw_desc1'); ?>" |
943 | 943 | name="<?php echo $this->get_field_name('gd_tw_desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label> |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
964 | 964 | */ |
965 | 965 | public function __construct() { |
966 | - $widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'),'post_type'=>''); |
|
966 | + $widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'), 'post_type'=>''); |
|
967 | 967 | parent::__construct( |
968 | 968 | 'geodir_advance_search', // Base ID |
969 | 969 | __('GD > Search', 'geodirectory'), // Name |
@@ -990,15 +990,15 @@ discard block |
||
990 | 990 | * @param array $args The widget arguments. |
991 | 991 | * @param array $instance The widget instance. |
992 | 992 | */ |
993 | - $args = apply_filters('widget_geodir_advance_search_args',$args,$instance); |
|
993 | + $args = apply_filters('widget_geodir_advance_search_args', $args, $instance); |
|
994 | 994 | |
995 | 995 | // prints the widget |
996 | 996 | extract($args, EXTR_SKIP); |
997 | 997 | |
998 | - if(isset($post_type) && $post_type){ |
|
999 | - geodir_get_search_post_type($post_type);// set the post type |
|
1000 | - }else{ |
|
1001 | - geodir_get_search_post_type();// set the post type |
|
998 | + if (isset($post_type) && $post_type) { |
|
999 | + geodir_get_search_post_type($post_type); // set the post type |
|
1000 | + } else { |
|
1001 | + geodir_get_search_post_type(); // set the post type |
|
1002 | 1002 | } |
1003 | 1003 | |
1004 | 1004 | echo $before_widget; |
@@ -997,7 +997,7 @@ |
||
997 | 997 | |
998 | 998 | if(isset($post_type) && $post_type){ |
999 | 999 | geodir_get_search_post_type($post_type);// set the post type |
1000 | - }else{ |
|
1000 | + } else{ |
|
1001 | 1001 | geodir_get_search_post_type();// set the post type |
1002 | 1002 | } |
1003 | 1003 |
@@ -17,26 +17,26 @@ discard block |
||
17 | 17 | function gd_compat_php_genesis() |
18 | 18 | { |
19 | 19 | // REPLACE GENESIS BREADCRUMBS WITH GD BREADCRUMBS |
20 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
20 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
26 | 26 | |
27 | 27 | |
28 | - // make top section wide |
|
29 | - remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
30 | - remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
31 | - remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
32 | - remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
33 | - remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
34 | - remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
28 | + // make top section wide |
|
29 | + remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
30 | + remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
31 | + remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
32 | + remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
33 | + remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
34 | + remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
35 | 35 | |
36 | - // REMOVE PAGE TITLES |
|
37 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
38 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
39 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
36 | + // REMOVE PAGE TITLES |
|
37 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
38 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
39 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | } |
@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | function gd_genesis_compat_left_sidebars() |
54 | 54 | { |
55 | 55 | |
56 | - if (is_page_geodir_home()) { |
|
57 | - remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
58 | - add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
59 | - } elseif (geodir_is_page('location')) { |
|
60 | - remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
61 | - add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
62 | - } elseif (geodir_is_page('listing')) { |
|
63 | - remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10); |
|
64 | - add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11); |
|
65 | - } elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) { |
|
66 | - //remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 ); |
|
67 | - //add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 ); |
|
68 | - } elseif (geodir_is_page('search')) { |
|
69 | - remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10); |
|
70 | - add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11); |
|
71 | - } elseif (geodir_is_page('author')) { |
|
72 | - remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10); |
|
73 | - add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11); |
|
74 | - } |
|
56 | + if (is_page_geodir_home()) { |
|
57 | + remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
58 | + add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
59 | + } elseif (geodir_is_page('location')) { |
|
60 | + remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
61 | + add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
62 | + } elseif (geodir_is_page('listing')) { |
|
63 | + remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10); |
|
64 | + add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11); |
|
65 | + } elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) { |
|
66 | + //remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 ); |
|
67 | + //add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 ); |
|
68 | + } elseif (geodir_is_page('search')) { |
|
69 | + remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10); |
|
70 | + add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11); |
|
71 | + } elseif (geodir_is_page('author')) { |
|
72 | + remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10); |
|
73 | + add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11); |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | 77 | } |
@@ -88,65 +88,65 @@ discard block |
||
88 | 88 | */ |
89 | 89 | function geodir_set_body_scs($classes) |
90 | 90 | { |
91 | - $remove_class = false; |
|
92 | - $new_class = ''; |
|
93 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
94 | - $remove_class = true; |
|
95 | - if (get_option('geodir_show_home_left_section')) { |
|
96 | - $new_class .= 'sidebar-'; |
|
97 | - } |
|
98 | - if (get_option('geodir_show_home_contant_section')) { |
|
99 | - $new_class .= 'content'; |
|
100 | - } |
|
101 | - if (get_option('geodir_show_home_right_section')) { |
|
102 | - $new_class .= '-sidebar'; |
|
103 | - } |
|
104 | - } elseif (geodir_is_page('listing')) { |
|
105 | - $remove_class = true; |
|
106 | - if (get_option('geodir_show_listing_left_section')) { |
|
107 | - $new_class .= 'sidebar-'; |
|
108 | - } |
|
109 | - $new_class .= 'content'; |
|
110 | - if (get_option('geodir_show_listing_right_section')) { |
|
111 | - $new_class .= '-sidebar'; |
|
112 | - } |
|
113 | - } elseif (geodir_is_page('detail')) { |
|
114 | - $remove_class = true; |
|
115 | - if (get_option('geodir_detail_sidebar_left_section')) { |
|
116 | - $new_class .= 'sidebar-content gd-details-sidebar-left'; |
|
117 | - } else { |
|
118 | - $new_class .= 'content-sidebar'; |
|
119 | - } |
|
120 | - } elseif (geodir_is_page('search')) { |
|
121 | - $remove_class = true; |
|
122 | - if (get_option('geodir_show_search_left_section')) { |
|
123 | - $new_class .= 'sidebar-'; |
|
124 | - } |
|
125 | - $new_class .= 'content'; |
|
126 | - if (get_option('geodir_show_search_right_section')) { |
|
127 | - $new_class .= '-sidebar'; |
|
128 | - } |
|
129 | - } elseif (geodir_is_page('author')) { |
|
130 | - $remove_class = true; |
|
131 | - if (get_option('geodir_show_author_left_section')) { |
|
132 | - $new_class .= 'sidebar-'; |
|
133 | - } |
|
134 | - $new_class .= 'content'; |
|
135 | - if (get_option('geodir_show_author_right_section')) { |
|
136 | - $new_class .= '-sidebar'; |
|
137 | - } |
|
138 | - } elseif (geodir_is_page('add-listing')) { |
|
139 | - $remove_class = true; |
|
140 | - $new_class .= 'content-sidebar'; |
|
141 | - } |
|
142 | - |
|
143 | - if ($remove_class) { |
|
144 | - $classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content')); |
|
145 | - //str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes); |
|
146 | - $classes[] = $new_class; |
|
147 | - } |
|
148 | - |
|
149 | - return $classes; |
|
91 | + $remove_class = false; |
|
92 | + $new_class = ''; |
|
93 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
94 | + $remove_class = true; |
|
95 | + if (get_option('geodir_show_home_left_section')) { |
|
96 | + $new_class .= 'sidebar-'; |
|
97 | + } |
|
98 | + if (get_option('geodir_show_home_contant_section')) { |
|
99 | + $new_class .= 'content'; |
|
100 | + } |
|
101 | + if (get_option('geodir_show_home_right_section')) { |
|
102 | + $new_class .= '-sidebar'; |
|
103 | + } |
|
104 | + } elseif (geodir_is_page('listing')) { |
|
105 | + $remove_class = true; |
|
106 | + if (get_option('geodir_show_listing_left_section')) { |
|
107 | + $new_class .= 'sidebar-'; |
|
108 | + } |
|
109 | + $new_class .= 'content'; |
|
110 | + if (get_option('geodir_show_listing_right_section')) { |
|
111 | + $new_class .= '-sidebar'; |
|
112 | + } |
|
113 | + } elseif (geodir_is_page('detail')) { |
|
114 | + $remove_class = true; |
|
115 | + if (get_option('geodir_detail_sidebar_left_section')) { |
|
116 | + $new_class .= 'sidebar-content gd-details-sidebar-left'; |
|
117 | + } else { |
|
118 | + $new_class .= 'content-sidebar'; |
|
119 | + } |
|
120 | + } elseif (geodir_is_page('search')) { |
|
121 | + $remove_class = true; |
|
122 | + if (get_option('geodir_show_search_left_section')) { |
|
123 | + $new_class .= 'sidebar-'; |
|
124 | + } |
|
125 | + $new_class .= 'content'; |
|
126 | + if (get_option('geodir_show_search_right_section')) { |
|
127 | + $new_class .= '-sidebar'; |
|
128 | + } |
|
129 | + } elseif (geodir_is_page('author')) { |
|
130 | + $remove_class = true; |
|
131 | + if (get_option('geodir_show_author_left_section')) { |
|
132 | + $new_class .= 'sidebar-'; |
|
133 | + } |
|
134 | + $new_class .= 'content'; |
|
135 | + if (get_option('geodir_show_author_right_section')) { |
|
136 | + $new_class .= '-sidebar'; |
|
137 | + } |
|
138 | + } elseif (geodir_is_page('add-listing')) { |
|
139 | + $remove_class = true; |
|
140 | + $new_class .= 'content-sidebar'; |
|
141 | + } |
|
142 | + |
|
143 | + if ($remove_class) { |
|
144 | + $classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content')); |
|
145 | + //str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes); |
|
146 | + $classes[] = $new_class; |
|
147 | + } |
|
148 | + |
|
149 | + return $classes; |
|
150 | 150 | |
151 | 151 | } |
152 | 152 | |
@@ -160,17 +160,17 @@ discard block |
||
160 | 160 | function gd_genesis_compat_add_top_section_back() |
161 | 161 | { |
162 | 162 | |
163 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
164 | - geodir_action_geodir_sidebar_home_top(); |
|
165 | - } elseif (geodir_is_page('listing')) { |
|
166 | - geodir_action_geodir_sidebar_listings_top(); |
|
167 | - } elseif (geodir_is_page('detail')) { |
|
168 | - geodir_action_geodir_sidebar_detail_top(); |
|
169 | - } elseif (geodir_is_page('search')) { |
|
170 | - geodir_action_geodir_sidebar_search_top(); |
|
171 | - } elseif (geodir_is_page('author')) { |
|
172 | - geodir_action_geodir_sidebar_author_top(); |
|
173 | - } |
|
163 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
164 | + geodir_action_geodir_sidebar_home_top(); |
|
165 | + } elseif (geodir_is_page('listing')) { |
|
166 | + geodir_action_geodir_sidebar_listings_top(); |
|
167 | + } elseif (geodir_is_page('detail')) { |
|
168 | + geodir_action_geodir_sidebar_detail_top(); |
|
169 | + } elseif (geodir_is_page('search')) { |
|
170 | + geodir_action_geodir_sidebar_search_top(); |
|
171 | + } elseif (geodir_is_page('author')) { |
|
172 | + geodir_action_geodir_sidebar_author_top(); |
|
173 | + } |
|
174 | 174 | |
175 | 175 | |
176 | 176 | } |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | */ |
184 | 184 | function geodir_replace_breadcrumb() |
185 | 185 | { |
186 | - if (is_front_page() && geodir_is_page('home') && !geodir_is_page('login')) { |
|
187 | - } else { |
|
188 | - echo '<div class="geodir-breadcrumb-bar"><div class="wrap">'; |
|
189 | - geodir_breadcrumb(); |
|
190 | - echo '</div></div>'; |
|
191 | - } |
|
186 | + if (is_front_page() && geodir_is_page('home') && !geodir_is_page('login')) { |
|
187 | + } else { |
|
188 | + echo '<div class="geodir-breadcrumb-bar"><div class="wrap">'; |
|
189 | + geodir_breadcrumb(); |
|
190 | + echo '</div></div>'; |
|
191 | + } |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | // Force Full Width on signup page |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | */ |
202 | 202 | function geodir_genesis_meta() |
203 | 203 | { |
204 | - if (geodir_is_page('login')) { |
|
205 | - add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content'); |
|
206 | - } |
|
204 | + if (geodir_is_page('login')) { |
|
205 | + add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content'); |
|
206 | + } |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | add_action('geodir_add_listing_page_title', 'geodir_add_listing_page_title_genesis_before', 8); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | function geodir_add_listing_page_title_genesis_before() |
217 | 217 | { |
218 | 218 | |
219 | - echo "<div class='entry' >"; |
|
219 | + echo "<div class='entry' >"; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | function geodir_add_listing_form_genesis_after() |
231 | 231 | { |
232 | 232 | |
233 | - echo "</div>"; |
|
233 | + echo "</div>"; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
@@ -249,38 +249,38 @@ discard block |
||
249 | 249 | { |
250 | 250 | |
251 | 251 | |
252 | - $title = ''; |
|
253 | - $subtitle = ''; |
|
254 | - |
|
255 | - if (geodir_is_page('listing')) { |
|
256 | - echo '<div class="wrap gd-title-wrap">'; |
|
257 | - geodir_action_listings_title(); |
|
258 | - echo '</div>'; |
|
259 | - } |
|
260 | - |
|
261 | - if (geodir_is_page('add-listing')) { |
|
262 | - echo '<div class="wrap gd-title-wrap">'; |
|
263 | - geodir_action_add_listing_page_title(); |
|
264 | - echo '</div>'; |
|
265 | - } |
|
266 | - |
|
267 | - if (geodir_is_page('author')) { |
|
268 | - echo '<div class="wrap gd-title-wrap">'; |
|
269 | - geodir_action_author_page_title(); |
|
270 | - echo '</div>'; |
|
271 | - } |
|
272 | - |
|
273 | - if (geodir_is_page('detail') || geodir_is_page('preview')) { |
|
274 | - echo '<div class="wrap gd-title-wrap">'; |
|
275 | - echo get_the_title(); |
|
276 | - echo '</div>'; |
|
277 | - } |
|
278 | - |
|
279 | - if (geodir_is_page('search')) { |
|
280 | - echo '<div class="wrap gd-title-wrap">'; |
|
281 | - geodir_action_search_page_title(); |
|
282 | - echo '</div>'; |
|
283 | - } |
|
252 | + $title = ''; |
|
253 | + $subtitle = ''; |
|
254 | + |
|
255 | + if (geodir_is_page('listing')) { |
|
256 | + echo '<div class="wrap gd-title-wrap">'; |
|
257 | + geodir_action_listings_title(); |
|
258 | + echo '</div>'; |
|
259 | + } |
|
260 | + |
|
261 | + if (geodir_is_page('add-listing')) { |
|
262 | + echo '<div class="wrap gd-title-wrap">'; |
|
263 | + geodir_action_add_listing_page_title(); |
|
264 | + echo '</div>'; |
|
265 | + } |
|
266 | + |
|
267 | + if (geodir_is_page('author')) { |
|
268 | + echo '<div class="wrap gd-title-wrap">'; |
|
269 | + geodir_action_author_page_title(); |
|
270 | + echo '</div>'; |
|
271 | + } |
|
272 | + |
|
273 | + if (geodir_is_page('detail') || geodir_is_page('preview')) { |
|
274 | + echo '<div class="wrap gd-title-wrap">'; |
|
275 | + echo get_the_title(); |
|
276 | + echo '</div>'; |
|
277 | + } |
|
278 | + |
|
279 | + if (geodir_is_page('search')) { |
|
280 | + echo '<div class="wrap gd-title-wrap">'; |
|
281 | + geodir_action_search_page_title(); |
|
282 | + echo '</div>'; |
|
283 | + } |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | */ |
294 | 294 | function gd_genesis_listing_page_title_bar() |
295 | 295 | { |
296 | - geodir_action_listings_title(); |
|
297 | - //geodir_action_listings_description(); |
|
296 | + geodir_action_listings_title(); |
|
297 | + //geodir_action_listings_description(); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -307,19 +307,19 @@ discard block |
||
307 | 307 | */ |
308 | 308 | function gd_compat_php_genesis_geo_1280_fix() |
309 | 309 | { |
310 | - if (function_exists('geo1280_search_bar')) { |
|
311 | - remove_action('genesis_after_header', 'geo1280_search_bar', 20); |
|
312 | - add_action('genesis_after_header', 'geo1280_search_bar_fix', 4); |
|
310 | + if (function_exists('geo1280_search_bar')) { |
|
311 | + remove_action('genesis_after_header', 'geo1280_search_bar', 20); |
|
312 | + add_action('genesis_after_header', 'geo1280_search_bar_fix', 4); |
|
313 | 313 | |
314 | - // |
|
314 | + // |
|
315 | 315 | |
316 | - remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20); |
|
317 | - remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20); |
|
318 | - add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105); |
|
316 | + remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20); |
|
317 | + remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20); |
|
318 | + add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105); |
|
319 | 319 | |
320 | - remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10); |
|
321 | - add_action('geodir_wrapper_open', 'geo1280_page_title', 101); |
|
322 | - } |
|
320 | + remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10); |
|
321 | + add_action('geodir_wrapper_open', 'geo1280_page_title', 101); |
|
322 | + } |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | function geo1280_search_bar_fix() |
332 | 332 | { |
333 | 333 | |
334 | - echo '<div class="geo1280-placeholder"></div>'; |
|
335 | - if (is_active_sidebar('search-bar')) { |
|
336 | - genesis_widget_area('search-bar', array( |
|
337 | - 'before' => '<div class="search-bar widget-area"><div class="wrap">', |
|
338 | - 'after' => '</div></div>', |
|
339 | - )); |
|
340 | - } |
|
334 | + echo '<div class="geo1280-placeholder"></div>'; |
|
335 | + if (is_active_sidebar('search-bar')) { |
|
336 | + genesis_widget_area('search-bar', array( |
|
337 | + 'before' => '<div class="search-bar widget-area"><div class="wrap">', |
|
338 | + 'after' => '</div></div>', |
|
339 | + )); |
|
340 | + } |
|
341 | 341 | } |
@@ -12,27 +12,27 @@ |
||
12 | 12 | <div class="clearfix"> |
13 | 13 | <div id="geodir_content"> |
14 | 14 | <?php |
15 | - /** This action is documented in geodirectory-templates/geodir-home.php */ |
|
16 | - do_action('geodir_add_page_content', 'before', 'info-page'); |
|
17 | - global $information; |
|
18 | - echo '<h5 class="geodir_information">'; |
|
19 | - echo $information; |
|
20 | - echo '</h5>'; |
|
21 | - /** This action is documented in geodirectory-templates/geodir-home.php */ |
|
22 | - do_action('geodir_add_page_content', 'after', 'info-page'); |
|
23 | - ?> |
|
15 | + /** This action is documented in geodirectory-templates/geodir-home.php */ |
|
16 | + do_action('geodir_add_page_content', 'before', 'info-page'); |
|
17 | + global $information; |
|
18 | + echo '<h5 class="geodir_information">'; |
|
19 | + echo $information; |
|
20 | + echo '</h5>'; |
|
21 | + /** This action is documented in geodirectory-templates/geodir-home.php */ |
|
22 | + do_action('geodir_add_page_content', 'after', 'info-page'); |
|
23 | + ?> |
|
24 | 24 | </div> |
25 | 25 | <!-- geodir_content ends here--> |
26 | 26 | <div id="gd-sidebar-wrapper"> |
27 | 27 | <div class="geodir-sidebar-main"> |
28 | 28 | <div class="geodir-gd-sidebar"> |
29 | 29 | <?php |
30 | - /** |
|
31 | - * Calls the author sidebar. |
|
32 | - * |
|
33 | - * @since 1.6.11 |
|
34 | - */ |
|
35 | - dynamic_sidebar('geodir_author_right_sidebar'); ?> |
|
30 | + /** |
|
31 | + * Calls the author sidebar. |
|
32 | + * |
|
33 | + * @since 1.6.11 |
|
34 | + */ |
|
35 | + dynamic_sidebar('geodir_author_right_sidebar'); ?> |
|
36 | 36 | </div> |
37 | 37 | </div> |
38 | 38 | </div> |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | global $sitepress; |
246 | 246 | $default_lang = $sitepress->get_default_language(); |
247 | 247 | $term_id = icl_object_id($cat_term->term_id, $post_type.'category', true, $default_lang); |
248 | - }else{ |
|
248 | + } else{ |
|
249 | 249 | $term_id = $cat_term->term_id; |
250 | 250 | } |
251 | 251 | if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) { |
@@ -273,8 +273,9 @@ discard block |
||
273 | 273 | |
274 | 274 | return $out; |
275 | 275 | } else { |
276 | - if ($cat_parent == 0) |
|
277 | - return _e('No category', 'geodirectory'); |
|
276 | + if ($cat_parent == 0) { |
|
277 | + return _e('No category', 'geodirectory'); |
|
278 | + } |
|
278 | 279 | } |
279 | 280 | return; |
280 | 281 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') { |
56 | 56 | |
57 | - if(isset($map_jason[$post->ID])){return null;} |
|
57 | + if (isset($map_jason[$post->ID])) {return null; } |
|
58 | 58 | |
59 | 59 | $srcharr = array("'", "/", "-", '"', '\\'); |
60 | 60 | $replarr = array("′", "⁄", "–", "“", ''); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $title = str_replace($srcharr, $replarr, $post_title); |
68 | 68 | |
69 | 69 | if (is_ssl()) { |
70 | - $icon = str_replace("http:","https:",$icon ); |
|
70 | + $icon = str_replace("http:", "https:", $icon); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if ($icon != '') { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $icon_size = array('w' => 36, 'h' => 45); |
84 | 84 | } |
85 | 85 | |
86 | - $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}'; |
|
86 | + $post_json = '{"id":"'.$post->ID.'","t": "'.$title.'","lt": "'.$post->post_latitude.'","ln": "'.$post->post_longitude.'","mk_id":"'.$post->ID.'_'.$post->default_category.'","i":"'.$icon.'","w":"'.$icon_size['w'].'","h":"'.$icon_size['h'].'"}'; |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * Filter the json data when creating output for post json marker.. |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | * @param string $post_json JSON representation of the post marker info. |
93 | 93 | * @param object $post The post object. |
94 | 94 | */ |
95 | - $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post); |
|
95 | + $post_map_json = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post); |
|
96 | 96 | |
97 | 97 | // only assign it if it has a value |
98 | - if($post_map_json){ |
|
98 | + if ($post_map_json) { |
|
99 | 99 | $map_jason[$post->ID] = $post_map_json; |
100 | 100 | } |
101 | 101 | |
@@ -119,13 +119,13 @@ discard block |
||
119 | 119 | if (is_array($map_jason) && !empty($map_jason)) { |
120 | 120 | |
121 | 121 | // on details page only show the main marker on the map |
122 | - if(geodir_is_page('detail')){ |
|
122 | + if (geodir_is_page('detail')) { |
|
123 | 123 | global $post; |
124 | - if(isset($map_jason[$post->ID])){ |
|
124 | + if (isset($map_jason[$post->ID])) { |
|
125 | 125 | $map_jason = array($map_jason[$post->ID]); |
126 | 126 | } |
127 | 127 | } |
128 | - $canvas_jason = $canvas . "_jason"; |
|
128 | + $canvas_jason = $canvas."_jason"; |
|
129 | 129 | $map_canvas_arr[$canvas] = array_unique($map_jason); |
130 | 130 | unset($cat_content_info); |
131 | 131 | $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]); |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | $json_content = substr(implode(',', $cat_content_info), 1); |
135 | 135 | $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016 |
136 | 136 | $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08 |
137 | - $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']'; |
|
137 | + $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']'; |
|
138 | 138 | } else { |
139 | 139 | $canvas_jason = '[{"totalcount":"0"}]'; |
140 | 140 | } |
141 | - $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
141 | + $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason); |
|
142 | 142 | |
143 | 143 | /** |
144 | 144 | * Filter the send_marker_jason_to_js() function map canvas json args. |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | * @param string $canvas Map canvas array key. |
151 | 151 | * @param array $map_canvas_jason_args Map canvas args. |
152 | 152 | */ |
153 | - $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args); |
|
153 | + $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args); |
|
154 | 154 | |
155 | - wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args); |
|
155 | + wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args); |
|
156 | 156 | } else { |
157 | 157 | $canvas_jason = '[{"totalcount":"0"}]'; |
158 | - $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
158 | + $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason); |
|
159 | 159 | |
160 | 160 | /** |
161 | 161 | * Filter the send_marker_jason_to_js() function map canvas json args. |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | * @param string $canvas Map canvas array key. |
168 | 168 | * @param array $map_canvas_jason_args Map canvas args. |
169 | 169 | */ |
170 | - $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args); |
|
171 | - wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args); |
|
170 | + $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args); |
|
171 | + wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -230,11 +230,11 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | |
233 | - $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
233 | + $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">'; |
|
234 | 234 | |
235 | 235 | $geodir_cat_icons = geodir_get_term_icon(); |
236 | 236 | |
237 | - $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place'; |
|
237 | + $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place'; |
|
238 | 238 | $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt; |
239 | 239 | foreach ($cat_terms as $cat_term): |
240 | 240 | |
@@ -252,19 +252,19 @@ discard block |
||
252 | 252 | global $sitepress; |
253 | 253 | $default_lang = $sitepress->get_default_language(); |
254 | 254 | $term_id = icl_object_id($cat_term->term_id, $post_type.'category', true, $default_lang); |
255 | - }else{ |
|
255 | + } else { |
|
256 | 256 | $term_id = $cat_term->term_id; |
257 | 257 | } |
258 | - if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) { |
|
258 | + if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$term_id, $geodir_home_map_untick)) { |
|
259 | 259 | $checked = ''; |
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | - $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"'; |
|
264 | - $term_check .= ' name="' . $map_canvas_name . '_cat[]" '; |
|
265 | - $term_check .= ' title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">'; |
|
266 | - $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>'; |
|
267 | - $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>'; |
|
263 | + $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"'; |
|
264 | + $term_check .= ' name="'.$map_canvas_name.'_cat[]" '; |
|
265 | + $term_check .= ' title="'.esc_attr(ucfirst($cat_term->name)).'" value="'.$cat_term->term_id.'" onclick="javascript:build_map_ajax_search_param(\''.$map_canvas_name.'\',false, this)">'; |
|
266 | + $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.ucfirst($cat_term->name).'"/>'; |
|
267 | + $out .= '<li>'.$term_check.'<label for="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'">'.$term_img.ucfirst($cat_term->name).'</label><i class="fa fa-long-arrow-down"></i>'; |
|
268 | 268 | |
269 | 269 | endif; |
270 | 270 | |
@@ -376,18 +376,18 @@ discard block |
||
376 | 376 | * @package GeoDirectory |
377 | 377 | */ |
378 | 378 | function geodir_map_load_script() { |
379 | - if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) { |
|
379 | + if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) { |
|
380 | 380 | $plugin_url = geodir_plugin_url(); |
381 | 381 | ?> |
382 | 382 | <script type="text/javascript"> |
383 | 383 | if (!(window.google && typeof google.maps !== 'undefined')) { |
384 | - var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>"); |
|
384 | + var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-style-css");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>"); |
|
385 | 385 | document.getElementsByTagName("head")[0].appendChild(css); |
386 | - var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION;?>"); |
|
386 | + var css = document.createElement("link");css.setAttribute("rel","stylesheet");css.setAttribute("type","text/css");css.setAttribute("media","all");css.setAttribute("id","geodirectory-leaflet-routing-style");css.setAttribute("href","<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css?ver=<?php echo GEODIRECTORY_VERSION; ?>"); |
|
387 | 387 | document.getElementsByTagName("head")[0].appendChild(css); |
388 | - document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>'); |
|
389 | - document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>'); |
|
390 | - document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url;?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>'); |
|
388 | + document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>'); |
|
389 | + document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>'); |
|
390 | + document.write('<' + 'script id="geodirectory-leaflet-routing-script" src="<?php echo $plugin_url; ?>/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>'); |
|
391 | 391 | } |
392 | 392 | </script> |
393 | 393 | <?php |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function geodir_init_map_jason() |
17 | 17 | { |
18 | - global $map_jason; |
|
19 | - $map_jason = array(); |
|
18 | + global $map_jason; |
|
19 | + $map_jason = array(); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function geodir_init_map_canvas_array() |
30 | 30 | { |
31 | - global $map_canvas_arr; |
|
32 | - $map_canvas_arr = array(); |
|
31 | + global $map_canvas_arr; |
|
32 | + $map_canvas_arr = array(); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -50,56 +50,56 @@ discard block |
||
50 | 50 | */ |
51 | 51 | function create_marker_jason_of_posts($post) |
52 | 52 | { |
53 | - global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes; |
|
53 | + global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes; |
|
54 | 54 | |
55 | - if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') { |
|
55 | + if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') { |
|
56 | 56 | |
57 | - if(isset($map_jason[$post->ID])){return null;} |
|
57 | + if(isset($map_jason[$post->ID])){return null;} |
|
58 | 58 | |
59 | - $srcharr = array("'", "/", "-", '"', '\\'); |
|
60 | - $replarr = array("′", "⁄", "–", "“", ''); |
|
59 | + $srcharr = array("'", "/", "-", '"', '\\'); |
|
60 | + $replarr = array("′", "⁄", "–", "“", ''); |
|
61 | 61 | |
62 | 62 | |
63 | - $geodir_cat_icons = geodir_get_term_icon(); |
|
64 | - $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : ''; |
|
63 | + $geodir_cat_icons = geodir_get_term_icon(); |
|
64 | + $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : ''; |
|
65 | 65 | |
66 | - $post_title = $post->post_title; |
|
67 | - $title = str_replace($srcharr, $replarr, $post_title); |
|
66 | + $post_title = $post->post_title; |
|
67 | + $title = str_replace($srcharr, $replarr, $post_title); |
|
68 | 68 | |
69 | - if (is_ssl()) { |
|
70 | - $icon = str_replace("http:","https:",$icon ); |
|
71 | - } |
|
69 | + if (is_ssl()) { |
|
70 | + $icon = str_replace("http:","https:",$icon ); |
|
71 | + } |
|
72 | 72 | |
73 | - if ($icon != '') { |
|
74 | - $gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes; |
|
73 | + if ($icon != '') { |
|
74 | + $gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes; |
|
75 | 75 | |
76 | - if (isset($gd_marker_sizes[$icon])) { |
|
77 | - $icon_size = $gd_marker_sizes[$icon]; |
|
78 | - } else { |
|
79 | - $icon_size = geodir_get_marker_size($icon); |
|
80 | - $gd_marker_sizes[$icon] = $icon_size; |
|
81 | - } |
|
82 | - } else { |
|
83 | - $icon_size = array('w' => 36, 'h' => 45); |
|
84 | - } |
|
85 | - |
|
86 | - $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}'; |
|
87 | - |
|
88 | - /** |
|
89 | - * Filter the json data when creating output for post json marker.. |
|
90 | - * |
|
91 | - * @since 1.5.7 |
|
92 | - * @param string $post_json JSON representation of the post marker info. |
|
93 | - * @param object $post The post object. |
|
94 | - */ |
|
95 | - $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post); |
|
96 | - |
|
97 | - // only assign it if it has a value |
|
98 | - if($post_map_json){ |
|
99 | - $map_jason[$post->ID] = $post_map_json; |
|
100 | - } |
|
101 | - |
|
102 | - } |
|
76 | + if (isset($gd_marker_sizes[$icon])) { |
|
77 | + $icon_size = $gd_marker_sizes[$icon]; |
|
78 | + } else { |
|
79 | + $icon_size = geodir_get_marker_size($icon); |
|
80 | + $gd_marker_sizes[$icon] = $icon_size; |
|
81 | + } |
|
82 | + } else { |
|
83 | + $icon_size = array('w' => 36, 'h' => 45); |
|
84 | + } |
|
85 | + |
|
86 | + $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}'; |
|
87 | + |
|
88 | + /** |
|
89 | + * Filter the json data when creating output for post json marker.. |
|
90 | + * |
|
91 | + * @since 1.5.7 |
|
92 | + * @param string $post_json JSON representation of the post marker info. |
|
93 | + * @param object $post The post object. |
|
94 | + */ |
|
95 | + $post_map_json = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post); |
|
96 | + |
|
97 | + // only assign it if it has a value |
|
98 | + if($post_map_json){ |
|
99 | + $map_jason[$post->ID] = $post_map_json; |
|
100 | + } |
|
101 | + |
|
102 | + } |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -112,67 +112,67 @@ discard block |
||
112 | 112 | */ |
113 | 113 | function send_marker_jason_to_js() |
114 | 114 | { |
115 | - global $map_jason, $map_canvas_arr; |
|
116 | - |
|
117 | - if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) { |
|
118 | - foreach ($map_canvas_arr as $canvas => $jason) { |
|
119 | - if (is_array($map_jason) && !empty($map_jason)) { |
|
120 | - |
|
121 | - // on details page only show the main marker on the map |
|
122 | - if(geodir_is_page('detail')){ |
|
123 | - global $post; |
|
124 | - if(isset($map_jason[$post->ID])){ |
|
125 | - $map_jason = array($map_jason[$post->ID]); |
|
126 | - } |
|
127 | - } |
|
128 | - $canvas_jason = $canvas . "_jason"; |
|
129 | - $map_canvas_arr[$canvas] = array_unique($map_jason); |
|
130 | - unset($cat_content_info); |
|
131 | - $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]); |
|
132 | - $totalcount = count(array_unique($map_jason)); |
|
133 | - if (!empty($cat_content_info)) { |
|
134 | - $json_content = substr(implode(',', $cat_content_info), 1); |
|
135 | - $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016 |
|
136 | - $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08 |
|
137 | - $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']'; |
|
138 | - } else { |
|
139 | - $canvas_jason = '[{"totalcount":"0"}]'; |
|
140 | - } |
|
141 | - $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
142 | - |
|
143 | - /** |
|
144 | - * Filter the send_marker_jason_to_js() function map canvas json args. |
|
145 | - * |
|
146 | - * You can use this filter to modify map canvas json args. |
|
147 | - * |
|
148 | - * @since 1.0.0 |
|
149 | - * @package GeoDirectory |
|
150 | - * @param string $canvas Map canvas array key. |
|
151 | - * @param array $map_canvas_jason_args Map canvas args. |
|
152 | - */ |
|
153 | - $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args); |
|
154 | - |
|
155 | - wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args); |
|
156 | - } else { |
|
157 | - $canvas_jason = '[{"totalcount":"0"}]'; |
|
158 | - $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
159 | - |
|
160 | - /** |
|
161 | - * Filter the send_marker_jason_to_js() function map canvas json args. |
|
162 | - * |
|
163 | - * You can use this filter to modify map canvas json args. |
|
164 | - * |
|
165 | - * @since 1.0.0 |
|
166 | - * @package GeoDirectory |
|
167 | - * @param string $canvas Map canvas array key. |
|
168 | - * @param array $map_canvas_jason_args Map canvas args. |
|
169 | - */ |
|
170 | - $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args); |
|
171 | - wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args); |
|
172 | - } |
|
173 | - } |
|
174 | - |
|
175 | - } |
|
115 | + global $map_jason, $map_canvas_arr; |
|
116 | + |
|
117 | + if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) { |
|
118 | + foreach ($map_canvas_arr as $canvas => $jason) { |
|
119 | + if (is_array($map_jason) && !empty($map_jason)) { |
|
120 | + |
|
121 | + // on details page only show the main marker on the map |
|
122 | + if(geodir_is_page('detail')){ |
|
123 | + global $post; |
|
124 | + if(isset($map_jason[$post->ID])){ |
|
125 | + $map_jason = array($map_jason[$post->ID]); |
|
126 | + } |
|
127 | + } |
|
128 | + $canvas_jason = $canvas . "_jason"; |
|
129 | + $map_canvas_arr[$canvas] = array_unique($map_jason); |
|
130 | + unset($cat_content_info); |
|
131 | + $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]); |
|
132 | + $totalcount = count(array_unique($map_jason)); |
|
133 | + if (!empty($cat_content_info)) { |
|
134 | + $json_content = substr(implode(',', $cat_content_info), 1); |
|
135 | + $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016 |
|
136 | + $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08 |
|
137 | + $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']'; |
|
138 | + } else { |
|
139 | + $canvas_jason = '[{"totalcount":"0"}]'; |
|
140 | + } |
|
141 | + $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
142 | + |
|
143 | + /** |
|
144 | + * Filter the send_marker_jason_to_js() function map canvas json args. |
|
145 | + * |
|
146 | + * You can use this filter to modify map canvas json args. |
|
147 | + * |
|
148 | + * @since 1.0.0 |
|
149 | + * @package GeoDirectory |
|
150 | + * @param string $canvas Map canvas array key. |
|
151 | + * @param array $map_canvas_jason_args Map canvas args. |
|
152 | + */ |
|
153 | + $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args); |
|
154 | + |
|
155 | + wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args); |
|
156 | + } else { |
|
157 | + $canvas_jason = '[{"totalcount":"0"}]'; |
|
158 | + $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason); |
|
159 | + |
|
160 | + /** |
|
161 | + * Filter the send_marker_jason_to_js() function map canvas json args. |
|
162 | + * |
|
163 | + * You can use this filter to modify map canvas json args. |
|
164 | + * |
|
165 | + * @since 1.0.0 |
|
166 | + * @package GeoDirectory |
|
167 | + * @param string $canvas Map canvas array key. |
|
168 | + * @param array $map_canvas_jason_args Map canvas args. |
|
169 | + */ |
|
170 | + $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args); |
|
171 | + wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args); |
|
172 | + } |
|
173 | + } |
|
174 | + |
|
175 | + } |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -195,99 +195,99 @@ discard block |
||
195 | 195 | */ |
196 | 196 | function home_map_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = true, $pading = 0, $map_canvas_name = '', $child_collapse, $is_home_map = false) |
197 | 197 | { |
198 | - global $cat_count, $geodir_cat_icons, $gd_session; |
|
198 | + global $cat_count, $geodir_cat_icons, $gd_session; |
|
199 | 199 | |
200 | - $exclude_categories = get_option('geodir_exclude_cat_on_map'); |
|
201 | - $exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade'); |
|
200 | + $exclude_categories = get_option('geodir_exclude_cat_on_map'); |
|
201 | + $exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade'); |
|
202 | 202 | |
203 | - // check if exclude categories saved before fix of categories identical names |
|
204 | - if ($exclude_categories_new) { |
|
205 | - $gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : ''; |
|
206 | - $exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array(); |
|
207 | - } |
|
203 | + // check if exclude categories saved before fix of categories identical names |
|
204 | + if ($exclude_categories_new) { |
|
205 | + $gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : ''; |
|
206 | + $exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array(); |
|
207 | + } |
|
208 | 208 | |
209 | - $exclude_cat_str = implode(',', $exclude_categories); |
|
209 | + $exclude_cat_str = implode(',', $exclude_categories); |
|
210 | 210 | |
211 | - if ($exclude_cat_str == '') { |
|
212 | - $exclude_cat_str = '0'; |
|
213 | - } |
|
211 | + if ($exclude_cat_str == '') { |
|
212 | + $exclude_cat_str = '0'; |
|
213 | + } |
|
214 | 214 | |
215 | - $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty)); |
|
215 | + $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty)); |
|
216 | 216 | |
217 | - if ($hide_empty) { |
|
218 | - $cat_terms = geodir_filter_empty_terms($cat_terms); |
|
219 | - } |
|
217 | + if ($hide_empty) { |
|
218 | + $cat_terms = geodir_filter_empty_terms($cat_terms); |
|
219 | + } |
|
220 | 220 | |
221 | - $main_list_class = ''; |
|
222 | - //If there are terms, start displaying |
|
223 | - if (count($cat_terms) > 0) { |
|
224 | - //Displaying as a list |
|
225 | - $p = $pading * 15; |
|
226 | - $pading++; |
|
221 | + $main_list_class = ''; |
|
222 | + //If there are terms, start displaying |
|
223 | + if (count($cat_terms) > 0) { |
|
224 | + //Displaying as a list |
|
225 | + $p = $pading * 15; |
|
226 | + $pading++; |
|
227 | 227 | |
228 | - if ($cat_parent == 0) { |
|
229 | - $list_class = 'main_list'; |
|
230 | - $display = ''; |
|
231 | - } else { |
|
232 | - $list_class = 'sub_list'; |
|
233 | - $display = !$child_collapse ? '' : 'display:none'; |
|
234 | - } |
|
228 | + if ($cat_parent == 0) { |
|
229 | + $list_class = 'main_list'; |
|
230 | + $display = ''; |
|
231 | + } else { |
|
232 | + $list_class = 'sub_list'; |
|
233 | + $display = !$child_collapse ? '' : 'display:none'; |
|
234 | + } |
|
235 | 235 | |
236 | - $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
236 | + $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
237 | 237 | |
238 | - $geodir_cat_icons = geodir_get_term_icon(); |
|
238 | + $geodir_cat_icons = geodir_get_term_icon(); |
|
239 | 239 | |
240 | - $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place'; |
|
241 | - if ($is_home_map && $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype')) { |
|
242 | - $geodir_default_map_search_pt = $homemap_catlist_ptype; |
|
243 | - } |
|
244 | - $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : (isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : $geodir_default_map_search_pt); |
|
240 | + $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place'; |
|
241 | + if ($is_home_map && $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype')) { |
|
242 | + $geodir_default_map_search_pt = $homemap_catlist_ptype; |
|
243 | + } |
|
244 | + $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : (isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : $geodir_default_map_search_pt); |
|
245 | 245 | |
246 | - foreach ($cat_terms as $cat_term): |
|
247 | - $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : ''; |
|
248 | - |
|
249 | - if (!in_array($cat_term->term_id, $exclude_categories)): |
|
250 | - //Secret sauce. Function calls itself to display child elements, if any |
|
251 | - $checked = 'checked="checked"'; |
|
252 | - |
|
253 | - // Untick the category by default on home map |
|
254 | - if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) { |
|
255 | - if (function_exists('icl_object_id')) { // if WPML |
|
256 | - global $sitepress; |
|
257 | - $default_lang = $sitepress->get_default_language(); |
|
258 | - $term_id = icl_object_id($cat_term->term_id, $post_type.'category', true, $default_lang); |
|
259 | - }else{ |
|
260 | - $term_id = $cat_term->term_id; |
|
261 | - } |
|
262 | - if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) { |
|
263 | - $checked = ''; |
|
264 | - } |
|
265 | - } |
|
266 | - |
|
267 | - $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"'; |
|
268 | - $term_check .= ' name="' . $map_canvas_name . '_cat[]" '; |
|
269 | - $term_check .= ' title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">'; |
|
270 | - $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>'; |
|
271 | - $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>'; |
|
272 | - |
|
273 | - endif; |
|
274 | - |
|
275 | - |
|
276 | - // get sub category by recursion |
|
277 | - $out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map); |
|
278 | - |
|
279 | - $out .= '</li>'; |
|
280 | - |
|
281 | - endforeach; |
|
282 | - |
|
283 | - $out .= '</ul>'; |
|
284 | - |
|
285 | - return $out; |
|
286 | - } else { |
|
287 | - if ($cat_parent == 0) |
|
288 | - return _e('No category', 'geodirectory'); |
|
289 | - } |
|
290 | - return; |
|
246 | + foreach ($cat_terms as $cat_term): |
|
247 | + $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : ''; |
|
248 | + |
|
249 | + if (!in_array($cat_term->term_id, $exclude_categories)): |
|
250 | + //Secret sauce. Function calls itself to display child elements, if any |
|
251 | + $checked = 'checked="checked"'; |
|
252 | + |
|
253 | + // Untick the category by default on home map |
|
254 | + if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) { |
|
255 | + if (function_exists('icl_object_id')) { // if WPML |
|
256 | + global $sitepress; |
|
257 | + $default_lang = $sitepress->get_default_language(); |
|
258 | + $term_id = icl_object_id($cat_term->term_id, $post_type.'category', true, $default_lang); |
|
259 | + }else{ |
|
260 | + $term_id = $cat_term->term_id; |
|
261 | + } |
|
262 | + if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $term_id, $geodir_home_map_untick)) { |
|
263 | + $checked = ''; |
|
264 | + } |
|
265 | + } |
|
266 | + |
|
267 | + $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"'; |
|
268 | + $term_check .= ' name="' . $map_canvas_name . '_cat[]" '; |
|
269 | + $term_check .= ' title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">'; |
|
270 | + $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>'; |
|
271 | + $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>'; |
|
272 | + |
|
273 | + endif; |
|
274 | + |
|
275 | + |
|
276 | + // get sub category by recursion |
|
277 | + $out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map); |
|
278 | + |
|
279 | + $out .= '</li>'; |
|
280 | + |
|
281 | + endforeach; |
|
282 | + |
|
283 | + $out .= '</ul>'; |
|
284 | + |
|
285 | + return $out; |
|
286 | + } else { |
|
287 | + if ($cat_parent == 0) |
|
288 | + return _e('No category', 'geodirectory'); |
|
289 | + } |
|
290 | + return; |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -299,19 +299,19 @@ discard block |
||
299 | 299 | * @return string The map API provider name. |
300 | 300 | */ |
301 | 301 | function geodir_map_name() { |
302 | - $geodir_map_name = get_option('geodir_load_map', 'google'); |
|
302 | + $geodir_map_name = get_option('geodir_load_map', 'google'); |
|
303 | 303 | |
304 | - if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) { |
|
305 | - $geodir_map_name = 'auto'; |
|
306 | - } |
|
307 | - |
|
308 | - /** |
|
309 | - * Filter the map JS API provider name. |
|
310 | - * |
|
311 | - * @since 1.6.1 |
|
312 | - * @param string $geodir_map_name The map API provider name. |
|
313 | - */ |
|
314 | - return apply_filters('geodir_map_name', $geodir_map_name); |
|
304 | + if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) { |
|
305 | + $geodir_map_name = 'auto'; |
|
306 | + } |
|
307 | + |
|
308 | + /** |
|
309 | + * Filter the map JS API provider name. |
|
310 | + * |
|
311 | + * @since 1.6.1 |
|
312 | + * @param string $geodir_map_name The map API provider name. |
|
313 | + */ |
|
314 | + return apply_filters('geodir_map_name', $geodir_map_name); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -327,48 +327,48 @@ discard block |
||
327 | 327 | * @return array The icon size. |
328 | 328 | */ |
329 | 329 | function geodir_get_marker_size($icon, $default_size = array('w' => 36, 'h' => 45)) { |
330 | - global $gd_marker_sizes; |
|
330 | + global $gd_marker_sizes; |
|
331 | 331 | |
332 | - if (empty($gd_marker_sizes)) { |
|
333 | - $gd_marker_sizes = array(); |
|
334 | - } |
|
332 | + if (empty($gd_marker_sizes)) { |
|
333 | + $gd_marker_sizes = array(); |
|
334 | + } |
|
335 | 335 | |
336 | - if (!empty($gd_marker_sizes[$icon])) { |
|
337 | - return $gd_marker_sizes[$icon]; |
|
338 | - } |
|
336 | + if (!empty($gd_marker_sizes[$icon])) { |
|
337 | + return $gd_marker_sizes[$icon]; |
|
338 | + } |
|
339 | 339 | |
340 | - if (empty($icon)) { |
|
341 | - $gd_marker_sizes[$icon] = $default_size; |
|
340 | + if (empty($icon)) { |
|
341 | + $gd_marker_sizes[$icon] = $default_size; |
|
342 | 342 | |
343 | - return $default_size; |
|
344 | - } |
|
343 | + return $default_size; |
|
344 | + } |
|
345 | 345 | |
346 | - $icon_url = $icon; |
|
346 | + $icon_url = $icon; |
|
347 | 347 | |
348 | - $uploads = wp_upload_dir(); // Array of key => value pairs |
|
348 | + $uploads = wp_upload_dir(); // Array of key => value pairs |
|
349 | 349 | |
350 | - if (!path_is_absolute($icon)) { |
|
351 | - $icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon); |
|
352 | - } |
|
350 | + if (!path_is_absolute($icon)) { |
|
351 | + $icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon); |
|
352 | + } |
|
353 | 353 | |
354 | - if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) { |
|
355 | - $icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon); |
|
356 | - } |
|
354 | + if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) { |
|
355 | + $icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon); |
|
356 | + } |
|
357 | 357 | |
358 | - $sizes = array(); |
|
359 | - if (is_file($icon) && file_exists($icon)) { |
|
360 | - $size = getimagesize(trim($icon)); |
|
358 | + $sizes = array(); |
|
359 | + if (is_file($icon) && file_exists($icon)) { |
|
360 | + $size = getimagesize(trim($icon)); |
|
361 | 361 | |
362 | - if (!empty($size[0]) && !empty($size[1])) { |
|
363 | - $sizes = array('w' => $size[0], 'h' => $size[1]); |
|
364 | - } |
|
365 | - } |
|
362 | + if (!empty($size[0]) && !empty($size[1])) { |
|
363 | + $sizes = array('w' => $size[0], 'h' => $size[1]); |
|
364 | + } |
|
365 | + } |
|
366 | 366 | |
367 | - $sizes = !empty($sizes) ? $sizes : $default_size; |
|
367 | + $sizes = !empty($sizes) ? $sizes : $default_size; |
|
368 | 368 | |
369 | - $gd_marker_sizes[$icon_url] = $sizes; |
|
369 | + $gd_marker_sizes[$icon_url] = $sizes; |
|
370 | 370 | |
371 | - return $sizes; |
|
371 | + return $sizes; |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | add_action('wp_footer', 'geodir_map_load_script', 10); |
@@ -380,8 +380,8 @@ discard block |
||
380 | 380 | * @package GeoDirectory |
381 | 381 | */ |
382 | 382 | function geodir_map_load_script() { |
383 | - if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) { |
|
384 | - $plugin_url = geodir_plugin_url(); |
|
383 | + if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) { |
|
384 | + $plugin_url = geodir_plugin_url(); |
|
385 | 385 | ?> |
386 | 386 | <script type="text/javascript"> |
387 | 387 | if (!(window.google && typeof google.maps !== 'undefined')) { |
@@ -395,5 +395,5 @@ discard block |
||
395 | 395 | } |
396 | 396 | </script> |
397 | 397 | <?php |
398 | - } |
|
398 | + } |
|
399 | 399 | } |
400 | 400 | \ No newline at end of file |