@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions |
|
51 | 51 | |
52 | 52 | update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
53 | 53 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @since 1.0.0 |
85 | 85 | * @package GeoDirectory |
86 | 86 | */ |
87 | -function geodir_upgrade_146(){ |
|
87 | +function geodir_upgrade_146() { |
|
88 | 88 | gd_convert_virtual_pages(); |
89 | 89 | } |
90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @since 1.5.0 |
95 | 95 | * @package GeoDirectory |
96 | 96 | */ |
97 | -function geodir_upgrade_150(){ |
|
97 | +function geodir_upgrade_150() { |
|
98 | 98 | gd_fix_cpt_rewrite_slug(); |
99 | 99 | } |
100 | 100 | |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | * @since 1.4.8 |
107 | 107 | * @package GeoDirectory |
108 | 108 | */ |
109 | -function geodir_upgrade_148(){ |
|
109 | +function geodir_upgrade_148() { |
|
110 | 110 | /* |
111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
112 | 112 | */ |
113 | - update_option('geodir_ga_pass',''); |
|
114 | - update_option('geodir_ga_user',''); |
|
113 | + update_option('geodir_ga_pass', ''); |
|
114 | + update_option('geodir_ga_user', ''); |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @since 1.5.3 |
123 | 123 | * @package GeoDirectory |
124 | 124 | */ |
125 | -function geodir_upgrade_153(){ |
|
125 | +function geodir_upgrade_153() { |
|
126 | 126 | geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
127 | 127 | geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @since 1.5.3 |
134 | 134 | * @package GeoDirectory |
135 | 135 | */ |
136 | -function geodir_upgrade_154(){ |
|
136 | +function geodir_upgrade_154() { |
|
137 | 137 | geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
138 | 138 | } |
139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @since 1.5.2 |
144 | 144 | * @package GeoDirectory |
145 | 145 | */ |
146 | -function geodir_upgrade_152(){ |
|
146 | +function geodir_upgrade_152() { |
|
147 | 147 | gd_fix_address_detail_table_limit(); |
148 | 148 | } |
149 | 149 | |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | |
642 | 642 | update_option('gd_theme_compats', $theme_compat); |
643 | 643 | |
644 | - gd_set_theme_compat();// set the compat pack if avail |
|
644 | + gd_set_theme_compat(); // set the compat pack if avail |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | * @package GeoDirectory |
653 | 653 | * @global object $wpdb WordPress Database object. |
654 | 654 | */ |
655 | -function gd_convert_virtual_pages(){ |
|
655 | +function gd_convert_virtual_pages() { |
|
656 | 656 | global $wpdb; |
657 | 657 | |
658 | 658 | // Update the add listing page settings |
@@ -663,9 +663,9 @@ discard block |
||
663 | 663 | ) |
664 | 664 | ); |
665 | 665 | |
666 | - if($add_listing_page){ |
|
667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
666 | + if ($add_listing_page) { |
|
667 | + wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish')); |
|
668 | + update_option('geodir_add_listing_page', $add_listing_page); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | // Update the listing preview page settings |
@@ -676,9 +676,9 @@ discard block |
||
676 | 676 | ) |
677 | 677 | ); |
678 | 678 | |
679 | - if($listing_preview_page){ |
|
680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
679 | + if ($listing_preview_page) { |
|
680 | + wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish')); |
|
681 | + update_option('geodir_preview_page', $listing_preview_page); |
|
682 | 682 | } |
683 | 683 | |
684 | 684 | // Update the listing success page settings |
@@ -689,9 +689,9 @@ discard block |
||
689 | 689 | ) |
690 | 690 | ); |
691 | 691 | |
692 | - if($listing_success_page){ |
|
693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
692 | + if ($listing_success_page) { |
|
693 | + wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish')); |
|
694 | + update_option('geodir_success_page', $listing_success_page); |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | // Update the listing success page settings |
@@ -702,11 +702,11 @@ discard block |
||
702 | 702 | ) |
703 | 703 | ); |
704 | 704 | |
705 | - if($location_page){ |
|
705 | + if ($location_page) { |
|
706 | 706 | $location_slug = get_option('geodir_location_prefix'); |
707 | - if(!$location_slug ){$location_slug = 'location';} |
|
708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
709 | - update_option( 'geodir_location_page', $location_page); |
|
707 | + if (!$location_slug) {$location_slug = 'location'; } |
|
708 | + wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug)); |
|
709 | + update_option('geodir_location_page', $location_page); |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | } |
@@ -725,13 +725,13 @@ discard block |
||
725 | 725 | $post_types = get_option('geodir_post_types'); |
726 | 726 | |
727 | 727 | |
728 | - if (is_array($post_types)){ |
|
728 | + if (is_array($post_types)) { |
|
729 | 729 | |
730 | 730 | foreach ($post_types as $post_type => $args) { |
731 | 731 | |
732 | 732 | |
733 | - if(isset($args['rewrite']['slug'])){ |
|
734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
733 | + if (isset($args['rewrite']['slug'])) { |
|
734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']); |
|
735 | 735 | } |
736 | 736 | |
737 | 737 | $alt_post_types[$post_type] = $args; |
@@ -739,8 +739,8 @@ discard block |
||
739 | 739 | } |
740 | 740 | } |
741 | 741 | |
742 | - if(!empty($alt_post_types)) { |
|
743 | - update_option('geodir_post_types',$alt_post_types); |
|
742 | + if (!empty($alt_post_types)) { |
|
743 | + update_option('geodir_post_types', $alt_post_types); |
|
744 | 744 | } |
745 | 745 | |
746 | 746 | |
@@ -767,8 +767,8 @@ discard block |
||
767 | 767 | // update each GD CTP |
768 | 768 | try { |
769 | 769 | $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
770 | - } catch(Exception $e) { |
|
771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
770 | + } catch (Exception $e) { |
|
771 | + error_log('Error: ' . $e->getMessage()); |
|
772 | 772 | } |
773 | 773 | } |
774 | 774 | } |
@@ -10,46 +10,46 @@ discard block |
||
10 | 10 | global $wpdb; |
11 | 11 | |
12 | 12 | if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) { |
13 | - /** |
|
14 | - * Include custom database table related functions. |
|
15 | - * |
|
16 | - * @since 1.0.0 |
|
17 | - * @package GeoDirectory |
|
18 | - */ |
|
19 | - include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | - add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | - if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | - add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | - } |
|
13 | + /** |
|
14 | + * Include custom database table related functions. |
|
15 | + * |
|
16 | + * @since 1.0.0 |
|
17 | + * @package GeoDirectory |
|
18 | + */ |
|
19 | + include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | + add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | + if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | + add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | + } |
|
24 | 24 | |
25 | - if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | - add_action('init', 'geodir_upgrade_146', 11); |
|
27 | - } |
|
25 | + if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | + add_action('init', 'geodir_upgrade_146', 11); |
|
27 | + } |
|
28 | 28 | |
29 | - if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | - add_action('init', 'geodir_upgrade_148', 11); |
|
31 | - } |
|
29 | + if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | + add_action('init', 'geodir_upgrade_148', 11); |
|
31 | + } |
|
32 | 32 | |
33 | - if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | - add_action('init', 'geodir_upgrade_150', 11); |
|
35 | - } |
|
33 | + if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | + add_action('init', 'geodir_upgrade_150', 11); |
|
35 | + } |
|
36 | 36 | |
37 | - if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | - add_action('init', 'geodir_upgrade_152', 11); |
|
39 | - } |
|
37 | + if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | + add_action('init', 'geodir_upgrade_152', 11); |
|
39 | + } |
|
40 | 40 | |
41 | - if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | - add_action('init', 'geodir_upgrade_153', 11); |
|
43 | - } |
|
41 | + if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | + add_action('init', 'geodir_upgrade_153', 11); |
|
43 | + } |
|
44 | 44 | |
45 | - if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | - add_action('init', 'geodir_upgrade_154', 11); |
|
47 | - } |
|
45 | + if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | + add_action('init', 'geodir_upgrade_154', 11); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
51 | 51 | |
52 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
52 | + update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
53 | 53 | |
54 | 54 | } |
55 | 55 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | */ |
63 | 63 | function geodirectory_upgrade_all() |
64 | 64 | { |
65 | - geodir_create_tables(); |
|
66 | - geodir_update_review_db(); |
|
67 | - gd_install_theme_compat(); |
|
65 | + geodir_create_tables(); |
|
66 | + geodir_update_review_db(); |
|
67 | + gd_install_theme_compat(); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function geodir_upgrade_136() |
77 | 77 | { |
78 | - geodir_fix_review_overall_rating(); |
|
78 | + geodir_fix_review_overall_rating(); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @package GeoDirectory |
86 | 86 | */ |
87 | 87 | function geodir_upgrade_146(){ |
88 | - gd_convert_virtual_pages(); |
|
88 | + gd_convert_virtual_pages(); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @package GeoDirectory |
96 | 96 | */ |
97 | 97 | function geodir_upgrade_150(){ |
98 | - gd_fix_cpt_rewrite_slug(); |
|
98 | + gd_fix_cpt_rewrite_slug(); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | * @package GeoDirectory |
108 | 108 | */ |
109 | 109 | function geodir_upgrade_148(){ |
110 | - /* |
|
110 | + /* |
|
111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
112 | 112 | */ |
113 | - update_option('geodir_ga_pass',''); |
|
114 | - update_option('geodir_ga_user',''); |
|
113 | + update_option('geodir_ga_pass',''); |
|
114 | + update_option('geodir_ga_user',''); |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | * @package GeoDirectory |
124 | 124 | */ |
125 | 125 | function geodir_upgrade_153(){ |
126 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
127 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
126 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
127 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @package GeoDirectory |
135 | 135 | */ |
136 | 136 | function geodir_upgrade_154(){ |
137 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
137 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @package GeoDirectory |
145 | 145 | */ |
146 | 146 | function geodir_upgrade_152(){ |
147 | - gd_fix_address_detail_table_limit(); |
|
147 | + gd_fix_address_detail_table_limit(); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | */ |
159 | 159 | function geodir_update_review_db() |
160 | 160 | { |
161 | - global $wpdb, $plugin_prefix; |
|
161 | + global $wpdb, $plugin_prefix; |
|
162 | 162 | |
163 | - geodir_fix_review_date(); |
|
164 | - geodir_fix_review_post_status(); |
|
165 | - geodir_fix_review_content(); |
|
166 | - geodir_fix_review_location(); |
|
163 | + geodir_fix_review_date(); |
|
164 | + geodir_fix_review_post_status(); |
|
165 | + geodir_fix_review_content(); |
|
166 | + geodir_fix_review_location(); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | |
@@ -176,8 +176,8 @@ discard block |
||
176 | 176 | */ |
177 | 177 | function geodir_fix_review_date() |
178 | 178 | { |
179 | - global $wpdb; |
|
180 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
179 | + global $wpdb; |
|
180 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | */ |
190 | 190 | function geodir_fix_review_post_status() |
191 | 191 | { |
192 | - global $wpdb; |
|
193 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
192 | + global $wpdb; |
|
193 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
@@ -203,12 +203,12 @@ discard block |
||
203 | 203 | */ |
204 | 204 | function geodir_fix_review_content() |
205 | 205 | { |
206 | - global $wpdb; |
|
207 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
208 | - return true; |
|
209 | - } else { |
|
210 | - return false; |
|
211 | - } |
|
206 | + global $wpdb; |
|
207 | + if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
208 | + return true; |
|
209 | + } else { |
|
210 | + return false; |
|
211 | + } |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -221,20 +221,20 @@ discard block |
||
221 | 221 | */ |
222 | 222 | function geodir_fix_review_location() |
223 | 223 | { |
224 | - global $wpdb; |
|
224 | + global $wpdb; |
|
225 | 225 | |
226 | - $all_postypes = geodir_get_posttypes(); |
|
226 | + $all_postypes = geodir_get_posttypes(); |
|
227 | 227 | |
228 | - if (!empty($all_postypes)) { |
|
229 | - foreach ($all_postypes as $key) { |
|
230 | - // update each GD CTP |
|
228 | + if (!empty($all_postypes)) { |
|
229 | + foreach ($all_postypes as $key) { |
|
230 | + // update each GD CTP |
|
231 | 231 | |
232 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
232 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
233 | 233 | |
234 | - } |
|
235 | - return true; |
|
236 | - } |
|
237 | - return false; |
|
234 | + } |
|
235 | + return true; |
|
236 | + } |
|
237 | + return false; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -246,25 +246,25 @@ discard block |
||
246 | 246 | */ |
247 | 247 | function geodir_fix_review_overall_rating() |
248 | 248 | { |
249 | - global $wpdb; |
|
249 | + global $wpdb; |
|
250 | 250 | |
251 | - $all_postypes = geodir_get_posttypes(); |
|
251 | + $all_postypes = geodir_get_posttypes(); |
|
252 | 252 | |
253 | - if (!empty($all_postypes)) { |
|
254 | - foreach ($all_postypes as $key) { |
|
255 | - // update each GD CTP |
|
256 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
253 | + if (!empty($all_postypes)) { |
|
254 | + foreach ($all_postypes as $key) { |
|
255 | + // update each GD CTP |
|
256 | + $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
257 | 257 | |
258 | - if (!empty($reviews)) { |
|
259 | - foreach ($reviews as $post_id) { |
|
260 | - geodir_update_postrating($post_id->post_id, $key); |
|
261 | - } |
|
258 | + if (!empty($reviews)) { |
|
259 | + foreach ($reviews as $post_id) { |
|
260 | + geodir_update_postrating($post_id->post_id, $key); |
|
261 | + } |
|
262 | 262 | |
263 | - } |
|
263 | + } |
|
264 | 264 | |
265 | - } |
|
265 | + } |
|
266 | 266 | |
267 | - } |
|
267 | + } |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
@@ -281,367 +281,367 @@ discard block |
||
281 | 281 | */ |
282 | 282 | function gd_install_theme_compat() |
283 | 283 | { |
284 | - global $wpdb; |
|
284 | + global $wpdb; |
|
285 | 285 | |
286 | - $theme_compat = array(); |
|
287 | - $theme_compat = get_option('gd_theme_compats'); |
|
286 | + $theme_compat = array(); |
|
287 | + $theme_compat = get_option('gd_theme_compats'); |
|
288 | 288 | //GDF |
289 | - $theme_compat['GeoDirectory_Framework'] = array( |
|
290 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
291 | - 'geodir_wrapper_open_class' => '', |
|
292 | - 'geodir_wrapper_open_replace' => '', |
|
293 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
294 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
295 | - 'geodir_wrapper_content_open_class' => '', |
|
296 | - 'geodir_wrapper_content_open_replace' => '', |
|
297 | - 'geodir_wrapper_content_close_replace' => '', |
|
298 | - 'geodir_article_open_id' => '', |
|
299 | - 'geodir_article_open_class' => '', |
|
300 | - 'geodir_article_open_replace' => '', |
|
301 | - 'geodir_article_close_replace' => '', |
|
302 | - 'geodir_sidebar_right_open_id' => '', |
|
303 | - 'geodir_sidebar_right_open_class' => '', |
|
304 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
305 | - 'geodir_sidebar_right_close_replace' => '', |
|
306 | - 'geodir_sidebar_left_open_id' => '', |
|
307 | - 'geodir_sidebar_left_open_class' => '', |
|
308 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
309 | - 'geodir_sidebar_left_close_replace' => '', |
|
310 | - 'geodir_main_content_open_id' => '', |
|
311 | - 'geodir_main_content_open_class' => '', |
|
312 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
313 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
314 | - 'geodir_top_content_add' => '', |
|
315 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
316 | - 'geodir_before_widget_filter' => '', |
|
317 | - 'geodir_after_widget_filter' => '', |
|
318 | - 'geodir_theme_compat_css' => '', |
|
319 | - 'geodir_theme_compat_js' => '', |
|
320 | - 'geodir_theme_compat_default_options' => '', |
|
321 | - 'geodir_theme_compat_code' => '' |
|
322 | - ); |
|
289 | + $theme_compat['GeoDirectory_Framework'] = array( |
|
290 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
291 | + 'geodir_wrapper_open_class' => '', |
|
292 | + 'geodir_wrapper_open_replace' => '', |
|
293 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
294 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
295 | + 'geodir_wrapper_content_open_class' => '', |
|
296 | + 'geodir_wrapper_content_open_replace' => '', |
|
297 | + 'geodir_wrapper_content_close_replace' => '', |
|
298 | + 'geodir_article_open_id' => '', |
|
299 | + 'geodir_article_open_class' => '', |
|
300 | + 'geodir_article_open_replace' => '', |
|
301 | + 'geodir_article_close_replace' => '', |
|
302 | + 'geodir_sidebar_right_open_id' => '', |
|
303 | + 'geodir_sidebar_right_open_class' => '', |
|
304 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
305 | + 'geodir_sidebar_right_close_replace' => '', |
|
306 | + 'geodir_sidebar_left_open_id' => '', |
|
307 | + 'geodir_sidebar_left_open_class' => '', |
|
308 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
309 | + 'geodir_sidebar_left_close_replace' => '', |
|
310 | + 'geodir_main_content_open_id' => '', |
|
311 | + 'geodir_main_content_open_class' => '', |
|
312 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
313 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
314 | + 'geodir_top_content_add' => '', |
|
315 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
316 | + 'geodir_before_widget_filter' => '', |
|
317 | + 'geodir_after_widget_filter' => '', |
|
318 | + 'geodir_theme_compat_css' => '', |
|
319 | + 'geodir_theme_compat_js' => '', |
|
320 | + 'geodir_theme_compat_default_options' => '', |
|
321 | + 'geodir_theme_compat_code' => '' |
|
322 | + ); |
|
323 | 323 | |
324 | 324 | //Directory Theme |
325 | - $theme_compat['Directory_Starter'] = array( |
|
326 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
327 | - 'geodir_wrapper_open_class' => '', |
|
328 | - 'geodir_wrapper_open_replace' => '', |
|
329 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
330 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
331 | - 'geodir_wrapper_content_open_class' => '', |
|
332 | - 'geodir_wrapper_content_open_replace' => '', |
|
333 | - 'geodir_wrapper_content_close_replace' => '', |
|
334 | - 'geodir_article_open_id' => '', |
|
335 | - 'geodir_article_open_class' => '', |
|
336 | - 'geodir_article_open_replace' => '', |
|
337 | - 'geodir_article_close_replace' => '', |
|
338 | - 'geodir_sidebar_right_open_id' => '', |
|
339 | - 'geodir_sidebar_right_open_class' => '', |
|
340 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
341 | - 'geodir_sidebar_right_close_replace' => '', |
|
342 | - 'geodir_sidebar_left_open_id' => '', |
|
343 | - 'geodir_sidebar_left_open_class' => '', |
|
344 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
345 | - 'geodir_sidebar_left_close_replace' => '', |
|
346 | - 'geodir_main_content_open_id' => '', |
|
347 | - 'geodir_main_content_open_class' => '', |
|
348 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
349 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
350 | - 'geodir_top_content_add' => '', |
|
351 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
352 | - 'geodir_before_widget_filter' => '', |
|
353 | - 'geodir_after_widget_filter' => '', |
|
354 | - 'geodir_theme_compat_css' => '', |
|
355 | - 'geodir_theme_compat_js' => '', |
|
356 | - 'geodir_theme_compat_default_options' => '', |
|
357 | - 'geodir_theme_compat_code' => '' |
|
358 | - ); |
|
325 | + $theme_compat['Directory_Starter'] = array( |
|
326 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
327 | + 'geodir_wrapper_open_class' => '', |
|
328 | + 'geodir_wrapper_open_replace' => '', |
|
329 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
330 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
331 | + 'geodir_wrapper_content_open_class' => '', |
|
332 | + 'geodir_wrapper_content_open_replace' => '', |
|
333 | + 'geodir_wrapper_content_close_replace' => '', |
|
334 | + 'geodir_article_open_id' => '', |
|
335 | + 'geodir_article_open_class' => '', |
|
336 | + 'geodir_article_open_replace' => '', |
|
337 | + 'geodir_article_close_replace' => '', |
|
338 | + 'geodir_sidebar_right_open_id' => '', |
|
339 | + 'geodir_sidebar_right_open_class' => '', |
|
340 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
341 | + 'geodir_sidebar_right_close_replace' => '', |
|
342 | + 'geodir_sidebar_left_open_id' => '', |
|
343 | + 'geodir_sidebar_left_open_class' => '', |
|
344 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
345 | + 'geodir_sidebar_left_close_replace' => '', |
|
346 | + 'geodir_main_content_open_id' => '', |
|
347 | + 'geodir_main_content_open_class' => '', |
|
348 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
349 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
350 | + 'geodir_top_content_add' => '', |
|
351 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
352 | + 'geodir_before_widget_filter' => '', |
|
353 | + 'geodir_after_widget_filter' => '', |
|
354 | + 'geodir_theme_compat_css' => '', |
|
355 | + 'geodir_theme_compat_js' => '', |
|
356 | + 'geodir_theme_compat_default_options' => '', |
|
357 | + 'geodir_theme_compat_code' => '' |
|
358 | + ); |
|
359 | 359 | |
360 | 360 | //Jobby |
361 | - $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
361 | + $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
362 | 362 | |
363 | 363 | //GeoProperty |
364 | - $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
364 | + $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
365 | 365 | |
366 | 366 | //Avada |
367 | - $theme_compat['Avada'] = array( |
|
368 | - 'geodir_wrapper_open_id' => '', |
|
369 | - 'geodir_wrapper_open_class' => '', |
|
370 | - 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
371 | - 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
372 | - 'geodir_wrapper_content_open_id' => 'content', |
|
373 | - 'geodir_wrapper_content_open_class' => '', |
|
374 | - 'geodir_wrapper_content_open_replace' => '', |
|
375 | - 'geodir_wrapper_content_close_replace' => '', |
|
376 | - 'geodir_article_open_id' => '', |
|
377 | - 'geodir_article_open_class' => '', |
|
378 | - 'geodir_article_open_replace' => '', |
|
379 | - 'geodir_article_close_replace' => '', |
|
380 | - 'geodir_sidebar_right_open_id' => '', |
|
381 | - 'geodir_sidebar_right_open_class' => '', |
|
382 | - 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
383 | - 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
384 | - 'geodir_sidebar_left_open_id' => '', |
|
385 | - 'geodir_sidebar_left_open_class' => '', |
|
386 | - 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
387 | - 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
388 | - 'geodir_main_content_open_id' => '', |
|
389 | - 'geodir_main_content_open_class' => '', |
|
390 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
391 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
392 | - 'geodir_top_content_add' => '', |
|
393 | - 'geodir_before_main_content_add' => '', |
|
394 | - 'geodir_before_widget_filter' => '', |
|
395 | - 'geodir_after_widget_filter' => '', |
|
396 | - 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
397 | - 'geodir_theme_compat_js' => '', |
|
398 | - 'geodir_theme_compat_default_options' => '', |
|
399 | - 'geodir_theme_compat_code' => 'Avada' |
|
400 | - ); |
|
367 | + $theme_compat['Avada'] = array( |
|
368 | + 'geodir_wrapper_open_id' => '', |
|
369 | + 'geodir_wrapper_open_class' => '', |
|
370 | + 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
371 | + 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
372 | + 'geodir_wrapper_content_open_id' => 'content', |
|
373 | + 'geodir_wrapper_content_open_class' => '', |
|
374 | + 'geodir_wrapper_content_open_replace' => '', |
|
375 | + 'geodir_wrapper_content_close_replace' => '', |
|
376 | + 'geodir_article_open_id' => '', |
|
377 | + 'geodir_article_open_class' => '', |
|
378 | + 'geodir_article_open_replace' => '', |
|
379 | + 'geodir_article_close_replace' => '', |
|
380 | + 'geodir_sidebar_right_open_id' => '', |
|
381 | + 'geodir_sidebar_right_open_class' => '', |
|
382 | + 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
383 | + 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
384 | + 'geodir_sidebar_left_open_id' => '', |
|
385 | + 'geodir_sidebar_left_open_class' => '', |
|
386 | + 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
387 | + 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
388 | + 'geodir_main_content_open_id' => '', |
|
389 | + 'geodir_main_content_open_class' => '', |
|
390 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
391 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
392 | + 'geodir_top_content_add' => '', |
|
393 | + 'geodir_before_main_content_add' => '', |
|
394 | + 'geodir_before_widget_filter' => '', |
|
395 | + 'geodir_after_widget_filter' => '', |
|
396 | + 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
397 | + 'geodir_theme_compat_js' => '', |
|
398 | + 'geodir_theme_compat_default_options' => '', |
|
399 | + 'geodir_theme_compat_code' => 'Avada' |
|
400 | + ); |
|
401 | 401 | |
402 | 402 | //Enfold |
403 | - $theme_compat['Enfold'] = array( |
|
404 | - 'geodir_wrapper_open_id' => '', |
|
405 | - 'geodir_wrapper_open_class' => '', |
|
406 | - 'geodir_wrapper_open_replace' => '', |
|
407 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
408 | - 'geodir_wrapper_content_open_id' => '', |
|
409 | - 'geodir_wrapper_content_open_class' => '', |
|
410 | - 'geodir_wrapper_content_open_replace' => '', |
|
411 | - 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
412 | - 'geodir_article_open_id' => '', |
|
413 | - 'geodir_article_open_class' => '', |
|
414 | - 'geodir_article_open_replace' => '', |
|
415 | - 'geodir_article_close_replace' => '', |
|
416 | - 'geodir_sidebar_right_open_id' => '', |
|
417 | - 'geodir_sidebar_right_open_class' => '', |
|
418 | - 'geodir_sidebar_right_open_replace' => '', |
|
419 | - 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
420 | - 'geodir_sidebar_left_open_id' => '', |
|
421 | - 'geodir_sidebar_left_open_class' => '', |
|
422 | - 'geodir_sidebar_left_open_replace' => '', |
|
423 | - 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
424 | - 'geodir_main_content_open_id' => '', |
|
425 | - 'geodir_main_content_open_class' => '', |
|
426 | - 'geodir_main_content_open_replace' => '', |
|
427 | - 'geodir_main_content_close_replace' => '', |
|
428 | - 'geodir_top_content_add' => '', |
|
429 | - 'geodir_before_main_content_add' => '', |
|
430 | - 'geodir_before_widget_filter' => '', |
|
431 | - 'geodir_after_widget_filter' => '', |
|
432 | - 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
433 | - 'geodir_theme_compat_js' => '', |
|
434 | - 'geodir_theme_compat_default_options' => '', |
|
435 | - 'geodir_theme_compat_code' => 'Enfold' |
|
436 | - ); |
|
403 | + $theme_compat['Enfold'] = array( |
|
404 | + 'geodir_wrapper_open_id' => '', |
|
405 | + 'geodir_wrapper_open_class' => '', |
|
406 | + 'geodir_wrapper_open_replace' => '', |
|
407 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
408 | + 'geodir_wrapper_content_open_id' => '', |
|
409 | + 'geodir_wrapper_content_open_class' => '', |
|
410 | + 'geodir_wrapper_content_open_replace' => '', |
|
411 | + 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
412 | + 'geodir_article_open_id' => '', |
|
413 | + 'geodir_article_open_class' => '', |
|
414 | + 'geodir_article_open_replace' => '', |
|
415 | + 'geodir_article_close_replace' => '', |
|
416 | + 'geodir_sidebar_right_open_id' => '', |
|
417 | + 'geodir_sidebar_right_open_class' => '', |
|
418 | + 'geodir_sidebar_right_open_replace' => '', |
|
419 | + 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
420 | + 'geodir_sidebar_left_open_id' => '', |
|
421 | + 'geodir_sidebar_left_open_class' => '', |
|
422 | + 'geodir_sidebar_left_open_replace' => '', |
|
423 | + 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
424 | + 'geodir_main_content_open_id' => '', |
|
425 | + 'geodir_main_content_open_class' => '', |
|
426 | + 'geodir_main_content_open_replace' => '', |
|
427 | + 'geodir_main_content_close_replace' => '', |
|
428 | + 'geodir_top_content_add' => '', |
|
429 | + 'geodir_before_main_content_add' => '', |
|
430 | + 'geodir_before_widget_filter' => '', |
|
431 | + 'geodir_after_widget_filter' => '', |
|
432 | + 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
433 | + 'geodir_theme_compat_js' => '', |
|
434 | + 'geodir_theme_compat_default_options' => '', |
|
435 | + 'geodir_theme_compat_code' => 'Enfold' |
|
436 | + ); |
|
437 | 437 | |
438 | 438 | // X |
439 | - $theme_compat['X'] = array( |
|
440 | - 'geodir_wrapper_open_id' => '', |
|
441 | - 'geodir_wrapper_open_class' => '', |
|
442 | - 'geodir_wrapper_open_replace' => '', |
|
443 | - 'geodir_wrapper_close_replace' => '', |
|
444 | - 'geodir_wrapper_content_open_id' => '', |
|
445 | - 'geodir_wrapper_content_open_class' => '', |
|
446 | - 'geodir_wrapper_content_open_replace' => '', |
|
447 | - 'geodir_wrapper_content_close_replace' => '', |
|
448 | - 'geodir_article_open_id' => '', |
|
449 | - 'geodir_article_open_class' => '', |
|
450 | - 'geodir_article_open_replace' => '', |
|
451 | - 'geodir_article_close_replace' => '', |
|
452 | - 'geodir_sidebar_right_open_id' => '', |
|
453 | - 'geodir_sidebar_right_open_class' => '', |
|
454 | - 'geodir_sidebar_right_open_replace' => '', |
|
455 | - 'geodir_sidebar_right_close_replace' => '', |
|
456 | - 'geodir_sidebar_left_open_id' => '', |
|
457 | - 'geodir_sidebar_left_open_class' => '', |
|
458 | - 'geodir_sidebar_left_open_replace' => '', |
|
459 | - 'geodir_sidebar_left_close_replace' => '', |
|
460 | - 'geodir_main_content_open_id' => '', |
|
461 | - 'geodir_main_content_open_class' => '', |
|
462 | - 'geodir_main_content_open_replace' => '', |
|
463 | - 'geodir_main_content_close_replace' => '', |
|
464 | - 'geodir_top_content_add' => '', |
|
465 | - 'geodir_before_main_content_add' => '', |
|
466 | - 'geodir_before_widget_filter' => '', |
|
467 | - 'geodir_after_widget_filter' => '', |
|
468 | - 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
469 | - 'geodir_theme_compat_js' => '', |
|
470 | - 'geodir_theme_compat_default_options' => '', |
|
471 | - 'geodir_theme_compat_code' => 'X' |
|
472 | - ); |
|
439 | + $theme_compat['X'] = array( |
|
440 | + 'geodir_wrapper_open_id' => '', |
|
441 | + 'geodir_wrapper_open_class' => '', |
|
442 | + 'geodir_wrapper_open_replace' => '', |
|
443 | + 'geodir_wrapper_close_replace' => '', |
|
444 | + 'geodir_wrapper_content_open_id' => '', |
|
445 | + 'geodir_wrapper_content_open_class' => '', |
|
446 | + 'geodir_wrapper_content_open_replace' => '', |
|
447 | + 'geodir_wrapper_content_close_replace' => '', |
|
448 | + 'geodir_article_open_id' => '', |
|
449 | + 'geodir_article_open_class' => '', |
|
450 | + 'geodir_article_open_replace' => '', |
|
451 | + 'geodir_article_close_replace' => '', |
|
452 | + 'geodir_sidebar_right_open_id' => '', |
|
453 | + 'geodir_sidebar_right_open_class' => '', |
|
454 | + 'geodir_sidebar_right_open_replace' => '', |
|
455 | + 'geodir_sidebar_right_close_replace' => '', |
|
456 | + 'geodir_sidebar_left_open_id' => '', |
|
457 | + 'geodir_sidebar_left_open_class' => '', |
|
458 | + 'geodir_sidebar_left_open_replace' => '', |
|
459 | + 'geodir_sidebar_left_close_replace' => '', |
|
460 | + 'geodir_main_content_open_id' => '', |
|
461 | + 'geodir_main_content_open_class' => '', |
|
462 | + 'geodir_main_content_open_replace' => '', |
|
463 | + 'geodir_main_content_close_replace' => '', |
|
464 | + 'geodir_top_content_add' => '', |
|
465 | + 'geodir_before_main_content_add' => '', |
|
466 | + 'geodir_before_widget_filter' => '', |
|
467 | + 'geodir_after_widget_filter' => '', |
|
468 | + 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
469 | + 'geodir_theme_compat_js' => '', |
|
470 | + 'geodir_theme_compat_default_options' => '', |
|
471 | + 'geodir_theme_compat_code' => 'X' |
|
472 | + ); |
|
473 | 473 | |
474 | 474 | // Divi |
475 | - $theme_compat['Divi'] = array( |
|
476 | - 'geodir_wrapper_open_id' => 'main-content', |
|
477 | - 'geodir_wrapper_open_class' => '', |
|
478 | - 'geodir_wrapper_open_replace' => '', |
|
479 | - 'geodir_wrapper_close_replace' => '', |
|
480 | - 'geodir_wrapper_content_open_id' => 'left-area', |
|
481 | - 'geodir_wrapper_content_open_class' => '', |
|
482 | - 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
483 | - 'geodir_wrapper_content_close_replace' => '', |
|
484 | - 'geodir_article_open_id' => '', |
|
485 | - 'geodir_article_open_class' => '', |
|
486 | - 'geodir_article_open_replace' => '', |
|
487 | - 'geodir_article_close_replace' => '', |
|
488 | - 'geodir_sidebar_right_open_id' => 'sidebar', |
|
489 | - 'geodir_sidebar_right_open_class' => '', |
|
490 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
491 | - 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
492 | - 'geodir_sidebar_left_open_id' => 'sidebar', |
|
493 | - 'geodir_sidebar_left_open_class' => '', |
|
494 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
495 | - 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
496 | - 'geodir_main_content_open_id' => '', |
|
497 | - 'geodir_main_content_open_class' => '', |
|
498 | - 'geodir_main_content_open_replace' => '', |
|
499 | - 'geodir_main_content_close_replace' => '', |
|
500 | - 'geodir_top_content_add' => '', |
|
501 | - 'geodir_before_main_content_add' => '', |
|
502 | - 'geodir_before_widget_filter' => '', |
|
503 | - 'geodir_after_widget_filter' => '', |
|
504 | - 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
505 | - 'geodir_theme_compat_js' => '', |
|
506 | - 'geodir_theme_compat_default_options' => '', |
|
507 | - 'geodir_theme_compat_code' => 'Divi' |
|
508 | - ); |
|
475 | + $theme_compat['Divi'] = array( |
|
476 | + 'geodir_wrapper_open_id' => 'main-content', |
|
477 | + 'geodir_wrapper_open_class' => '', |
|
478 | + 'geodir_wrapper_open_replace' => '', |
|
479 | + 'geodir_wrapper_close_replace' => '', |
|
480 | + 'geodir_wrapper_content_open_id' => 'left-area', |
|
481 | + 'geodir_wrapper_content_open_class' => '', |
|
482 | + 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
483 | + 'geodir_wrapper_content_close_replace' => '', |
|
484 | + 'geodir_article_open_id' => '', |
|
485 | + 'geodir_article_open_class' => '', |
|
486 | + 'geodir_article_open_replace' => '', |
|
487 | + 'geodir_article_close_replace' => '', |
|
488 | + 'geodir_sidebar_right_open_id' => 'sidebar', |
|
489 | + 'geodir_sidebar_right_open_class' => '', |
|
490 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
491 | + 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
492 | + 'geodir_sidebar_left_open_id' => 'sidebar', |
|
493 | + 'geodir_sidebar_left_open_class' => '', |
|
494 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
495 | + 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
496 | + 'geodir_main_content_open_id' => '', |
|
497 | + 'geodir_main_content_open_class' => '', |
|
498 | + 'geodir_main_content_open_replace' => '', |
|
499 | + 'geodir_main_content_close_replace' => '', |
|
500 | + 'geodir_top_content_add' => '', |
|
501 | + 'geodir_before_main_content_add' => '', |
|
502 | + 'geodir_before_widget_filter' => '', |
|
503 | + 'geodir_after_widget_filter' => '', |
|
504 | + 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
505 | + 'geodir_theme_compat_js' => '', |
|
506 | + 'geodir_theme_compat_default_options' => '', |
|
507 | + 'geodir_theme_compat_code' => 'Divi' |
|
508 | + ); |
|
509 | 509 | |
510 | 510 | // Genesis |
511 | - $theme_compat['Genesis'] = array( |
|
512 | - 'geodir_wrapper_open_id' => '', |
|
513 | - 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
514 | - 'geodir_wrapper_open_replace' => '', |
|
515 | - 'geodir_wrapper_close_replace' => '', |
|
516 | - 'geodir_wrapper_content_open_id' => '', |
|
517 | - 'geodir_wrapper_content_open_class' => 'content', |
|
518 | - 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
519 | - 'geodir_wrapper_content_close_replace' => '', |
|
520 | - 'geodir_article_open_id' => '', |
|
521 | - 'geodir_article_open_class' => '', |
|
522 | - 'geodir_article_open_replace' => '', |
|
523 | - 'geodir_article_close_replace' => '', |
|
524 | - 'geodir_sidebar_right_open_id' => '', |
|
525 | - 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
526 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
527 | - 'geodir_sidebar_right_close_replace' => '', |
|
528 | - 'geodir_sidebar_left_open_id' => '', |
|
529 | - 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
530 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
531 | - 'geodir_sidebar_left_close_replace' => '', |
|
532 | - 'geodir_main_content_open_id' => '', |
|
533 | - 'geodir_main_content_open_class' => '', |
|
534 | - 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
535 | - 'geodir_main_content_close_replace' => '', |
|
536 | - 'geodir_top_content_add' => '', |
|
537 | - 'geodir_before_main_content_add' => '', |
|
538 | - 'geodir_before_widget_filter' => '', |
|
539 | - 'geodir_after_widget_filter' => '', |
|
540 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
541 | - 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
542 | - 'geodir_theme_compat_js' => '', |
|
543 | - 'geodir_theme_compat_default_options' => '', |
|
544 | - 'geodir_theme_compat_code' => 'Genesis' |
|
545 | - ); |
|
511 | + $theme_compat['Genesis'] = array( |
|
512 | + 'geodir_wrapper_open_id' => '', |
|
513 | + 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
514 | + 'geodir_wrapper_open_replace' => '', |
|
515 | + 'geodir_wrapper_close_replace' => '', |
|
516 | + 'geodir_wrapper_content_open_id' => '', |
|
517 | + 'geodir_wrapper_content_open_class' => 'content', |
|
518 | + 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
519 | + 'geodir_wrapper_content_close_replace' => '', |
|
520 | + 'geodir_article_open_id' => '', |
|
521 | + 'geodir_article_open_class' => '', |
|
522 | + 'geodir_article_open_replace' => '', |
|
523 | + 'geodir_article_close_replace' => '', |
|
524 | + 'geodir_sidebar_right_open_id' => '', |
|
525 | + 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
526 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
527 | + 'geodir_sidebar_right_close_replace' => '', |
|
528 | + 'geodir_sidebar_left_open_id' => '', |
|
529 | + 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
530 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
531 | + 'geodir_sidebar_left_close_replace' => '', |
|
532 | + 'geodir_main_content_open_id' => '', |
|
533 | + 'geodir_main_content_open_class' => '', |
|
534 | + 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
535 | + 'geodir_main_content_close_replace' => '', |
|
536 | + 'geodir_top_content_add' => '', |
|
537 | + 'geodir_before_main_content_add' => '', |
|
538 | + 'geodir_before_widget_filter' => '', |
|
539 | + 'geodir_after_widget_filter' => '', |
|
540 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
541 | + 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
542 | + 'geodir_theme_compat_js' => '', |
|
543 | + 'geodir_theme_compat_default_options' => '', |
|
544 | + 'geodir_theme_compat_code' => 'Genesis' |
|
545 | + ); |
|
546 | 546 | |
547 | 547 | // Jupiter |
548 | - $theme_compat['Jupiter'] = array( |
|
549 | - 'geodir_wrapper_open_id' => '', |
|
550 | - 'geodir_wrapper_open_class' => '', |
|
551 | - 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
552 | - 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
553 | - 'geodir_wrapper_content_open_id' => '', |
|
554 | - 'geodir_wrapper_content_open_class' => '', |
|
555 | - 'geodir_wrapper_content_open_replace' => '', |
|
556 | - 'geodir_wrapper_content_close_replace' => '', |
|
557 | - 'geodir_article_open_id' => '', |
|
558 | - 'geodir_article_open_class' => '', |
|
559 | - 'geodir_article_open_replace' => '', |
|
560 | - 'geodir_article_close_replace' => '', |
|
561 | - 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
562 | - 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
563 | - 'geodir_sidebar_right_open_replace' => '', |
|
564 | - 'geodir_sidebar_right_close_replace' => '', |
|
565 | - 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
566 | - 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
567 | - 'geodir_sidebar_left_open_replace' => '', |
|
568 | - 'geodir_sidebar_left_close_replace' => '', |
|
569 | - 'geodir_main_content_open_id' => '', |
|
570 | - 'geodir_main_content_open_class' => '', |
|
571 | - 'geodir_main_content_open_replace' => '', |
|
572 | - 'geodir_main_content_close_replace' => '', |
|
573 | - 'geodir_top_content_add' => '', |
|
574 | - 'geodir_before_main_content_add' => '', |
|
575 | - 'geodir_before_widget_filter' => '', |
|
576 | - 'geodir_after_widget_filter' => '', |
|
577 | - 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
578 | - 'geodir_after_title_filter' => '', |
|
579 | - 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
580 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
581 | - 'geodir_sub_menu_li_class_filter' => '', |
|
582 | - 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
583 | - 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
584 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
585 | - 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
586 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
587 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
588 | - 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
589 | - 'geodir_theme_compat_js' => '', |
|
590 | - 'geodir_theme_compat_default_options' => '', |
|
591 | - 'geodir_theme_compat_code' => 'Jupiter' |
|
592 | - ); |
|
548 | + $theme_compat['Jupiter'] = array( |
|
549 | + 'geodir_wrapper_open_id' => '', |
|
550 | + 'geodir_wrapper_open_class' => '', |
|
551 | + 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
552 | + 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
553 | + 'geodir_wrapper_content_open_id' => '', |
|
554 | + 'geodir_wrapper_content_open_class' => '', |
|
555 | + 'geodir_wrapper_content_open_replace' => '', |
|
556 | + 'geodir_wrapper_content_close_replace' => '', |
|
557 | + 'geodir_article_open_id' => '', |
|
558 | + 'geodir_article_open_class' => '', |
|
559 | + 'geodir_article_open_replace' => '', |
|
560 | + 'geodir_article_close_replace' => '', |
|
561 | + 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
562 | + 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
563 | + 'geodir_sidebar_right_open_replace' => '', |
|
564 | + 'geodir_sidebar_right_close_replace' => '', |
|
565 | + 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
566 | + 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
567 | + 'geodir_sidebar_left_open_replace' => '', |
|
568 | + 'geodir_sidebar_left_close_replace' => '', |
|
569 | + 'geodir_main_content_open_id' => '', |
|
570 | + 'geodir_main_content_open_class' => '', |
|
571 | + 'geodir_main_content_open_replace' => '', |
|
572 | + 'geodir_main_content_close_replace' => '', |
|
573 | + 'geodir_top_content_add' => '', |
|
574 | + 'geodir_before_main_content_add' => '', |
|
575 | + 'geodir_before_widget_filter' => '', |
|
576 | + 'geodir_after_widget_filter' => '', |
|
577 | + 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
578 | + 'geodir_after_title_filter' => '', |
|
579 | + 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
580 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
581 | + 'geodir_sub_menu_li_class_filter' => '', |
|
582 | + 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
583 | + 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
584 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
585 | + 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
586 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
587 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
588 | + 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
589 | + 'geodir_theme_compat_js' => '', |
|
590 | + 'geodir_theme_compat_default_options' => '', |
|
591 | + 'geodir_theme_compat_code' => 'Jupiter' |
|
592 | + ); |
|
593 | 593 | |
594 | 594 | // Multi News |
595 | - $theme_compat['Multi_News'] = array( |
|
596 | - 'geodir_wrapper_open_id' => '', |
|
597 | - 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
598 | - 'geodir_wrapper_open_replace' => '', |
|
599 | - 'geodir_wrapper_close_replace' => '', |
|
600 | - 'geodir_wrapper_content_open_id' => '', |
|
601 | - 'geodir_wrapper_content_open_class' => '', |
|
602 | - 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
603 | - 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
604 | - 'geodir_article_open_id' => '', |
|
605 | - 'geodir_article_open_class' => '', |
|
606 | - 'geodir_article_open_replace' => '', |
|
607 | - 'geodir_article_close_replace' => '', |
|
608 | - 'geodir_sidebar_right_open_id' => '', |
|
609 | - 'geodir_sidebar_right_open_class' => '', |
|
610 | - 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
611 | - 'geodir_sidebar_right_close_replace' => '', |
|
612 | - 'geodir_sidebar_left_open_id' => '', |
|
613 | - 'geodir_sidebar_left_open_class' => '', |
|
614 | - 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
615 | - 'geodir_sidebar_left_close_replace' => '', |
|
616 | - 'geodir_main_content_open_id' => '', |
|
617 | - 'geodir_main_content_open_class' => '', |
|
618 | - 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
619 | - 'geodir_main_content_close_replace' => '</div>', |
|
620 | - 'geodir_top_content_add' => '', |
|
621 | - 'geodir_before_main_content_add' => '', |
|
622 | - 'geodir_full_page_class_filter' => 'section full-width-section', |
|
623 | - 'geodir_before_widget_filter' => '', |
|
624 | - 'geodir_after_widget_filter' => '', |
|
625 | - 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
626 | - 'geodir_after_title_filter' => '</h2></div>', |
|
627 | - 'geodir_menu_li_class_filter' => '', |
|
628 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
629 | - 'geodir_sub_menu_li_class_filter' => '', |
|
630 | - 'geodir_menu_a_class_filter' => '', |
|
631 | - 'geodir_sub_menu_a_class_filter' => '', |
|
632 | - 'geodir_location_switcher_menu_li_class_filter' => '', |
|
633 | - 'geodir_location_switcher_menu_a_class_filter' => '', |
|
634 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
635 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
636 | - 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
637 | - 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
638 | - 'geodir_theme_compat_default_options' => '', |
|
639 | - 'geodir_theme_compat_code' => 'Multi_News' |
|
640 | - ); |
|
641 | - |
|
642 | - update_option('gd_theme_compats', $theme_compat); |
|
643 | - |
|
644 | - gd_set_theme_compat();// set the compat pack if avail |
|
595 | + $theme_compat['Multi_News'] = array( |
|
596 | + 'geodir_wrapper_open_id' => '', |
|
597 | + 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
598 | + 'geodir_wrapper_open_replace' => '', |
|
599 | + 'geodir_wrapper_close_replace' => '', |
|
600 | + 'geodir_wrapper_content_open_id' => '', |
|
601 | + 'geodir_wrapper_content_open_class' => '', |
|
602 | + 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
603 | + 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
604 | + 'geodir_article_open_id' => '', |
|
605 | + 'geodir_article_open_class' => '', |
|
606 | + 'geodir_article_open_replace' => '', |
|
607 | + 'geodir_article_close_replace' => '', |
|
608 | + 'geodir_sidebar_right_open_id' => '', |
|
609 | + 'geodir_sidebar_right_open_class' => '', |
|
610 | + 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
611 | + 'geodir_sidebar_right_close_replace' => '', |
|
612 | + 'geodir_sidebar_left_open_id' => '', |
|
613 | + 'geodir_sidebar_left_open_class' => '', |
|
614 | + 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
615 | + 'geodir_sidebar_left_close_replace' => '', |
|
616 | + 'geodir_main_content_open_id' => '', |
|
617 | + 'geodir_main_content_open_class' => '', |
|
618 | + 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
619 | + 'geodir_main_content_close_replace' => '</div>', |
|
620 | + 'geodir_top_content_add' => '', |
|
621 | + 'geodir_before_main_content_add' => '', |
|
622 | + 'geodir_full_page_class_filter' => 'section full-width-section', |
|
623 | + 'geodir_before_widget_filter' => '', |
|
624 | + 'geodir_after_widget_filter' => '', |
|
625 | + 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
626 | + 'geodir_after_title_filter' => '</h2></div>', |
|
627 | + 'geodir_menu_li_class_filter' => '', |
|
628 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
629 | + 'geodir_sub_menu_li_class_filter' => '', |
|
630 | + 'geodir_menu_a_class_filter' => '', |
|
631 | + 'geodir_sub_menu_a_class_filter' => '', |
|
632 | + 'geodir_location_switcher_menu_li_class_filter' => '', |
|
633 | + 'geodir_location_switcher_menu_a_class_filter' => '', |
|
634 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
635 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
636 | + 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
637 | + 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
638 | + 'geodir_theme_compat_default_options' => '', |
|
639 | + 'geodir_theme_compat_code' => 'Multi_News' |
|
640 | + ); |
|
641 | + |
|
642 | + update_option('gd_theme_compats', $theme_compat); |
|
643 | + |
|
644 | + gd_set_theme_compat();// set the compat pack if avail |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | |
@@ -653,61 +653,61 @@ discard block |
||
653 | 653 | * @global object $wpdb WordPress Database object. |
654 | 654 | */ |
655 | 655 | function gd_convert_virtual_pages(){ |
656 | - global $wpdb; |
|
657 | - |
|
658 | - // Update the add listing page settings |
|
659 | - $add_listing_page = $wpdb->get_var( |
|
660 | - $wpdb->prepare( |
|
661 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
662 | - array('add-listing') |
|
663 | - ) |
|
664 | - ); |
|
665 | - |
|
666 | - if($add_listing_page){ |
|
667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
669 | - } |
|
670 | - |
|
671 | - // Update the listing preview page settings |
|
672 | - $listing_preview_page = $wpdb->get_var( |
|
673 | - $wpdb->prepare( |
|
674 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
675 | - array('listing-preview') |
|
676 | - ) |
|
677 | - ); |
|
678 | - |
|
679 | - if($listing_preview_page){ |
|
680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
682 | - } |
|
683 | - |
|
684 | - // Update the listing success page settings |
|
685 | - $listing_success_page = $wpdb->get_var( |
|
686 | - $wpdb->prepare( |
|
687 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
688 | - array('listing-success') |
|
689 | - ) |
|
690 | - ); |
|
691 | - |
|
692 | - if($listing_success_page){ |
|
693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
695 | - } |
|
696 | - |
|
697 | - // Update the listing success page settings |
|
698 | - $location_page = $wpdb->get_var( |
|
699 | - $wpdb->prepare( |
|
700 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
701 | - array('location') |
|
702 | - ) |
|
703 | - ); |
|
704 | - |
|
705 | - if($location_page){ |
|
706 | - $location_slug = get_option('geodir_location_prefix'); |
|
707 | - if(!$location_slug ){$location_slug = 'location';} |
|
708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
709 | - update_option( 'geodir_location_page', $location_page); |
|
710 | - } |
|
656 | + global $wpdb; |
|
657 | + |
|
658 | + // Update the add listing page settings |
|
659 | + $add_listing_page = $wpdb->get_var( |
|
660 | + $wpdb->prepare( |
|
661 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
662 | + array('add-listing') |
|
663 | + ) |
|
664 | + ); |
|
665 | + |
|
666 | + if($add_listing_page){ |
|
667 | + wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
668 | + update_option( 'geodir_add_listing_page', $add_listing_page); |
|
669 | + } |
|
670 | + |
|
671 | + // Update the listing preview page settings |
|
672 | + $listing_preview_page = $wpdb->get_var( |
|
673 | + $wpdb->prepare( |
|
674 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
675 | + array('listing-preview') |
|
676 | + ) |
|
677 | + ); |
|
678 | + |
|
679 | + if($listing_preview_page){ |
|
680 | + wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
681 | + update_option( 'geodir_preview_page', $listing_preview_page); |
|
682 | + } |
|
683 | + |
|
684 | + // Update the listing success page settings |
|
685 | + $listing_success_page = $wpdb->get_var( |
|
686 | + $wpdb->prepare( |
|
687 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
688 | + array('listing-success') |
|
689 | + ) |
|
690 | + ); |
|
691 | + |
|
692 | + if($listing_success_page){ |
|
693 | + wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
694 | + update_option( 'geodir_success_page', $listing_success_page); |
|
695 | + } |
|
696 | + |
|
697 | + // Update the listing success page settings |
|
698 | + $location_page = $wpdb->get_var( |
|
699 | + $wpdb->prepare( |
|
700 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
701 | + array('location') |
|
702 | + ) |
|
703 | + ); |
|
704 | + |
|
705 | + if($location_page){ |
|
706 | + $location_slug = get_option('geodir_location_prefix'); |
|
707 | + if(!$location_slug ){$location_slug = 'location';} |
|
708 | + wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
709 | + update_option( 'geodir_location_page', $location_page); |
|
710 | + } |
|
711 | 711 | |
712 | 712 | } |
713 | 713 | |
@@ -721,31 +721,31 @@ discard block |
||
721 | 721 | function gd_fix_cpt_rewrite_slug() |
722 | 722 | { |
723 | 723 | |
724 | - $alt_post_types = array(); |
|
725 | - $post_types = get_option('geodir_post_types'); |
|
724 | + $alt_post_types = array(); |
|
725 | + $post_types = get_option('geodir_post_types'); |
|
726 | 726 | |
727 | 727 | |
728 | - if (is_array($post_types)){ |
|
728 | + if (is_array($post_types)){ |
|
729 | 729 | |
730 | - foreach ($post_types as $post_type => $args) { |
|
730 | + foreach ($post_types as $post_type => $args) { |
|
731 | 731 | |
732 | 732 | |
733 | - if(isset($args['rewrite']['slug'])){ |
|
734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
735 | - } |
|
733 | + if(isset($args['rewrite']['slug'])){ |
|
734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
735 | + } |
|
736 | 736 | |
737 | - $alt_post_types[$post_type] = $args; |
|
737 | + $alt_post_types[$post_type] = $args; |
|
738 | 738 | |
739 | - } |
|
740 | - } |
|
739 | + } |
|
740 | + } |
|
741 | 741 | |
742 | - if(!empty($alt_post_types)) { |
|
743 | - update_option('geodir_post_types',$alt_post_types); |
|
744 | - } |
|
742 | + if(!empty($alt_post_types)) { |
|
743 | + update_option('geodir_post_types',$alt_post_types); |
|
744 | + } |
|
745 | 745 | |
746 | 746 | |
747 | - // flush the rewrite rules |
|
748 | - flush_rewrite_rules(); |
|
747 | + // flush the rewrite rules |
|
748 | + flush_rewrite_rules(); |
|
749 | 749 | } |
750 | 750 | |
751 | 751 | |
@@ -758,18 +758,18 @@ discard block |
||
758 | 758 | */ |
759 | 759 | function gd_fix_address_detail_table_limit() |
760 | 760 | { |
761 | - global $wpdb; |
|
762 | - |
|
763 | - $all_postypes = geodir_get_posttypes(); |
|
764 | - |
|
765 | - if (!empty($all_postypes)) { |
|
766 | - foreach ($all_postypes as $key) { |
|
767 | - // update each GD CTP |
|
768 | - try { |
|
769 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
770 | - } catch(Exception $e) { |
|
771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
772 | - } |
|
773 | - } |
|
774 | - } |
|
761 | + global $wpdb; |
|
762 | + |
|
763 | + $all_postypes = geodir_get_posttypes(); |
|
764 | + |
|
765 | + if (!empty($all_postypes)) { |
|
766 | + foreach ($all_postypes as $key) { |
|
767 | + // update each GD CTP |
|
768 | + try { |
|
769 | + $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
770 | + } catch(Exception $e) { |
|
771 | + error_log( 'Error: ' . $e->getMessage() ); |
|
772 | + } |
|
773 | + } |
|
774 | + } |
|
775 | 775 | } |
@@ -6,26 +6,26 @@ discard block |
||
6 | 6 | * @package GeoDirectory |
7 | 7 | */ |
8 | 8 | if (!function_exists('geodir_create_tables')) { |
9 | - /** |
|
10 | - * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | - * |
|
12 | - * @since 1.0.0 |
|
13 | - * @package GeoDirectory |
|
14 | - * @global object $wpdb WordPress Database object. |
|
15 | - * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | - */ |
|
17 | - function geodir_create_tables() |
|
18 | - { |
|
19 | - |
|
20 | - global $wpdb, $plugin_prefix; |
|
21 | - |
|
22 | - $wpdb->hide_errors(); |
|
23 | - |
|
24 | - $collate = ''; |
|
25 | - if ($wpdb->has_cap('collation')) { |
|
26 | - if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | - if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
28 | - } |
|
9 | + /** |
|
10 | + * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | + * |
|
12 | + * @since 1.0.0 |
|
13 | + * @package GeoDirectory |
|
14 | + * @global object $wpdb WordPress Database object. |
|
15 | + * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | + */ |
|
17 | + function geodir_create_tables() |
|
18 | + { |
|
19 | + |
|
20 | + global $wpdb, $plugin_prefix; |
|
21 | + |
|
22 | + $wpdb->hide_errors(); |
|
23 | + |
|
24 | + $collate = ''; |
|
25 | + if ($wpdb->has_cap('collation')) { |
|
26 | + if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | + if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Include any functions needed for upgrades. |
@@ -36,31 +36,31 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | // rename tables if we need to |
39 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
40 | - $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
41 | - } |
|
42 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
43 | - $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
44 | - } |
|
45 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
46 | - $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
47 | - } |
|
48 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
49 | - $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
50 | - } |
|
51 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
52 | - $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
53 | - } |
|
54 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
55 | - $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
56 | - } |
|
57 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
58 | - $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
59 | - } |
|
60 | - |
|
61 | - |
|
62 | - // Table for storing Countries |
|
63 | - $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
39 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
40 | + $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
41 | + } |
|
42 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
43 | + $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
44 | + } |
|
45 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
46 | + $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
47 | + } |
|
48 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
49 | + $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
50 | + } |
|
51 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
52 | + $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
53 | + } |
|
54 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
55 | + $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
56 | + } |
|
57 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
58 | + $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
59 | + } |
|
60 | + |
|
61 | + |
|
62 | + // Table for storing Countries |
|
63 | + $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
64 | 64 | CountryId smallint AUTO_INCREMENT NOT NULL , |
65 | 65 | Country varchar (50) NOT NULL , |
66 | 66 | FIPS104 varchar (2) NOT NULL , |
@@ -79,21 +79,21 @@ discard block |
||
79 | 79 | Comment varchar (255) NULL , |
80 | 80 | PRIMARY KEY (CountryId)) $collate "; |
81 | 81 | |
82 | - /** |
|
83 | - * Filter the SQL query that creates/updates the country DB table structure. |
|
84 | - * |
|
85 | - * @since 1.0.0 |
|
86 | - * @param string $sql The SQL insert query string. |
|
87 | - */ |
|
88 | - $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
89 | - dbDelta($GEODIR_COUNTRIES_TABLE); |
|
82 | + /** |
|
83 | + * Filter the SQL query that creates/updates the country DB table structure. |
|
84 | + * |
|
85 | + * @since 1.0.0 |
|
86 | + * @param string $sql The SQL insert query string. |
|
87 | + */ |
|
88 | + $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
89 | + dbDelta($GEODIR_COUNTRIES_TABLE); |
|
90 | 90 | |
91 | 91 | |
92 | - $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
92 | + $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
93 | 93 | |
94 | - if ($country_table_empty == 0) { |
|
94 | + if ($country_table_empty == 0) { |
|
95 | 95 | |
96 | - $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
96 | + $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
97 | 97 | (1, 'Afghanistan', 'AF', 'AF', 'AFG', '4', 'AF', 'Kabul ', 'Asia ', 'Afghan', 'Afghans', 'Afghani ', 'AFA', 26813057, 'Afghanistan', ''), |
98 | 98 | (2, 'Albania', 'AL', 'AL', 'ALB', '8', 'AL', 'Tirana ', 'Europe ', 'Albanian', 'Albanians', 'Lek ', 'ALL', 3510484, 'Albania', ''), |
99 | 99 | (3, 'Algeria', 'AG', 'DZ', 'DZA', '12', 'DZ', 'Algiers ', 'Africa ', 'Algerian', 'Algerians', 'Algerian Dinar ', 'DZD', 31736053, 'Algeria', ''), |
@@ -367,21 +367,21 @@ discard block |
||
367 | 367 | (276, 'Curaçao', 'UC', 'CW', 'CUW', '531', 'CW', 'Willemstad ', 'Central America and the Caribbean', 'Curaçaoan', 'Curaçaoans', 'Netherlands Antillean guilder', 'ANG', 152760, 'Curaçao', ''), |
368 | 368 | (277, 'Caribbean Netherlands', '--', 'BQ', 'BES', '535', 'BQ', '--', 'Central America and the Caribbean', '--', '--', 'United States dollar', 'USD', 21133, 'Caribbean Netherlands', '')"; |
369 | 369 | |
370 | - /** |
|
371 | - * Filter the SQL query that inserts the country DB table data. |
|
372 | - * |
|
373 | - * @since 1.0.0 |
|
374 | - * @param string $sql The SQL insert query string. |
|
375 | - */ |
|
376 | - $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
377 | - $wpdb->query($countries_insert); |
|
370 | + /** |
|
371 | + * Filter the SQL query that inserts the country DB table data. |
|
372 | + * |
|
373 | + * @since 1.0.0 |
|
374 | + * @param string $sql The SQL insert query string. |
|
375 | + */ |
|
376 | + $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
377 | + $wpdb->query($countries_insert); |
|
378 | 378 | |
379 | - } |
|
379 | + } |
|
380 | 380 | |
381 | 381 | |
382 | - // Table for storing location attribute - these are user defined |
|
382 | + // Table for storing location attribute - these are user defined |
|
383 | 383 | |
384 | - $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
384 | + $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
385 | 385 | id int NOT NULL AUTO_INCREMENT, |
386 | 386 | post_id int( 10 ) NOT NULL, |
387 | 387 | post_title varchar(254) NOT NULL, |
@@ -390,19 +390,19 @@ discard block |
||
390 | 390 | PRIMARY KEY (id) |
391 | 391 | ) $collate "; |
392 | 392 | |
393 | - /** |
|
394 | - * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
395 | - * |
|
396 | - * @since 1.0.0 |
|
397 | - * @param string $sql The SQL insert query string. |
|
398 | - */ |
|
399 | - $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
393 | + /** |
|
394 | + * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
395 | + * |
|
396 | + * @since 1.0.0 |
|
397 | + * @param string $sql The SQL insert query string. |
|
398 | + */ |
|
399 | + $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
400 | 400 | |
401 | - dbDelta($icon_table); |
|
401 | + dbDelta($icon_table); |
|
402 | 402 | |
403 | - // Table for storing post custom fields - these are user defined |
|
403 | + // Table for storing post custom fields - these are user defined |
|
404 | 404 | |
405 | - $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
405 | + $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
406 | 406 | id int(11) NOT NULL AUTO_INCREMENT, |
407 | 407 | post_type varchar(100) NULL, |
408 | 408 | data_type varchar(100) NULL DEFAULT NULL, |
@@ -436,18 +436,18 @@ discard block |
||
436 | 436 | PRIMARY KEY (id) |
437 | 437 | ) $collate"; |
438 | 438 | |
439 | - /** |
|
440 | - * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
441 | - * |
|
442 | - * @since 1.0.0 |
|
443 | - * @param string $sql The SQL insert query string. |
|
444 | - */ |
|
445 | - $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
439 | + /** |
|
440 | + * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
441 | + * |
|
442 | + * @since 1.0.0 |
|
443 | + * @param string $sql The SQL insert query string. |
|
444 | + */ |
|
445 | + $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
446 | 446 | |
447 | - dbDelta($post_custom_fields); |
|
447 | + dbDelta($post_custom_fields); |
|
448 | 448 | |
449 | - // Table for storing place attribute - these are user defined |
|
450 | - $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
449 | + // Table for storing place attribute - these are user defined |
|
450 | + $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
451 | 451 | post_id int(11) NOT NULL, |
452 | 452 | post_title text NULL DEFAULT NULL, |
453 | 453 | post_status varchar(20) NULL DEFAULT NULL, |
@@ -473,22 +473,22 @@ discard block |
||
473 | 473 | PRIMARY KEY (post_id) |
474 | 474 | ) $collate "; |
475 | 475 | |
476 | - /** |
|
477 | - * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
478 | - * |
|
479 | - * @since 1.0.0 |
|
480 | - * @param string $sql The SQL insert query string. |
|
481 | - */ |
|
482 | - $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
476 | + /** |
|
477 | + * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
478 | + * |
|
479 | + * @since 1.0.0 |
|
480 | + * @param string $sql The SQL insert query string. |
|
481 | + */ |
|
482 | + $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
483 | 483 | |
484 | - dbDelta($post_detail); |
|
484 | + dbDelta($post_detail); |
|
485 | 485 | |
486 | - // alter post_title |
|
487 | - //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
486 | + // alter post_title |
|
487 | + //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
488 | 488 | |
489 | - // Table for storing place images - these are user defined |
|
489 | + // Table for storing place images - these are user defined |
|
490 | 490 | |
491 | - $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
491 | + $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
492 | 492 | ID int(11) NOT NULL AUTO_INCREMENT, |
493 | 493 | post_id int(11) NOT NULL, |
494 | 494 | user_id int(11) DEFAULT NULL, |
@@ -504,18 +504,18 @@ discard block |
||
504 | 504 | PRIMARY KEY (ID) |
505 | 505 | ) $collate "; |
506 | 506 | |
507 | - /** |
|
508 | - * Filter the SQL query that creates/updates the attachments DB table structure. |
|
509 | - * |
|
510 | - * @since 1.0.0 |
|
511 | - * @param string $sql The SQL insert query string. |
|
512 | - */ |
|
513 | - $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
507 | + /** |
|
508 | + * Filter the SQL query that creates/updates the attachments DB table structure. |
|
509 | + * |
|
510 | + * @since 1.0.0 |
|
511 | + * @param string $sql The SQL insert query string. |
|
512 | + */ |
|
513 | + $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
514 | 514 | |
515 | - dbDelta($attechment_table); |
|
515 | + dbDelta($attechment_table); |
|
516 | 516 | |
517 | 517 | |
518 | - $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
518 | + $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
519 | 519 | id int(11) NOT NULL AUTO_INCREMENT, |
520 | 520 | post_type varchar(255) NOT NULL, |
521 | 521 | data_type varchar(255) NOT NULL, |
@@ -533,18 +533,18 @@ discard block |
||
533 | 533 | PRIMARY KEY (id) |
534 | 534 | ) $collate "; |
535 | 535 | |
536 | - /** |
|
537 | - * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
538 | - * |
|
539 | - * @since 1.0.0 |
|
540 | - * @param string $sql The SQL insert query string. |
|
541 | - */ |
|
542 | - $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
536 | + /** |
|
537 | + * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
538 | + * |
|
539 | + * @since 1.0.0 |
|
540 | + * @param string $sql The SQL insert query string. |
|
541 | + */ |
|
542 | + $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
543 | 543 | |
544 | - dbDelta($custom_sort_fields_table); |
|
544 | + dbDelta($custom_sort_fields_table); |
|
545 | 545 | |
546 | 546 | |
547 | - $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
547 | + $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
548 | 548 | id int(11) NOT NULL AUTO_INCREMENT, |
549 | 549 | post_id int(11) DEFAULT NULL, |
550 | 550 | post_title varchar( 255 ) NULL DEFAULT NULL, |
@@ -568,191 +568,191 @@ discard block |
||
568 | 568 | PRIMARY KEY (id) |
569 | 569 | ) $collate "; |
570 | 570 | |
571 | - /** |
|
572 | - * Filter the SQL query that creates the review DB table structure. |
|
573 | - * |
|
574 | - * @since 1.0.0 |
|
575 | - * @param string $sql The SQL insert query string. |
|
576 | - */ |
|
577 | - $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
578 | - dbDelta($review_table); |
|
571 | + /** |
|
572 | + * Filter the SQL query that creates the review DB table structure. |
|
573 | + * |
|
574 | + * @since 1.0.0 |
|
575 | + * @param string $sql The SQL insert query string. |
|
576 | + */ |
|
577 | + $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
578 | + dbDelta($review_table); |
|
579 | 579 | |
580 | 580 | |
581 | 581 | |
582 | - // Alter terms table |
|
583 | - $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
584 | - if (!$term_icon_column) { |
|
585 | - $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
586 | - } |
|
582 | + // Alter terms table |
|
583 | + $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
584 | + if (!$term_icon_column) { |
|
585 | + $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
586 | + } |
|
587 | 587 | |
588 | - //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
588 | + //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
589 | 589 | |
590 | 590 | |
591 | - } |
|
591 | + } |
|
592 | 592 | } // END MAIN FUNCTION geodir_tables_install |
593 | 593 | |
594 | 594 | if (!function_exists('geodir_create_default_fields')) { |
595 | - /** |
|
596 | - * Inserts default custom fields table data into database. |
|
597 | - * |
|
598 | - * @since 1.0.0 |
|
599 | - * @package GeoDirectory |
|
600 | - */ |
|
601 | - function geodir_create_default_fields() |
|
602 | - { |
|
603 | - |
|
604 | - $fields = array(); |
|
605 | - |
|
606 | - $fields[] = array('listing_type' => 'gd_place', |
|
607 | - 'data_type' => 'VARCHAR', |
|
608 | - 'field_type' => 'taxonomy', |
|
609 | - 'admin_title' => __('Category', 'geodirectory'), |
|
610 | - 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'), |
|
611 | - 'site_title' => __('Category', 'geodirectory'), |
|
612 | - 'htmlvar_name' => 'gd_placecategory', |
|
613 | - 'default_value' => '', |
|
614 | - 'is_default' => '1', |
|
615 | - 'is_admin' => '1', |
|
616 | - 'is_required' => '1', |
|
617 | - 'clabels' => __('Category', 'geodirectory')); |
|
618 | - |
|
619 | - $fields[] = array('listing_type' => 'gd_place', |
|
620 | - 'data_type' => 'VARCHAR', |
|
621 | - 'field_type' => 'address', |
|
622 | - 'admin_title' => __('Address', 'geodirectory'), |
|
623 | - 'admin_desc' => ADDRESS_MSG, |
|
624 | - 'site_title' => __('Address', 'geodirectory'), |
|
625 | - 'htmlvar_name' => 'post', |
|
626 | - 'default_value' => '', |
|
627 | - 'option_values' => '', |
|
628 | - 'is_default' => '1', |
|
629 | - 'is_admin' => '1', |
|
630 | - 'is_required' => '1', |
|
631 | - 'required_msg' => __('Address fields are required', 'geodirectory'), |
|
632 | - 'clabels' => __('Address', 'geodirectory'), |
|
633 | - 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'), |
|
634 | - 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'), |
|
635 | - 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'), |
|
636 | - 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'), |
|
637 | - 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'), |
|
638 | - 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'), |
|
639 | - 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
640 | - 'show_latlng' => 1)); |
|
641 | - |
|
642 | - $fields[] = array('listing_type' => 'gd_place', |
|
643 | - 'data_type' => 'VARCHAR', |
|
644 | - 'field_type' => 'text', |
|
645 | - 'admin_title' => __('Time', 'geodirectory'), |
|
646 | - 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'), |
|
647 | - 'site_title' => __('Time', 'geodirectory'), |
|
648 | - 'htmlvar_name' => 'timing', |
|
649 | - 'default_value' => '', |
|
650 | - 'option_values' => '', |
|
651 | - 'is_default' => '1', |
|
652 | - 'is_admin' => '1', |
|
653 | - 'clabels' => __('Time', 'geodirectory')); |
|
654 | - |
|
655 | - $fields[] = array('listing_type' => 'gd_place', |
|
656 | - 'data_type' => 'VARCHAR', |
|
657 | - 'field_type' => 'phone', |
|
658 | - 'admin_title' => __('Phone', 'geodirectory'), |
|
659 | - 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'), |
|
660 | - 'site_title' => __('Phone', 'geodirectory'), |
|
661 | - 'htmlvar_name' => 'contact', |
|
662 | - 'default_value' => '', |
|
663 | - 'option_values' => '', |
|
664 | - 'is_default' => '1', |
|
665 | - 'is_admin' => '1', |
|
666 | - 'clabels' => __('Phone', 'geodirectory')); |
|
667 | - |
|
668 | - $fields[] = array('listing_type' => 'gd_place', |
|
669 | - 'data_type' => 'VARCHAR', |
|
670 | - 'field_type' => 'email', |
|
671 | - 'admin_title' => __('Email', 'geodirectory'), |
|
672 | - 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'), |
|
673 | - 'site_title' => __('Email', 'geodirectory'), |
|
674 | - 'htmlvar_name' => 'email', |
|
675 | - 'default_value' => '', |
|
676 | - 'option_values' => '', |
|
677 | - 'is_default' => '1', |
|
678 | - 'is_admin' => '1', |
|
679 | - 'clabels' => __('Email', 'geodirectory')); |
|
680 | - |
|
681 | - $fields[] = array('listing_type' => 'gd_place', |
|
682 | - 'data_type' => 'VARCHAR', |
|
683 | - 'field_type' => 'url', |
|
684 | - 'admin_title' => __('Website', 'geodirectory'), |
|
685 | - 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'), |
|
686 | - 'site_title' => __('Website', 'geodirectory'), |
|
687 | - 'htmlvar_name' => 'website', |
|
688 | - 'default_value' => '', |
|
689 | - 'option_values' => '', |
|
690 | - 'is_default' => '1', |
|
691 | - 'is_admin' => '1', |
|
692 | - 'clabels' => __('Website', 'geodirectory')); |
|
693 | - |
|
694 | - $fields[] = array('listing_type' => 'gd_place', |
|
695 | - 'data_type' => 'VARCHAR', |
|
696 | - 'field_type' => 'url', |
|
697 | - 'admin_title' => __('Twitter', 'geodirectory'), |
|
698 | - 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'), |
|
699 | - 'site_title' => __('Twitter', 'geodirectory'), |
|
700 | - 'htmlvar_name' => 'twitter', |
|
701 | - 'default_value' => '', |
|
702 | - 'option_values' => '', |
|
703 | - 'is_default' => '1', |
|
704 | - 'is_admin' => '1', |
|
705 | - 'clabels' => __('Twitter', 'geodirectory')); |
|
706 | - |
|
707 | - $fields[] = array('listing_type' => 'gd_place', |
|
708 | - 'data_type' => 'VARCHAR', |
|
709 | - 'field_type' => 'url', |
|
710 | - 'admin_title' => __('Facebook', 'geodirectory'), |
|
711 | - 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'), |
|
712 | - 'site_title' => __('Facebook', 'geodirectory'), |
|
713 | - 'htmlvar_name' => 'facebook', |
|
714 | - 'default_value' => '', |
|
715 | - 'option_values' => '', |
|
716 | - 'is_default' => '1', |
|
717 | - 'is_admin' => '1', |
|
718 | - 'clabels' => __('Facebook', 'geodirectory')); |
|
719 | - |
|
720 | - $fields[] = array('listing_type' => 'gd_place', |
|
721 | - 'data_type' => 'TEXT', |
|
722 | - 'field_type' => 'textarea', |
|
723 | - 'admin_title' => __('Video', 'geodirectory'), |
|
724 | - 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'), |
|
725 | - 'site_title' => __('Video', 'geodirectory'), |
|
726 | - 'htmlvar_name' => 'video', |
|
727 | - 'default_value' => '', |
|
728 | - 'option_values' => '', |
|
729 | - 'is_default' => '0', |
|
730 | - 'is_admin' => '1', |
|
731 | - 'clabels' => __('Video', 'geodirectory')); |
|
732 | - |
|
733 | - $fields[] = array('listing_type' => 'gd_place', |
|
734 | - 'data_type' => 'TEXT', |
|
735 | - 'field_type' => 'textarea', |
|
736 | - 'admin_title' => __('Special Offers', 'geodirectory'), |
|
737 | - 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'), |
|
738 | - 'site_title' => __('Special Offers', 'geodirectory'), |
|
739 | - 'htmlvar_name' => 'special_offers', |
|
740 | - 'default_value' => '', |
|
741 | - 'option_values' => '', |
|
742 | - 'is_default' => '0', |
|
743 | - 'is_admin' => '1', |
|
744 | - 'clabels' => __('Special Offers', 'geodirectory')); |
|
745 | - |
|
746 | - /** |
|
747 | - * Filter the array of default custom fields DB table data. |
|
748 | - * |
|
749 | - * @since 1.0.0 |
|
750 | - * @param string $fields The default custom fields as an array. |
|
751 | - */ |
|
752 | - $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
753 | - foreach ($fields as $field_index => $field) { |
|
754 | - geodir_custom_field_save($field); |
|
755 | - |
|
756 | - } |
|
757 | - } |
|
595 | + /** |
|
596 | + * Inserts default custom fields table data into database. |
|
597 | + * |
|
598 | + * @since 1.0.0 |
|
599 | + * @package GeoDirectory |
|
600 | + */ |
|
601 | + function geodir_create_default_fields() |
|
602 | + { |
|
603 | + |
|
604 | + $fields = array(); |
|
605 | + |
|
606 | + $fields[] = array('listing_type' => 'gd_place', |
|
607 | + 'data_type' => 'VARCHAR', |
|
608 | + 'field_type' => 'taxonomy', |
|
609 | + 'admin_title' => __('Category', 'geodirectory'), |
|
610 | + 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'), |
|
611 | + 'site_title' => __('Category', 'geodirectory'), |
|
612 | + 'htmlvar_name' => 'gd_placecategory', |
|
613 | + 'default_value' => '', |
|
614 | + 'is_default' => '1', |
|
615 | + 'is_admin' => '1', |
|
616 | + 'is_required' => '1', |
|
617 | + 'clabels' => __('Category', 'geodirectory')); |
|
618 | + |
|
619 | + $fields[] = array('listing_type' => 'gd_place', |
|
620 | + 'data_type' => 'VARCHAR', |
|
621 | + 'field_type' => 'address', |
|
622 | + 'admin_title' => __('Address', 'geodirectory'), |
|
623 | + 'admin_desc' => ADDRESS_MSG, |
|
624 | + 'site_title' => __('Address', 'geodirectory'), |
|
625 | + 'htmlvar_name' => 'post', |
|
626 | + 'default_value' => '', |
|
627 | + 'option_values' => '', |
|
628 | + 'is_default' => '1', |
|
629 | + 'is_admin' => '1', |
|
630 | + 'is_required' => '1', |
|
631 | + 'required_msg' => __('Address fields are required', 'geodirectory'), |
|
632 | + 'clabels' => __('Address', 'geodirectory'), |
|
633 | + 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'), |
|
634 | + 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'), |
|
635 | + 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'), |
|
636 | + 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'), |
|
637 | + 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'), |
|
638 | + 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'), |
|
639 | + 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
640 | + 'show_latlng' => 1)); |
|
641 | + |
|
642 | + $fields[] = array('listing_type' => 'gd_place', |
|
643 | + 'data_type' => 'VARCHAR', |
|
644 | + 'field_type' => 'text', |
|
645 | + 'admin_title' => __('Time', 'geodirectory'), |
|
646 | + 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'), |
|
647 | + 'site_title' => __('Time', 'geodirectory'), |
|
648 | + 'htmlvar_name' => 'timing', |
|
649 | + 'default_value' => '', |
|
650 | + 'option_values' => '', |
|
651 | + 'is_default' => '1', |
|
652 | + 'is_admin' => '1', |
|
653 | + 'clabels' => __('Time', 'geodirectory')); |
|
654 | + |
|
655 | + $fields[] = array('listing_type' => 'gd_place', |
|
656 | + 'data_type' => 'VARCHAR', |
|
657 | + 'field_type' => 'phone', |
|
658 | + 'admin_title' => __('Phone', 'geodirectory'), |
|
659 | + 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'), |
|
660 | + 'site_title' => __('Phone', 'geodirectory'), |
|
661 | + 'htmlvar_name' => 'contact', |
|
662 | + 'default_value' => '', |
|
663 | + 'option_values' => '', |
|
664 | + 'is_default' => '1', |
|
665 | + 'is_admin' => '1', |
|
666 | + 'clabels' => __('Phone', 'geodirectory')); |
|
667 | + |
|
668 | + $fields[] = array('listing_type' => 'gd_place', |
|
669 | + 'data_type' => 'VARCHAR', |
|
670 | + 'field_type' => 'email', |
|
671 | + 'admin_title' => __('Email', 'geodirectory'), |
|
672 | + 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'), |
|
673 | + 'site_title' => __('Email', 'geodirectory'), |
|
674 | + 'htmlvar_name' => 'email', |
|
675 | + 'default_value' => '', |
|
676 | + 'option_values' => '', |
|
677 | + 'is_default' => '1', |
|
678 | + 'is_admin' => '1', |
|
679 | + 'clabels' => __('Email', 'geodirectory')); |
|
680 | + |
|
681 | + $fields[] = array('listing_type' => 'gd_place', |
|
682 | + 'data_type' => 'VARCHAR', |
|
683 | + 'field_type' => 'url', |
|
684 | + 'admin_title' => __('Website', 'geodirectory'), |
|
685 | + 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'), |
|
686 | + 'site_title' => __('Website', 'geodirectory'), |
|
687 | + 'htmlvar_name' => 'website', |
|
688 | + 'default_value' => '', |
|
689 | + 'option_values' => '', |
|
690 | + 'is_default' => '1', |
|
691 | + 'is_admin' => '1', |
|
692 | + 'clabels' => __('Website', 'geodirectory')); |
|
693 | + |
|
694 | + $fields[] = array('listing_type' => 'gd_place', |
|
695 | + 'data_type' => 'VARCHAR', |
|
696 | + 'field_type' => 'url', |
|
697 | + 'admin_title' => __('Twitter', 'geodirectory'), |
|
698 | + 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'), |
|
699 | + 'site_title' => __('Twitter', 'geodirectory'), |
|
700 | + 'htmlvar_name' => 'twitter', |
|
701 | + 'default_value' => '', |
|
702 | + 'option_values' => '', |
|
703 | + 'is_default' => '1', |
|
704 | + 'is_admin' => '1', |
|
705 | + 'clabels' => __('Twitter', 'geodirectory')); |
|
706 | + |
|
707 | + $fields[] = array('listing_type' => 'gd_place', |
|
708 | + 'data_type' => 'VARCHAR', |
|
709 | + 'field_type' => 'url', |
|
710 | + 'admin_title' => __('Facebook', 'geodirectory'), |
|
711 | + 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'), |
|
712 | + 'site_title' => __('Facebook', 'geodirectory'), |
|
713 | + 'htmlvar_name' => 'facebook', |
|
714 | + 'default_value' => '', |
|
715 | + 'option_values' => '', |
|
716 | + 'is_default' => '1', |
|
717 | + 'is_admin' => '1', |
|
718 | + 'clabels' => __('Facebook', 'geodirectory')); |
|
719 | + |
|
720 | + $fields[] = array('listing_type' => 'gd_place', |
|
721 | + 'data_type' => 'TEXT', |
|
722 | + 'field_type' => 'textarea', |
|
723 | + 'admin_title' => __('Video', 'geodirectory'), |
|
724 | + 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'), |
|
725 | + 'site_title' => __('Video', 'geodirectory'), |
|
726 | + 'htmlvar_name' => 'video', |
|
727 | + 'default_value' => '', |
|
728 | + 'option_values' => '', |
|
729 | + 'is_default' => '0', |
|
730 | + 'is_admin' => '1', |
|
731 | + 'clabels' => __('Video', 'geodirectory')); |
|
732 | + |
|
733 | + $fields[] = array('listing_type' => 'gd_place', |
|
734 | + 'data_type' => 'TEXT', |
|
735 | + 'field_type' => 'textarea', |
|
736 | + 'admin_title' => __('Special Offers', 'geodirectory'), |
|
737 | + 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'), |
|
738 | + 'site_title' => __('Special Offers', 'geodirectory'), |
|
739 | + 'htmlvar_name' => 'special_offers', |
|
740 | + 'default_value' => '', |
|
741 | + 'option_values' => '', |
|
742 | + 'is_default' => '0', |
|
743 | + 'is_admin' => '1', |
|
744 | + 'clabels' => __('Special Offers', 'geodirectory')); |
|
745 | + |
|
746 | + /** |
|
747 | + * Filter the array of default custom fields DB table data. |
|
748 | + * |
|
749 | + * @since 1.0.0 |
|
750 | + * @param string $fields The default custom fields as an array. |
|
751 | + */ |
|
752 | + $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
753 | + foreach ($fields as $field_index => $field) { |
|
754 | + geodir_custom_field_save($field); |
|
755 | + |
|
756 | + } |
|
757 | + } |
|
758 | 758 | } |
759 | 759 | \ No newline at end of file |
@@ -23,8 +23,12 @@ |
||
23 | 23 | |
24 | 24 | $collate = ''; |
25 | 25 | if ($wpdb->has_cap('collation')) { |
26 | - if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | - if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
26 | + if (!empty($wpdb->charset)) { |
|
27 | + $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
28 | + } |
|
29 | + if (!empty($wpdb->collate)) { |
|
30 | + $collate .= " COLLATE $wpdb->collate"; |
|
31 | + } |
|
28 | 32 | } |
29 | 33 | |
30 | 34 | /** |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * GeoDirectory Installation related functions. |
|
4 | - * |
|
5 | - * Plugin install script which adds default pages, taxonomies, and database tables. |
|
6 | - * |
|
7 | - * @since 1.0.0 |
|
8 | - * @package GeoDirectory |
|
9 | - */ |
|
3 | + * GeoDirectory Installation related functions. |
|
4 | + * |
|
5 | + * Plugin install script which adds default pages, taxonomies, and database tables. |
|
6 | + * |
|
7 | + * @since 1.0.0 |
|
8 | + * @package GeoDirectory |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Include custom database table related functions. |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | function geodir_activation() |
25 | 25 | { |
26 | 26 | |
27 | - geodir_install(); |
|
28 | - add_action('wp_loaded', 'geodir_flush_activation'); |
|
27 | + geodir_install(); |
|
28 | + add_action('wp_loaded', 'geodir_flush_activation'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function geodir_flush_activation() |
38 | 38 | { |
39 | - // Remove rewrite rules and then recreate rewrite rules. |
|
40 | - // flush late so everything is loaded |
|
41 | - flush_rewrite_rules(); |
|
39 | + // Remove rewrite rules and then recreate rewrite rules. |
|
40 | + // flush late so everything is loaded |
|
41 | + flush_rewrite_rules(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -50,44 +50,44 @@ discard block |
||
50 | 50 | */ |
51 | 51 | function geodir_install() |
52 | 52 | { |
53 | - global $geodir_settings; |
|
54 | - |
|
55 | - /** |
|
56 | - * Called before the GD installation scripts have run. |
|
57 | - * |
|
58 | - * @since 1.0.0 |
|
59 | - * @see 'geodir_installation_end' |
|
60 | - */ |
|
61 | - do_action('geodir_installation_start'); |
|
62 | - |
|
63 | - // Do install |
|
64 | - if (!get_option('geodir_default_data_installed')) { |
|
65 | - geodir_create_tables(); // in admin db install.php |
|
66 | - geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
67 | - geodir_create_default_fields(); |
|
68 | - //geodir_default_taxonomies(); |
|
69 | - geodir_set_default_options(); |
|
70 | - geodir_create_pages(); |
|
71 | - geodir_set_default_widgets(); |
|
72 | - gd_install_theme_compat(); |
|
73 | - |
|
74 | - update_option('geodir_default_data_installed', 1); |
|
75 | - |
|
76 | - } |
|
77 | - |
|
78 | - if (!get_option('geodir_default_data_installed_1.2.8')) { |
|
79 | - //geodir_create_tables(); // in admin db install.php |
|
80 | - update_option('geodir_default_data_installed_1.2.8', 1); |
|
81 | - } |
|
82 | - |
|
83 | - geodir_installation_end(); |
|
84 | - /** |
|
85 | - * Called after the GD installation scripts have run. |
|
86 | - * |
|
87 | - * @since 1.0.0 |
|
88 | - * @see 'geodir_installation_start' |
|
89 | - */ |
|
90 | - do_action('geodir_installation_end'); |
|
53 | + global $geodir_settings; |
|
54 | + |
|
55 | + /** |
|
56 | + * Called before the GD installation scripts have run. |
|
57 | + * |
|
58 | + * @since 1.0.0 |
|
59 | + * @see 'geodir_installation_end' |
|
60 | + */ |
|
61 | + do_action('geodir_installation_start'); |
|
62 | + |
|
63 | + // Do install |
|
64 | + if (!get_option('geodir_default_data_installed')) { |
|
65 | + geodir_create_tables(); // in admin db install.php |
|
66 | + geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
67 | + geodir_create_default_fields(); |
|
68 | + //geodir_default_taxonomies(); |
|
69 | + geodir_set_default_options(); |
|
70 | + geodir_create_pages(); |
|
71 | + geodir_set_default_widgets(); |
|
72 | + gd_install_theme_compat(); |
|
73 | + |
|
74 | + update_option('geodir_default_data_installed', 1); |
|
75 | + |
|
76 | + } |
|
77 | + |
|
78 | + if (!get_option('geodir_default_data_installed_1.2.8')) { |
|
79 | + //geodir_create_tables(); // in admin db install.php |
|
80 | + update_option('geodir_default_data_installed_1.2.8', 1); |
|
81 | + } |
|
82 | + |
|
83 | + geodir_installation_end(); |
|
84 | + /** |
|
85 | + * Called after the GD installation scripts have run. |
|
86 | + * |
|
87 | + * @since 1.0.0 |
|
88 | + * @see 'geodir_installation_start' |
|
89 | + */ |
|
90 | + do_action('geodir_installation_end'); |
|
91 | 91 | |
92 | 92 | |
93 | 93 | } |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | function geodir_create_pages() |
105 | 105 | { |
106 | 106 | |
107 | - //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' ); |
|
108 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
109 | - geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), ''); |
|
110 | - geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), ''); |
|
111 | - geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), ''); |
|
112 | - geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), ''); |
|
107 | + //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' ); |
|
108 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
109 | + geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), ''); |
|
110 | + geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), ''); |
|
111 | + geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), ''); |
|
112 | + geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), ''); |
|
113 | 113 | |
114 | - //New since 1.5.3 |
|
115 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
116 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
114 | + //New since 1.5.3 |
|
115 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
116 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
117 | 117 | |
118 | 118 | |
119 | 119 | } |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | */ |
130 | 130 | function geodir_installation_end() |
131 | 131 | { |
132 | - //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
132 | + //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
133 | 133 | |
134 | - update_option("geodir_installed", 1); |
|
135 | - update_option("geodir_installation_redirect", 1); |
|
136 | - update_option('skip_install_geodir_pages', 0); |
|
134 | + update_option("geodir_installed", 1); |
|
135 | + update_option("geodir_installation_redirect", 1); |
|
136 | + update_option('skip_install_geodir_pages', 0); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -147,45 +147,45 @@ discard block |
||
147 | 147 | */ |
148 | 148 | function geodir_set_default_options() |
149 | 149 | { |
150 | - global $geodir_settings; |
|
151 | - /** |
|
152 | - * Contains settings array for general tab. |
|
153 | - * |
|
154 | - * @since 1.0.0 |
|
155 | - * @package GeoDirectory |
|
156 | - */ |
|
157 | - include_once("option-pages/general_settings_array.php"); |
|
158 | - /** |
|
159 | - * Contains settings array for design tab. |
|
160 | - * |
|
161 | - * @since 1.0.0 |
|
162 | - * @package GeoDirectory |
|
163 | - */ |
|
164 | - include_once("option-pages/design_settings_array.php"); |
|
165 | - /** |
|
166 | - * Contains settings array for notifications tab. |
|
167 | - * |
|
168 | - * @since 1.0.0 |
|
169 | - * @package GeoDirectory |
|
170 | - */ |
|
171 | - include_once("option-pages/notifications_settings_array.php"); |
|
172 | - /** |
|
173 | - * Contains settings array for permalink tab. |
|
174 | - * |
|
175 | - * @since 1.0.0 |
|
176 | - * @package GeoDirectory |
|
177 | - */ |
|
178 | - include_once("option-pages/permalink_settings_array.php"); |
|
179 | - /** |
|
180 | - * Contains settings array for title / meta tab. |
|
181 | - * |
|
182 | - * @since 1.5.4 |
|
183 | - * @package GeoDirectory |
|
184 | - */ |
|
185 | - include_once("option-pages/title_meta_settings_array.php"); |
|
186 | - foreach ($geodir_settings as $value) { |
|
187 | - geodir_update_options($value, true); |
|
188 | - } |
|
150 | + global $geodir_settings; |
|
151 | + /** |
|
152 | + * Contains settings array for general tab. |
|
153 | + * |
|
154 | + * @since 1.0.0 |
|
155 | + * @package GeoDirectory |
|
156 | + */ |
|
157 | + include_once("option-pages/general_settings_array.php"); |
|
158 | + /** |
|
159 | + * Contains settings array for design tab. |
|
160 | + * |
|
161 | + * @since 1.0.0 |
|
162 | + * @package GeoDirectory |
|
163 | + */ |
|
164 | + include_once("option-pages/design_settings_array.php"); |
|
165 | + /** |
|
166 | + * Contains settings array for notifications tab. |
|
167 | + * |
|
168 | + * @since 1.0.0 |
|
169 | + * @package GeoDirectory |
|
170 | + */ |
|
171 | + include_once("option-pages/notifications_settings_array.php"); |
|
172 | + /** |
|
173 | + * Contains settings array for permalink tab. |
|
174 | + * |
|
175 | + * @since 1.0.0 |
|
176 | + * @package GeoDirectory |
|
177 | + */ |
|
178 | + include_once("option-pages/permalink_settings_array.php"); |
|
179 | + /** |
|
180 | + * Contains settings array for title / meta tab. |
|
181 | + * |
|
182 | + * @since 1.5.4 |
|
183 | + * @package GeoDirectory |
|
184 | + */ |
|
185 | + include_once("option-pages/title_meta_settings_array.php"); |
|
186 | + foreach ($geodir_settings as $value) { |
|
187 | + geodir_update_options($value, true); |
|
188 | + } |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | |
@@ -199,103 +199,103 @@ discard block |
||
199 | 199 | function geodir_set_default_widgets() |
200 | 200 | { |
201 | 201 | |
202 | - $widget_option_list = array(); |
|
203 | - $widgetinfo = array(); |
|
204 | - $sidebarvalue_array = array(); |
|
205 | - $sidebars_widgets = array(); |
|
202 | + $widget_option_list = array(); |
|
203 | + $widgetinfo = array(); |
|
204 | + $sidebarvalue_array = array(); |
|
205 | + $sidebars_widgets = array(); |
|
206 | 206 | |
207 | - /*===========================*/ |
|
208 | - /* Widgets ON HOME PAGE */ |
|
209 | - /*===========================*/ |
|
207 | + /*===========================*/ |
|
208 | + /* Widgets ON HOME PAGE */ |
|
209 | + /*===========================*/ |
|
210 | 210 | |
211 | - $widget_option_list['geodir_home_top'] = |
|
212 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
213 | - 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'), |
|
214 | - 'geodir_advance_search' => array()); |
|
211 | + $widget_option_list['geodir_home_top'] = |
|
212 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
213 | + 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'), |
|
214 | + 'geodir_advance_search' => array()); |
|
215 | 215 | |
216 | - $widget_option_list['geodir_home_content'] = |
|
217 | - array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1')); |
|
216 | + $widget_option_list['geodir_home_content'] = |
|
217 | + array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1')); |
|
218 | 218 | |
219 | - $widget_option_list['geodir_home_right'] = |
|
220 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
221 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
219 | + $widget_option_list['geodir_home_right'] = |
|
220 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
221 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
222 | 222 | |
223 | - /*===========================*/ |
|
224 | - /* Widgets ON LISTING PAGE */ |
|
225 | - /*===========================*/ |
|
223 | + /*===========================*/ |
|
224 | + /* Widgets ON LISTING PAGE */ |
|
225 | + /*===========================*/ |
|
226 | 226 | |
227 | - $widget_option_list['geodir_listing_top'] = |
|
228 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
229 | - 'geodir_advance_search' => array()); |
|
227 | + $widget_option_list['geodir_listing_top'] = |
|
228 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
229 | + 'geodir_advance_search' => array()); |
|
230 | 230 | |
231 | - $widget_option_list['geodir_listing_right_sidebar'] = |
|
232 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
233 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
234 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
231 | + $widget_option_list['geodir_listing_right_sidebar'] = |
|
232 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
233 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
234 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
235 | 235 | |
236 | 236 | |
237 | - /*===========================*/ |
|
238 | - /* Widgets ON SEARCH PAGE */ |
|
239 | - /*===========================*/ |
|
237 | + /*===========================*/ |
|
238 | + /* Widgets ON SEARCH PAGE */ |
|
239 | + /*===========================*/ |
|
240 | 240 | |
241 | - $widget_option_list['geodir_search_top'] = |
|
242 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
243 | - 'geodir_advance_search' => array()); |
|
241 | + $widget_option_list['geodir_search_top'] = |
|
242 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
243 | + 'geodir_advance_search' => array()); |
|
244 | 244 | |
245 | - $widget_option_list['geodir_search_right_sidebar'] = |
|
246 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
247 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
248 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
245 | + $widget_option_list['geodir_search_right_sidebar'] = |
|
246 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
247 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
248 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
249 | 249 | |
250 | - /*===========================*/ |
|
251 | - /* Widgets ON DETAIL/SINGLE PAGE */ |
|
252 | - /*===========================*/ |
|
250 | + /*===========================*/ |
|
251 | + /* Widgets ON DETAIL/SINGLE PAGE */ |
|
252 | + /*===========================*/ |
|
253 | 253 | |
254 | - $widget_option_list['geodir_detail_sidebar'] = |
|
255 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
256 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
257 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
254 | + $widget_option_list['geodir_detail_sidebar'] = |
|
255 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
256 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
257 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
258 | 258 | |
259 | 259 | |
260 | - /*===========================*/ |
|
261 | - /* Widgets ON AUTHOR PAGE */ |
|
262 | - /*===========================*/ |
|
260 | + /*===========================*/ |
|
261 | + /* Widgets ON AUTHOR PAGE */ |
|
262 | + /*===========================*/ |
|
263 | 263 | |
264 | 264 | |
265 | - $widget_option_list['geodir_author_right_sidebar'] = |
|
266 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory'))); |
|
265 | + $widget_option_list['geodir_author_right_sidebar'] = |
|
266 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory'))); |
|
267 | 267 | |
268 | 268 | |
269 | - $sidebars_widgets = get_option('sidebars_widgets'); |
|
269 | + $sidebars_widgets = get_option('sidebars_widgets'); |
|
270 | 270 | |
271 | - foreach ($widget_option_list as $key => $widget_options) { |
|
271 | + foreach ($widget_option_list as $key => $widget_options) { |
|
272 | 272 | |
273 | - foreach ($widget_options as $key2 => $widget_options_obj) { |
|
274 | - $widgetid = 'widget_' . $key2; |
|
273 | + foreach ($widget_options as $key2 => $widget_options_obj) { |
|
274 | + $widgetid = 'widget_' . $key2; |
|
275 | 275 | |
276 | - $widgetinfo[$widgetid][] = $widget_options_obj; |
|
276 | + $widgetinfo[$widgetid][] = $widget_options_obj; |
|
277 | 277 | |
278 | - $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
278 | + $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
279 | 279 | |
280 | - $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
280 | + $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
281 | 281 | |
282 | - } |
|
282 | + } |
|
283 | 283 | |
284 | - if (!empty($sidebarvalue_array[$key])) { |
|
284 | + if (!empty($sidebarvalue_array[$key])) { |
|
285 | 285 | |
286 | - $sidebars_widgets = get_option('sidebars_widgets'); |
|
287 | - $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
288 | - update_option('sidebars_widgets', $sidebars_widgets); |
|
286 | + $sidebars_widgets = get_option('sidebars_widgets'); |
|
287 | + $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
288 | + update_option('sidebars_widgets', $sidebars_widgets); |
|
289 | 289 | |
290 | - foreach ($widget_update as $key => $value) { |
|
290 | + foreach ($widget_update as $key => $value) { |
|
291 | 291 | |
292 | - update_option($key, $value); |
|
292 | + update_option($key, $value); |
|
293 | 293 | |
294 | - } |
|
294 | + } |
|
295 | 295 | |
296 | - } |
|
296 | + } |
|
297 | 297 | |
298 | - } |
|
298 | + } |
|
299 | 299 | |
300 | 300 | |
301 | 301 | } |
@@ -16,184 +16,184 @@ |
||
16 | 16 | */ |
17 | 17 | $geodir_settings['permalink_settings'] = apply_filters('geodir_permalink_settings', array( |
18 | 18 | |
19 | - /* Listing Permalink Settings start */ |
|
20 | - array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '), |
|
21 | - |
|
22 | - |
|
23 | - array('name' => __('Listing Detail Permalink Settings', 'geodirectory'), |
|
24 | - 'type' => 'sectionstart', |
|
25 | - 'desc' => '', |
|
26 | - 'id' => 'geodir_permalink'), |
|
27 | - |
|
28 | - array( |
|
29 | - 'name' => __('Add location in urls', 'geodirectory'), |
|
30 | - 'desc' => __('Add location slug in listing urls', 'geodirectory'), |
|
31 | - 'id' => 'geodir_add_location_url', |
|
32 | - 'type' => 'checkbox', |
|
33 | - 'std' => '1', |
|
34 | - 'checkboxgroup' => 'start' |
|
35 | - ), |
|
36 | - |
|
37 | - array( |
|
38 | - 'name' => __('Add full location in listing urls', 'geodirectory'), |
|
39 | - 'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'), |
|
40 | - 'id' => 'geodir_show_location_url', |
|
41 | - 'type' => 'radio', |
|
42 | - 'value' => 'all', |
|
43 | - 'std' => 'all', |
|
44 | - 'radiogroup' => '' |
|
45 | - ), |
|
46 | - |
|
47 | - array( |
|
48 | - 'name' => __('Add country and city slug in listing urls', 'geodirectory'), |
|
49 | - 'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'), |
|
50 | - 'id' => 'geodir_show_location_url', |
|
51 | - 'type' => 'radio', |
|
52 | - 'std' => 'all', |
|
53 | - 'value' => 'country_city', |
|
54 | - 'radiogroup' => '' |
|
55 | - ), |
|
56 | - array( |
|
57 | - 'name' => __('Add region and city slug in listing urls', 'geodirectory'), |
|
58 | - 'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'), |
|
59 | - 'id' => 'geodir_show_location_url', |
|
60 | - 'type' => 'radio', |
|
61 | - 'std' => 'all', |
|
62 | - 'value' => 'region_city', |
|
63 | - 'radiogroup' => '' |
|
64 | - ), |
|
65 | - array( |
|
66 | - 'name' => __('Add only city in listing urls', 'geodirectory'), |
|
67 | - 'desc' => __('Add city slug in listing urls', 'geodirectory'), |
|
68 | - 'id' => 'geodir_show_location_url', |
|
69 | - 'type' => 'radio', |
|
70 | - 'std' => 'all', |
|
71 | - 'value' => 'city', |
|
72 | - 'radiogroup' => 'end' |
|
73 | - ), |
|
74 | - |
|
75 | - |
|
76 | - |
|
77 | - array( |
|
78 | - 'name' => __('Add category in listing urls', 'geodirectory'), |
|
79 | - 'desc' => __('Add requested category slugs in listing urls', 'geodirectory'), |
|
80 | - 'id' => 'geodir_add_categories_url', |
|
81 | - 'type' => 'checkbox', |
|
82 | - 'std' => '1', |
|
83 | - ), |
|
84 | - |
|
85 | - array( |
|
86 | - 'name' => __('Listing url prefix', 'geodirectory'), |
|
87 | - 'desc' => __('Listing prefix to show in url', 'geodirectory'), |
|
88 | - 'id' => 'geodir_listing_prefix', |
|
89 | - 'type' => 'text', |
|
90 | - 'css' => 'min-width:300px;', |
|
91 | - 'std' => 'places' |
|
92 | - ), |
|
93 | - |
|
94 | - array( |
|
95 | - 'name' => __('Location url prefix', 'geodirectory'), |
|
96 | - 'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'), |
|
97 | - 'id' => 'geodir_location_prefix', |
|
98 | - 'type' => 'text', |
|
99 | - 'css' => 'min-width:300px;', |
|
100 | - 'std' => 'location' // Default value to show home top section |
|
101 | - ), |
|
102 | - |
|
103 | - array( |
|
104 | - 'name' => __('Location and category url separator', 'geodirectory'), |
|
105 | - 'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'), |
|
106 | - 'id' => 'geodir_listingurl_separator', |
|
107 | - 'type' => 'text', |
|
108 | - 'css' => 'min-width:300px;', |
|
109 | - 'std' => 'C' // Default value to show home top section |
|
110 | - ), |
|
111 | - |
|
112 | - array( |
|
113 | - 'name' => __('Listing detail url separator', 'geodirectory'), |
|
114 | - 'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'), |
|
115 | - 'id' => 'geodir_detailurl_separator', |
|
116 | - 'type' => 'text', |
|
117 | - 'css' => 'min-width:300px;', |
|
118 | - 'std' => 'info' // Default value to show home top section |
|
119 | - ), |
|
120 | - |
|
121 | - |
|
122 | - array('type' => 'sectionend', 'id' => 'geodir_permalink'), |
|
123 | - |
|
124 | - array('name' => __('GeoDirectory Pages', 'geodirectory'), |
|
125 | - 'type' => 'sectionstart', |
|
126 | - 'desc' => '', |
|
127 | - 'id' => 'geodir_pages'), |
|
128 | - |
|
129 | - array( |
|
130 | - 'name' => __('GD Home page', 'geodirectory'), |
|
131 | - 'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'), |
|
132 | - 'id' => 'geodir_home_page', |
|
133 | - 'type' => 'single_select_page', |
|
134 | - 'class' => 'chosen_select' |
|
135 | - ), |
|
136 | - |
|
137 | - array( |
|
138 | - 'name' => __('Add listing page', 'geodirectory'), |
|
139 | - 'desc' => __('Select the page to use for adding listings', 'geodirectory'), |
|
140 | - 'id' => 'geodir_add_listing_page', |
|
141 | - 'type' => 'single_select_page', |
|
142 | - 'class' => 'chosen_select' |
|
143 | - ), |
|
144 | - |
|
145 | - array( |
|
146 | - 'name' => __('Listing preview page', 'geodirectory'), |
|
147 | - 'desc' => __('Select the page to use for listing preview', 'geodirectory'), |
|
148 | - 'id' => 'geodir_preview_page', |
|
149 | - 'type' => 'single_select_page', |
|
150 | - 'class' => 'chosen_select' |
|
151 | - ), |
|
152 | - |
|
153 | - array( |
|
154 | - 'name' => __('Listing success page', 'geodirectory'), |
|
155 | - 'desc' => __('Select the page to use for listing success', 'geodirectory'), |
|
156 | - 'id' => 'geodir_success_page', |
|
157 | - 'type' => 'single_select_page', |
|
158 | - 'class' => 'chosen_select' |
|
159 | - ), |
|
160 | - |
|
161 | - array( |
|
162 | - 'name' => __('Location page', 'geodirectory'), |
|
163 | - 'desc' => __('Select the page to use for locations', 'geodirectory'), |
|
164 | - 'id' => 'geodir_location_page', |
|
165 | - 'type' => 'single_select_page', |
|
166 | - 'class' => 'chosen_select' |
|
167 | - ), |
|
168 | - |
|
169 | - array( |
|
170 | - 'name' => __('Terms and Conditions page', 'geodirectory'), |
|
171 | - 'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'), |
|
172 | - 'id' => 'geodir_term_condition_page', |
|
173 | - 'type' => 'single_select_page', |
|
174 | - 'class' => 'chosen_select' |
|
175 | - ), |
|
176 | - |
|
177 | - array( |
|
178 | - 'name' => __('Info page', 'geodirectory'), |
|
179 | - 'desc' => __('Select the page to use for Gd general Info', 'geodirectory'), |
|
180 | - 'id' => 'geodir_info_page', |
|
181 | - 'type' => 'single_select_page', |
|
182 | - 'class' => 'chosen_select' |
|
183 | - ), |
|
184 | - |
|
185 | - array( |
|
186 | - 'name' => __('Login page', 'geodirectory'), |
|
187 | - 'desc' => __('Select the page to use for Login / Register', 'geodirectory'), |
|
188 | - 'id' => 'geodir_login_page', |
|
189 | - 'type' => 'single_select_page', |
|
190 | - 'class' => 'chosen_select' |
|
191 | - ), |
|
192 | - |
|
193 | - |
|
194 | - array('type' => 'sectionend', 'id' => 'geodir_pages'), |
|
195 | - |
|
196 | - /* Listing Detail Permalink Settings End */ |
|
19 | + /* Listing Permalink Settings start */ |
|
20 | + array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '), |
|
21 | + |
|
22 | + |
|
23 | + array('name' => __('Listing Detail Permalink Settings', 'geodirectory'), |
|
24 | + 'type' => 'sectionstart', |
|
25 | + 'desc' => '', |
|
26 | + 'id' => 'geodir_permalink'), |
|
27 | + |
|
28 | + array( |
|
29 | + 'name' => __('Add location in urls', 'geodirectory'), |
|
30 | + 'desc' => __('Add location slug in listing urls', 'geodirectory'), |
|
31 | + 'id' => 'geodir_add_location_url', |
|
32 | + 'type' => 'checkbox', |
|
33 | + 'std' => '1', |
|
34 | + 'checkboxgroup' => 'start' |
|
35 | + ), |
|
36 | + |
|
37 | + array( |
|
38 | + 'name' => __('Add full location in listing urls', 'geodirectory'), |
|
39 | + 'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'), |
|
40 | + 'id' => 'geodir_show_location_url', |
|
41 | + 'type' => 'radio', |
|
42 | + 'value' => 'all', |
|
43 | + 'std' => 'all', |
|
44 | + 'radiogroup' => '' |
|
45 | + ), |
|
46 | + |
|
47 | + array( |
|
48 | + 'name' => __('Add country and city slug in listing urls', 'geodirectory'), |
|
49 | + 'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'), |
|
50 | + 'id' => 'geodir_show_location_url', |
|
51 | + 'type' => 'radio', |
|
52 | + 'std' => 'all', |
|
53 | + 'value' => 'country_city', |
|
54 | + 'radiogroup' => '' |
|
55 | + ), |
|
56 | + array( |
|
57 | + 'name' => __('Add region and city slug in listing urls', 'geodirectory'), |
|
58 | + 'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'), |
|
59 | + 'id' => 'geodir_show_location_url', |
|
60 | + 'type' => 'radio', |
|
61 | + 'std' => 'all', |
|
62 | + 'value' => 'region_city', |
|
63 | + 'radiogroup' => '' |
|
64 | + ), |
|
65 | + array( |
|
66 | + 'name' => __('Add only city in listing urls', 'geodirectory'), |
|
67 | + 'desc' => __('Add city slug in listing urls', 'geodirectory'), |
|
68 | + 'id' => 'geodir_show_location_url', |
|
69 | + 'type' => 'radio', |
|
70 | + 'std' => 'all', |
|
71 | + 'value' => 'city', |
|
72 | + 'radiogroup' => 'end' |
|
73 | + ), |
|
74 | + |
|
75 | + |
|
76 | + |
|
77 | + array( |
|
78 | + 'name' => __('Add category in listing urls', 'geodirectory'), |
|
79 | + 'desc' => __('Add requested category slugs in listing urls', 'geodirectory'), |
|
80 | + 'id' => 'geodir_add_categories_url', |
|
81 | + 'type' => 'checkbox', |
|
82 | + 'std' => '1', |
|
83 | + ), |
|
84 | + |
|
85 | + array( |
|
86 | + 'name' => __('Listing url prefix', 'geodirectory'), |
|
87 | + 'desc' => __('Listing prefix to show in url', 'geodirectory'), |
|
88 | + 'id' => 'geodir_listing_prefix', |
|
89 | + 'type' => 'text', |
|
90 | + 'css' => 'min-width:300px;', |
|
91 | + 'std' => 'places' |
|
92 | + ), |
|
93 | + |
|
94 | + array( |
|
95 | + 'name' => __('Location url prefix', 'geodirectory'), |
|
96 | + 'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'), |
|
97 | + 'id' => 'geodir_location_prefix', |
|
98 | + 'type' => 'text', |
|
99 | + 'css' => 'min-width:300px;', |
|
100 | + 'std' => 'location' // Default value to show home top section |
|
101 | + ), |
|
102 | + |
|
103 | + array( |
|
104 | + 'name' => __('Location and category url separator', 'geodirectory'), |
|
105 | + 'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'), |
|
106 | + 'id' => 'geodir_listingurl_separator', |
|
107 | + 'type' => 'text', |
|
108 | + 'css' => 'min-width:300px;', |
|
109 | + 'std' => 'C' // Default value to show home top section |
|
110 | + ), |
|
111 | + |
|
112 | + array( |
|
113 | + 'name' => __('Listing detail url separator', 'geodirectory'), |
|
114 | + 'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'), |
|
115 | + 'id' => 'geodir_detailurl_separator', |
|
116 | + 'type' => 'text', |
|
117 | + 'css' => 'min-width:300px;', |
|
118 | + 'std' => 'info' // Default value to show home top section |
|
119 | + ), |
|
120 | + |
|
121 | + |
|
122 | + array('type' => 'sectionend', 'id' => 'geodir_permalink'), |
|
123 | + |
|
124 | + array('name' => __('GeoDirectory Pages', 'geodirectory'), |
|
125 | + 'type' => 'sectionstart', |
|
126 | + 'desc' => '', |
|
127 | + 'id' => 'geodir_pages'), |
|
128 | + |
|
129 | + array( |
|
130 | + 'name' => __('GD Home page', 'geodirectory'), |
|
131 | + 'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'), |
|
132 | + 'id' => 'geodir_home_page', |
|
133 | + 'type' => 'single_select_page', |
|
134 | + 'class' => 'chosen_select' |
|
135 | + ), |
|
136 | + |
|
137 | + array( |
|
138 | + 'name' => __('Add listing page', 'geodirectory'), |
|
139 | + 'desc' => __('Select the page to use for adding listings', 'geodirectory'), |
|
140 | + 'id' => 'geodir_add_listing_page', |
|
141 | + 'type' => 'single_select_page', |
|
142 | + 'class' => 'chosen_select' |
|
143 | + ), |
|
144 | + |
|
145 | + array( |
|
146 | + 'name' => __('Listing preview page', 'geodirectory'), |
|
147 | + 'desc' => __('Select the page to use for listing preview', 'geodirectory'), |
|
148 | + 'id' => 'geodir_preview_page', |
|
149 | + 'type' => 'single_select_page', |
|
150 | + 'class' => 'chosen_select' |
|
151 | + ), |
|
152 | + |
|
153 | + array( |
|
154 | + 'name' => __('Listing success page', 'geodirectory'), |
|
155 | + 'desc' => __('Select the page to use for listing success', 'geodirectory'), |
|
156 | + 'id' => 'geodir_success_page', |
|
157 | + 'type' => 'single_select_page', |
|
158 | + 'class' => 'chosen_select' |
|
159 | + ), |
|
160 | + |
|
161 | + array( |
|
162 | + 'name' => __('Location page', 'geodirectory'), |
|
163 | + 'desc' => __('Select the page to use for locations', 'geodirectory'), |
|
164 | + 'id' => 'geodir_location_page', |
|
165 | + 'type' => 'single_select_page', |
|
166 | + 'class' => 'chosen_select' |
|
167 | + ), |
|
168 | + |
|
169 | + array( |
|
170 | + 'name' => __('Terms and Conditions page', 'geodirectory'), |
|
171 | + 'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'), |
|
172 | + 'id' => 'geodir_term_condition_page', |
|
173 | + 'type' => 'single_select_page', |
|
174 | + 'class' => 'chosen_select' |
|
175 | + ), |
|
176 | + |
|
177 | + array( |
|
178 | + 'name' => __('Info page', 'geodirectory'), |
|
179 | + 'desc' => __('Select the page to use for Gd general Info', 'geodirectory'), |
|
180 | + 'id' => 'geodir_info_page', |
|
181 | + 'type' => 'single_select_page', |
|
182 | + 'class' => 'chosen_select' |
|
183 | + ), |
|
184 | + |
|
185 | + array( |
|
186 | + 'name' => __('Login page', 'geodirectory'), |
|
187 | + 'desc' => __('Select the page to use for Login / Register', 'geodirectory'), |
|
188 | + 'id' => 'geodir_login_page', |
|
189 | + 'type' => 'single_select_page', |
|
190 | + 'class' => 'chosen_select' |
|
191 | + ), |
|
192 | + |
|
193 | + |
|
194 | + array('type' => 'sectionend', 'id' => 'geodir_pages'), |
|
195 | + |
|
196 | + /* Listing Detail Permalink Settings End */ |
|
197 | 197 | |
198 | 198 | |
199 | 199 | )); // End Design settings |
@@ -1,43 +1,43 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Jupiter theme compatibility functions. |
|
4 | - * |
|
5 | - * This file lets the GeoDirectory Plugin use the Jupiter theme HTML wrappers to fit and work perfectly. |
|
6 | - * |
|
7 | - * @since 1.0.0 |
|
8 | - * @package GeoDirectory |
|
9 | - */ |
|
3 | + * Jupiter theme compatibility functions. |
|
4 | + * |
|
5 | + * This file lets the GeoDirectory Plugin use the Jupiter theme HTML wrappers to fit and work perfectly. |
|
6 | + * |
|
7 | + * @since 1.0.0 |
|
8 | + * @package GeoDirectory |
|
9 | + */ |
|
10 | 10 | add_action('after_setup_theme', 'jupiter_action_calls', 11); |
11 | 11 | /** |
12 | - * Action calls for jupiter theme compatibility. |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * @package GeoDirectory |
|
16 | - */ |
|
12 | + * Action calls for jupiter theme compatibility. |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * @package GeoDirectory |
|
16 | + */ |
|
17 | 17 | function jupiter_action_calls() |
18 | 18 | { |
19 | - // REMOVE BREADCRUMB |
|
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 | - |
|
27 | - // REMOVE PAGE TITLES |
|
28 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
29 | - remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10); |
|
30 | - remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
31 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
32 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
33 | - |
|
34 | - |
|
35 | - // CAHNGE PAGE TITLES |
|
36 | - remove_action('page_title', 'mk_page_title'); |
|
37 | - add_action('page_title', 'gd_mk_page_title'); |
|
38 | - // CHANGE BREADCRUMS FOR GD PAGES |
|
39 | - remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs'); |
|
40 | - add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs'); |
|
19 | + // REMOVE BREADCRUMB |
|
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 | + |
|
27 | + // REMOVE PAGE TITLES |
|
28 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
29 | + remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10); |
|
30 | + remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
31 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
32 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
33 | + |
|
34 | + |
|
35 | + // CAHNGE PAGE TITLES |
|
36 | + remove_action('page_title', 'mk_page_title'); |
|
37 | + add_action('page_title', 'gd_mk_page_title'); |
|
38 | + // CHANGE BREADCRUMS FOR GD PAGES |
|
39 | + remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs'); |
|
40 | + add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs'); |
|
41 | 41 | |
42 | 42 | |
43 | 43 | } |
@@ -52,19 +52,19 @@ discard block |
||
52 | 52 | function gd_mk_theme_breadcrumbs() |
53 | 53 | { |
54 | 54 | |
55 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
56 | - jupiter_geodir_breadcrumb(); |
|
57 | - } elseif (geodir_is_page('listing')) { |
|
58 | - jupiter_geodir_breadcrumb(); |
|
59 | - } elseif (geodir_is_page('detail')) { |
|
60 | - jupiter_geodir_breadcrumb(); |
|
61 | - } elseif (geodir_is_page('search')) { |
|
62 | - jupiter_geodir_breadcrumb(); |
|
63 | - } elseif (geodir_is_page('author')) { |
|
64 | - jupiter_geodir_breadcrumb(); |
|
65 | - } else { |
|
66 | - mk_theme_breadcrumbs(); |
|
67 | - } |
|
55 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
56 | + jupiter_geodir_breadcrumb(); |
|
57 | + } elseif (geodir_is_page('listing')) { |
|
58 | + jupiter_geodir_breadcrumb(); |
|
59 | + } elseif (geodir_is_page('detail')) { |
|
60 | + jupiter_geodir_breadcrumb(); |
|
61 | + } elseif (geodir_is_page('search')) { |
|
62 | + jupiter_geodir_breadcrumb(); |
|
63 | + } elseif (geodir_is_page('author')) { |
|
64 | + jupiter_geodir_breadcrumb(); |
|
65 | + } else { |
|
66 | + mk_theme_breadcrumbs(); |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -76,35 +76,35 @@ discard block |
||
76 | 76 | */ |
77 | 77 | function gd_mk_page_title() |
78 | 78 | { |
79 | - global $wp; |
|
80 | - |
|
81 | - |
|
82 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
83 | - jupiter_geodir_page_title(); |
|
84 | - } elseif (geodir_is_page('listing')) { |
|
85 | - ob_start(); // Start buffering; |
|
86 | - geodir_action_listings_title(); |
|
87 | - $gd_title = ob_get_clean(); |
|
88 | - $title_p = explode('">', $gd_title); |
|
89 | - $title = str_replace('</h1></header>', "", $title_p[2]); |
|
90 | - jupiter_geodir_page_title($title); |
|
91 | - } elseif (geodir_is_page('search')) { |
|
92 | - ob_start(); // Start buffering; |
|
93 | - geodir_action_listings_title(); |
|
94 | - $gd_title = ob_get_clean(); |
|
95 | - $title_p = explode('">', $gd_title); |
|
96 | - $title = str_replace('</h1></header>', "", $title_p[2]); |
|
97 | - jupiter_geodir_page_title($title); |
|
98 | - } elseif (geodir_is_page('author')) { |
|
99 | - ob_start(); // Start buffering; |
|
100 | - geodir_action_author_page_title(); |
|
101 | - $gd_title = ob_get_clean(); |
|
102 | - $gd_title = str_replace('<h1>', "", $gd_title); |
|
103 | - $gd_title = str_replace('</h1>', "", $gd_title); |
|
104 | - jupiter_geodir_page_title($gd_title); |
|
105 | - } else { |
|
106 | - mk_page_title(); |
|
107 | - } |
|
79 | + global $wp; |
|
80 | + |
|
81 | + |
|
82 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
83 | + jupiter_geodir_page_title(); |
|
84 | + } elseif (geodir_is_page('listing')) { |
|
85 | + ob_start(); // Start buffering; |
|
86 | + geodir_action_listings_title(); |
|
87 | + $gd_title = ob_get_clean(); |
|
88 | + $title_p = explode('">', $gd_title); |
|
89 | + $title = str_replace('</h1></header>', "", $title_p[2]); |
|
90 | + jupiter_geodir_page_title($title); |
|
91 | + } elseif (geodir_is_page('search')) { |
|
92 | + ob_start(); // Start buffering; |
|
93 | + geodir_action_listings_title(); |
|
94 | + $gd_title = ob_get_clean(); |
|
95 | + $title_p = explode('">', $gd_title); |
|
96 | + $title = str_replace('</h1></header>', "", $title_p[2]); |
|
97 | + jupiter_geodir_page_title($title); |
|
98 | + } elseif (geodir_is_page('author')) { |
|
99 | + ob_start(); // Start buffering; |
|
100 | + geodir_action_author_page_title(); |
|
101 | + $gd_title = ob_get_clean(); |
|
102 | + $gd_title = str_replace('<h1>', "", $gd_title); |
|
103 | + $gd_title = str_replace('</h1>', "", $gd_title); |
|
104 | + jupiter_geodir_page_title($gd_title); |
|
105 | + } else { |
|
106 | + mk_page_title(); |
|
107 | + } |
|
108 | 108 | |
109 | 109 | |
110 | 110 | } |
@@ -119,48 +119,48 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function jupiter_geodir_breadcrumb() |
121 | 121 | { |
122 | - $item = ''; |
|
123 | - ob_start(); // Start buffering; |
|
124 | - geodir_breadcrumb(); |
|
125 | - $gd_crums = ob_get_clean(); |
|
126 | - if ($gd_crums) { |
|
127 | - $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
128 | - $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
129 | - $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
130 | - $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
131 | - $gd_crums = explode(" > ", $gd_crums); |
|
132 | - $trail_end = array_pop($gd_crums); |
|
133 | - $gd_crums['trail_end'] = $trail_end; |
|
134 | - //print_r($gd_crums);exit; |
|
135 | - //print_r($trail); |
|
136 | - $item = $gd_crums; |
|
137 | - |
|
138 | - } |
|
139 | - if (!$item) { |
|
140 | - return; |
|
141 | - } |
|
142 | - global $mk_options, $post; |
|
143 | - $post_id = global_get_post_id(); |
|
144 | - |
|
145 | - if ($post_id) { |
|
146 | - $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true); |
|
147 | - $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true); |
|
148 | - if ($local_skining == 'true' && !empty($breadcrumb_skin)) { |
|
149 | - $breadcrumb_skin_class = $breadcrumb_skin; |
|
150 | - } else { |
|
151 | - $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
152 | - } |
|
153 | - } else { |
|
154 | - $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
155 | - } |
|
156 | - |
|
157 | - |
|
158 | - $delimiter = ' / '; |
|
159 | - |
|
160 | - echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
161 | - |
|
162 | - echo implode($delimiter, $item); |
|
163 | - echo "</div></div>"; |
|
122 | + $item = ''; |
|
123 | + ob_start(); // Start buffering; |
|
124 | + geodir_breadcrumb(); |
|
125 | + $gd_crums = ob_get_clean(); |
|
126 | + if ($gd_crums) { |
|
127 | + $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
128 | + $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
129 | + $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
130 | + $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
131 | + $gd_crums = explode(" > ", $gd_crums); |
|
132 | + $trail_end = array_pop($gd_crums); |
|
133 | + $gd_crums['trail_end'] = $trail_end; |
|
134 | + //print_r($gd_crums);exit; |
|
135 | + //print_r($trail); |
|
136 | + $item = $gd_crums; |
|
137 | + |
|
138 | + } |
|
139 | + if (!$item) { |
|
140 | + return; |
|
141 | + } |
|
142 | + global $mk_options, $post; |
|
143 | + $post_id = global_get_post_id(); |
|
144 | + |
|
145 | + if ($post_id) { |
|
146 | + $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true); |
|
147 | + $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true); |
|
148 | + if ($local_skining == 'true' && !empty($breadcrumb_skin)) { |
|
149 | + $breadcrumb_skin_class = $breadcrumb_skin; |
|
150 | + } else { |
|
151 | + $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
152 | + } |
|
153 | + } else { |
|
154 | + $breadcrumb_skin_class = $mk_options['breadcrumb_skin']; |
|
155 | + } |
|
156 | + |
|
157 | + |
|
158 | + $delimiter = ' / '; |
|
159 | + |
|
160 | + echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">'; |
|
161 | + |
|
162 | + echo implode($delimiter, $item); |
|
163 | + echo "</div></div>"; |
|
164 | 164 | |
165 | 165 | } |
166 | 166 | |
@@ -174,41 +174,41 @@ discard block |
||
174 | 174 | */ |
175 | 175 | function jupiter_geodir_page_title($title = '', $subtitle = '') |
176 | 176 | { |
177 | - global $mk_options; |
|
178 | - |
|
179 | - $post_id = global_get_post_id(); |
|
180 | - $shadow_css = ''; |
|
181 | - if ($mk_options['page_title_shadow'] == 'true') { |
|
182 | - $shadow_css = 'mk-drop-shadow'; |
|
183 | - } |
|
184 | - |
|
185 | - $align = !empty($align) ? $align : 'left'; |
|
186 | - |
|
187 | - //$title = 'xxxx'; |
|
188 | - echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
189 | - echo '<div class="mk-grid">'; |
|
190 | - if (!empty($title)) { |
|
191 | - echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
192 | - |
|
193 | - } |
|
194 | - |
|
195 | - if (!empty($subtitle)) { |
|
196 | - echo '<div class="page-introduce-subtitle">'; |
|
197 | - echo $subtitle; |
|
198 | - echo '</div>'; |
|
199 | - } |
|
200 | - if ($mk_options['disable_breadcrumb'] == 'true') { |
|
201 | - if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') { |
|
202 | - /** |
|
203 | - * Calls the theme breadcrumbs for Jupiter theme. |
|
204 | - * |
|
205 | - * @since 1.4.0 |
|
206 | - */ |
|
207 | - do_action('theme_breadcrumbs', $post_id); |
|
208 | - } |
|
209 | - } |
|
210 | - |
|
211 | - echo '<div class="clearboth"></div></div></section>'; |
|
177 | + global $mk_options; |
|
178 | + |
|
179 | + $post_id = global_get_post_id(); |
|
180 | + $shadow_css = ''; |
|
181 | + if ($mk_options['page_title_shadow'] == 'true') { |
|
182 | + $shadow_css = 'mk-drop-shadow'; |
|
183 | + } |
|
184 | + |
|
185 | + $align = !empty($align) ? $align : 'left'; |
|
186 | + |
|
187 | + //$title = 'xxxx'; |
|
188 | + echo '<section id="mk-page-introduce" class="intro-' . $align . '">'; |
|
189 | + echo '<div class="mk-grid">'; |
|
190 | + if (!empty($title)) { |
|
191 | + echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>'; |
|
192 | + |
|
193 | + } |
|
194 | + |
|
195 | + if (!empty($subtitle)) { |
|
196 | + echo '<div class="page-introduce-subtitle">'; |
|
197 | + echo $subtitle; |
|
198 | + echo '</div>'; |
|
199 | + } |
|
200 | + if ($mk_options['disable_breadcrumb'] == 'true') { |
|
201 | + if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') { |
|
202 | + /** |
|
203 | + * Calls the theme breadcrumbs for Jupiter theme. |
|
204 | + * |
|
205 | + * @since 1.4.0 |
|
206 | + */ |
|
207 | + do_action('theme_breadcrumbs', $post_id); |
|
208 | + } |
|
209 | + } |
|
210 | + |
|
211 | + echo '<div class="clearboth"></div></div></section>'; |
|
212 | 212 | |
213 | 213 | |
214 | 214 | } |
@@ -126,8 +126,10 @@ |
||
126 | 126 | $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
127 | 127 | if (preg_match_all("/$regexp/siU", $crums, $matches)) { |
128 | 128 | return $matches[0]; |
129 | - } else return ''; |
|
130 | -} |
|
129 | + } else { |
|
130 | + return ''; |
|
131 | + } |
|
132 | + } |
|
131 | 133 | |
132 | 134 | |
133 | 135 | /** |
@@ -16,36 +16,36 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function multi_news_action_calls() |
18 | 18 | { |
19 | - // REMOVE BREADCRUMB |
|
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 | - |
|
27 | - //ADD BREADCRUMS |
|
28 | - add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
29 | - add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
30 | - add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
31 | - add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
32 | - //add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
33 | - add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
34 | - |
|
35 | - |
|
36 | - // fix breadcrums |
|
37 | - add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1); |
|
38 | - |
|
39 | - // REMOVE PAGE TITLES |
|
40 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
41 | - // remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10); |
|
42 | - remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
43 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
44 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
45 | - |
|
46 | - |
|
47 | - add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1); |
|
48 | - add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1); |
|
19 | + // REMOVE BREADCRUMB |
|
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 | + |
|
27 | + //ADD BREADCRUMS |
|
28 | + add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
29 | + add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
30 | + add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
31 | + add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
32 | + //add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
33 | + add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
34 | + |
|
35 | + |
|
36 | + // fix breadcrums |
|
37 | + add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1); |
|
38 | + |
|
39 | + // REMOVE PAGE TITLES |
|
40 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
41 | + // remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10); |
|
42 | + remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
43 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
44 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
45 | + |
|
46 | + |
|
47 | + add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1); |
|
48 | + add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | */ |
58 | 58 | function gd_mn_extra_wrap($page) |
59 | 59 | { |
60 | - if ($page == 'add-listing-page') { |
|
61 | - echo '<div class="site-content page-wrap">'; |
|
62 | - } elseif ($page == 'signup-page') { |
|
63 | - echo '</div><div class="section full-width-section" style="float: left;width:100%;">'; |
|
64 | - } |
|
60 | + if ($page == 'add-listing-page') { |
|
61 | + echo '<div class="site-content page-wrap">'; |
|
62 | + } elseif ($page == 'signup-page') { |
|
63 | + echo '</div><div class="section full-width-section" style="float: left;width:100%;">'; |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function gd_mn_extra_wrap_end($page) |
77 | 77 | { |
78 | - if ($page == 'add-listing-page') { |
|
79 | - echo '</div>'; |
|
80 | - } |
|
78 | + if ($page == 'add-listing-page') { |
|
79 | + echo '</div>'; |
|
80 | + } |
|
81 | 81 | |
82 | 82 | } |
83 | 83 | |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | function gd_mn_replace_breadcrums() |
92 | 92 | { |
93 | 93 | |
94 | - if (mom_option('breadcrumb') != 0) { ?> |
|
94 | + if (mom_option('breadcrumb') != 0) { ?> |
|
95 | 95 | <?php if (mom_option('cats_bread')) { |
96 | - $cclass = ''; |
|
97 | - if (mom_option('cat_slider') == false) { |
|
98 | - $cclass = 'post-crumbs '; |
|
99 | - } |
|
100 | - ?> |
|
96 | + $cclass = ''; |
|
97 | + if (mom_option('cat_slider') == false) { |
|
98 | + $cclass = 'post-crumbs '; |
|
99 | + } |
|
100 | + ?> |
|
101 | 101 | <div class="<?php echo $cclass; ?>entry-crumbs" xmlns:v="http://rdf.data-vocabulary.org/#"> |
102 | 102 | |
103 | 103 | <?php mom_breadcrumb(); ?> |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function gd_get_breadcrum_links() |
121 | 121 | { |
122 | - ob_start(); |
|
123 | - geodir_breadcrumb(); |
|
124 | - $crums = ob_get_contents(); |
|
125 | - ob_get_clean(); |
|
126 | - $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
|
127 | - if (preg_match_all("/$regexp/siU", $crums, $matches)) { |
|
128 | - return $matches[0]; |
|
129 | - } else return ''; |
|
122 | + ob_start(); |
|
123 | + geodir_breadcrumb(); |
|
124 | + $crums = ob_get_contents(); |
|
125 | + ob_get_clean(); |
|
126 | + $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
|
127 | + if (preg_match_all("/$regexp/siU", $crums, $matches)) { |
|
128 | + return $matches[0]; |
|
129 | + } else return ''; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -140,30 +140,30 @@ discard block |
||
140 | 140 | */ |
141 | 141 | function gd_breadcrumbs_plus_items($items) |
142 | 142 | { //print_r($items);exit; |
143 | - $bits = array(); |
|
144 | - $pieces = gd_get_breadcrum_links(); |
|
145 | - //unset($pieces[0]); |
|
146 | - $bits = $pieces; |
|
143 | + $bits = array(); |
|
144 | + $pieces = gd_get_breadcrum_links(); |
|
145 | + //unset($pieces[0]); |
|
146 | + $bits = $pieces; |
|
147 | 147 | |
148 | - $title = $items['last']; |
|
149 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
148 | + $title = $items['last']; |
|
149 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
150 | 150 | |
151 | - } elseif (geodir_is_page('listing')) { |
|
151 | + } elseif (geodir_is_page('listing')) { |
|
152 | 152 | |
153 | - } elseif (geodir_is_page('detail')) { |
|
154 | - ob_start(); |
|
155 | - geodir_action_page_title(); |
|
156 | - $title = ob_get_contents(); |
|
157 | - ob_end_clean(); |
|
158 | - } elseif (geodir_is_page('search')) { |
|
159 | - } elseif (geodir_is_page('author')) { |
|
160 | - } |
|
153 | + } elseif (geodir_is_page('detail')) { |
|
154 | + ob_start(); |
|
155 | + geodir_action_page_title(); |
|
156 | + $title = ob_get_contents(); |
|
157 | + ob_end_clean(); |
|
158 | + } elseif (geodir_is_page('search')) { |
|
159 | + } elseif (geodir_is_page('author')) { |
|
160 | + } |
|
161 | 161 | |
162 | - $title = strip_tags($title); |
|
163 | - $items = gd_breadcrumbs_plus_items_add($items, $bits, $title); |
|
162 | + $title = strip_tags($title); |
|
163 | + $items = gd_breadcrumbs_plus_items_add($items, $bits, $title); |
|
164 | 164 | |
165 | 165 | |
166 | - return $items; |
|
166 | + return $items; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -179,28 +179,28 @@ discard block |
||
179 | 179 | */ |
180 | 180 | function gd_breadcrumbs_plus_items_add($items, $bits, $last) |
181 | 181 | { |
182 | - //$pieces = explode("</div>", $items[0]); |
|
183 | - if (is_array($bits)) { |
|
184 | - $items = array(); |
|
185 | - $pieces = ''; |
|
186 | - foreach ($bits as $bit) { |
|
187 | - $pieces .= $bit; |
|
188 | - } |
|
189 | - $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>"; |
|
190 | - if (isset($last) && $last) { |
|
191 | - $items['last'] = $last; |
|
192 | - } |
|
193 | - } |
|
194 | - |
|
195 | - //print_r($items); |
|
196 | - return $items; |
|
182 | + //$pieces = explode("</div>", $items[0]); |
|
183 | + if (is_array($bits)) { |
|
184 | + $items = array(); |
|
185 | + $pieces = ''; |
|
186 | + foreach ($bits as $bit) { |
|
187 | + $pieces .= $bit; |
|
188 | + } |
|
189 | + $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>"; |
|
190 | + if (isset($last) && $last) { |
|
191 | + $items['last'] = $last; |
|
192 | + } |
|
193 | + } |
|
194 | + |
|
195 | + //print_r($items); |
|
196 | + return $items; |
|
197 | 197 | |
198 | 198 | } |
199 | 199 | |
200 | 200 | add_filter('geodir_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1); |
201 | 201 | add_filter('geodir_location_switcher_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1); |
202 | 202 | function gd_multinews_mobile_menu_caret($html){ |
203 | - $html .= '<i class="responsive-caret"></i>'; |
|
204 | - return $html; |
|
203 | + $html .= '<i class="responsive-caret"></i>'; |
|
204 | + return $html; |
|
205 | 205 | |
206 | 206 | } |
@@ -197,9 +197,9 @@ |
||
197 | 197 | |
198 | 198 | } |
199 | 199 | |
200 | -add_filter('geodir_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1); |
|
201 | -add_filter('geodir_location_switcher_menu_after_sub_ul','gd_multinews_mobile_menu_caret',10,1); |
|
202 | -function gd_multinews_mobile_menu_caret($html){ |
|
200 | +add_filter('geodir_menu_after_sub_ul', 'gd_multinews_mobile_menu_caret', 10, 1); |
|
201 | +add_filter('geodir_location_switcher_menu_after_sub_ul', 'gd_multinews_mobile_menu_caret', 10, 1); |
|
202 | +function gd_multinews_mobile_menu_caret($html) { |
|
203 | 203 | $html .= '<i class="responsive-caret"></i>'; |
204 | 204 | return $html; |
205 | 205 |
@@ -39,8 +39,9 @@ discard block |
||
39 | 39 | if (get_option('geodir_show_listing_nav')) { |
40 | 40 | |
41 | 41 | $menu_class = ''; |
42 | - if (geodir_is_page('listing')) |
|
43 | - $menu_class = 'current-menu-item'; |
|
42 | + if (geodir_is_page('listing')) { |
|
43 | + $menu_class = 'current-menu-item'; |
|
44 | + } |
|
44 | 45 | |
45 | 46 | |
46 | 47 | //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
@@ -52,8 +53,9 @@ discard block |
||
52 | 53 | if (in_array($post_type, $show_post_type_main_nav)) { |
53 | 54 | if (get_post_type_archive_link($post_type)) { |
54 | 55 | $menu_class = ''; |
55 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
56 | - $menu_class = 'current-menu-item'; |
|
56 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) { |
|
57 | + $menu_class = 'current-menu-item'; |
|
58 | + } |
|
57 | 59 | /** |
58 | 60 | * Filter the menu li class. |
59 | 61 | * |
@@ -130,8 +132,9 @@ discard block |
||
130 | 132 | if (get_post_type_archive_link($post_type)) { |
131 | 133 | |
132 | 134 | $menu_class = ''; |
133 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
134 | - $menu_class = 'current-menu-item'; |
|
135 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) { |
|
136 | + $menu_class = 'current-menu-item'; |
|
137 | + } |
|
135 | 138 | |
136 | 139 | $items .= '<li class="' . $sub_li_class . '"> |
137 | 140 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
@@ -153,8 +156,9 @@ discard block |
||
153 | 156 | if (get_option('geodir_show_addlisting_nav')) { |
154 | 157 | |
155 | 158 | $menu_class = ''; |
156 | - if (geodir_is_page('add-listing')) |
|
157 | - $menu_class = 'current-menu-item'; |
|
159 | + if (geodir_is_page('add-listing')) { |
|
160 | + $menu_class = 'current-menu-item'; |
|
161 | + } |
|
158 | 162 | |
159 | 163 | //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
160 | 164 | $post_types = geodir_get_posttypes('object'); |
@@ -170,8 +174,9 @@ discard block |
||
170 | 174 | if (geodir_get_addlisting_link($post_type)) { |
171 | 175 | |
172 | 176 | $menu_class = ''; |
173 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
174 | - $menu_class = 'current-menu-item'; |
|
177 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) { |
|
178 | + $menu_class = 'current-menu-item'; |
|
179 | + } |
|
175 | 180 | /** |
176 | 181 | * Filter the menu li class. |
177 | 182 | * |
@@ -255,8 +260,9 @@ discard block |
||
255 | 260 | if (geodir_get_addlisting_link($post_type)) { |
256 | 261 | |
257 | 262 | $menu_class = ''; |
258 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
259 | - $menu_class = 'current-menu-item'; |
|
263 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) { |
|
264 | + $menu_class = 'current-menu-item'; |
|
265 | + } |
|
260 | 266 | /** |
261 | 267 | * Filter the menu li class. |
262 | 268 | * |
@@ -311,8 +317,9 @@ discard block |
||
311 | 317 | } |
312 | 318 | //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
313 | 319 | // $menu = str_replace("</ul></div>",geodir_add_nav_menu_items()."</ul></div>",$menu); |
314 | - else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
315 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
320 | + else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) { |
|
321 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
322 | + } |
|
316 | 323 | |
317 | 324 | return $menu; |
318 | 325 | |
@@ -398,24 +405,28 @@ discard block |
||
398 | 405 | $geodir_post_type = get_query_var('post_type'); |
399 | 406 | |
400 | 407 | if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
401 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
402 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
403 | - elseif (isset($_REQUEST['listing_type'])) |
|
404 | - $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
408 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
409 | + $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
410 | + } elseif (isset($_REQUEST['listing_type'])) { |
|
411 | + $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
412 | + } |
|
405 | 413 | } |
406 | 414 | |
407 | - if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) |
|
408 | - $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
415 | + if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) { |
|
416 | + $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
417 | + } |
|
409 | 418 | |
410 | - if (is_tax()) |
|
411 | - $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
419 | + if (is_tax()) { |
|
420 | + $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
421 | + } |
|
412 | 422 | |
413 | 423 | |
414 | 424 | $all_postypes = geodir_get_posttypes(); |
415 | 425 | $all_postypes = stripslashes_deep($all_postypes); |
416 | 426 | |
417 | - if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
418 | - $geodir_post_type = ''; |
|
427 | + if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) { |
|
428 | + $geodir_post_type = ''; |
|
429 | + } |
|
419 | 430 | |
420 | 431 | |
421 | 432 | return $geodir_post_type; |
@@ -462,11 +473,12 @@ discard block |
||
462 | 473 | endswitch; |
463 | 474 | } |
464 | 475 | |
465 | - if (!empty($post_types)) |
|
466 | - return $post_types; |
|
467 | - else |
|
468 | - return array(); |
|
469 | -} |
|
476 | + if (!empty($post_types)) { |
|
477 | + return $post_types; |
|
478 | + } else { |
|
479 | + return array(); |
|
480 | + } |
|
481 | + } |
|
470 | 482 | |
471 | 483 | /** |
472 | 484 | * Get Custom Post Type info. |
@@ -483,9 +495,10 @@ discard block |
||
483 | 495 | $post_types = stripslashes_deep($post_types); |
484 | 496 | if (!empty($post_types) && $post_type != '') { |
485 | 497 | return $post_types[$post_type]; |
486 | - } else |
|
487 | - return false; |
|
488 | -} |
|
498 | + } else { |
|
499 | + return false; |
|
500 | + } |
|
501 | + } |
|
489 | 502 | |
490 | 503 | if (!function_exists('geodir_get_taxonomies')) { |
491 | 504 | /** |
@@ -509,18 +522,21 @@ discard block |
||
509 | 522 | $gd_taxonomies = array_keys($taxonomies); |
510 | 523 | |
511 | 524 | |
512 | - if ($post_type != '') |
|
513 | - $gd_taxonomies = array(); |
|
525 | + if ($post_type != '') { |
|
526 | + $gd_taxonomies = array(); |
|
527 | + } |
|
514 | 528 | |
515 | 529 | $i = 0; |
516 | 530 | foreach ($taxonomies as $taxonomy => $args) { |
517 | 531 | |
518 | - if ($post_type != '' && $args['object_type'] == $post_type) |
|
519 | - $gd_taxonomies[] = $taxonomy; |
|
532 | + if ($post_type != '' && $args['object_type'] == $post_type) { |
|
533 | + $gd_taxonomies[] = $taxonomy; |
|
534 | + } |
|
520 | 535 | |
521 | 536 | if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) { |
522 | - if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
523 | - unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
537 | + if (array_search($taxonomy, $gd_taxonomies) !== false) { |
|
538 | + unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
539 | + } |
|
524 | 540 | } |
525 | 541 | |
526 | 542 | } |
@@ -575,10 +591,11 @@ discard block |
||
575 | 591 | . ucfirst($category_obj->name) . '</option>'; |
576 | 592 | } |
577 | 593 | |
578 | - if ($echo) |
|
579 | - echo $html; |
|
580 | - else |
|
581 | - return $html; |
|
594 | + if ($echo) { |
|
595 | + echo $html; |
|
596 | + } else { |
|
597 | + return $html; |
|
598 | + } |
|
582 | 599 | } |
583 | 600 | } |
584 | 601 | |
@@ -612,11 +629,12 @@ discard block |
||
612 | 629 | |
613 | 630 | } |
614 | 631 | |
615 | - if (!empty($listing_slug)) |
|
616 | - return $listing_slug; |
|
617 | - else |
|
618 | - return false; |
|
619 | -} |
|
632 | + if (!empty($listing_slug)) { |
|
633 | + return $listing_slug; |
|
634 | + } else { |
|
635 | + return false; |
|
636 | + } |
|
637 | + } |
|
620 | 638 | |
621 | 639 | |
622 | 640 | /** |
@@ -647,16 +665,18 @@ discard block |
||
647 | 665 | if (!empty($taxonomies)) { |
648 | 666 | foreach (geodir_get_posttypes() as $pt) { |
649 | 667 | $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
650 | - if (array_intersect($taxonomies, $object_taxonomies)) |
|
651 | - $post_type[] = $pt; |
|
668 | + if (array_intersect($taxonomies, $object_taxonomies)) { |
|
669 | + $post_type[] = $pt; |
|
670 | + } |
|
652 | 671 | } |
653 | 672 | } |
654 | 673 | |
655 | - if (!empty($post_type)) |
|
656 | - return $post_type[0]; |
|
657 | - else |
|
658 | - return false; |
|
659 | -} |
|
674 | + if (!empty($post_type)) { |
|
675 | + return $post_type[0]; |
|
676 | + } else { |
|
677 | + return false; |
|
678 | + } |
|
679 | + } |
|
660 | 680 | |
661 | 681 | if (!function_exists('geodir_custom_taxonomy_walker')) { |
662 | 682 | /** |
@@ -712,18 +732,18 @@ discard block |
||
712 | 732 | $checked = ''; |
713 | 733 | |
714 | 734 | if (in_array($cat_term->term_id, $search_terms)) { |
715 | - if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
716 | - $checked = 'selected="selected"'; |
|
717 | - else |
|
718 | - $checked = 'checked="checked"'; |
|
735 | + if ($cat_display == 'select' || $cat_display == 'multiselect') { |
|
736 | + $checked = 'selected="selected"'; |
|
737 | + } else { |
|
738 | + $checked = 'checked="checked"'; |
|
739 | + } |
|
719 | 740 | } |
720 | 741 | |
721 | - if ($cat_display == 'radio') |
|
722 | - $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
723 | - elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
724 | - $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
725 | - |
|
726 | - else { |
|
742 | + if ($cat_display == 'radio') { |
|
743 | + $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
744 | + } elseif ($cat_display == 'select' || $cat_display == 'multiselect') { |
|
745 | + $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
746 | + } else { |
|
727 | 747 | $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
728 | 748 | } |
729 | 749 | |
@@ -732,8 +752,9 @@ discard block |
||
732 | 752 | |
733 | 753 | } |
734 | 754 | |
735 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
736 | - $out .= '</div>'; |
|
755 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') { |
|
756 | + $out .= '</div>'; |
|
757 | + } |
|
737 | 758 | |
738 | 759 | return $out; |
739 | 760 | } |
@@ -759,18 +780,21 @@ discard block |
||
759 | 780 | global $exclude_cats, $gd_session; |
760 | 781 | |
761 | 782 | $cat_exclude = ''; |
762 | - if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
763 | - $cat_exclude = serialize($exclude_cats); |
|
783 | + if (is_array($exclude_cats) && !empty($exclude_cats)) { |
|
784 | + $cat_exclude = serialize($exclude_cats); |
|
785 | + } |
|
764 | 786 | |
765 | 787 | if (isset($_REQUEST['backandedit'])) { |
766 | 788 | $post = (object)$gd_session->get('listing'); |
767 | 789 | |
768 | - if (!is_array($post->post_category[$cat_taxonomy])) |
|
769 | - $post_category = $post->post_category[$cat_taxonomy]; |
|
790 | + if (!is_array($post->post_category[$cat_taxonomy])) { |
|
791 | + $post_category = $post->post_category[$cat_taxonomy]; |
|
792 | + } |
|
770 | 793 | |
771 | 794 | $post_categories = $post->post_category_str; |
772 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
773 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
795 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
796 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
797 | + } |
|
774 | 798 | |
775 | 799 | } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) { |
776 | 800 | global $post; |
@@ -961,8 +985,9 @@ discard block |
||
961 | 985 | if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
962 | 986 | $post_cat_str = $post_categories[$cat_taxonomy]; |
963 | 987 | $post_cat_array = explode("#", $post_cat_str); |
964 | - if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
965 | - $style = "display:none;"; |
|
988 | + if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) { |
|
989 | + $style = "display:none;"; |
|
990 | + } |
|
966 | 991 | } |
967 | 992 | ?> |
968 | 993 | <div class="main_cat_list" style=" <?php if (isset($style)) { |
@@ -997,7 +1022,7 @@ discard block |
||
997 | 1022 | print_r($exclude_cats); |
998 | 1023 | if(is_array( $exclude_cats)){ |
999 | 1024 | $exclude_cats = array_map( 'intval', $exclude_cats ); |
1000 | - }else{ |
|
1025 | + } else{ |
|
1001 | 1026 | $exclude_cats = intval($exclude_cats); |
1002 | 1027 | } |
1003 | 1028 | |
@@ -1027,7 +1052,10 @@ discard block |
||
1027 | 1052 | |
1028 | 1053 | <div class="post_default_category"> |
1029 | 1054 | <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id;?>" |
1030 | - onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" ';?> /> |
|
1055 | + onchange="update_listing_cat()" <?php if ($default) { |
|
1056 | + echo ' checked="checked" '; |
|
1057 | +} |
|
1058 | +?> /> |
|
1031 | 1059 | <span> |
1032 | 1060 | <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name));?> |
1033 | 1061 | </span> |
@@ -1127,8 +1155,9 @@ discard block |
||
1127 | 1155 | $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
1128 | 1156 | |
1129 | 1157 | $option_selected = ''; |
1130 | - if (!$selected) |
|
1131 | - $option_slected = ' selected="selected" '; |
|
1158 | + if (!$selected) { |
|
1159 | + $option_slected = ' selected="selected" '; |
|
1160 | + } |
|
1132 | 1161 | |
1133 | 1162 | echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
1134 | 1163 | |
@@ -1136,8 +1165,9 @@ discard block |
||
1136 | 1165 | |
1137 | 1166 | foreach ($cat_terms as $cat_term) { |
1138 | 1167 | $option_selected = ''; |
1139 | - if ($selected == $cat_term->term_id) |
|
1140 | - $option_selected = ' selected="selected" '; |
|
1168 | + if ($selected == $cat_term->term_id) { |
|
1169 | + $option_selected = ' selected="selected" '; |
|
1170 | + } |
|
1141 | 1171 | |
1142 | 1172 | // Count child terms |
1143 | 1173 | $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
@@ -1202,8 +1232,9 @@ discard block |
||
1202 | 1232 | |
1203 | 1233 | $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
1204 | 1234 | |
1205 | - if (!$listing_slug = get_option('geodir_listing_prefix')) |
|
1206 | - $listing_slug = 'places'; |
|
1235 | + if (!$listing_slug = get_option('geodir_listing_prefix')) { |
|
1236 | + $listing_slug = 'places'; |
|
1237 | + } |
|
1207 | 1238 | |
1208 | 1239 | /** |
1209 | 1240 | * Taxonomies |
@@ -1351,7 +1382,7 @@ discard block |
||
1351 | 1382 | //print_r( $segments); |
1352 | 1383 | if($gd_wpml_get_languages){ |
1353 | 1384 | $langs = $gd_wpml_get_languages; |
1354 | - }else{ |
|
1385 | + } else{ |
|
1355 | 1386 | global $sitepress; |
1356 | 1387 | $gd_wpml_get_languages = $sitepress->get_active_languages(); |
1357 | 1388 | } |
@@ -1494,8 +1525,9 @@ discard block |
||
1494 | 1525 | 'city_slug' => $post->city_slug |
1495 | 1526 | ); |
1496 | 1527 | |
1497 | - } else |
|
1498 | - $post_location = geodir_get_location(); |
|
1528 | + } else { |
|
1529 | + $post_location = geodir_get_location(); |
|
1530 | + } |
|
1499 | 1531 | |
1500 | 1532 | |
1501 | 1533 | } else { |
@@ -1524,8 +1556,9 @@ discard block |
||
1524 | 1556 | ); |
1525 | 1557 | |
1526 | 1558 | } |
1527 | - } else |
|
1528 | - $post_location = geodir_get_location(); |
|
1559 | + } else { |
|
1560 | + $post_location = geodir_get_location(); |
|
1561 | + } |
|
1529 | 1562 | } |
1530 | 1563 | |
1531 | 1564 | |
@@ -1568,8 +1601,9 @@ discard block |
||
1568 | 1601 | $post_terms = $post_terms[0]; |
1569 | 1602 | } |
1570 | 1603 | |
1571 | - if (!$post_terms) |
|
1572 | - $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1604 | + if (!$post_terms) { |
|
1605 | + $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1606 | + } |
|
1573 | 1607 | |
1574 | 1608 | if (!$post_terms) { |
1575 | 1609 | $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
@@ -1583,8 +1617,9 @@ discard block |
||
1583 | 1617 | |
1584 | 1618 | $term = get_term_by('id', $post_terms, $taxonomies); |
1585 | 1619 | |
1586 | - if (!empty($term)) |
|
1587 | - $term_request = $term->slug; |
|
1620 | + if (!empty($term)) { |
|
1621 | + $term_request = $term->slug; |
|
1622 | + } |
|
1588 | 1623 | //$term_request = $term->slug.'/'; |
1589 | 1624 | } |
1590 | 1625 | |
@@ -1599,15 +1634,20 @@ discard block |
||
1599 | 1634 | $request_term .= $term_request; |
1600 | 1635 | |
1601 | 1636 | } else { |
1602 | - if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
1637 | + if (isset($location_request) && $location_request != '') { |
|
1638 | + $request_term = $location_request; |
|
1639 | + } |
|
1603 | 1640 | |
1604 | - if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
1641 | + if (isset($term_request) && $term_request != '') { |
|
1642 | + $request_term .= $term_request; |
|
1643 | + } |
|
1605 | 1644 | } |
1606 | 1645 | $request_term = trim($request_term, '/'); |
1607 | - if (!empty($request_term)) |
|
1608 | - $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1609 | - else |
|
1610 | - $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1646 | + if (!empty($request_term)) { |
|
1647 | + $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1648 | + } else { |
|
1649 | + $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1650 | + } |
|
1611 | 1651 | //echo $post_link ; |
1612 | 1652 | } |
1613 | 1653 | // temp cache the permalink |
@@ -1649,8 +1689,9 @@ discard block |
||
1649 | 1689 | if ($geodir_add_location_url && get_option('geodir_add_location_url')) { |
1650 | 1690 | $include_location = true; |
1651 | 1691 | } |
1652 | - } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) |
|
1653 | - $include_location = true; |
|
1692 | + } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) { |
|
1693 | + $include_location = true; |
|
1694 | + } |
|
1654 | 1695 | |
1655 | 1696 | if ($include_location) { |
1656 | 1697 | global $post; |
@@ -1800,10 +1841,11 @@ discard block |
||
1800 | 1841 | if (!is_object($obj_post_type)) { |
1801 | 1842 | return; |
1802 | 1843 | } |
1803 | - if ($echo) |
|
1804 | - echo $obj_post_type->labels->singular_name; |
|
1805 | - else |
|
1806 | - return $obj_post_type->labels->singular_name; |
|
1844 | + if ($echo) { |
|
1845 | + echo $obj_post_type->labels->singular_name; |
|
1846 | + } else { |
|
1847 | + return $obj_post_type->labels->singular_name; |
|
1848 | + } |
|
1807 | 1849 | |
1808 | 1850 | } |
1809 | 1851 | |
@@ -1820,14 +1862,16 @@ discard block |
||
1820 | 1862 | { |
1821 | 1863 | $all_postypes = geodir_get_posttypes(); |
1822 | 1864 | |
1823 | - if (!in_array($post_type, $all_postypes)) |
|
1824 | - return false; |
|
1865 | + if (!in_array($post_type, $all_postypes)) { |
|
1866 | + return false; |
|
1867 | + } |
|
1825 | 1868 | |
1826 | 1869 | $obj_post_type = get_post_type_object($post_type); |
1827 | - if ($echo) |
|
1828 | - echo $obj_post_type->labels->name; |
|
1829 | - else |
|
1830 | - return $obj_post_type->labels->name; |
|
1870 | + if ($echo) { |
|
1871 | + echo $obj_post_type->labels->name; |
|
1872 | + } else { |
|
1873 | + return $obj_post_type->labels->name; |
|
1874 | + } |
|
1831 | 1875 | |
1832 | 1876 | } |
1833 | 1877 | |
@@ -1852,19 +1896,22 @@ discard block |
||
1852 | 1896 | $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
1853 | 1897 | |
1854 | 1898 | if (is_int($term)) { |
1855 | - if (0 == $term) |
|
1856 | - return 0; |
|
1899 | + if (0 == $term) { |
|
1900 | + return 0; |
|
1901 | + } |
|
1857 | 1902 | $where = 't.term_id = %d'; |
1858 | - if (!empty($taxonomy)) |
|
1859 | - return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1860 | - else |
|
1861 | - return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1903 | + if (!empty($taxonomy)) { |
|
1904 | + return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1905 | + } else { |
|
1906 | + return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1907 | + } |
|
1862 | 1908 | } |
1863 | 1909 | |
1864 | 1910 | $term = trim(wp_unslash($term)); |
1865 | 1911 | |
1866 | - if ('' === $slug = sanitize_title($term)) |
|
1867 | - return 0; |
|
1912 | + if ('' === $slug = sanitize_title($term)) { |
|
1913 | + return 0; |
|
1914 | + } |
|
1868 | 1915 | |
1869 | 1916 | $where = 't.slug = %s'; |
1870 | 1917 | |
@@ -1881,14 +1928,16 @@ discard block |
||
1881 | 1928 | $where_fields[] = $taxonomy; |
1882 | 1929 | |
1883 | 1930 | |
1884 | - if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) |
|
1885 | - return $result; |
|
1931 | + if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) { |
|
1932 | + return $result; |
|
1933 | + } |
|
1886 | 1934 | |
1887 | 1935 | return false; |
1888 | 1936 | } |
1889 | 1937 | |
1890 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) |
|
1891 | - return $result; |
|
1938 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) { |
|
1939 | + return $result; |
|
1940 | + } |
|
1892 | 1941 | |
1893 | 1942 | return false; |
1894 | 1943 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $items .= '<li class="' . $sub_li_class . '"> |
137 | 137 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
138 | - ' . __(ucfirst($args->labels->name),'geodirectory') . ' |
|
138 | + ' . __(ucfirst($args->labels->name), 'geodirectory') . ' |
|
139 | 139 | </a> |
140 | 140 | </li>'; |
141 | 141 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * |
152 | 152 | * @since 1.5.9 |
153 | 153 | */ |
154 | - $items .= apply_filters('geodir_menu_after_sub_ul',''); |
|
154 | + $items .= apply_filters('geodir_menu_after_sub_ul', ''); |
|
155 | 155 | $items .= '</li>'; |
156 | 156 | } |
157 | 157 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
195 | 195 | $items .= '<li class="' . $li_class . '"> |
196 | 196 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $a_class . '"> |
197 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
|
197 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name) . ' |
|
198 | 198 | </a> |
199 | 199 | </li>'; |
200 | 200 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
274 | 274 | $items .= '<li class="' . $li_class . '"> |
275 | 275 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $sub_a_class . '"> |
276 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
|
276 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name) . ' |
|
277 | 277 | </a> |
278 | 278 | </li>'; |
279 | 279 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | $items .= ' </ul> '; |
288 | - $items .= apply_filters('geodir_menu_after_sub_ul',''); |
|
288 | + $items .= apply_filters('geodir_menu_after_sub_ul', ''); |
|
289 | 289 | $items .= '</li>'; |
290 | 290 | |
291 | 291 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | |
408 | 408 | if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
409 | 409 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
410 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
410 | + $geodir_post_type = get_post_type((int) $_REQUEST['pid']); |
|
411 | 411 | elseif (isset($_REQUEST['listing_type'])) |
412 | 412 | $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
413 | 413 | } |
@@ -447,14 +447,14 @@ discard block |
||
447 | 447 | switch ($output): |
448 | 448 | case 'object': |
449 | 449 | case 'Object': |
450 | - $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
450 | + $post_types = json_decode(json_encode($post_types), FALSE); //(object)$post_types; |
|
451 | 451 | break; |
452 | 452 | case 'array': |
453 | 453 | case 'Array': |
454 | - $post_types = (array)$post_types; |
|
454 | + $post_types = (array) $post_types; |
|
455 | 455 | break; |
456 | 456 | case 'options': |
457 | - $post_types = (array)$post_types; |
|
457 | + $post_types = (array) $post_types; |
|
458 | 458 | |
459 | 459 | $options = array(); |
460 | 460 | if (!empty($post_types)) { |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | } elseif (isset($wp_query->tax_query->queries)) { |
649 | 649 | $tax_arr = $wp_query->tax_query->queries; |
650 | 650 | //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
651 | - if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);} |
|
651 | + if (isset($tax_arr['relation'])) {unset($tax_arr['relation']); } |
|
652 | 652 | $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
653 | 653 | } |
654 | 654 | |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | $cat_exclude = serialize($exclude_cats); |
772 | 772 | |
773 | 773 | if (isset($_REQUEST['backandedit'])) { |
774 | - $post = (object)$gd_session->get('listing'); |
|
774 | + $post = (object) $gd_session->get('listing'); |
|
775 | 775 | |
776 | 776 | if (!is_array($post->post_category[$cat_taxonomy])) |
777 | 777 | $post_category = $post->post_category[$cat_taxonomy]; |
@@ -849,14 +849,14 @@ discard block |
||
849 | 849 | |
850 | 850 | function show_subcatlist(main_cat, catObj) { |
851 | 851 | if (main_cat != '') { |
852 | - var url = '<?php echo geodir_get_ajax_url();?>'; |
|
853 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
854 | - var cat_exclude = '<?php echo base64_encode($cat_exclude);?>'; |
|
852 | + var url = '<?php echo geodir_get_ajax_url(); ?>'; |
|
853 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
854 | + var cat_exclude = '<?php echo base64_encode($cat_exclude); ?>'; |
|
855 | 855 | var cat_limit = jQuery('#' + cat_taxonomy).find('#cat_limit').val(); |
856 | - <?php if ((int)$cat_limit > 0) { ?> |
|
856 | + <?php if ((int) $cat_limit > 0) { ?> |
|
857 | 857 | var selected = parseInt(jQuery('#' + cat_taxonomy).find('.cat_sublist > div.post_catlist_item').length); |
858 | 858 | if (cat_limit != '' && selected > 0 && selected >= cat_limit && cat_limit != 0) { |
859 | - alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int)$cat_limit));?>"); |
|
859 | + alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int) $cat_limit)); ?>"); |
|
860 | 860 | return false; |
861 | 861 | } |
862 | 862 | <?php } ?> |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | } |
896 | 896 | |
897 | 897 | function update_listing_cat(el) { |
898 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
898 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
899 | 899 | var cat_ids = ''; |
900 | 900 | var main_cat = ''; |
901 | 901 | var sub_cat = ''; |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | <div class="main_cat_list" style=" <?php if (isset($style)) { |
977 | 977 | echo $style; |
978 | 978 | }?> "> |
979 | - <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
979 | + <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
980 | 980 | ?> |
981 | 981 | </div> |
982 | 982 | <?php |
@@ -1003,9 +1003,9 @@ discard block |
||
1003 | 1003 | if ($exclude != '') { |
1004 | 1004 | $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
1005 | 1005 | |
1006 | - if(is_array( $exclude_cats)){ |
|
1007 | - $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
1008 | - }else{ |
|
1006 | + if (is_array($exclude_cats)) { |
|
1007 | + $exclude_cats = array_map('intval', $exclude_cats); |
|
1008 | + } else { |
|
1009 | 1009 | $exclude_cats = intval($exclude_cats); |
1010 | 1010 | } |
1011 | 1011 | |
@@ -1019,25 +1019,25 @@ discard block |
||
1019 | 1019 | <?php $main_cat = get_term($parrent, $request_taxonomy); ?> |
1020 | 1020 | |
1021 | 1021 | <div class="post_catlist_item" style="border:1px solid #CCCCCC; margin:5px auto; padding:5px;"> |
1022 | - <img alt="move icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/move.png';?>" |
|
1022 | + <img alt="move icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/move.png'; ?>" |
|
1023 | 1023 | onclick="jQuery(this).closest('div').remove();update_listing_cat(this);" align="right"/> |
1024 | 1024 | <?php /* ?> |
1025 | 1025 | <img src="<?php echo geodir_plugin_url().'/geodirectory-assets/images/move.png';?>" onclick="jQuery(this).closest('div').remove();show_subcatlist();" align="right" /> |
1026 | 1026 | <?php */ ?> |
1027 | 1027 | |
1028 | - <input type="checkbox" value="<?php echo $main_cat->term_id;?>" class="listing_main_cat" |
|
1028 | + <input type="checkbox" value="<?php echo $main_cat->term_id; ?>" class="listing_main_cat" |
|
1029 | 1029 | onchange="if(jQuery(this).is(':checked')){jQuery(this).closest('div').find('.post_default_category').prop('checked',false).show();}else{jQuery(this).closest('div').find('.post_default_category').prop('checked',false).hide();};update_listing_cat()" |
1030 | 1030 | checked="checked" disabled="disabled"/> |
1031 | 1031 | <span> |
1032 | - <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name));?> |
|
1032 | + <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?> |
|
1033 | 1033 | </span> |
1034 | 1034 | <br/> |
1035 | 1035 | |
1036 | 1036 | <div class="post_default_category"> |
1037 | - <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id;?>" |
|
1038 | - onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" ';?> /> |
|
1037 | + <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id; ?>" |
|
1038 | + onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" '; ?> /> |
|
1039 | 1039 | <span> |
1040 | - <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name));?> |
|
1040 | + <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?> |
|
1041 | 1041 | </span> |
1042 | 1042 | </div> |
1043 | 1043 | |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | $post_cat_str = $post_categories[$request_taxonomy]; |
1071 | 1071 | $post_cat_array = explode("#", $post_cat_str); |
1072 | 1072 | if (is_array($post_cat_array)) { |
1073 | - $post_cat_array = array_unique( $post_cat_array ); |
|
1073 | + $post_cat_array = array_unique($post_cat_array); |
|
1074 | 1074 | |
1075 | 1075 | foreach ($post_cat_array as $post_cat_html) { |
1076 | 1076 | |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | } |
1086 | 1086 | $post_sub_catid = ''; |
1087 | 1087 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
1088 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1088 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
1089 | 1089 | } |
1090 | 1090 | |
1091 | 1091 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | } |
1107 | 1107 | |
1108 | 1108 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
1109 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1109 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
1110 | 1110 | } |
1111 | 1111 | |
1112 | 1112 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1148,8 +1148,8 @@ discard block |
||
1148 | 1148 | $option_selected = ' selected="selected" '; |
1149 | 1149 | |
1150 | 1150 | // Count child terms |
1151 | - $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
1152 | - $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
1151 | + $child_terms = get_terms($cat_taxonomy, array('parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1)); |
|
1152 | + $has_child = !empty($child_terms) ? 't' : 'f'; |
|
1153 | 1153 | |
1154 | 1154 | echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
1155 | 1155 | } |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | 2 => __('Custom field updated.', 'geodirectory'), |
1183 | 1183 | 3 => __('Custom field deleted.', 'geodirectory'), |
1184 | 1184 | 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name), |
1185 | - 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false, |
|
1185 | + 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int) $_GET['revision'], false)) : false, |
|
1186 | 1186 | 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
1187 | 1187 | 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name), |
1188 | 1188 | 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | 'menu_icon' => $menu_icon, |
1320 | 1320 | 'public' => true, |
1321 | 1321 | 'query_var' => true, |
1322 | - 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true), |
|
1322 | + 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true), |
|
1323 | 1323 | 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/), |
1324 | 1324 | 'taxonomies' => array('gd_placecategory', 'gd_place_tags')); |
1325 | 1325 | |
@@ -1341,25 +1341,25 @@ discard block |
||
1341 | 1341 | } |
1342 | 1342 | |
1343 | 1343 | $gd_wpml_get_languages = ""; |
1344 | -function gd_wpml_get_lang_from_url($url){ |
|
1344 | +function gd_wpml_get_lang_from_url($url) { |
|
1345 | 1345 | |
1346 | 1346 | global $gd_wpml_get_languages; |
1347 | - if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];} |
|
1347 | + if (isset($_REQUEST['lang']) && $_REQUEST['lang']) {return $_REQUEST['lang']; } |
|
1348 | 1348 | |
1349 | 1349 | |
1350 | 1350 | // |
1351 | - $url = str_replace(array("http://","https://"),"",$url); |
|
1352 | - $site_url = str_replace(array("http://","https://"),"",get_bloginfo('url')); |
|
1351 | + $url = str_replace(array("http://", "https://"), "", $url); |
|
1352 | + $site_url = str_replace(array("http://", "https://"), "", get_bloginfo('url')); |
|
1353 | 1353 | |
1354 | - $url = str_replace($site_url,"",$url); |
|
1354 | + $url = str_replace($site_url, "", $url); |
|
1355 | 1355 | |
1356 | 1356 | |
1357 | 1357 | $segments = explode('/', trim($url, '/')); |
1358 | 1358 | |
1359 | 1359 | //print_r( $segments); |
1360 | - if($gd_wpml_get_languages){ |
|
1360 | + if ($gd_wpml_get_languages) { |
|
1361 | 1361 | $langs = $gd_wpml_get_languages; |
1362 | - }else{ |
|
1362 | + } else { |
|
1363 | 1363 | global $sitepress; |
1364 | 1364 | $gd_wpml_get_languages = $sitepress->get_active_languages(); |
1365 | 1365 | } |
@@ -1424,17 +1424,17 @@ discard block |
||
1424 | 1424 | $slug = $post_types[$post->post_type]['rewrite']['slug']; |
1425 | 1425 | |
1426 | 1426 | // Alter the CPT slug if WPML is set to do so |
1427 | - if(function_exists('icl_object_id')){ |
|
1428 | - if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1427 | + if (function_exists('icl_object_id')) { |
|
1428 | + if (gd_wpml_slug_translation_turned_on($post->post_type) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1429 | 1429 | |
1430 | 1430 | $org_slug = $slug; |
1431 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1431 | + $slug = apply_filters('wpml_translate_single_string', |
|
1432 | 1432 | $slug, |
1433 | 1433 | 'WordPress', |
1434 | 1434 | 'URL slug: ' . $slug, |
1435 | 1435 | $language_code); |
1436 | 1436 | |
1437 | - if(!$slug){$slug = $org_slug;} |
|
1437 | + if (!$slug) {$slug = $org_slug; } |
|
1438 | 1438 | |
1439 | 1439 | } |
1440 | 1440 | } |
@@ -1456,7 +1456,7 @@ discard block |
||
1456 | 1456 | } |
1457 | 1457 | |
1458 | 1458 | $post_link = trailingslashit( |
1459 | - preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
1459 | + preg_replace("/" . preg_quote($slug, "/") . "/", $slug . "/%gd_taxonomy%", $post_link, 1) |
|
1460 | 1460 | ); |
1461 | 1461 | |
1462 | 1462 | if ($fix_url) { |
@@ -1484,7 +1484,7 @@ discard block |
||
1484 | 1484 | ) |
1485 | 1485 | ); |
1486 | 1486 | |
1487 | - $post = (object)array_merge((array)$post, (array)$post2); |
|
1487 | + $post = (object) array_merge((array) $post, (array) $post2); |
|
1488 | 1488 | |
1489 | 1489 | $comment_post_cache[$post->ID] = $post; |
1490 | 1490 | } |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | |
1494 | 1494 | if (false !== strpos($post_link, '%gd_taxonomy%')) { |
1495 | 1495 | |
1496 | - if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) { |
|
1496 | + if (apply_filters("geodir_add_location_url_to_url", get_option('geodir_add_location_url'), $post->post_type, $post)) { |
|
1497 | 1497 | $location_request = ''; |
1498 | 1498 | |
1499 | 1499 | |
@@ -1507,7 +1507,7 @@ discard block |
||
1507 | 1507 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
1508 | 1508 | $post->country_slug = str_replace(']', '', $post->country_slug); |
1509 | 1509 | |
1510 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1510 | + $post_location = (object) array('country_slug' => $post->country_slug, |
|
1511 | 1511 | 'region_slug' => $post->region_slug, |
1512 | 1512 | 'city_slug' => $post->city_slug |
1513 | 1513 | ); |
@@ -1536,7 +1536,7 @@ discard block |
||
1536 | 1536 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
1537 | 1537 | $post->country_slug = str_replace(']', '', $post->country_slug); |
1538 | 1538 | |
1539 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1539 | + $post_location = (object) array('country_slug' => $post->country_slug, |
|
1540 | 1540 | 'region_slug' => $post->region_slug, |
1541 | 1541 | 'city_slug' => $post->city_slug |
1542 | 1542 | ); |
@@ -1676,7 +1676,7 @@ discard block |
||
1676 | 1676 | $location_manager = defined('POST_LOCATION_TABLE') ? true : false; |
1677 | 1677 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
1678 | 1678 | |
1679 | - if(geodir_is_page('detail') && isset($post->country_slug)){ |
|
1679 | + if (geodir_is_page('detail') && isset($post->country_slug)) { |
|
1680 | 1680 | $location_terms = array( |
1681 | 1681 | 'gd_country' => $post->country_slug, |
1682 | 1682 | 'gd_region' => $post->region_slug, |
@@ -1695,7 +1695,7 @@ discard block |
||
1695 | 1695 | |
1696 | 1696 | if (!empty($location_terms)) { |
1697 | 1697 | |
1698 | - $url_separator = '';//get_option('geodir_listingurl_separator'); |
|
1698 | + $url_separator = ''; //get_option('geodir_listingurl_separator'); |
|
1699 | 1699 | |
1700 | 1700 | if (get_option('permalink_structure') != '') { |
1701 | 1701 | $old_listing_slug = '/' . $listing_slug . '/'; |
@@ -1718,31 +1718,31 @@ discard block |
||
1718 | 1718 | }*/ |
1719 | 1719 | |
1720 | 1720 | // Alter the CPT slug if WPML is set to do so |
1721 | - if(function_exists('icl_object_id')){ |
|
1721 | + if (function_exists('icl_object_id')) { |
|
1722 | 1722 | $post_types = get_option('geodir_post_types'); |
1723 | - $post_type = str_replace("category","",$taxonomy); |
|
1724 | - $post_type = str_replace("_tags","",$post_type); |
|
1723 | + $post_type = str_replace("category", "", $taxonomy); |
|
1724 | + $post_type = str_replace("_tags", "", $post_type); |
|
1725 | 1725 | $slug = $post_types[$post_type]['rewrite']['slug']; |
1726 | - if ( gd_wpml_slug_translation_turned_on( $post_type )) { |
|
1726 | + if (gd_wpml_slug_translation_turned_on($post_type)) { |
|
1727 | 1727 | |
1728 | 1728 | global $sitepress; |
1729 | 1729 | $default_lang = $sitepress->get_default_language(); |
1730 | 1730 | $language_code = gd_wpml_get_lang_from_url($termlink); |
1731 | - if(!$language_code ){$language_code = $default_lang;} |
|
1731 | + if (!$language_code) {$language_code = $default_lang; } |
|
1732 | 1732 | |
1733 | 1733 | $org_slug = $slug; |
1734 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1734 | + $slug = apply_filters('wpml_translate_single_string', |
|
1735 | 1735 | $slug, |
1736 | 1736 | 'WordPress', |
1737 | 1737 | 'URL slug: ' . $slug, |
1738 | 1738 | $language_code); |
1739 | 1739 | |
1740 | 1740 | |
1741 | - if(!$slug){$slug = $org_slug;} |
|
1741 | + if (!$slug) {$slug = $org_slug; } |
|
1742 | 1742 | |
1743 | 1743 | $termlink = trailingslashit( |
1744 | 1744 | |
1745 | - preg_replace( "/" . preg_quote( $org_slug, "/" ) . "/", $slug ,$termlink, 1 ) |
|
1745 | + preg_replace("/" . preg_quote($org_slug, "/") . "/", $slug, $termlink, 1) |
|
1746 | 1746 | ); |
1747 | 1747 | |
1748 | 1748 | } |
@@ -1775,7 +1775,7 @@ discard block |
||
1775 | 1775 | |
1776 | 1776 | if (in_array($post_type, geodir_get_posttypes())) { |
1777 | 1777 | if (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) { |
1778 | - if(geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) { |
|
1778 | + if (geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) { |
|
1779 | 1779 | $location_terms = array( |
1780 | 1780 | 'gd_country' => $post->country_slug, |
1781 | 1781 | 'gd_region' => $post->region_slug, |
@@ -1888,7 +1888,7 @@ discard block |
||
1888 | 1888 | |
1889 | 1889 | $where_fields = array($slug); |
1890 | 1890 | if (!empty($taxonomy)) { |
1891 | - $parent = (int)$parent; |
|
1891 | + $parent = (int) $parent; |
|
1892 | 1892 | if ($parent > 0) { |
1893 | 1893 | $where_fields[] = $parent; |
1894 | 1894 | $else_where_fields[] = $parent; |
@@ -1957,7 +1957,7 @@ discard block |
||
1957 | 1957 | $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)"); |
1958 | 1958 | //$terms = get_terms( $taxonomy ); |
1959 | 1959 | |
1960 | - if($terms) { |
|
1960 | + if ($terms) { |
|
1961 | 1961 | foreach ($terms as $term) { |
1962 | 1962 | $post_type = str_replace("category", "", $term->taxonomy); |
1963 | 1963 | $a_terms[$post_type][] = $term; |
@@ -1965,7 +1965,7 @@ discard block |
||
1965 | 1965 | } |
1966 | 1966 | } |
1967 | 1967 | |
1968 | - if($a_terms) { |
|
1968 | + if ($a_terms) { |
|
1969 | 1969 | foreach ($a_terms as $pt => $t2) { |
1970 | 1970 | |
1971 | 1971 | foreach ($t2 as $term) { |
@@ -1990,7 +1990,7 @@ discard block |
||
1990 | 1990 | } |
1991 | 1991 | |
1992 | 1992 | if (is_ssl()) { |
1993 | - $terms_icons = str_replace("http:","https:",$terms_icons ); |
|
1993 | + $terms_icons = str_replace("http:", "https:", $terms_icons); |
|
1994 | 1994 | } |
1995 | 1995 | |
1996 | 1996 | return $terms_icons; |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Geodirectory Custom Post Types/Taxonomies |
|
4 | - * |
|
5 | - * Inits custom post types and taxonomies |
|
6 | - * |
|
7 | - * @package GeoDirectory |
|
8 | - * @category Core |
|
9 | - * @author WPGeoDirectory |
|
10 | - */ |
|
3 | + * Geodirectory Custom Post Types/Taxonomies |
|
4 | + * |
|
5 | + * Inits custom post types and taxonomies |
|
6 | + * |
|
7 | + * @package GeoDirectory |
|
8 | + * @category Core |
|
9 | + * @author WPGeoDirectory |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Contains custom post types/taxonomies related functions. |
@@ -33,265 +33,265 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function geodir_add_nav_menu_items() |
35 | 35 | { |
36 | - $items = ''; |
|
37 | - // apply filter to add more navigations // -Filter-Location-Manager |
|
38 | - |
|
39 | - if (get_option('geodir_show_listing_nav')) { |
|
40 | - |
|
41 | - $menu_class = ''; |
|
42 | - if (geodir_is_page('listing')) |
|
43 | - $menu_class = 'current-menu-item'; |
|
44 | - |
|
45 | - |
|
46 | - //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
|
47 | - $post_types = geodir_get_posttypes('object'); |
|
48 | - $show_post_type_main_nav = get_option('geodir_add_posttype_in_main_nav'); |
|
49 | - if (!empty($post_types)) { |
|
50 | - foreach ($post_types as $post_type => $args) { |
|
51 | - if (!empty($show_post_type_main_nav)) { |
|
52 | - if (in_array($post_type, $show_post_type_main_nav)) { |
|
53 | - if (get_post_type_archive_link($post_type)) { |
|
54 | - $menu_class = ''; |
|
55 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
56 | - $menu_class = 'current-menu-item'; |
|
57 | - /** |
|
58 | - * Filter the menu li class. |
|
59 | - * |
|
60 | - * @since 1.0.0 |
|
61 | - * @param string $menu_class The menu HTML class. |
|
62 | - */ |
|
63 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
64 | - /** |
|
65 | - * Filter the menu a class. |
|
66 | - * |
|
67 | - * @since 1.0.0 |
|
68 | - */ |
|
69 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
70 | - $items .= '<li class="' . $li_class . '"> |
|
36 | + $items = ''; |
|
37 | + // apply filter to add more navigations // -Filter-Location-Manager |
|
38 | + |
|
39 | + if (get_option('geodir_show_listing_nav')) { |
|
40 | + |
|
41 | + $menu_class = ''; |
|
42 | + if (geodir_is_page('listing')) |
|
43 | + $menu_class = 'current-menu-item'; |
|
44 | + |
|
45 | + |
|
46 | + //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
|
47 | + $post_types = geodir_get_posttypes('object'); |
|
48 | + $show_post_type_main_nav = get_option('geodir_add_posttype_in_main_nav'); |
|
49 | + if (!empty($post_types)) { |
|
50 | + foreach ($post_types as $post_type => $args) { |
|
51 | + if (!empty($show_post_type_main_nav)) { |
|
52 | + if (in_array($post_type, $show_post_type_main_nav)) { |
|
53 | + if (get_post_type_archive_link($post_type)) { |
|
54 | + $menu_class = ''; |
|
55 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
56 | + $menu_class = 'current-menu-item'; |
|
57 | + /** |
|
58 | + * Filter the menu li class. |
|
59 | + * |
|
60 | + * @since 1.0.0 |
|
61 | + * @param string $menu_class The menu HTML class. |
|
62 | + */ |
|
63 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
64 | + /** |
|
65 | + * Filter the menu a class. |
|
66 | + * |
|
67 | + * @since 1.0.0 |
|
68 | + */ |
|
69 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
70 | + $items .= '<li class="' . $li_class . '"> |
|
71 | 71 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $a_class . '"> |
72 | 72 | ' . __(ucfirst($args->labels->name)) . ' |
73 | 73 | </a> |
74 | 74 | </li>'; |
75 | - } |
|
76 | - } |
|
77 | - } |
|
78 | - } |
|
79 | - } |
|
80 | - //END LISTING OF POST TYPE IN MAIN NAVIGATION |
|
81 | - |
|
82 | - $view_posttype_listing = get_option('geodir_add_posttype_in_listing_nav'); |
|
83 | - $is_listing_sub_meny_exists = (!empty($view_posttype_listing)) ? true : false; |
|
84 | - if ($is_listing_sub_meny_exists) { |
|
85 | - /** |
|
86 | - * Filter the menu li class. |
|
87 | - * |
|
88 | - * @since 1.0.0 |
|
89 | - * @param string $menu_class The menu HTML class. |
|
90 | - */ |
|
91 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class); |
|
92 | - /** |
|
93 | - * Filter the sub menu li class. |
|
94 | - * |
|
95 | - * @since 1.0.0 |
|
96 | - * @param string $menu_class The menu HTML class. |
|
97 | - */ |
|
98 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
99 | - /** |
|
100 | - * Filter the sub menu ul class. |
|
101 | - * |
|
102 | - * @since 1.0.0 |
|
103 | - */ |
|
104 | - $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
105 | - /** |
|
106 | - * Filter the menu a class. |
|
107 | - * |
|
108 | - * @since 1.0.0 |
|
109 | - */ |
|
110 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
111 | - /** |
|
112 | - * Filter the sub menu a class. |
|
113 | - * |
|
114 | - * @since 1.0.0 |
|
115 | - */ |
|
116 | - $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
117 | - $items .= '<li class="' . $li_class . '"> |
|
75 | + } |
|
76 | + } |
|
77 | + } |
|
78 | + } |
|
79 | + } |
|
80 | + //END LISTING OF POST TYPE IN MAIN NAVIGATION |
|
81 | + |
|
82 | + $view_posttype_listing = get_option('geodir_add_posttype_in_listing_nav'); |
|
83 | + $is_listing_sub_meny_exists = (!empty($view_posttype_listing)) ? true : false; |
|
84 | + if ($is_listing_sub_meny_exists) { |
|
85 | + /** |
|
86 | + * Filter the menu li class. |
|
87 | + * |
|
88 | + * @since 1.0.0 |
|
89 | + * @param string $menu_class The menu HTML class. |
|
90 | + */ |
|
91 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class); |
|
92 | + /** |
|
93 | + * Filter the sub menu li class. |
|
94 | + * |
|
95 | + * @since 1.0.0 |
|
96 | + * @param string $menu_class The menu HTML class. |
|
97 | + */ |
|
98 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
99 | + /** |
|
100 | + * Filter the sub menu ul class. |
|
101 | + * |
|
102 | + * @since 1.0.0 |
|
103 | + */ |
|
104 | + $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
105 | + /** |
|
106 | + * Filter the menu a class. |
|
107 | + * |
|
108 | + * @since 1.0.0 |
|
109 | + */ |
|
110 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
111 | + /** |
|
112 | + * Filter the sub menu a class. |
|
113 | + * |
|
114 | + * @since 1.0.0 |
|
115 | + */ |
|
116 | + $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
117 | + $items .= '<li class="' . $li_class . '"> |
|
118 | 118 | <a href="#" class="' . $a_class . '">' . __('Listing', 'geodirectory') . '</a> |
119 | 119 | <ul class="' . $sub_ul_class . '">'; |
120 | - $post_types = geodir_get_posttypes('object'); |
|
120 | + $post_types = geodir_get_posttypes('object'); |
|
121 | 121 | |
122 | - $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav'); |
|
122 | + $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav'); |
|
123 | 123 | |
124 | - if (!empty($post_types)) { |
|
125 | - global $geodir_add_location_url; |
|
126 | - $geodir_add_location_url = true; |
|
127 | - foreach ($post_types as $post_type => $args) { |
|
128 | - if (!empty($show_listing_post_types)) { |
|
129 | - if (in_array($post_type, $show_listing_post_types)) { |
|
130 | - if (get_post_type_archive_link($post_type)) { |
|
124 | + if (!empty($post_types)) { |
|
125 | + global $geodir_add_location_url; |
|
126 | + $geodir_add_location_url = true; |
|
127 | + foreach ($post_types as $post_type => $args) { |
|
128 | + if (!empty($show_listing_post_types)) { |
|
129 | + if (in_array($post_type, $show_listing_post_types)) { |
|
130 | + if (get_post_type_archive_link($post_type)) { |
|
131 | 131 | |
132 | - $menu_class = ''; |
|
133 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
134 | - $menu_class = 'current-menu-item'; |
|
132 | + $menu_class = ''; |
|
133 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
134 | + $menu_class = 'current-menu-item'; |
|
135 | 135 | |
136 | - $items .= '<li class="' . $sub_li_class . '"> |
|
136 | + $items .= '<li class="' . $sub_li_class . '"> |
|
137 | 137 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
138 | 138 | ' . __(ucfirst($args->labels->name),'geodirectory') . ' |
139 | 139 | </a> |
140 | 140 | </li>'; |
141 | - } |
|
142 | - } |
|
143 | - } |
|
144 | - } |
|
145 | - $geodir_add_location_url = NULL; |
|
146 | - } |
|
141 | + } |
|
142 | + } |
|
143 | + } |
|
144 | + } |
|
145 | + $geodir_add_location_url = NULL; |
|
146 | + } |
|
147 | + |
|
148 | + $items .= ' </ul> '; |
|
149 | + /** |
|
150 | + * Filter called after the sub menu closing ul tag for dynamic added menu items. |
|
151 | + * |
|
152 | + * @since 1.5.9 |
|
153 | + */ |
|
154 | + $items .= apply_filters('geodir_menu_after_sub_ul',''); |
|
155 | + $items .= '</li>'; |
|
156 | + } |
|
157 | + } |
|
147 | 158 | |
148 | - $items .= ' </ul> '; |
|
149 | - /** |
|
150 | - * Filter called after the sub menu closing ul tag for dynamic added menu items. |
|
151 | - * |
|
152 | - * @since 1.5.9 |
|
153 | - */ |
|
154 | - $items .= apply_filters('geodir_menu_after_sub_ul',''); |
|
155 | - $items .= '</li>'; |
|
156 | - } |
|
157 | - } |
|
158 | - |
|
159 | - if (get_option('geodir_show_addlisting_nav')) { |
|
160 | - |
|
161 | - $menu_class = ''; |
|
162 | - if (geodir_is_page('add-listing')) |
|
163 | - $menu_class = 'current-menu-item'; |
|
164 | - |
|
165 | - //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
166 | - $post_types = geodir_get_posttypes('object'); |
|
167 | - $show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_main_nav'); |
|
168 | - $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend'); |
|
169 | - |
|
170 | - if (!empty($post_types)) { |
|
171 | - foreach ($post_types as $post_type => $args) { |
|
172 | - if (!empty($geodir_allow_posttype_frontend)) { |
|
173 | - if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
174 | - if (!empty($show_add_listing_post_types_main_nav)) { |
|
175 | - if (in_array($post_type, $show_add_listing_post_types_main_nav)) { |
|
176 | - if (geodir_get_addlisting_link($post_type)) { |
|
177 | - |
|
178 | - $menu_class = ''; |
|
179 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
180 | - $menu_class = 'current-menu-item'; |
|
181 | - /** |
|
182 | - * Filter the menu li class. |
|
183 | - * |
|
184 | - * @since 1.0.0 |
|
185 | - * @param string $menu_class The menu HTML class. |
|
186 | - */ |
|
187 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
188 | - /** |
|
189 | - * Filter the menu a class. |
|
190 | - * |
|
191 | - * @since 1.0.0 |
|
192 | - */ |
|
193 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
194 | - $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
195 | - $items .= '<li class="' . $li_class . '"> |
|
159 | + if (get_option('geodir_show_addlisting_nav')) { |
|
160 | + |
|
161 | + $menu_class = ''; |
|
162 | + if (geodir_is_page('add-listing')) |
|
163 | + $menu_class = 'current-menu-item'; |
|
164 | + |
|
165 | + //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
166 | + $post_types = geodir_get_posttypes('object'); |
|
167 | + $show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_main_nav'); |
|
168 | + $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend'); |
|
169 | + |
|
170 | + if (!empty($post_types)) { |
|
171 | + foreach ($post_types as $post_type => $args) { |
|
172 | + if (!empty($geodir_allow_posttype_frontend)) { |
|
173 | + if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
174 | + if (!empty($show_add_listing_post_types_main_nav)) { |
|
175 | + if (in_array($post_type, $show_add_listing_post_types_main_nav)) { |
|
176 | + if (geodir_get_addlisting_link($post_type)) { |
|
177 | + |
|
178 | + $menu_class = ''; |
|
179 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
180 | + $menu_class = 'current-menu-item'; |
|
181 | + /** |
|
182 | + * Filter the menu li class. |
|
183 | + * |
|
184 | + * @since 1.0.0 |
|
185 | + * @param string $menu_class The menu HTML class. |
|
186 | + */ |
|
187 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
188 | + /** |
|
189 | + * Filter the menu a class. |
|
190 | + * |
|
191 | + * @since 1.0.0 |
|
192 | + */ |
|
193 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
194 | + $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
195 | + $items .= '<li class="' . $li_class . '"> |
|
196 | 196 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $a_class . '"> |
197 | 197 | ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
198 | 198 | </a> |
199 | 199 | </li>'; |
200 | - } |
|
201 | - } |
|
202 | - } |
|
203 | - } |
|
204 | - } |
|
205 | - } |
|
206 | - } |
|
207 | - //END SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
208 | - } |
|
209 | - |
|
210 | - $view_add_posttype_listing = get_option('geodir_add_listing_link_add_listing_nav'); |
|
211 | - $is_add_listing_sub_meny_exists = (!empty($view_add_posttype_listing)) ? true : false; |
|
212 | - if ($is_add_listing_sub_meny_exists) { |
|
213 | - |
|
214 | - if (get_option('geodir_show_addlisting_nav')) { |
|
215 | - /** |
|
216 | - * Filter the menu li class. |
|
217 | - * |
|
218 | - * @since 1.0.0 |
|
219 | - * @param string $menu_class The menu HTML class. |
|
220 | - */ |
|
221 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class); |
|
222 | - /** |
|
223 | - * Filter the sub menu li class. |
|
224 | - * |
|
225 | - * @since 1.0.0 |
|
226 | - * @param string $menu_class The menu HTML class. |
|
227 | - */ |
|
228 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
229 | - /** |
|
230 | - * Filter the sub menu ul class. |
|
231 | - * |
|
232 | - * @since 1.0.0 |
|
233 | - */ |
|
234 | - $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
235 | - /** |
|
236 | - * Filter the menu a class. |
|
237 | - * |
|
238 | - * @since 1.0.0 |
|
239 | - */ |
|
240 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
241 | - /** |
|
242 | - * Filter the sub menu a class. |
|
243 | - * |
|
244 | - * @since 1.0.0 |
|
245 | - */ |
|
246 | - $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
247 | - $items .= '<li class="' . $li_class . '"> |
|
200 | + } |
|
201 | + } |
|
202 | + } |
|
203 | + } |
|
204 | + } |
|
205 | + } |
|
206 | + } |
|
207 | + //END SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
208 | + } |
|
209 | + |
|
210 | + $view_add_posttype_listing = get_option('geodir_add_listing_link_add_listing_nav'); |
|
211 | + $is_add_listing_sub_meny_exists = (!empty($view_add_posttype_listing)) ? true : false; |
|
212 | + if ($is_add_listing_sub_meny_exists) { |
|
213 | + |
|
214 | + if (get_option('geodir_show_addlisting_nav')) { |
|
215 | + /** |
|
216 | + * Filter the menu li class. |
|
217 | + * |
|
218 | + * @since 1.0.0 |
|
219 | + * @param string $menu_class The menu HTML class. |
|
220 | + */ |
|
221 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class); |
|
222 | + /** |
|
223 | + * Filter the sub menu li class. |
|
224 | + * |
|
225 | + * @since 1.0.0 |
|
226 | + * @param string $menu_class The menu HTML class. |
|
227 | + */ |
|
228 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
229 | + /** |
|
230 | + * Filter the sub menu ul class. |
|
231 | + * |
|
232 | + * @since 1.0.0 |
|
233 | + */ |
|
234 | + $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
235 | + /** |
|
236 | + * Filter the menu a class. |
|
237 | + * |
|
238 | + * @since 1.0.0 |
|
239 | + */ |
|
240 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
241 | + /** |
|
242 | + * Filter the sub menu a class. |
|
243 | + * |
|
244 | + * @since 1.0.0 |
|
245 | + */ |
|
246 | + $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
247 | + $items .= '<li class="' . $li_class . '"> |
|
248 | 248 | <a href="#" class="' . $a_class . '">' . __('Add Listing', 'geodirectory') . '</a> |
249 | 249 | <ul class="' . $sub_ul_class . '">'; |
250 | 250 | |
251 | - $post_types = geodir_get_posttypes('object'); |
|
252 | - |
|
253 | - $show_add_listing_post_types = get_option('geodir_add_listing_link_add_listing_nav'); |
|
254 | - |
|
255 | - if (!empty($post_types)) { |
|
256 | - foreach ($post_types as $post_type => $args) { |
|
257 | - if (!empty($geodir_allow_posttype_frontend)) { |
|
258 | - if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
259 | - if (!empty($show_add_listing_post_types)) { |
|
260 | - if (in_array($post_type, $show_add_listing_post_types)) { |
|
261 | - if (geodir_get_addlisting_link($post_type)) { |
|
262 | - |
|
263 | - $menu_class = ''; |
|
264 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
265 | - $menu_class = 'current-menu-item'; |
|
266 | - /** |
|
267 | - * Filter the menu li class. |
|
268 | - * |
|
269 | - * @since 1.0.0 |
|
270 | - * @param string $menu_class The menu HTML class. |
|
271 | - */ |
|
272 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
273 | - $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
274 | - $items .= '<li class="' . $li_class . '"> |
|
251 | + $post_types = geodir_get_posttypes('object'); |
|
252 | + |
|
253 | + $show_add_listing_post_types = get_option('geodir_add_listing_link_add_listing_nav'); |
|
254 | + |
|
255 | + if (!empty($post_types)) { |
|
256 | + foreach ($post_types as $post_type => $args) { |
|
257 | + if (!empty($geodir_allow_posttype_frontend)) { |
|
258 | + if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
259 | + if (!empty($show_add_listing_post_types)) { |
|
260 | + if (in_array($post_type, $show_add_listing_post_types)) { |
|
261 | + if (geodir_get_addlisting_link($post_type)) { |
|
262 | + |
|
263 | + $menu_class = ''; |
|
264 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
265 | + $menu_class = 'current-menu-item'; |
|
266 | + /** |
|
267 | + * Filter the menu li class. |
|
268 | + * |
|
269 | + * @since 1.0.0 |
|
270 | + * @param string $menu_class The menu HTML class. |
|
271 | + */ |
|
272 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
273 | + $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
274 | + $items .= '<li class="' . $li_class . '"> |
|
275 | 275 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $sub_a_class . '"> |
276 | 276 | ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
277 | 277 | </a> |
278 | 278 | </li>'; |
279 | - } |
|
280 | - } |
|
281 | - } |
|
282 | - } |
|
283 | - } |
|
284 | - } |
|
285 | - } |
|
279 | + } |
|
280 | + } |
|
281 | + } |
|
282 | + } |
|
283 | + } |
|
284 | + } |
|
285 | + } |
|
286 | 286 | |
287 | - $items .= ' </ul> '; |
|
288 | - $items .= apply_filters('geodir_menu_after_sub_ul',''); |
|
289 | - $items .= '</li>'; |
|
287 | + $items .= ' </ul> '; |
|
288 | + $items .= apply_filters('geodir_menu_after_sub_ul',''); |
|
289 | + $items .= '</li>'; |
|
290 | 290 | |
291 | - } |
|
292 | - } |
|
293 | - // apply filter to add more navigations // -Filter-Location-Manager |
|
294 | - return $items; |
|
291 | + } |
|
292 | + } |
|
293 | + // apply filter to add more navigations // -Filter-Location-Manager |
|
294 | + return $items; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | |
@@ -309,20 +309,20 @@ discard block |
||
309 | 309 | */ |
310 | 310 | function geodir_pagemenu_items($menu, $args) |
311 | 311 | { |
312 | - $locations = get_nav_menu_locations(); |
|
313 | - $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
314 | - $geodir_theme_location_nav = array(); |
|
315 | - if (empty($locations) && empty($geodir_theme_location)) { |
|
316 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
317 | - $geodir_theme_location_nav[] = $args['theme_location']; |
|
318 | - update_option('geodir_theme_location_nav', $geodir_theme_location_nav); |
|
319 | - } |
|
320 | - //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
|
312 | + $locations = get_nav_menu_locations(); |
|
313 | + $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
314 | + $geodir_theme_location_nav = array(); |
|
315 | + if (empty($locations) && empty($geodir_theme_location)) { |
|
316 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
317 | + $geodir_theme_location_nav[] = $args['theme_location']; |
|
318 | + update_option('geodir_theme_location_nav', $geodir_theme_location_nav); |
|
319 | + } |
|
320 | + //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
|
321 | 321 | // $menu = str_replace("</ul></div>",geodir_add_nav_menu_items()."</ul></div>",$menu); |
322 | - else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
323 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
322 | + else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
323 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
324 | 324 | |
325 | - return $menu; |
|
325 | + return $menu; |
|
326 | 326 | |
327 | 327 | } |
328 | 328 | |
@@ -342,18 +342,18 @@ discard block |
||
342 | 342 | function geodir_menu_items($items, $args) |
343 | 343 | { |
344 | 344 | |
345 | - $location = $args->theme_location; |
|
345 | + $location = $args->theme_location; |
|
346 | 346 | |
347 | - $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
347 | + $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
348 | 348 | |
349 | - if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) { |
|
349 | + if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) { |
|
350 | 350 | |
351 | - $items = $items . geodir_add_nav_menu_items(); |
|
352 | - return $items; |
|
351 | + $items = $items . geodir_add_nav_menu_items(); |
|
352 | + return $items; |
|
353 | 353 | |
354 | - } else { |
|
355 | - return $items; |
|
356 | - } |
|
354 | + } else { |
|
355 | + return $items; |
|
356 | + } |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | /** |
@@ -368,25 +368,25 @@ discard block |
||
368 | 368 | */ |
369 | 369 | function geodir_get_category_all_array() |
370 | 370 | { |
371 | - global $wpdb; |
|
372 | - $return_array = array(); |
|
373 | - |
|
374 | - $taxonomies = geodir_get_taxonomies(); |
|
375 | - $taxonomies = implode("','", $taxonomies); |
|
376 | - $taxonomies = "'" . $taxonomies . "'"; |
|
377 | - |
|
378 | - $pn_categories = $wpdb->get_results( |
|
379 | - $wpdb->prepare( |
|
380 | - "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
|
381 | - array($wpdb->terms . term_id) |
|
382 | - ) |
|
383 | - ); |
|
384 | - |
|
385 | - foreach ($pn_categories as $pn_categories_obj) { |
|
386 | - $return_array[] = array("id" => $pn_categories_obj->cat_ID, |
|
387 | - "title" => $pn_categories_obj->name,); |
|
388 | - } |
|
389 | - return $return_array; |
|
371 | + global $wpdb; |
|
372 | + $return_array = array(); |
|
373 | + |
|
374 | + $taxonomies = geodir_get_taxonomies(); |
|
375 | + $taxonomies = implode("','", $taxonomies); |
|
376 | + $taxonomies = "'" . $taxonomies . "'"; |
|
377 | + |
|
378 | + $pn_categories = $wpdb->get_results( |
|
379 | + $wpdb->prepare( |
|
380 | + "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
|
381 | + array($wpdb->terms . term_id) |
|
382 | + ) |
|
383 | + ); |
|
384 | + |
|
385 | + foreach ($pn_categories as $pn_categories_obj) { |
|
386 | + $return_array[] = array("id" => $pn_categories_obj->cat_ID, |
|
387 | + "title" => $pn_categories_obj->name,); |
|
388 | + } |
|
389 | + return $return_array; |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | |
@@ -401,32 +401,32 @@ discard block |
||
401 | 401 | */ |
402 | 402 | function geodir_get_current_posttype() |
403 | 403 | { |
404 | - global $wp_query, $geodir_post_type; |
|
404 | + global $wp_query, $geodir_post_type; |
|
405 | 405 | |
406 | - $geodir_post_type = get_query_var('post_type'); |
|
406 | + $geodir_post_type = get_query_var('post_type'); |
|
407 | 407 | |
408 | - if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
|
409 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
410 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
411 | - elseif (isset($_REQUEST['listing_type'])) |
|
412 | - $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
413 | - } |
|
408 | + if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
|
409 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
410 | + $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
411 | + elseif (isset($_REQUEST['listing_type'])) |
|
412 | + $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
413 | + } |
|
414 | 414 | |
415 | - if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) |
|
416 | - $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
415 | + if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) |
|
416 | + $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
417 | 417 | |
418 | - if (is_tax()) |
|
419 | - $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
418 | + if (is_tax()) |
|
419 | + $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
420 | 420 | |
421 | 421 | |
422 | - $all_postypes = geodir_get_posttypes(); |
|
423 | - $all_postypes = stripslashes_deep($all_postypes); |
|
422 | + $all_postypes = geodir_get_posttypes(); |
|
423 | + $all_postypes = stripslashes_deep($all_postypes); |
|
424 | 424 | |
425 | - if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
426 | - $geodir_post_type = ''; |
|
425 | + if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
426 | + $geodir_post_type = ''; |
|
427 | 427 | |
428 | 428 | |
429 | - return $geodir_post_type; |
|
429 | + return $geodir_post_type; |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | /** |
@@ -440,21 +440,21 @@ discard block |
||
440 | 440 | */ |
441 | 441 | function geodir_get_posttypes($output = 'names') |
442 | 442 | { |
443 | - $post_types = array(); |
|
444 | - $post_types = get_option('geodir_post_types'); |
|
445 | - $post_types = stripslashes_deep($post_types); |
|
446 | - if (!empty($post_types)) { |
|
447 | - switch ($output): |
|
448 | - case 'object': |
|
449 | - case 'Object': |
|
450 | - $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
451 | - break; |
|
452 | - case 'array': |
|
453 | - case 'Array': |
|
454 | - $post_types = (array)$post_types; |
|
455 | - break; |
|
443 | + $post_types = array(); |
|
444 | + $post_types = get_option('geodir_post_types'); |
|
445 | + $post_types = stripslashes_deep($post_types); |
|
446 | + if (!empty($post_types)) { |
|
447 | + switch ($output): |
|
448 | + case 'object': |
|
449 | + case 'Object': |
|
450 | + $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
451 | + break; |
|
452 | + case 'array': |
|
453 | + case 'Array': |
|
454 | + $post_types = (array)$post_types; |
|
455 | + break; |
|
456 | 456 | case 'options': |
457 | - $post_types = (array)$post_types; |
|
457 | + $post_types = (array)$post_types; |
|
458 | 458 | |
459 | 459 | $options = array(); |
460 | 460 | if (!empty($post_types)) { |
@@ -463,17 +463,17 @@ discard block |
||
463 | 463 | } |
464 | 464 | } |
465 | 465 | $post_types = $options; |
466 | - break; |
|
467 | - default: |
|
468 | - $post_types = array_keys($post_types); |
|
469 | - break; |
|
470 | - endswitch; |
|
471 | - } |
|
472 | - |
|
473 | - if (!empty($post_types)) |
|
474 | - return $post_types; |
|
475 | - else |
|
476 | - return array(); |
|
466 | + break; |
|
467 | + default: |
|
468 | + $post_types = array_keys($post_types); |
|
469 | + break; |
|
470 | + endswitch; |
|
471 | + } |
|
472 | + |
|
473 | + if (!empty($post_types)) |
|
474 | + return $post_types; |
|
475 | + else |
|
476 | + return array(); |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |
@@ -486,108 +486,108 @@ discard block |
||
486 | 486 | */ |
487 | 487 | function geodir_get_posttype_info($post_type = '') |
488 | 488 | { |
489 | - $post_types = array(); |
|
490 | - $post_types = get_option('geodir_post_types'); |
|
491 | - $post_types = stripslashes_deep($post_types); |
|
492 | - if (!empty($post_types) && $post_type != '') { |
|
493 | - return $post_types[$post_type]; |
|
494 | - } else |
|
495 | - return false; |
|
489 | + $post_types = array(); |
|
490 | + $post_types = get_option('geodir_post_types'); |
|
491 | + $post_types = stripslashes_deep($post_types); |
|
492 | + if (!empty($post_types) && $post_type != '') { |
|
493 | + return $post_types[$post_type]; |
|
494 | + } else |
|
495 | + return false; |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | if (!function_exists('geodir_get_taxonomies')) { |
499 | - /** |
|
500 | - * Get all custom taxonomies. |
|
501 | - * |
|
502 | - * @since 1.0.0 |
|
503 | - * @package GeoDirectory |
|
504 | - * @param string $post_type The post type. |
|
505 | - * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
506 | - * @return array|bool Taxonomies on success. false on failure. |
|
507 | - */ |
|
508 | - function geodir_get_taxonomies($post_type = '', $tages_taxonomies = false) |
|
509 | - { |
|
499 | + /** |
|
500 | + * Get all custom taxonomies. |
|
501 | + * |
|
502 | + * @since 1.0.0 |
|
503 | + * @package GeoDirectory |
|
504 | + * @param string $post_type The post type. |
|
505 | + * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
506 | + * @return array|bool Taxonomies on success. false on failure. |
|
507 | + */ |
|
508 | + function geodir_get_taxonomies($post_type = '', $tages_taxonomies = false) |
|
509 | + { |
|
510 | 510 | |
511 | - $taxonomies = array(); |
|
512 | - $gd_taxonomies = array(); |
|
511 | + $taxonomies = array(); |
|
512 | + $gd_taxonomies = array(); |
|
513 | 513 | |
514 | - if ($taxonomies = get_option('geodir_taxonomies')) { |
|
514 | + if ($taxonomies = get_option('geodir_taxonomies')) { |
|
515 | 515 | |
516 | 516 | |
517 | - $gd_taxonomies = array_keys($taxonomies); |
|
517 | + $gd_taxonomies = array_keys($taxonomies); |
|
518 | 518 | |
519 | 519 | |
520 | - if ($post_type != '') |
|
521 | - $gd_taxonomies = array(); |
|
520 | + if ($post_type != '') |
|
521 | + $gd_taxonomies = array(); |
|
522 | 522 | |
523 | - $i = 0; |
|
524 | - foreach ($taxonomies as $taxonomy => $args) { |
|
523 | + $i = 0; |
|
524 | + foreach ($taxonomies as $taxonomy => $args) { |
|
525 | 525 | |
526 | - if ($post_type != '' && $args['object_type'] == $post_type) |
|
527 | - $gd_taxonomies[] = $taxonomy; |
|
526 | + if ($post_type != '' && $args['object_type'] == $post_type) |
|
527 | + $gd_taxonomies[] = $taxonomy; |
|
528 | 528 | |
529 | - if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) { |
|
530 | - if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
531 | - unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
532 | - } |
|
529 | + if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) { |
|
530 | + if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
531 | + unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
532 | + } |
|
533 | 533 | |
534 | - } |
|
534 | + } |
|
535 | + |
|
536 | + $gd_taxonomies = array_values($gd_taxonomies); |
|
537 | + } |
|
535 | 538 | |
536 | - $gd_taxonomies = array_values($gd_taxonomies); |
|
537 | - } |
|
538 | - |
|
539 | - /** |
|
540 | - * Filter the taxonomies. |
|
541 | - * |
|
542 | - * @since 1.0.0 |
|
543 | - * @param array $gd_taxonomies The taxonomy array. |
|
544 | - */ |
|
545 | - $taxonomies = apply_filters('geodir_taxonomy', $gd_taxonomies); |
|
546 | - |
|
547 | - if (!empty($taxonomies)) { |
|
548 | - return $taxonomies; |
|
549 | - } else { |
|
550 | - return false; |
|
551 | - } |
|
552 | - } |
|
539 | + /** |
|
540 | + * Filter the taxonomies. |
|
541 | + * |
|
542 | + * @since 1.0.0 |
|
543 | + * @param array $gd_taxonomies The taxonomy array. |
|
544 | + */ |
|
545 | + $taxonomies = apply_filters('geodir_taxonomy', $gd_taxonomies); |
|
546 | + |
|
547 | + if (!empty($taxonomies)) { |
|
548 | + return $taxonomies; |
|
549 | + } else { |
|
550 | + return false; |
|
551 | + } |
|
552 | + } |
|
553 | 553 | } |
554 | 554 | |
555 | 555 | if (!function_exists(' geodir_get_categories_dl')) { |
556 | - /** |
|
557 | - * Get categories dropdown HTML. |
|
558 | - * |
|
559 | - * @since 1.0.0 |
|
560 | - * @package GeoDirectory |
|
561 | - * @param string $post_type The post type. |
|
562 | - * @param string $selected The selected value. |
|
563 | - * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
564 | - * @param bool $echo Prints the HTML when set to true. Default: true. |
|
565 | - * @return void|string Dropdown HTML. |
|
566 | - */ |
|
567 | - function geodir_get_categories_dl($post_type = '', $selected = '', $tages_taxonomies = false, $echo = true) |
|
568 | - { |
|
569 | - |
|
570 | - $html = ''; |
|
571 | - $taxonomies = geodir_get_taxonomies($post_type, $tages_taxonomies); |
|
572 | - |
|
573 | - $categories = get_terms($taxonomies); |
|
574 | - |
|
575 | - $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>'; |
|
576 | - |
|
577 | - foreach ($categories as $category_obj) { |
|
578 | - $select_opt = ''; |
|
579 | - if ($selected == $category_obj->term_id) { |
|
580 | - $select_opt = 'selected="selected"'; |
|
581 | - } |
|
582 | - $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
583 | - . ucfirst($category_obj->name) . '</option>'; |
|
584 | - } |
|
585 | - |
|
586 | - if ($echo) |
|
587 | - echo $html; |
|
588 | - else |
|
589 | - return $html; |
|
590 | - } |
|
556 | + /** |
|
557 | + * Get categories dropdown HTML. |
|
558 | + * |
|
559 | + * @since 1.0.0 |
|
560 | + * @package GeoDirectory |
|
561 | + * @param string $post_type The post type. |
|
562 | + * @param string $selected The selected value. |
|
563 | + * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
564 | + * @param bool $echo Prints the HTML when set to true. Default: true. |
|
565 | + * @return void|string Dropdown HTML. |
|
566 | + */ |
|
567 | + function geodir_get_categories_dl($post_type = '', $selected = '', $tages_taxonomies = false, $echo = true) |
|
568 | + { |
|
569 | + |
|
570 | + $html = ''; |
|
571 | + $taxonomies = geodir_get_taxonomies($post_type, $tages_taxonomies); |
|
572 | + |
|
573 | + $categories = get_terms($taxonomies); |
|
574 | + |
|
575 | + $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>'; |
|
576 | + |
|
577 | + foreach ($categories as $category_obj) { |
|
578 | + $select_opt = ''; |
|
579 | + if ($selected == $category_obj->term_id) { |
|
580 | + $select_opt = 'selected="selected"'; |
|
581 | + } |
|
582 | + $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
583 | + . ucfirst($category_obj->name) . '</option>'; |
|
584 | + } |
|
585 | + |
|
586 | + if ($echo) |
|
587 | + echo $html; |
|
588 | + else |
|
589 | + return $html; |
|
590 | + } |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | |
@@ -602,28 +602,28 @@ discard block |
||
602 | 602 | function geodir_get_listing_slug($object_type = '') |
603 | 603 | { |
604 | 604 | |
605 | - $listing_slug = ''; |
|
605 | + $listing_slug = ''; |
|
606 | 606 | |
607 | - $post_types = get_option('geodir_post_types'); |
|
608 | - $taxonomies = get_option('geodir_taxonomies'); |
|
607 | + $post_types = get_option('geodir_post_types'); |
|
608 | + $taxonomies = get_option('geodir_taxonomies'); |
|
609 | 609 | |
610 | 610 | |
611 | - if ($object_type != '') { |
|
612 | - if (!empty($post_types) && array_key_exists($object_type, $post_types)) { |
|
611 | + if ($object_type != '') { |
|
612 | + if (!empty($post_types) && array_key_exists($object_type, $post_types)) { |
|
613 | 613 | |
614 | - $object_info = $post_types[$object_type]; |
|
615 | - $listing_slug = $object_info['listing_slug']; |
|
616 | - } elseif (!empty($taxonomies) && array_key_exists($object_type, $taxonomies)) { |
|
617 | - $object_info = $taxonomies[$object_type]; |
|
618 | - $listing_slug = $object_info['listing_slug']; |
|
619 | - } |
|
614 | + $object_info = $post_types[$object_type]; |
|
615 | + $listing_slug = $object_info['listing_slug']; |
|
616 | + } elseif (!empty($taxonomies) && array_key_exists($object_type, $taxonomies)) { |
|
617 | + $object_info = $taxonomies[$object_type]; |
|
618 | + $listing_slug = $object_info['listing_slug']; |
|
619 | + } |
|
620 | 620 | |
621 | - } |
|
621 | + } |
|
622 | 622 | |
623 | - if (!empty($listing_slug)) |
|
624 | - return $listing_slug; |
|
625 | - else |
|
626 | - return false; |
|
623 | + if (!empty($listing_slug)) |
|
624 | + return $listing_slug; |
|
625 | + else |
|
626 | + return false; |
|
627 | 627 | } |
628 | 628 | |
629 | 629 | |
@@ -638,212 +638,212 @@ discard block |
||
638 | 638 | */ |
639 | 639 | function geodir_get_taxonomy_posttype($taxonomy = '') |
640 | 640 | { |
641 | - global $wp_query; |
|
642 | - |
|
643 | - $post_type = array(); |
|
644 | - $taxonomies = array(); |
|
645 | - |
|
646 | - if (!empty($taxonomy)) { |
|
647 | - $taxonomies[] = $taxonomy; |
|
648 | - } elseif (isset($wp_query->tax_query->queries)) { |
|
649 | - $tax_arr = $wp_query->tax_query->queries; |
|
650 | - //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
|
651 | - if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);} |
|
652 | - $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
|
653 | - } |
|
654 | - |
|
655 | - if (!empty($taxonomies)) { |
|
656 | - foreach (geodir_get_posttypes() as $pt) { |
|
657 | - $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
|
658 | - if (array_intersect($taxonomies, $object_taxonomies)) |
|
659 | - $post_type[] = $pt; |
|
660 | - } |
|
661 | - } |
|
662 | - |
|
663 | - if (!empty($post_type)) |
|
664 | - return $post_type[0]; |
|
665 | - else |
|
666 | - return false; |
|
641 | + global $wp_query; |
|
642 | + |
|
643 | + $post_type = array(); |
|
644 | + $taxonomies = array(); |
|
645 | + |
|
646 | + if (!empty($taxonomy)) { |
|
647 | + $taxonomies[] = $taxonomy; |
|
648 | + } elseif (isset($wp_query->tax_query->queries)) { |
|
649 | + $tax_arr = $wp_query->tax_query->queries; |
|
650 | + //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
|
651 | + if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);} |
|
652 | + $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
|
653 | + } |
|
654 | + |
|
655 | + if (!empty($taxonomies)) { |
|
656 | + foreach (geodir_get_posttypes() as $pt) { |
|
657 | + $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
|
658 | + if (array_intersect($taxonomies, $object_taxonomies)) |
|
659 | + $post_type[] = $pt; |
|
660 | + } |
|
661 | + } |
|
662 | + |
|
663 | + if (!empty($post_type)) |
|
664 | + return $post_type[0]; |
|
665 | + else |
|
666 | + return false; |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | if (!function_exists('geodir_custom_taxonomy_walker')) { |
670 | - /** |
|
671 | - * Custom taxonomy walker function. |
|
672 | - * |
|
673 | - * @since 1.0.0 |
|
674 | - * @package GeoDirectory |
|
675 | - * @param string $cat_taxonomy The taxonomy name. |
|
676 | - * @param int $cat_parent The parent term ID. |
|
677 | - * @param bool $hide_empty Hide empty taxonomies? Default: false. |
|
678 | - * @param int $pading CSS padding in pixels. |
|
679 | - * @return string|void taxonomy HTML. |
|
680 | - */ |
|
681 | - function geodir_custom_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = false, $pading = 0) |
|
682 | - { |
|
683 | - global $cat_display, $post_cat, $exclude_cats; |
|
684 | - |
|
685 | - $search_terms = trim($post_cat, ","); |
|
686 | - |
|
687 | - $search_terms = explode(",", $search_terms); |
|
688 | - |
|
689 | - $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'hide_empty' => $hide_empty, 'exclude' => $exclude_cats)); |
|
690 | - |
|
691 | - $display = ''; |
|
692 | - $onchange = ''; |
|
693 | - $term_check = ''; |
|
694 | - $main_list_class = ''; |
|
695 | - $out = ''; |
|
696 | - //If there are terms, start displaying |
|
697 | - if (count($cat_terms) > 0) { |
|
698 | - //Displaying as a list |
|
699 | - $p = $pading * 20; |
|
700 | - $pading++; |
|
701 | - |
|
702 | - |
|
703 | - if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) { |
|
704 | - if ($cat_parent == 0) { |
|
705 | - $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
706 | - $main_list_class = 'class="main_list_selecter"'; |
|
707 | - } else { |
|
708 | - //$display = 'display:none'; |
|
709 | - $list_class = 'sub_list gd-sub-cats-list'; |
|
710 | - } |
|
711 | - } |
|
670 | + /** |
|
671 | + * Custom taxonomy walker function. |
|
672 | + * |
|
673 | + * @since 1.0.0 |
|
674 | + * @package GeoDirectory |
|
675 | + * @param string $cat_taxonomy The taxonomy name. |
|
676 | + * @param int $cat_parent The parent term ID. |
|
677 | + * @param bool $hide_empty Hide empty taxonomies? Default: false. |
|
678 | + * @param int $pading CSS padding in pixels. |
|
679 | + * @return string|void taxonomy HTML. |
|
680 | + */ |
|
681 | + function geodir_custom_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = false, $pading = 0) |
|
682 | + { |
|
683 | + global $cat_display, $post_cat, $exclude_cats; |
|
684 | + |
|
685 | + $search_terms = trim($post_cat, ","); |
|
686 | + |
|
687 | + $search_terms = explode(",", $search_terms); |
|
688 | + |
|
689 | + $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'hide_empty' => $hide_empty, 'exclude' => $exclude_cats)); |
|
690 | + |
|
691 | + $display = ''; |
|
692 | + $onchange = ''; |
|
693 | + $term_check = ''; |
|
694 | + $main_list_class = ''; |
|
695 | + $out = ''; |
|
696 | + //If there are terms, start displaying |
|
697 | + if (count($cat_terms) > 0) { |
|
698 | + //Displaying as a list |
|
699 | + $p = $pading * 20; |
|
700 | + $pading++; |
|
701 | + |
|
702 | + |
|
703 | + if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) { |
|
704 | + if ($cat_parent == 0) { |
|
705 | + $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
706 | + $main_list_class = 'class="main_list_selecter"'; |
|
707 | + } else { |
|
708 | + //$display = 'display:none'; |
|
709 | + $list_class = 'sub_list gd-sub-cats-list'; |
|
710 | + } |
|
711 | + } |
|
712 | 712 | |
713 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') { |
|
714 | - $p = 0; |
|
715 | - $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
716 | - } |
|
713 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') { |
|
714 | + $p = 0; |
|
715 | + $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
716 | + } |
|
717 | 717 | |
718 | - foreach ($cat_terms as $cat_term) { |
|
718 | + foreach ($cat_terms as $cat_term) { |
|
719 | 719 | |
720 | - $checked = ''; |
|
720 | + $checked = ''; |
|
721 | 721 | |
722 | - if (in_array($cat_term->term_id, $search_terms)) { |
|
723 | - if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
724 | - $checked = 'selected="selected"'; |
|
725 | - else |
|
726 | - $checked = 'checked="checked"'; |
|
727 | - } |
|
722 | + if (in_array($cat_term->term_id, $search_terms)) { |
|
723 | + if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
724 | + $checked = 'selected="selected"'; |
|
725 | + else |
|
726 | + $checked = 'checked="checked"'; |
|
727 | + } |
|
728 | 728 | |
729 | - if ($cat_display == 'radio') |
|
730 | - $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
731 | - elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
732 | - $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
729 | + if ($cat_display == 'radio') |
|
730 | + $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
731 | + elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
732 | + $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
733 | 733 | |
734 | - else { |
|
735 | - $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
736 | - } |
|
734 | + else { |
|
735 | + $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
736 | + } |
|
737 | 737 | |
738 | - // Call recurson to print sub cats |
|
739 | - $out .= geodir_custom_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading); |
|
738 | + // Call recurson to print sub cats |
|
739 | + $out .= geodir_custom_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading); |
|
740 | 740 | |
741 | - } |
|
741 | + } |
|
742 | 742 | |
743 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
744 | - $out .= '</div>'; |
|
743 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
744 | + $out .= '</div>'; |
|
745 | 745 | |
746 | - return $out; |
|
747 | - } |
|
748 | - return; |
|
749 | - } |
|
746 | + return $out; |
|
747 | + } |
|
748 | + return; |
|
749 | + } |
|
750 | 750 | } |
751 | 751 | |
752 | 752 | if (!function_exists('geodir_custom_taxonomy_walker2')) { |
753 | - /** |
|
754 | - * Custom taxonomy walker function. |
|
755 | - * |
|
756 | - * @since 1.0.0 |
|
757 | - * @package GeoDirectory |
|
758 | - * @global object $post WordPress Post object. |
|
759 | - * @global object $gd_session GeoDirectory Session object. |
|
760 | - * @param string $cat_taxonomy The taxonomy name. |
|
761 | - * @param string $cat_limit Number of categories to display. |
|
762 | - */ |
|
763 | - function geodir_custom_taxonomy_walker2($cat_taxonomy, $cat_limit = '') |
|
764 | - { |
|
765 | - $post_category = ''; |
|
766 | - $post_category_str = ''; |
|
767 | - global $exclude_cats, $gd_session; |
|
768 | - |
|
769 | - $cat_exclude = ''; |
|
770 | - if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
771 | - $cat_exclude = serialize($exclude_cats); |
|
772 | - |
|
773 | - if (isset($_REQUEST['backandedit'])) { |
|
774 | - $post = (object)$gd_session->get('listing'); |
|
775 | - |
|
776 | - if (!is_array($post->post_category[$cat_taxonomy])) |
|
777 | - $post_category = $post->post_category[$cat_taxonomy]; |
|
778 | - |
|
779 | - $post_categories = $post->post_category_str; |
|
780 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
781 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
782 | - |
|
783 | - } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) { |
|
784 | - global $post; |
|
785 | - |
|
786 | - $post_category = geodir_get_post_meta($post->ID, $cat_taxonomy, true); |
|
787 | - if (empty($post_category) && isset($post->{$cat_taxonomy})) { |
|
788 | - $post_category = $post->{$cat_taxonomy}; |
|
789 | - } |
|
753 | + /** |
|
754 | + * Custom taxonomy walker function. |
|
755 | + * |
|
756 | + * @since 1.0.0 |
|
757 | + * @package GeoDirectory |
|
758 | + * @global object $post WordPress Post object. |
|
759 | + * @global object $gd_session GeoDirectory Session object. |
|
760 | + * @param string $cat_taxonomy The taxonomy name. |
|
761 | + * @param string $cat_limit Number of categories to display. |
|
762 | + */ |
|
763 | + function geodir_custom_taxonomy_walker2($cat_taxonomy, $cat_limit = '') |
|
764 | + { |
|
765 | + $post_category = ''; |
|
766 | + $post_category_str = ''; |
|
767 | + global $exclude_cats, $gd_session; |
|
768 | + |
|
769 | + $cat_exclude = ''; |
|
770 | + if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
771 | + $cat_exclude = serialize($exclude_cats); |
|
772 | + |
|
773 | + if (isset($_REQUEST['backandedit'])) { |
|
774 | + $post = (object)$gd_session->get('listing'); |
|
775 | + |
|
776 | + if (!is_array($post->post_category[$cat_taxonomy])) |
|
777 | + $post_category = $post->post_category[$cat_taxonomy]; |
|
778 | + |
|
779 | + $post_categories = $post->post_category_str; |
|
780 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
781 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
782 | + |
|
783 | + } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) { |
|
784 | + global $post; |
|
785 | + |
|
786 | + $post_category = geodir_get_post_meta($post->ID, $cat_taxonomy, true); |
|
787 | + if (empty($post_category) && isset($post->{$cat_taxonomy})) { |
|
788 | + $post_category = $post->{$cat_taxonomy}; |
|
789 | + } |
|
790 | 790 | |
791 | - $post_categories = get_post_meta($post->ID, 'post_categories', true); |
|
791 | + $post_categories = get_post_meta($post->ID, 'post_categories', true); |
|
792 | 792 | |
793 | - if (empty($post_category) && !empty($post_categories) && !empty($post_categories[$cat_taxonomy])) { |
|
794 | - foreach (explode(",", $post_categories[$cat_taxonomy]) as $cat_part) { |
|
795 | - if (is_numeric($cat_part)) { |
|
796 | - $cat_part_arr[] = $cat_part; |
|
797 | - } |
|
798 | - } |
|
799 | - if (is_array($cat_part_arr)) { |
|
800 | - $post_category = implode(',', $cat_part_arr); |
|
801 | - } |
|
802 | - } |
|
793 | + if (empty($post_category) && !empty($post_categories) && !empty($post_categories[$cat_taxonomy])) { |
|
794 | + foreach (explode(",", $post_categories[$cat_taxonomy]) as $cat_part) { |
|
795 | + if (is_numeric($cat_part)) { |
|
796 | + $cat_part_arr[] = $cat_part; |
|
797 | + } |
|
798 | + } |
|
799 | + if (is_array($cat_part_arr)) { |
|
800 | + $post_category = implode(',', $cat_part_arr); |
|
801 | + } |
|
802 | + } |
|
803 | 803 | |
804 | - if (!empty($post_category)) { |
|
805 | - $cat1 = array_filter(explode(',', $post_category)); |
|
806 | - $post_category = ',' . implode(',', $cat1) . ','; |
|
804 | + if (!empty($post_category)) { |
|
805 | + $cat1 = array_filter(explode(',', $post_category)); |
|
806 | + $post_category = ',' . implode(',', $cat1) . ','; |
|
807 | 807 | |
808 | - } |
|
808 | + } |
|
809 | 809 | |
810 | - if ($post_category != '' && is_array($exclude_cats) && !empty($exclude_cats)) { |
|
810 | + if ($post_category != '' && is_array($exclude_cats) && !empty($exclude_cats)) { |
|
811 | 811 | |
812 | - $post_category_upd = explode(',', $post_category); |
|
813 | - $post_category_change = ''; |
|
814 | - foreach ($post_category_upd as $cat) { |
|
812 | + $post_category_upd = explode(',', $post_category); |
|
813 | + $post_category_change = ''; |
|
814 | + foreach ($post_category_upd as $cat) { |
|
815 | 815 | |
816 | - if (!in_array($cat, $exclude_cats) && $cat != '') { |
|
817 | - $post_category_change .= ',' . $cat; |
|
818 | - } |
|
819 | - } |
|
820 | - $post_category = $post_category_change; |
|
821 | - } |
|
816 | + if (!in_array($cat, $exclude_cats) && $cat != '') { |
|
817 | + $post_category_change .= ',' . $cat; |
|
818 | + } |
|
819 | + } |
|
820 | + $post_category = $post_category_change; |
|
821 | + } |
|
822 | 822 | |
823 | 823 | |
824 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
825 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
826 | - } |
|
827 | - } |
|
824 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
825 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
826 | + } |
|
827 | + } |
|
828 | 828 | |
829 | - echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
829 | + echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
830 | 830 | |
831 | - echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
831 | + echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
832 | 832 | |
833 | - echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
833 | + echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
834 | 834 | |
835 | 835 | |
836 | - ?> |
|
836 | + ?> |
|
837 | 837 | <div class="cat_sublist"> |
838 | 838 | <?php |
839 | 839 | |
840 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
840 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
841 | 841 | |
842 | - if ((geodir_is_page('add-listing') || is_admin()) && !empty($post_categories[$cat_taxonomy])) { |
|
842 | + if ((geodir_is_page('add-listing') || is_admin()) && !empty($post_categories[$cat_taxonomy])) { |
|
843 | 843 | |
844 | - geodir_editpost_categories_html($cat_taxonomy, $post_id, $post_categories); |
|
845 | - } |
|
846 | - ?> |
|
844 | + geodir_editpost_categories_html($cat_taxonomy, $post_id, $post_categories); |
|
845 | + } |
|
846 | + ?> |
|
847 | 847 | </div> |
848 | 848 | <script type="text/javascript"> |
849 | 849 | |
@@ -966,22 +966,22 @@ discard block |
||
966 | 966 | |
967 | 967 | </script> |
968 | 968 | <?php |
969 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
970 | - $post_cat_str = $post_categories[$cat_taxonomy]; |
|
971 | - $post_cat_array = explode("#", $post_cat_str); |
|
972 | - if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
973 | - $style = "display:none;"; |
|
974 | - } |
|
975 | - ?> |
|
969 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
970 | + $post_cat_str = $post_categories[$cat_taxonomy]; |
|
971 | + $post_cat_array = explode("#", $post_cat_str); |
|
972 | + if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
973 | + $style = "display:none;"; |
|
974 | + } |
|
975 | + ?> |
|
976 | 976 | <div class="main_cat_list" style=" <?php if (isset($style)) { |
977 | - echo $style; |
|
978 | - }?> "> |
|
977 | + echo $style; |
|
978 | + }?> "> |
|
979 | 979 | <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
980 | - ?> |
|
980 | + ?> |
|
981 | 981 | </div> |
982 | 982 | <?php |
983 | 983 | |
984 | - } |
|
984 | + } |
|
985 | 985 | } |
986 | 986 | |
987 | 987 | /** |
@@ -998,23 +998,23 @@ discard block |
||
998 | 998 | */ |
999 | 999 | function geodir_addpost_categories_html($request_taxonomy, $parrent, $selected = false, $main_selected = true, $default = false, $exclude = '') |
1000 | 1000 | { |
1001 | - global $exclude_cats; |
|
1001 | + global $exclude_cats; |
|
1002 | 1002 | |
1003 | - if ($exclude != '') { |
|
1004 | - $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
|
1003 | + if ($exclude != '') { |
|
1004 | + $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
|
1005 | 1005 | |
1006 | - if(is_array( $exclude_cats)){ |
|
1007 | - $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
1008 | - }else{ |
|
1009 | - $exclude_cats = intval($exclude_cats); |
|
1010 | - } |
|
1006 | + if(is_array( $exclude_cats)){ |
|
1007 | + $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
1008 | + }else{ |
|
1009 | + $exclude_cats = intval($exclude_cats); |
|
1010 | + } |
|
1011 | 1011 | |
1012 | - } |
|
1012 | + } |
|
1013 | 1013 | |
1014 | - if ((is_array($exclude_cats) && !empty($exclude_cats) && !in_array($parrent, $exclude_cats)) || |
|
1015 | - (!is_array($exclude_cats) || empty($exclude_cats)) |
|
1016 | - ) { |
|
1017 | - ?> |
|
1014 | + if ((is_array($exclude_cats) && !empty($exclude_cats) && !in_array($parrent, $exclude_cats)) || |
|
1015 | + (!is_array($exclude_cats) || empty($exclude_cats)) |
|
1016 | + ) { |
|
1017 | + ?> |
|
1018 | 1018 | |
1019 | 1019 | <?php $main_cat = get_term($parrent, $request_taxonomy); ?> |
1020 | 1020 | |
@@ -1043,8 +1043,8 @@ discard block |
||
1043 | 1043 | |
1044 | 1044 | <br/> |
1045 | 1045 | <?php |
1046 | - $cat_terms = get_terms($request_taxonomy, array('parent' => $main_cat->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1047 | - if (!empty($cat_terms)) { ?> |
|
1046 | + $cat_terms = get_terms($request_taxonomy, array('parent' => $main_cat->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1047 | + if (!empty($cat_terms)) { ?> |
|
1048 | 1048 | <span> <?php printf(__('Add listing in category', 'geodirectory')); ?></span> |
1049 | 1049 | <?php geodir_get_catlist($request_taxonomy, $parrent, $selected) ?> |
1050 | 1050 | <?php } ?> |
@@ -1066,53 +1066,53 @@ discard block |
||
1066 | 1066 | function geodir_editpost_categories_html($request_taxonomy, $request_postid, $post_categories) |
1067 | 1067 | { |
1068 | 1068 | |
1069 | - if (!empty($post_categories) && array_key_exists($request_taxonomy, $post_categories)) { |
|
1070 | - $post_cat_str = $post_categories[$request_taxonomy]; |
|
1071 | - $post_cat_array = explode("#", $post_cat_str); |
|
1072 | - if (is_array($post_cat_array)) { |
|
1073 | - $post_cat_array = array_unique( $post_cat_array ); |
|
1069 | + if (!empty($post_categories) && array_key_exists($request_taxonomy, $post_categories)) { |
|
1070 | + $post_cat_str = $post_categories[$request_taxonomy]; |
|
1071 | + $post_cat_array = explode("#", $post_cat_str); |
|
1072 | + if (is_array($post_cat_array)) { |
|
1073 | + $post_cat_array = array_unique( $post_cat_array ); |
|
1074 | 1074 | |
1075 | 1075 | foreach ($post_cat_array as $post_cat_html) { |
1076 | 1076 | |
1077 | - $post_cat_info = explode(":", $post_cat_html); |
|
1078 | - $post_maincat_str = $post_cat_info[0]; |
|
1077 | + $post_cat_info = explode(":", $post_cat_html); |
|
1078 | + $post_maincat_str = $post_cat_info[0]; |
|
1079 | 1079 | |
1080 | - if (!empty($post_maincat_str)) { |
|
1081 | - $post_maincat_info = explode(",", $post_maincat_str); |
|
1082 | - $post_maincat_id = $post_maincat_info[0]; |
|
1083 | - ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1084 | - (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1085 | - } |
|
1086 | - $post_sub_catid = ''; |
|
1087 | - if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1088 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1089 | - } |
|
1080 | + if (!empty($post_maincat_str)) { |
|
1081 | + $post_maincat_info = explode(",", $post_maincat_str); |
|
1082 | + $post_maincat_id = $post_maincat_info[0]; |
|
1083 | + ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1084 | + (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1085 | + } |
|
1086 | + $post_sub_catid = ''; |
|
1087 | + if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1088 | + $post_sub_catid = (int)$post_cat_info[1]; |
|
1089 | + } |
|
1090 | 1090 | |
1091 | - geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1091 | + geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1092 | 1092 | |
1093 | - } |
|
1094 | - } else { |
|
1093 | + } |
|
1094 | + } else { |
|
1095 | 1095 | |
1096 | - $post_cat_info = explode(":", $post_cat_str); |
|
1097 | - $post_maincat_str = $post_cat_info[0]; |
|
1096 | + $post_cat_info = explode(":", $post_cat_str); |
|
1097 | + $post_maincat_str = $post_cat_info[0]; |
|
1098 | 1098 | |
1099 | - $post_sub_catid = ''; |
|
1099 | + $post_sub_catid = ''; |
|
1100 | 1100 | |
1101 | - if (!empty($post_maincat_str)) { |
|
1102 | - $post_maincat_info = explode(",", $post_maincat_str); |
|
1103 | - $post_maincat_id = $post_maincat_info[0]; |
|
1104 | - ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1105 | - (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1106 | - } |
|
1101 | + if (!empty($post_maincat_str)) { |
|
1102 | + $post_maincat_info = explode(",", $post_maincat_str); |
|
1103 | + $post_maincat_id = $post_maincat_info[0]; |
|
1104 | + ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1105 | + (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1106 | + } |
|
1107 | 1107 | |
1108 | - if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1109 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1110 | - } |
|
1108 | + if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1109 | + $post_sub_catid = (int)$post_cat_info[1]; |
|
1110 | + } |
|
1111 | 1111 | |
1112 | - geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1112 | + geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1113 | 1113 | |
1114 | - } |
|
1115 | - } |
|
1114 | + } |
|
1115 | + } |
|
1116 | 1116 | } |
1117 | 1117 | |
1118 | 1118 | /** |
@@ -1126,35 +1126,35 @@ discard block |
||
1126 | 1126 | */ |
1127 | 1127 | function geodir_get_catlist($cat_taxonomy, $parrent = 0, $selected = false) |
1128 | 1128 | { |
1129 | - global $exclude_cats; |
|
1129 | + global $exclude_cats; |
|
1130 | 1130 | |
1131 | - $cat_terms = get_terms($cat_taxonomy, array('parent' => $parrent, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1131 | + $cat_terms = get_terms($cat_taxonomy, array('parent' => $parrent, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1132 | 1132 | |
1133 | - if (!empty($cat_terms)) { |
|
1134 | - $onchange = ''; |
|
1135 | - $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
|
1133 | + if (!empty($cat_terms)) { |
|
1134 | + $onchange = ''; |
|
1135 | + $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
|
1136 | 1136 | |
1137 | - $option_selected = ''; |
|
1138 | - if (!$selected) |
|
1139 | - $option_slected = ' selected="selected" '; |
|
1137 | + $option_selected = ''; |
|
1138 | + if (!$selected) |
|
1139 | + $option_slected = ' selected="selected" '; |
|
1140 | 1140 | |
1141 | - echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
1141 | + echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
1142 | 1142 | |
1143 | - echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>'; |
|
1143 | + echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>'; |
|
1144 | 1144 | |
1145 | - foreach ($cat_terms as $cat_term) { |
|
1146 | - $option_selected = ''; |
|
1147 | - if ($selected == $cat_term->term_id) |
|
1148 | - $option_selected = ' selected="selected" '; |
|
1145 | + foreach ($cat_terms as $cat_term) { |
|
1146 | + $option_selected = ''; |
|
1147 | + if ($selected == $cat_term->term_id) |
|
1148 | + $option_selected = ' selected="selected" '; |
|
1149 | 1149 | |
1150 | - // Count child terms |
|
1151 | - $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
1152 | - $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
1150 | + // Count child terms |
|
1151 | + $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
1152 | + $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
1153 | 1153 | |
1154 | - echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
|
1155 | - } |
|
1156 | - echo '</select>'; |
|
1157 | - } |
|
1154 | + echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
|
1155 | + } |
|
1156 | + echo '</select>'; |
|
1157 | + } |
|
1158 | 1158 | } |
1159 | 1159 | |
1160 | 1160 | /** |
@@ -1170,28 +1170,28 @@ discard block |
||
1170 | 1170 | */ |
1171 | 1171 | function geodir_custom_update_messages($messages) |
1172 | 1172 | { |
1173 | - global $post, $post_ID; |
|
1174 | - |
|
1175 | - $post_types = get_post_types(array('show_ui' => true, '_builtin' => false), 'objects'); |
|
1176 | - |
|
1177 | - foreach ($post_types as $post_type => $post_object) { |
|
1178 | - |
|
1179 | - $messages[$post_type] = array( |
|
1180 | - 0 => '', // Unused. Messages start at index 1. |
|
1181 | - 1 => sprintf(__('%s updated. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1182 | - 2 => __('Custom field updated.', 'geodirectory'), |
|
1183 | - 3 => __('Custom field deleted.', 'geodirectory'), |
|
1184 | - 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name), |
|
1185 | - 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false, |
|
1186 | - 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1187 | - 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name), |
|
1188 | - 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1189 | - 9 => sprintf(__('%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, date_i18n(__('M j, Y @ G:i', 'geodirectory'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1190 | - 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1191 | - ); |
|
1192 | - } |
|
1193 | - |
|
1194 | - return $messages; |
|
1173 | + global $post, $post_ID; |
|
1174 | + |
|
1175 | + $post_types = get_post_types(array('show_ui' => true, '_builtin' => false), 'objects'); |
|
1176 | + |
|
1177 | + foreach ($post_types as $post_type => $post_object) { |
|
1178 | + |
|
1179 | + $messages[$post_type] = array( |
|
1180 | + 0 => '', // Unused. Messages start at index 1. |
|
1181 | + 1 => sprintf(__('%s updated. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1182 | + 2 => __('Custom field updated.', 'geodirectory'), |
|
1183 | + 3 => __('Custom field deleted.', 'geodirectory'), |
|
1184 | + 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name), |
|
1185 | + 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false, |
|
1186 | + 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1187 | + 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name), |
|
1188 | + 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1189 | + 9 => sprintf(__('%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, date_i18n(__('M j, Y @ G:i', 'geodirectory'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1190 | + 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1191 | + ); |
|
1192 | + } |
|
1193 | + |
|
1194 | + return $messages; |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | |
@@ -1206,181 +1206,181 @@ discard block |
||
1206 | 1206 | function geodir_register_defaults() |
1207 | 1207 | { |
1208 | 1208 | |
1209 | - global $wpdb; |
|
1210 | - |
|
1211 | - $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
1212 | - |
|
1213 | - if (!$listing_slug = get_option('geodir_listing_prefix')) |
|
1214 | - $listing_slug = 'places'; |
|
1215 | - |
|
1216 | - /** |
|
1217 | - * Taxonomies |
|
1218 | - **/ |
|
1219 | - //if ( ! taxonomy_exists('gd_place_tags') ) |
|
1220 | - { |
|
1221 | - |
|
1222 | - $gd_placetags = array(); |
|
1223 | - $gd_placetags['object_type'] = 'gd_place'; |
|
1224 | - $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
1225 | - $gd_placetags['args'] = array( |
|
1226 | - 'public' => true, |
|
1227 | - 'hierarchical' => false, |
|
1228 | - 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true), |
|
1229 | - 'query_var' => true, |
|
1230 | - |
|
1231 | - 'labels' => array( |
|
1232 | - 'name' => __('Place Tags', 'geodirectory'), |
|
1233 | - 'singular_name' => __('Place Tag', 'geodirectory'), |
|
1234 | - 'search_items' => __('Search Place Tags', 'geodirectory'), |
|
1235 | - 'popular_items' => __('Popular Place Tags', 'geodirectory'), |
|
1236 | - 'all_items' => __('All Place Tags', 'geodirectory'), |
|
1237 | - 'edit_item' => __('Edit Place Tag', 'geodirectory'), |
|
1238 | - 'update_item' => __('Update Place Tag', 'geodirectory'), |
|
1239 | - 'add_new_item' => __('Add New Place Tag', 'geodirectory'), |
|
1240 | - 'new_item_name' => __('New Place Tag Name', 'geodirectory'), |
|
1241 | - 'add_or_remove_items' => __('Add or remove Place tags', 'geodirectory'), |
|
1242 | - 'choose_from_most_used' => __('Choose from the most used Place tags', 'geodirectory'), |
|
1243 | - 'separate_items_with_commas' => __('Separate Place tags with commas', 'geodirectory'), |
|
1244 | - ), |
|
1245 | - ); |
|
1246 | - |
|
1247 | - |
|
1248 | - $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1249 | - $geodir_taxonomies['gd_place_tags'] = $gd_placetags; |
|
1250 | - update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1251 | - |
|
1252 | - |
|
1253 | - // Update post types and delete tmp options |
|
1254 | - flush_rewrite_rules(); |
|
1255 | - |
|
1256 | - } |
|
1257 | - |
|
1258 | - //if ( ! taxonomy_exists('gd_placecategory') ) |
|
1259 | - { |
|
1260 | - |
|
1261 | - $gd_placecategory = array(); |
|
1262 | - $gd_placecategory['object_type'] = 'gd_place'; |
|
1263 | - $gd_placecategory['listing_slug'] = $listing_slug; |
|
1264 | - $gd_placecategory['args'] = array( |
|
1265 | - 'public' => true, |
|
1266 | - 'hierarchical' => true, |
|
1267 | - 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true), |
|
1268 | - 'query_var' => true, |
|
1269 | - 'labels' => array( |
|
1270 | - 'name' => __('Place Categories', 'geodirectory'), |
|
1271 | - 'singular_name' => __('Place Category', 'geodirectory'), |
|
1272 | - 'search_items' => __('Search Place Categories', 'geodirectory'), |
|
1273 | - 'popular_items' => __('Popular Place Categories', 'geodirectory'), |
|
1274 | - 'all_items' => __('All Place Categories', 'geodirectory'), |
|
1275 | - 'edit_item' => __('Edit Place Category', 'geodirectory'), |
|
1276 | - 'update_item' => __('Update Place Category', 'geodirectory'), |
|
1277 | - 'add_new_item' => __('Add New Place Category', 'geodirectory'), |
|
1278 | - 'new_item_name' => __('New Place Category', 'geodirectory'), |
|
1279 | - 'add_or_remove_items' => __('Add or remove Place categories', 'geodirectory'), |
|
1280 | - ), |
|
1281 | - ); |
|
1282 | - |
|
1283 | - |
|
1284 | - $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1285 | - $geodir_taxonomies['gd_placecategory'] = $gd_placecategory; |
|
1286 | - update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1287 | - |
|
1288 | - |
|
1289 | - flush_rewrite_rules(); |
|
1290 | - } |
|
1291 | - |
|
1292 | - /** |
|
1293 | - * Post Types |
|
1294 | - **/ |
|
1295 | - |
|
1296 | - //if ( ! post_type_exists('gd_place') ) |
|
1297 | - { |
|
1298 | - |
|
1299 | - $labels = array( |
|
1300 | - 'name' => __('Places', 'geodirectory'), |
|
1301 | - 'singular_name' => __('Place', 'geodirectory'), |
|
1302 | - 'add_new' => __('Add New', 'geodirectory'), |
|
1303 | - 'add_new_item' => __('Add New Place', 'geodirectory'), |
|
1304 | - 'edit_item' => __('Edit Place', 'geodirectory'), |
|
1305 | - 'new_item' => __('New Place', 'geodirectory'), |
|
1306 | - 'view_item' => __('View Place', 'geodirectory'), |
|
1307 | - 'search_items' => __('Search Places', 'geodirectory'), |
|
1308 | - 'not_found' => __('No Place Found', 'geodirectory'), |
|
1309 | - 'not_found_in_trash' => __('No Place Found In Trash', 'geodirectory')); |
|
1310 | - |
|
1311 | - $place_default = array( |
|
1312 | - 'labels' => $labels, |
|
1313 | - 'can_export' => true, |
|
1314 | - 'capability_type' => 'post', |
|
1315 | - 'description' => 'Place post type.', |
|
1316 | - 'has_archive' => $listing_slug, |
|
1317 | - 'hierarchical' => false, |
|
1318 | - 'map_meta_cap' => true, |
|
1319 | - 'menu_icon' => $menu_icon, |
|
1320 | - 'public' => true, |
|
1321 | - 'query_var' => true, |
|
1322 | - 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true), |
|
1323 | - 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/), |
|
1324 | - 'taxonomies' => array('gd_placecategory', 'gd_place_tags')); |
|
1325 | - |
|
1326 | - //Update custom post types |
|
1327 | - $geodir_post_types = get_option('geodir_post_types'); |
|
1328 | - $geodir_post_types['gd_place'] = $place_default; |
|
1329 | - update_option('geodir_post_types', $geodir_post_types); |
|
1330 | - |
|
1331 | - // Update post types and delete tmp options |
|
1332 | - flush_rewrite_rules(); |
|
1333 | - } |
|
1334 | - |
|
1335 | - |
|
1336 | - geodir_register_taxonomies(); |
|
1337 | - geodir_register_post_types(); |
|
1338 | - |
|
1339 | - //die; |
|
1209 | + global $wpdb; |
|
1210 | + |
|
1211 | + $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
1212 | + |
|
1213 | + if (!$listing_slug = get_option('geodir_listing_prefix')) |
|
1214 | + $listing_slug = 'places'; |
|
1215 | + |
|
1216 | + /** |
|
1217 | + * Taxonomies |
|
1218 | + **/ |
|
1219 | + //if ( ! taxonomy_exists('gd_place_tags') ) |
|
1220 | + { |
|
1221 | + |
|
1222 | + $gd_placetags = array(); |
|
1223 | + $gd_placetags['object_type'] = 'gd_place'; |
|
1224 | + $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
1225 | + $gd_placetags['args'] = array( |
|
1226 | + 'public' => true, |
|
1227 | + 'hierarchical' => false, |
|
1228 | + 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true), |
|
1229 | + 'query_var' => true, |
|
1230 | + |
|
1231 | + 'labels' => array( |
|
1232 | + 'name' => __('Place Tags', 'geodirectory'), |
|
1233 | + 'singular_name' => __('Place Tag', 'geodirectory'), |
|
1234 | + 'search_items' => __('Search Place Tags', 'geodirectory'), |
|
1235 | + 'popular_items' => __('Popular Place Tags', 'geodirectory'), |
|
1236 | + 'all_items' => __('All Place Tags', 'geodirectory'), |
|
1237 | + 'edit_item' => __('Edit Place Tag', 'geodirectory'), |
|
1238 | + 'update_item' => __('Update Place Tag', 'geodirectory'), |
|
1239 | + 'add_new_item' => __('Add New Place Tag', 'geodirectory'), |
|
1240 | + 'new_item_name' => __('New Place Tag Name', 'geodirectory'), |
|
1241 | + 'add_or_remove_items' => __('Add or remove Place tags', 'geodirectory'), |
|
1242 | + 'choose_from_most_used' => __('Choose from the most used Place tags', 'geodirectory'), |
|
1243 | + 'separate_items_with_commas' => __('Separate Place tags with commas', 'geodirectory'), |
|
1244 | + ), |
|
1245 | + ); |
|
1246 | + |
|
1247 | + |
|
1248 | + $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1249 | + $geodir_taxonomies['gd_place_tags'] = $gd_placetags; |
|
1250 | + update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1251 | + |
|
1252 | + |
|
1253 | + // Update post types and delete tmp options |
|
1254 | + flush_rewrite_rules(); |
|
1255 | + |
|
1256 | + } |
|
1257 | + |
|
1258 | + //if ( ! taxonomy_exists('gd_placecategory') ) |
|
1259 | + { |
|
1260 | + |
|
1261 | + $gd_placecategory = array(); |
|
1262 | + $gd_placecategory['object_type'] = 'gd_place'; |
|
1263 | + $gd_placecategory['listing_slug'] = $listing_slug; |
|
1264 | + $gd_placecategory['args'] = array( |
|
1265 | + 'public' => true, |
|
1266 | + 'hierarchical' => true, |
|
1267 | + 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true), |
|
1268 | + 'query_var' => true, |
|
1269 | + 'labels' => array( |
|
1270 | + 'name' => __('Place Categories', 'geodirectory'), |
|
1271 | + 'singular_name' => __('Place Category', 'geodirectory'), |
|
1272 | + 'search_items' => __('Search Place Categories', 'geodirectory'), |
|
1273 | + 'popular_items' => __('Popular Place Categories', 'geodirectory'), |
|
1274 | + 'all_items' => __('All Place Categories', 'geodirectory'), |
|
1275 | + 'edit_item' => __('Edit Place Category', 'geodirectory'), |
|
1276 | + 'update_item' => __('Update Place Category', 'geodirectory'), |
|
1277 | + 'add_new_item' => __('Add New Place Category', 'geodirectory'), |
|
1278 | + 'new_item_name' => __('New Place Category', 'geodirectory'), |
|
1279 | + 'add_or_remove_items' => __('Add or remove Place categories', 'geodirectory'), |
|
1280 | + ), |
|
1281 | + ); |
|
1282 | + |
|
1283 | + |
|
1284 | + $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1285 | + $geodir_taxonomies['gd_placecategory'] = $gd_placecategory; |
|
1286 | + update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1287 | + |
|
1288 | + |
|
1289 | + flush_rewrite_rules(); |
|
1290 | + } |
|
1291 | + |
|
1292 | + /** |
|
1293 | + * Post Types |
|
1294 | + **/ |
|
1295 | + |
|
1296 | + //if ( ! post_type_exists('gd_place') ) |
|
1297 | + { |
|
1298 | + |
|
1299 | + $labels = array( |
|
1300 | + 'name' => __('Places', 'geodirectory'), |
|
1301 | + 'singular_name' => __('Place', 'geodirectory'), |
|
1302 | + 'add_new' => __('Add New', 'geodirectory'), |
|
1303 | + 'add_new_item' => __('Add New Place', 'geodirectory'), |
|
1304 | + 'edit_item' => __('Edit Place', 'geodirectory'), |
|
1305 | + 'new_item' => __('New Place', 'geodirectory'), |
|
1306 | + 'view_item' => __('View Place', 'geodirectory'), |
|
1307 | + 'search_items' => __('Search Places', 'geodirectory'), |
|
1308 | + 'not_found' => __('No Place Found', 'geodirectory'), |
|
1309 | + 'not_found_in_trash' => __('No Place Found In Trash', 'geodirectory')); |
|
1310 | + |
|
1311 | + $place_default = array( |
|
1312 | + 'labels' => $labels, |
|
1313 | + 'can_export' => true, |
|
1314 | + 'capability_type' => 'post', |
|
1315 | + 'description' => 'Place post type.', |
|
1316 | + 'has_archive' => $listing_slug, |
|
1317 | + 'hierarchical' => false, |
|
1318 | + 'map_meta_cap' => true, |
|
1319 | + 'menu_icon' => $menu_icon, |
|
1320 | + 'public' => true, |
|
1321 | + 'query_var' => true, |
|
1322 | + 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true), |
|
1323 | + 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/), |
|
1324 | + 'taxonomies' => array('gd_placecategory', 'gd_place_tags')); |
|
1325 | + |
|
1326 | + //Update custom post types |
|
1327 | + $geodir_post_types = get_option('geodir_post_types'); |
|
1328 | + $geodir_post_types['gd_place'] = $place_default; |
|
1329 | + update_option('geodir_post_types', $geodir_post_types); |
|
1330 | + |
|
1331 | + // Update post types and delete tmp options |
|
1332 | + flush_rewrite_rules(); |
|
1333 | + } |
|
1334 | + |
|
1335 | + |
|
1336 | + geodir_register_taxonomies(); |
|
1337 | + geodir_register_post_types(); |
|
1338 | + |
|
1339 | + //die; |
|
1340 | 1340 | |
1341 | 1341 | } |
1342 | 1342 | |
1343 | 1343 | $gd_wpml_get_languages = ""; |
1344 | 1344 | function gd_wpml_get_lang_from_url($url){ |
1345 | 1345 | |
1346 | - global $gd_wpml_get_languages; |
|
1347 | - if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];} |
|
1346 | + global $gd_wpml_get_languages; |
|
1347 | + if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];} |
|
1348 | 1348 | |
1349 | 1349 | |
1350 | - // |
|
1351 | - $url = str_replace(array("http://","https://"),"",$url); |
|
1352 | - $site_url = str_replace(array("http://","https://"),"",get_bloginfo('url')); |
|
1350 | + // |
|
1351 | + $url = str_replace(array("http://","https://"),"",$url); |
|
1352 | + $site_url = str_replace(array("http://","https://"),"",get_bloginfo('url')); |
|
1353 | 1353 | |
1354 | - $url = str_replace($site_url,"",$url); |
|
1354 | + $url = str_replace($site_url,"",$url); |
|
1355 | 1355 | |
1356 | 1356 | |
1357 | - $segments = explode('/', trim($url, '/')); |
|
1357 | + $segments = explode('/', trim($url, '/')); |
|
1358 | 1358 | |
1359 | - //print_r( $segments); |
|
1360 | - if($gd_wpml_get_languages){ |
|
1361 | - $langs = $gd_wpml_get_languages; |
|
1362 | - }else{ |
|
1363 | - global $sitepress; |
|
1364 | - $gd_wpml_get_languages = $sitepress->get_active_languages(); |
|
1365 | - } |
|
1359 | + //print_r( $segments); |
|
1360 | + if($gd_wpml_get_languages){ |
|
1361 | + $langs = $gd_wpml_get_languages; |
|
1362 | + }else{ |
|
1363 | + global $sitepress; |
|
1364 | + $gd_wpml_get_languages = $sitepress->get_active_languages(); |
|
1365 | + } |
|
1366 | 1366 | |
1367 | - if (isset($segments[0]) && $segments[0] && array_key_exists($segments[0], $gd_wpml_get_languages)) { |
|
1368 | - return $segments[0]; |
|
1369 | - } |
|
1367 | + if (isset($segments[0]) && $segments[0] && array_key_exists($segments[0], $gd_wpml_get_languages)) { |
|
1368 | + return $segments[0]; |
|
1369 | + } |
|
1370 | 1370 | |
1371 | - return false; |
|
1371 | + return false; |
|
1372 | 1372 | |
1373 | 1373 | |
1374 | 1374 | } |
1375 | 1375 | |
1376 | 1376 | function gd_wpml_slug_translation_turned_on($post_type) { |
1377 | 1377 | |
1378 | - global $sitepress; |
|
1379 | - $settings = $sitepress->get_settings(); |
|
1380 | - return isset($settings['posts_slug_translation']['types'][$post_type]) |
|
1381 | - && $settings['posts_slug_translation']['types'][$post_type] |
|
1382 | - && isset($settings['posts_slug_translation']['on']) |
|
1383 | - && $settings['posts_slug_translation']['on']; |
|
1378 | + global $sitepress; |
|
1379 | + $settings = $sitepress->get_settings(); |
|
1380 | + return isset($settings['posts_slug_translation']['types'][$post_type]) |
|
1381 | + && $settings['posts_slug_translation']['types'][$post_type] |
|
1382 | + && isset($settings['posts_slug_translation']['on']) |
|
1383 | + && $settings['posts_slug_translation']['on']; |
|
1384 | 1384 | } |
1385 | 1385 | |
1386 | 1386 | |
@@ -1405,150 +1405,150 @@ discard block |
||
1405 | 1405 | */ |
1406 | 1406 | function geodir_listing_permalink_structure($post_link, $post_obj, $leavename, $sample) |
1407 | 1407 | { |
1408 | - //echo $post_link."<br />".$sample ; |
|
1408 | + //echo $post_link."<br />".$sample ; |
|
1409 | 1409 | |
1410 | 1410 | |
1411 | - global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache; |
|
1412 | - if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) { |
|
1413 | - } elseif (isset($post_obj->post_status) && $post_obj->post_status == 'auto-draft') { |
|
1414 | - return $post_link; |
|
1415 | - } else { |
|
1416 | - $orig_post = $post; |
|
1417 | - $post = $post_obj; |
|
1418 | - } |
|
1411 | + global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache; |
|
1412 | + if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) { |
|
1413 | + } elseif (isset($post_obj->post_status) && $post_obj->post_status == 'auto-draft') { |
|
1414 | + return $post_link; |
|
1415 | + } else { |
|
1416 | + $orig_post = $post; |
|
1417 | + $post = $post_obj; |
|
1418 | + } |
|
1419 | 1419 | |
1420 | - if (in_array($post->post_type, geodir_get_posttypes())) { |
|
1420 | + if (in_array($post->post_type, geodir_get_posttypes())) { |
|
1421 | 1421 | |
1422 | 1422 | |
1423 | - $post_types = get_option('geodir_post_types'); |
|
1424 | - $slug = $post_types[$post->post_type]['rewrite']['slug']; |
|
1423 | + $post_types = get_option('geodir_post_types'); |
|
1424 | + $slug = $post_types[$post->post_type]['rewrite']['slug']; |
|
1425 | 1425 | |
1426 | - // Alter the CPT slug if WPML is set to do so |
|
1427 | - if(function_exists('icl_object_id')){ |
|
1428 | - if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1426 | + // Alter the CPT slug if WPML is set to do so |
|
1427 | + if(function_exists('icl_object_id')){ |
|
1428 | + if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1429 | 1429 | |
1430 | - $org_slug = $slug; |
|
1431 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1432 | - $slug, |
|
1433 | - 'WordPress', |
|
1434 | - 'URL slug: ' . $slug, |
|
1435 | - $language_code); |
|
1430 | + $org_slug = $slug; |
|
1431 | + $slug = apply_filters( 'wpml_translate_single_string', |
|
1432 | + $slug, |
|
1433 | + 'WordPress', |
|
1434 | + 'URL slug: ' . $slug, |
|
1435 | + $language_code); |
|
1436 | 1436 | |
1437 | - if(!$slug){$slug = $org_slug;} |
|
1437 | + if(!$slug){$slug = $org_slug;} |
|
1438 | 1438 | |
1439 | - } |
|
1440 | - } |
|
1439 | + } |
|
1440 | + } |
|
1441 | 1441 | |
1442 | - if (function_exists('geodir_location_geo_home_link')) { |
|
1443 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
1444 | - } |
|
1442 | + if (function_exists('geodir_location_geo_home_link')) { |
|
1443 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
1444 | + } |
|
1445 | 1445 | |
1446 | - // Fix slug problem when slug matches part of host or base url/ Ex: url -> www.abcxyz.com & slug -> xyz. |
|
1447 | - $site_url = trailingslashit(get_bloginfo('url')); |
|
1446 | + // Fix slug problem when slug matches part of host or base url/ Ex: url -> www.abcxyz.com & slug -> xyz. |
|
1447 | + $site_url = trailingslashit(get_bloginfo('url')); |
|
1448 | 1448 | |
1449 | - if (function_exists('geodir_location_geo_home_link')) { |
|
1450 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
1451 | - } |
|
1452 | - |
|
1453 | - $fix_url = strpos($post_link, $site_url) === 0 ? true : false; |
|
1454 | - if ($fix_url) { |
|
1455 | - $post_link = str_replace($site_url, '', $post_link); |
|
1456 | - } |
|
1449 | + if (function_exists('geodir_location_geo_home_link')) { |
|
1450 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
1451 | + } |
|
1452 | + |
|
1453 | + $fix_url = strpos($post_link, $site_url) === 0 ? true : false; |
|
1454 | + if ($fix_url) { |
|
1455 | + $post_link = str_replace($site_url, '', $post_link); |
|
1456 | + } |
|
1457 | 1457 | |
1458 | - $post_link = trailingslashit( |
|
1459 | - preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
1460 | - ); |
|
1461 | - |
|
1462 | - if ($fix_url) { |
|
1463 | - $post_link = $site_url . $post_link; |
|
1464 | - } |
|
1465 | - |
|
1466 | - if (isset($comment_post_cache[$post->ID])) { |
|
1467 | - $post = $comment_post_cache[$post->ID]; |
|
1468 | - } |
|
1469 | - if (isset($gd_permalink_cache[$post->ID]) && $gd_permalink_cache[$post->ID] && !$sample) { |
|
1470 | - $post_id = $post->ID; |
|
1471 | - if (isset($orig_post)) { |
|
1472 | - $post = $orig_post; |
|
1473 | - } |
|
1474 | - return $gd_permalink_cache[$post_id]; |
|
1475 | - } |
|
1458 | + $post_link = trailingslashit( |
|
1459 | + preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
1460 | + ); |
|
1476 | 1461 | |
1477 | - if (!isset($post->post_locations)) { |
|
1478 | - $post_type = $post->post_type; |
|
1479 | - $ID = $post->ID; |
|
1480 | - $post2 = $wpdb->get_row( |
|
1481 | - $wpdb->prepare( |
|
1482 | - "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1483 | - array($post->ID) |
|
1484 | - ) |
|
1485 | - ); |
|
1462 | + if ($fix_url) { |
|
1463 | + $post_link = $site_url . $post_link; |
|
1464 | + } |
|
1486 | 1465 | |
1487 | - $post = (object)array_merge((array)$post, (array)$post2); |
|
1466 | + if (isset($comment_post_cache[$post->ID])) { |
|
1467 | + $post = $comment_post_cache[$post->ID]; |
|
1468 | + } |
|
1469 | + if (isset($gd_permalink_cache[$post->ID]) && $gd_permalink_cache[$post->ID] && !$sample) { |
|
1470 | + $post_id = $post->ID; |
|
1471 | + if (isset($orig_post)) { |
|
1472 | + $post = $orig_post; |
|
1473 | + } |
|
1474 | + return $gd_permalink_cache[$post_id]; |
|
1475 | + } |
|
1488 | 1476 | |
1489 | - $comment_post_cache[$post->ID] = $post; |
|
1490 | - } |
|
1477 | + if (!isset($post->post_locations)) { |
|
1478 | + $post_type = $post->post_type; |
|
1479 | + $ID = $post->ID; |
|
1480 | + $post2 = $wpdb->get_row( |
|
1481 | + $wpdb->prepare( |
|
1482 | + "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1483 | + array($post->ID) |
|
1484 | + ) |
|
1485 | + ); |
|
1491 | 1486 | |
1487 | + $post = (object)array_merge((array)$post, (array)$post2); |
|
1492 | 1488 | |
1489 | + $comment_post_cache[$post->ID] = $post; |
|
1490 | + } |
|
1493 | 1491 | |
1494 | - if (false !== strpos($post_link, '%gd_taxonomy%')) { |
|
1495 | 1492 | |
1496 | - if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) { |
|
1497 | - $location_request = ''; |
|
1498 | 1493 | |
1494 | + if (false !== strpos($post_link, '%gd_taxonomy%')) { |
|
1499 | 1495 | |
1500 | - if (!empty($post->post_locations)) { |
|
1501 | - $geodir_arr_locations = explode(',', $post->post_locations); |
|
1502 | - if (count($geodir_arr_locations) == 3) { |
|
1503 | - $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1504 | - $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1505 | - $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1506 | - $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1507 | - $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1508 | - $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1496 | + if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) { |
|
1497 | + $location_request = ''; |
|
1509 | 1498 | |
1510 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1511 | - 'region_slug' => $post->region_slug, |
|
1512 | - 'city_slug' => $post->city_slug |
|
1513 | - ); |
|
1514 | 1499 | |
1515 | - } else |
|
1516 | - $post_location = geodir_get_location(); |
|
1500 | + if (!empty($post->post_locations)) { |
|
1501 | + $geodir_arr_locations = explode(',', $post->post_locations); |
|
1502 | + if (count($geodir_arr_locations) == 3) { |
|
1503 | + $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1504 | + $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1505 | + $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1506 | + $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1507 | + $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1508 | + $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1517 | 1509 | |
1510 | + $post_location = (object)array('country_slug' => $post->country_slug, |
|
1511 | + 'region_slug' => $post->region_slug, |
|
1512 | + 'city_slug' => $post->city_slug |
|
1513 | + ); |
|
1518 | 1514 | |
1519 | - } else { |
|
1515 | + } else |
|
1516 | + $post_location = geodir_get_location(); |
|
1520 | 1517 | |
1521 | - $post_location_sql = $wpdb->get_results( |
|
1522 | - $wpdb->prepare( |
|
1523 | - "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1524 | - array($post->ID) |
|
1525 | - ) |
|
1526 | - ); |
|
1527 | - |
|
1528 | - if (!empty($post_location_sql) && is_array($post_location_sql) && !empty($post_location_sql[0]->post_locations)) { |
|
1529 | - |
|
1530 | - $geodir_arr_locations = explode(',', $post_location_sql[0]->post_locations); |
|
1531 | - if (count($geodir_arr_locations) == 3) { |
|
1532 | - $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1533 | - $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1534 | - $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1535 | - $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1536 | - $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1537 | - $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1538 | - |
|
1539 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1540 | - 'region_slug' => $post->region_slug, |
|
1541 | - 'city_slug' => $post->city_slug |
|
1542 | - ); |
|
1543 | 1518 | |
1544 | - } |
|
1545 | - } else |
|
1546 | - $post_location = geodir_get_location(); |
|
1547 | - } |
|
1519 | + } else { |
|
1520 | + |
|
1521 | + $post_location_sql = $wpdb->get_results( |
|
1522 | + $wpdb->prepare( |
|
1523 | + "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1524 | + array($post->ID) |
|
1525 | + ) |
|
1526 | + ); |
|
1527 | + |
|
1528 | + if (!empty($post_location_sql) && is_array($post_location_sql) && !empty($post_location_sql[0]->post_locations)) { |
|
1529 | + |
|
1530 | + $geodir_arr_locations = explode(',', $post_location_sql[0]->post_locations); |
|
1531 | + if (count($geodir_arr_locations) == 3) { |
|
1532 | + $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1533 | + $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1534 | + $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1535 | + $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1536 | + $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1537 | + $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1538 | + |
|
1539 | + $post_location = (object)array('country_slug' => $post->country_slug, |
|
1540 | + 'region_slug' => $post->region_slug, |
|
1541 | + 'city_slug' => $post->city_slug |
|
1542 | + ); |
|
1543 | + |
|
1544 | + } |
|
1545 | + } else |
|
1546 | + $post_location = geodir_get_location(); |
|
1547 | + } |
|
1548 | 1548 | |
1549 | 1549 | |
1550 | - if (!empty($post_location)) { |
|
1551 | - $country_slug = isset($post_location->country_slug) ? $post_location->country_slug : ''; |
|
1550 | + if (!empty($post_location)) { |
|
1551 | + $country_slug = isset($post_location->country_slug) ? $post_location->country_slug : ''; |
|
1552 | 1552 | $region_slug = isset($post_location->region_slug) ? $post_location->region_slug : ''; |
1553 | 1553 | $city_slug = isset($post_location->city_slug) ? $post_location->city_slug : ''; |
1554 | 1554 | |
@@ -1566,78 +1566,78 @@ discard block |
||
1566 | 1566 | $location_slug[] = $city_slug; |
1567 | 1567 | |
1568 | 1568 | $location_request .= implode('/', $location_slug) . '/'; |
1569 | - } |
|
1570 | - } |
|
1569 | + } |
|
1570 | + } |
|
1571 | 1571 | |
1572 | - if (get_option('geodir_add_categories_url')) { |
|
1572 | + if (get_option('geodir_add_categories_url')) { |
|
1573 | 1573 | |
1574 | - $term_request = ''; |
|
1575 | - $taxonomies = geodir_get_taxonomies($post->post_type); |
|
1574 | + $term_request = ''; |
|
1575 | + $taxonomies = geodir_get_taxonomies($post->post_type); |
|
1576 | 1576 | |
1577 | - $taxonomies = end($taxonomies); |
|
1577 | + $taxonomies = end($taxonomies); |
|
1578 | 1578 | |
1579 | - if (!empty($post->default_category)) { |
|
1580 | - $post_terms = $post->default_category; |
|
1581 | - } else { |
|
1582 | - $post_terms = ''; |
|
1579 | + if (!empty($post->default_category)) { |
|
1580 | + $post_terms = $post->default_category; |
|
1581 | + } else { |
|
1582 | + $post_terms = ''; |
|
1583 | 1583 | |
1584 | - if (isset($post->{$taxonomies})) { |
|
1585 | - $post_terms = explode(",", trim($post->{$taxonomies}, ",")); |
|
1586 | - $post_terms = $post_terms[0]; |
|
1587 | - } |
|
1584 | + if (isset($post->{$taxonomies})) { |
|
1585 | + $post_terms = explode(",", trim($post->{$taxonomies}, ",")); |
|
1586 | + $post_terms = $post_terms[0]; |
|
1587 | + } |
|
1588 | 1588 | |
1589 | - if (!$post_terms) |
|
1590 | - $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1589 | + if (!$post_terms) |
|
1590 | + $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1591 | 1591 | |
1592 | - if (!$post_terms) { |
|
1593 | - $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
|
1592 | + if (!$post_terms) { |
|
1593 | + $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
|
1594 | 1594 | |
1595 | - if ($post_terms) { |
|
1596 | - $post_terms = explode(",", trim($post_terms, ",")); |
|
1597 | - $post_terms = $post_terms[0]; |
|
1598 | - } |
|
1599 | - } |
|
1600 | - } |
|
1595 | + if ($post_terms) { |
|
1596 | + $post_terms = explode(",", trim($post_terms, ",")); |
|
1597 | + $post_terms = $post_terms[0]; |
|
1598 | + } |
|
1599 | + } |
|
1600 | + } |
|
1601 | 1601 | |
1602 | - $term = get_term_by('id', $post_terms, $taxonomies); |
|
1602 | + $term = get_term_by('id', $post_terms, $taxonomies); |
|
1603 | 1603 | |
1604 | - if (!empty($term)) |
|
1605 | - $term_request = $term->slug; |
|
1606 | - //$term_request = $term->slug.'/'; |
|
1607 | - } |
|
1604 | + if (!empty($term)) |
|
1605 | + $term_request = $term->slug; |
|
1606 | + //$term_request = $term->slug.'/'; |
|
1607 | + } |
|
1608 | 1608 | |
1609 | - $request_term = ''; |
|
1610 | - $listingurl_separator = ''; |
|
1611 | - //$detailurl_separator = get_option('geodir_detailurl_separator'); |
|
1612 | - $detailurl_separator = ''; |
|
1613 | - if (isset($location_request) && $location_request != '' && isset($term_request) && $term_request != '') { |
|
1614 | - $request_term = $location_request; |
|
1615 | - //$listingurl_separator = get_option('geodir_listingurl_separator'); |
|
1616 | - //$request_term .= $listingurl_separator.'/'.$term_request; |
|
1617 | - $request_term .= $term_request; |
|
1609 | + $request_term = ''; |
|
1610 | + $listingurl_separator = ''; |
|
1611 | + //$detailurl_separator = get_option('geodir_detailurl_separator'); |
|
1612 | + $detailurl_separator = ''; |
|
1613 | + if (isset($location_request) && $location_request != '' && isset($term_request) && $term_request != '') { |
|
1614 | + $request_term = $location_request; |
|
1615 | + //$listingurl_separator = get_option('geodir_listingurl_separator'); |
|
1616 | + //$request_term .= $listingurl_separator.'/'.$term_request; |
|
1617 | + $request_term .= $term_request; |
|
1618 | 1618 | |
1619 | - } else { |
|
1620 | - if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
1619 | + } else { |
|
1620 | + if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
1621 | 1621 | |
1622 | - if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
1623 | - } |
|
1624 | - $request_term = trim($request_term, '/'); |
|
1625 | - if (!empty($request_term)) |
|
1626 | - $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1627 | - else |
|
1628 | - $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1629 | - //echo $post_link ; |
|
1630 | - } |
|
1631 | - // temp cache the permalink |
|
1632 | - if (!$sample && (!isset($_REQUEST['geodir_ajax']) || (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] != 'add_listing'))) { |
|
1633 | - $gd_permalink_cache[$post->ID] = $post_link; |
|
1634 | - } |
|
1635 | - } |
|
1636 | - if (isset($orig_post)) { |
|
1637 | - $post = $orig_post; |
|
1638 | - } |
|
1639 | - //echo $post_link ; |
|
1640 | - return $post_link; |
|
1622 | + if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
1623 | + } |
|
1624 | + $request_term = trim($request_term, '/'); |
|
1625 | + if (!empty($request_term)) |
|
1626 | + $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1627 | + else |
|
1628 | + $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1629 | + //echo $post_link ; |
|
1630 | + } |
|
1631 | + // temp cache the permalink |
|
1632 | + if (!$sample && (!isset($_REQUEST['geodir_ajax']) || (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] != 'add_listing'))) { |
|
1633 | + $gd_permalink_cache[$post->ID] = $post_link; |
|
1634 | + } |
|
1635 | + } |
|
1636 | + if (isset($orig_post)) { |
|
1637 | + $post = $orig_post; |
|
1638 | + } |
|
1639 | + //echo $post_link ; |
|
1640 | + return $post_link; |
|
1641 | 1641 | |
1642 | 1642 | } |
1643 | 1643 | |
@@ -1654,103 +1654,103 @@ discard block |
||
1654 | 1654 | * @return string The term link. |
1655 | 1655 | */ |
1656 | 1656 | function geodir_term_link($termlink, $term, $taxonomy) { |
1657 | - $geodir_taxonomies = geodir_get_taxonomies('', true); |
|
1657 | + $geodir_taxonomies = geodir_get_taxonomies('', true); |
|
1658 | 1658 | |
1659 | - if (isset($taxonomy) && !empty($geodir_taxonomies) && in_array($taxonomy, $geodir_taxonomies)) { |
|
1660 | - global $geodir_add_location_url, $gd_session; |
|
1661 | - $include_location = false; |
|
1662 | - $request_term = array(); |
|
1659 | + if (isset($taxonomy) && !empty($geodir_taxonomies) && in_array($taxonomy, $geodir_taxonomies)) { |
|
1660 | + global $geodir_add_location_url, $gd_session; |
|
1661 | + $include_location = false; |
|
1662 | + $request_term = array(); |
|
1663 | 1663 | |
1664 | - $listing_slug = geodir_get_listing_slug($taxonomy); |
|
1664 | + $listing_slug = geodir_get_listing_slug($taxonomy); |
|
1665 | 1665 | |
1666 | - if ($geodir_add_location_url != NULL && $geodir_add_location_url != '') { |
|
1667 | - if ($geodir_add_location_url && get_option('geodir_add_location_url')) { |
|
1668 | - $include_location = true; |
|
1669 | - } |
|
1670 | - } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) |
|
1671 | - $include_location = true; |
|
1666 | + if ($geodir_add_location_url != NULL && $geodir_add_location_url != '') { |
|
1667 | + if ($geodir_add_location_url && get_option('geodir_add_location_url')) { |
|
1668 | + $include_location = true; |
|
1669 | + } |
|
1670 | + } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) |
|
1671 | + $include_location = true; |
|
1672 | 1672 | |
1673 | - if ($include_location) { |
|
1674 | - global $post; |
|
1673 | + if ($include_location) { |
|
1674 | + global $post; |
|
1675 | 1675 | |
1676 | 1676 | $location_manager = defined('POST_LOCATION_TABLE') ? true : false; |
1677 | 1677 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
1678 | 1678 | |
1679 | 1679 | if(geodir_is_page('detail') && isset($post->country_slug)){ |
1680 | - $location_terms = array( |
|
1681 | - 'gd_country' => $post->country_slug, |
|
1682 | - 'gd_region' => $post->region_slug, |
|
1683 | - 'gd_city' => $post->city_slug |
|
1684 | - ); |
|
1680 | + $location_terms = array( |
|
1681 | + 'gd_country' => $post->country_slug, |
|
1682 | + 'gd_region' => $post->region_slug, |
|
1683 | + 'gd_city' => $post->city_slug |
|
1684 | + ); |
|
1685 | 1685 | |
1686 | 1686 | if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) { |
1687 | 1687 | $location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood; |
1688 | 1688 | } |
1689 | - } else { |
|
1690 | - $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1691 | - } |
|
1689 | + } else { |
|
1690 | + $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1691 | + } |
|
1692 | 1692 | |
1693 | - $geodir_show_location_url = get_option('geodir_show_location_url'); |
|
1694 | - $location_terms = geodir_remove_location_terms($location_terms); |
|
1693 | + $geodir_show_location_url = get_option('geodir_show_location_url'); |
|
1694 | + $location_terms = geodir_remove_location_terms($location_terms); |
|
1695 | 1695 | |
1696 | - if (!empty($location_terms)) { |
|
1696 | + if (!empty($location_terms)) { |
|
1697 | 1697 | |
1698 | - $url_separator = '';//get_option('geodir_listingurl_separator'); |
|
1698 | + $url_separator = '';//get_option('geodir_listingurl_separator'); |
|
1699 | 1699 | |
1700 | - if (get_option('permalink_structure') != '') { |
|
1701 | - $old_listing_slug = '/' . $listing_slug . '/'; |
|
1702 | - $request_term = implode("/", $location_terms); |
|
1703 | - $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
1700 | + if (get_option('permalink_structure') != '') { |
|
1701 | + $old_listing_slug = '/' . $listing_slug . '/'; |
|
1702 | + $request_term = implode("/", $location_terms); |
|
1703 | + $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
1704 | 1704 | |
1705 | - $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
|
1706 | - } else { |
|
1707 | - $termlink = geodir_getlink($termlink, $request_term); |
|
1708 | - } |
|
1709 | - } |
|
1710 | - } |
|
1705 | + $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
|
1706 | + } else { |
|
1707 | + $termlink = geodir_getlink($termlink, $request_term); |
|
1708 | + } |
|
1709 | + } |
|
1710 | + } |
|
1711 | 1711 | |
1712 | - // Alter the CPT slug is WPML is set to do so |
|
1713 | - /* we can replace this with the below function |
|
1712 | + // Alter the CPT slug is WPML is set to do so |
|
1713 | + /* we can replace this with the below function |
|
1714 | 1714 | if(function_exists('icl_object_id')){ |
1715 | 1715 | global $sitepress; |
1716 | 1716 | $post_type = str_replace("category","",$taxonomy); |
1717 | 1717 | $termlink = $sitepress->post_type_archive_link_filter( $termlink, $post_type); |
1718 | 1718 | }*/ |
1719 | 1719 | |
1720 | - // Alter the CPT slug if WPML is set to do so |
|
1721 | - if(function_exists('icl_object_id')){ |
|
1722 | - $post_types = get_option('geodir_post_types'); |
|
1723 | - $post_type = str_replace("category","",$taxonomy); |
|
1720 | + // Alter the CPT slug if WPML is set to do so |
|
1721 | + if(function_exists('icl_object_id')){ |
|
1722 | + $post_types = get_option('geodir_post_types'); |
|
1723 | + $post_type = str_replace("category","",$taxonomy); |
|
1724 | 1724 | $post_type = str_replace("_tags","",$post_type); |
1725 | - $slug = $post_types[$post_type]['rewrite']['slug']; |
|
1726 | - if ( gd_wpml_slug_translation_turned_on( $post_type )) { |
|
1725 | + $slug = $post_types[$post_type]['rewrite']['slug']; |
|
1726 | + if ( gd_wpml_slug_translation_turned_on( $post_type )) { |
|
1727 | 1727 | |
1728 | - global $sitepress; |
|
1729 | - $default_lang = $sitepress->get_default_language(); |
|
1730 | - $language_code = gd_wpml_get_lang_from_url($termlink); |
|
1731 | - if(!$language_code ){$language_code = $default_lang;} |
|
1728 | + global $sitepress; |
|
1729 | + $default_lang = $sitepress->get_default_language(); |
|
1730 | + $language_code = gd_wpml_get_lang_from_url($termlink); |
|
1731 | + if(!$language_code ){$language_code = $default_lang;} |
|
1732 | 1732 | |
1733 | - $org_slug = $slug; |
|
1734 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1735 | - $slug, |
|
1736 | - 'WordPress', |
|
1737 | - 'URL slug: ' . $slug, |
|
1738 | - $language_code); |
|
1733 | + $org_slug = $slug; |
|
1734 | + $slug = apply_filters( 'wpml_translate_single_string', |
|
1735 | + $slug, |
|
1736 | + 'WordPress', |
|
1737 | + 'URL slug: ' . $slug, |
|
1738 | + $language_code); |
|
1739 | 1739 | |
1740 | 1740 | |
1741 | - if(!$slug){$slug = $org_slug;} |
|
1741 | + if(!$slug){$slug = $org_slug;} |
|
1742 | 1742 | |
1743 | - $termlink = trailingslashit( |
|
1743 | + $termlink = trailingslashit( |
|
1744 | 1744 | |
1745 | - preg_replace( "/" . preg_quote( $org_slug, "/" ) . "/", $slug ,$termlink, 1 ) |
|
1746 | - ); |
|
1745 | + preg_replace( "/" . preg_quote( $org_slug, "/" ) . "/", $slug ,$termlink, 1 ) |
|
1746 | + ); |
|
1747 | 1747 | |
1748 | - } |
|
1749 | - } |
|
1748 | + } |
|
1749 | + } |
|
1750 | 1750 | |
1751 | - } |
|
1751 | + } |
|
1752 | 1752 | |
1753 | - return $termlink; |
|
1753 | + return $termlink; |
|
1754 | 1754 | } |
1755 | 1755 | |
1756 | 1756 | /** |
@@ -1776,14 +1776,14 @@ discard block |
||
1776 | 1776 | if (in_array($post_type, geodir_get_posttypes())) { |
1777 | 1777 | if (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) { |
1778 | 1778 | if(geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) { |
1779 | - $location_terms = array( |
|
1780 | - 'gd_country' => $post->country_slug, |
|
1781 | - 'gd_region' => $post->region_slug, |
|
1782 | - 'gd_city' => $post->city_slug |
|
1783 | - ); |
|
1784 | - } else { |
|
1785 | - $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1786 | - } |
|
1779 | + $location_terms = array( |
|
1780 | + 'gd_country' => $post->country_slug, |
|
1781 | + 'gd_region' => $post->region_slug, |
|
1782 | + 'gd_city' => $post->city_slug |
|
1783 | + ); |
|
1784 | + } else { |
|
1785 | + $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1786 | + } |
|
1787 | 1787 | |
1788 | 1788 | $location_terms = geodir_remove_location_terms($location_terms); |
1789 | 1789 | |
@@ -1814,14 +1814,14 @@ discard block |
||
1814 | 1814 | */ |
1815 | 1815 | function get_post_type_singular_label($post_type, $echo = false) |
1816 | 1816 | { |
1817 | - $obj_post_type = get_post_type_object($post_type); |
|
1818 | - if (!is_object($obj_post_type)) { |
|
1819 | - return; |
|
1820 | - } |
|
1821 | - if ($echo) |
|
1822 | - echo $obj_post_type->labels->singular_name; |
|
1823 | - else |
|
1824 | - return $obj_post_type->labels->singular_name; |
|
1817 | + $obj_post_type = get_post_type_object($post_type); |
|
1818 | + if (!is_object($obj_post_type)) { |
|
1819 | + return; |
|
1820 | + } |
|
1821 | + if ($echo) |
|
1822 | + echo $obj_post_type->labels->singular_name; |
|
1823 | + else |
|
1824 | + return $obj_post_type->labels->singular_name; |
|
1825 | 1825 | |
1826 | 1826 | } |
1827 | 1827 | |
@@ -1836,16 +1836,16 @@ discard block |
||
1836 | 1836 | */ |
1837 | 1837 | function get_post_type_plural_label($post_type, $echo = false) |
1838 | 1838 | { |
1839 | - $all_postypes = geodir_get_posttypes(); |
|
1839 | + $all_postypes = geodir_get_posttypes(); |
|
1840 | 1840 | |
1841 | - if (!in_array($post_type, $all_postypes)) |
|
1842 | - return false; |
|
1841 | + if (!in_array($post_type, $all_postypes)) |
|
1842 | + return false; |
|
1843 | 1843 | |
1844 | - $obj_post_type = get_post_type_object($post_type); |
|
1845 | - if ($echo) |
|
1846 | - echo $obj_post_type->labels->name; |
|
1847 | - else |
|
1848 | - return $obj_post_type->labels->name; |
|
1844 | + $obj_post_type = get_post_type_object($post_type); |
|
1845 | + if ($echo) |
|
1846 | + echo $obj_post_type->labels->name; |
|
1847 | + else |
|
1848 | + return $obj_post_type->labels->name; |
|
1849 | 1849 | |
1850 | 1850 | } |
1851 | 1851 | |
@@ -1864,51 +1864,51 @@ discard block |
||
1864 | 1864 | */ |
1865 | 1865 | function geodir_term_exists($term, $taxonomy = '', $parent = 0) |
1866 | 1866 | { |
1867 | - global $wpdb; |
|
1868 | - |
|
1869 | - $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; |
|
1870 | - $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
|
1871 | - |
|
1872 | - if (is_int($term)) { |
|
1873 | - if (0 == $term) |
|
1874 | - return 0; |
|
1875 | - $where = 't.term_id = %d'; |
|
1876 | - if (!empty($taxonomy)) |
|
1877 | - return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1878 | - else |
|
1879 | - return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1880 | - } |
|
1867 | + global $wpdb; |
|
1868 | + |
|
1869 | + $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; |
|
1870 | + $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
|
1871 | + |
|
1872 | + if (is_int($term)) { |
|
1873 | + if (0 == $term) |
|
1874 | + return 0; |
|
1875 | + $where = 't.term_id = %d'; |
|
1876 | + if (!empty($taxonomy)) |
|
1877 | + return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1878 | + else |
|
1879 | + return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1880 | + } |
|
1881 | 1881 | |
1882 | - $term = trim(wp_unslash($term)); |
|
1882 | + $term = trim(wp_unslash($term)); |
|
1883 | 1883 | |
1884 | - if ('' === $slug = sanitize_title($term)) |
|
1885 | - return 0; |
|
1884 | + if ('' === $slug = sanitize_title($term)) |
|
1885 | + return 0; |
|
1886 | 1886 | |
1887 | - $where = 't.slug = %s'; |
|
1887 | + $where = 't.slug = %s'; |
|
1888 | 1888 | |
1889 | - $where_fields = array($slug); |
|
1890 | - if (!empty($taxonomy)) { |
|
1891 | - $parent = (int)$parent; |
|
1892 | - if ($parent > 0) { |
|
1893 | - $where_fields[] = $parent; |
|
1894 | - $else_where_fields[] = $parent; |
|
1895 | - $where .= ' AND tt.parent = %d'; |
|
1889 | + $where_fields = array($slug); |
|
1890 | + if (!empty($taxonomy)) { |
|
1891 | + $parent = (int)$parent; |
|
1892 | + if ($parent > 0) { |
|
1893 | + $where_fields[] = $parent; |
|
1894 | + $else_where_fields[] = $parent; |
|
1895 | + $where .= ' AND tt.parent = %d'; |
|
1896 | 1896 | |
1897 | - } |
|
1897 | + } |
|
1898 | 1898 | |
1899 | - $where_fields[] = $taxonomy; |
|
1899 | + $where_fields[] = $taxonomy; |
|
1900 | 1900 | |
1901 | 1901 | |
1902 | - if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) |
|
1903 | - return $result; |
|
1902 | + if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) |
|
1903 | + return $result; |
|
1904 | 1904 | |
1905 | - return false; |
|
1906 | - } |
|
1905 | + return false; |
|
1906 | + } |
|
1907 | 1907 | |
1908 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) |
|
1909 | - return $result; |
|
1908 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) |
|
1909 | + return $result; |
|
1910 | 1910 | |
1911 | - return false; |
|
1911 | + return false; |
|
1912 | 1912 | } |
1913 | 1913 | |
1914 | 1914 | /** |
@@ -1920,7 +1920,7 @@ discard block |
||
1920 | 1920 | function geodir_get_term_icon_rebuild() |
1921 | 1921 | { |
1922 | 1922 | |
1923 | - update_option('gd_term_icons', ''); |
|
1923 | + update_option('gd_term_icons', ''); |
|
1924 | 1924 | |
1925 | 1925 | } |
1926 | 1926 | |
@@ -1938,60 +1938,60 @@ discard block |
||
1938 | 1938 | */ |
1939 | 1939 | function geodir_get_term_icon($term_id = false, $rebuild = false) |
1940 | 1940 | { |
1941 | - global $wpdb; |
|
1942 | - if (!$rebuild) { |
|
1943 | - $terms_icons = get_option('gd_term_icons'); |
|
1944 | - } else { |
|
1945 | - $terms_icons = ''; |
|
1946 | - } |
|
1947 | - |
|
1948 | - if (empty($terms_icons)) { |
|
1949 | - $default_icon_url = get_option('geodir_default_marker_icon'); |
|
1950 | - $taxonomy = geodir_get_taxonomies(); |
|
1951 | - $post_types = geodir_get_posttypes(); |
|
1952 | - $tax_arr = array(); |
|
1953 | - foreach ($post_types as $post_type) { |
|
1954 | - $tax_arr[] = "'" . $post_type . "category'"; |
|
1955 | - } |
|
1956 | - $tax_c = implode(',', $tax_arr); |
|
1957 | - $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)"); |
|
1958 | - //$terms = get_terms( $taxonomy ); |
|
1959 | - |
|
1960 | - if($terms) { |
|
1961 | - foreach ($terms as $term) { |
|
1962 | - $post_type = str_replace("category", "", $term->taxonomy); |
|
1963 | - $a_terms[$post_type][] = $term; |
|
1941 | + global $wpdb; |
|
1942 | + if (!$rebuild) { |
|
1943 | + $terms_icons = get_option('gd_term_icons'); |
|
1944 | + } else { |
|
1945 | + $terms_icons = ''; |
|
1946 | + } |
|
1964 | 1947 | |
1965 | - } |
|
1966 | - } |
|
1948 | + if (empty($terms_icons)) { |
|
1949 | + $default_icon_url = get_option('geodir_default_marker_icon'); |
|
1950 | + $taxonomy = geodir_get_taxonomies(); |
|
1951 | + $post_types = geodir_get_posttypes(); |
|
1952 | + $tax_arr = array(); |
|
1953 | + foreach ($post_types as $post_type) { |
|
1954 | + $tax_arr[] = "'" . $post_type . "category'"; |
|
1955 | + } |
|
1956 | + $tax_c = implode(',', $tax_arr); |
|
1957 | + $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)"); |
|
1958 | + //$terms = get_terms( $taxonomy ); |
|
1967 | 1959 | |
1968 | - if($a_terms) { |
|
1969 | - foreach ($a_terms as $pt => $t2) { |
|
1960 | + if($terms) { |
|
1961 | + foreach ($terms as $term) { |
|
1962 | + $post_type = str_replace("category", "", $term->taxonomy); |
|
1963 | + $a_terms[$post_type][] = $term; |
|
1970 | 1964 | |
1971 | - foreach ($t2 as $term) { |
|
1972 | - $term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt); |
|
1973 | - if ($term_icon) { |
|
1974 | - $term_icon_url = $term_icon["src"]; |
|
1975 | - } else { |
|
1976 | - $term_icon_url = $default_icon_url; |
|
1977 | - } |
|
1978 | - $terms_icons[$term->term_id] = $term_icon_url; |
|
1979 | - } |
|
1980 | - } |
|
1981 | - } |
|
1965 | + } |
|
1966 | + } |
|
1967 | + |
|
1968 | + if($a_terms) { |
|
1969 | + foreach ($a_terms as $pt => $t2) { |
|
1970 | + |
|
1971 | + foreach ($t2 as $term) { |
|
1972 | + $term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt); |
|
1973 | + if ($term_icon) { |
|
1974 | + $term_icon_url = $term_icon["src"]; |
|
1975 | + } else { |
|
1976 | + $term_icon_url = $default_icon_url; |
|
1977 | + } |
|
1978 | + $terms_icons[$term->term_id] = $term_icon_url; |
|
1979 | + } |
|
1980 | + } |
|
1981 | + } |
|
1982 | 1982 | |
1983 | - update_option('gd_term_icons', $terms_icons); |
|
1984 | - } |
|
1983 | + update_option('gd_term_icons', $terms_icons); |
|
1984 | + } |
|
1985 | 1985 | |
1986 | - if ($term_id && isset($terms_icons[$term_id])) { |
|
1987 | - return $terms_icons[$term_id]; |
|
1988 | - } elseif ($term_id && !isset($terms_icons[$term_id])) { |
|
1989 | - return get_option('geodir_default_marker_icon'); |
|
1990 | - } |
|
1986 | + if ($term_id && isset($terms_icons[$term_id])) { |
|
1987 | + return $terms_icons[$term_id]; |
|
1988 | + } elseif ($term_id && !isset($terms_icons[$term_id])) { |
|
1989 | + return get_option('geodir_default_marker_icon'); |
|
1990 | + } |
|
1991 | 1991 | |
1992 | - if (is_ssl()) { |
|
1993 | - $terms_icons = str_replace("http:","https:",$terms_icons ); |
|
1994 | - } |
|
1992 | + if (is_ssl()) { |
|
1993 | + $terms_icons = str_replace("http:","https:",$terms_icons ); |
|
1994 | + } |
|
1995 | 1995 | |
1996 | - return $terms_icons; |
|
1996 | + return $terms_icons; |
|
1997 | 1997 | } |
1998 | 1998 | \ No newline at end of file |
@@ -245,13 +245,14 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function geodir_add_async_forscript($url) |
247 | 247 | { |
248 | - if (strpos($url, '#asyncload')===false) |
|
249 | - return $url; |
|
250 | - else if (is_admin()) |
|
251 | - return str_replace('#asyncload', '', $url); |
|
252 | - else |
|
253 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
254 | -} |
|
248 | + if (strpos($url, '#asyncload')===false) { |
|
249 | + return $url; |
|
250 | + } else if (is_admin()) { |
|
251 | + return str_replace('#asyncload', '', $url); |
|
252 | + } else { |
|
253 | + return str_replace('#asyncload', '', $url)."' async='async"; |
|
254 | + } |
|
255 | + } |
|
255 | 256 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
256 | 257 | |
257 | 258 | /** |
@@ -298,7 +299,7 @@ discard block |
||
298 | 299 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
299 | 300 | wp_enqueue_style('geodir-chosen-style'); |
300 | 301 | |
301 | - }else{ |
|
302 | + } else{ |
|
302 | 303 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
303 | 304 | wp_enqueue_style('geodir-core-scss'); |
304 | 305 | |
@@ -359,8 +360,10 @@ discard block |
||
359 | 360 | |
360 | 361 | $half_pages_to_show = round($pages_to_show / 2); |
361 | 362 | |
362 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page. |
|
363 | - return; |
|
363 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) { |
|
364 | + // dont apply default pagination for geodirectory home page. |
|
365 | + return; |
|
366 | + } |
|
364 | 367 | |
365 | 368 | if (!is_single()) { |
366 | 369 | if (function_exists('geodir_location_geo_home_link')) { |
@@ -433,11 +436,21 @@ discard block |
||
433 | 436 | } |
434 | 437 | $dist_dif = 1000; |
435 | 438 | |
436 | - if ($dist <= 5000) $dist_dif = 500; |
|
437 | - if ($dist <= 1000) $dist_dif = 100; |
|
438 | - if ($dist <= 500) $dist_dif = 50; |
|
439 | - if ($dist <= 100) $dist_dif = 10; |
|
440 | - if ($dist <= 50) $dist_dif = 5; |
|
439 | + if ($dist <= 5000) { |
|
440 | + $dist_dif = 500; |
|
441 | + } |
|
442 | + if ($dist <= 1000) { |
|
443 | + $dist_dif = 100; |
|
444 | + } |
|
445 | + if ($dist <= 500) { |
|
446 | + $dist_dif = 50; |
|
447 | + } |
|
448 | + if ($dist <= 100) { |
|
449 | + $dist_dif = 10; |
|
450 | + } |
|
451 | + if ($dist <= 50) { |
|
452 | + $dist_dif = 5; |
|
453 | + } |
|
441 | 454 | |
442 | 455 | ?> |
443 | 456 | <script type="text/javascript"> |
@@ -499,18 +512,23 @@ discard block |
||
499 | 512 | { |
500 | 513 | |
501 | 514 | $default_search_for_text = SEARCH_FOR_TEXT; |
502 | - if (get_option('geodir_search_field_default_text')) |
|
503 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
515 | + if (get_option('geodir_search_field_default_text')) { |
|
516 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
517 | + } |
|
504 | 518 | |
505 | 519 | $default_near_text = NEAR_TEXT; |
506 | - if (get_option('geodir_near_field_default_text')) |
|
507 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
520 | + if (get_option('geodir_near_field_default_text')) { |
|
521 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
522 | + } |
|
508 | 523 | |
509 | 524 | ?> |
510 | 525 | |
511 | 526 | |
512 | 527 | <script type="text/javascript"> |
513 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
528 | + var default_location = '<?php if($search_location = geodir_get_default_location()) { |
|
529 | + echo $search_location->city ; |
|
530 | +} |
|
531 | +?>'; |
|
514 | 532 | var latlng; |
515 | 533 | var Sgeocoder; |
516 | 534 | var address; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $is_detail_page = false; |
39 | 39 | |
40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
40 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) { |
|
41 | 41 | $is_detail_page = true; |
42 | 42 | } |
43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'siteurl' => get_option('siteurl'), |
52 | 52 | 'geodir_plugin_url' => geodir_plugin_url(), |
53 | 53 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
54 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'), |
|
55 | 55 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
56 | 56 | ); |
57 | 57 | |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | * |
73 | 73 | * } |
74 | 74 | */ |
75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
75 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data); |
|
76 | 76 | |
77 | 77 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
78 | 78 | |
79 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
80 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
79 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true); |
|
80 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); } |
|
81 | 81 | |
82 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
82 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true); |
|
83 | 83 | wp_enqueue_script('geodirectory-lightbox-jquery'); |
84 | 84 | |
85 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
85 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true); |
|
86 | 86 | if ($is_detail_page) { |
87 | 87 | wp_enqueue_script('geodirectory-jquery-simplemodal'); |
88 | 88 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
100 | 100 | wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL); |
101 | 101 | |
102 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
102 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true); |
|
103 | 103 | wp_enqueue_script('geodirectory-goMap-script'); |
104 | 104 | |
105 | 105 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | wp_enqueue_script('plupload-all'); |
117 | 117 | wp_enqueue_script('jquery-ui-sortable'); |
118 | 118 | |
119 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
119 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
120 | 120 | wp_enqueue_script('geodirectory-plupload-script'); |
121 | 121 | // SCRIPT FOR UPLOAD END |
122 | 122 | |
@@ -229,12 +229,12 @@ discard block |
||
229 | 229 | */ |
230 | 230 | function geodir_add_async_forscript($url) |
231 | 231 | { |
232 | - if (strpos($url, '#asyncload')===false) |
|
232 | + if (strpos($url, '#asyncload') === false) |
|
233 | 233 | return $url; |
234 | 234 | else if (is_admin()) |
235 | 235 | return str_replace('#asyncload', '', $url); |
236 | 236 | else |
237 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
237 | + return str_replace('#asyncload', '', $url) . "' async='async"; |
|
238 | 238 | } |
239 | 239 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
240 | 240 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | { |
249 | 249 | |
250 | 250 | |
251 | - if(get_option('geodir_scss_core')) { |
|
251 | + if (get_option('geodir_scss_core')) { |
|
252 | 252 | |
253 | 253 | |
254 | 254 | wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
283 | 283 | wp_enqueue_style('geodir-chosen-style'); |
284 | 284 | |
285 | - }else{ |
|
285 | + } else { |
|
286 | 286 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
287 | 287 | wp_enqueue_style('geodir-core-scss'); |
288 | 288 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | |
291 | 291 | } |
292 | 292 | |
293 | - if(is_rtl()){ |
|
293 | + if (is_rtl()) { |
|
294 | 294 | wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
295 | 295 | wp_enqueue_style('geodirectory-frontend-rtl-style'); |
296 | 296 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $term_id = get_queried_object_id(); |
366 | 366 | $taxonomy = get_query_var('taxonomy'); |
367 | 367 | |
368 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) { |
|
368 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category') { |
|
369 | 369 | $term = get_term($term_id, $post_type . 'category'); |
370 | 370 | } |
371 | 371 | } |
@@ -374,9 +374,9 @@ discard block |
||
374 | 374 | $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
375 | 375 | |
376 | 376 | if (!is_array($taxonomy_search)) { |
377 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
378 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
379 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
377 | + $term = get_term((int) $taxonomy_search, $post_type . 'category'); |
|
378 | + } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
379 | + $term = get_term((int) $taxonomy_search[0], $post_type . 'category'); |
|
380 | 380 | } |
381 | 381 | } |
382 | 382 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | if ($max_page > 1 || $always_show) { |
389 | 389 | // Extra pagination info |
390 | 390 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
391 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
391 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
392 | 392 | $end_no = min($paged * $posts_per_page, $numposts); |
393 | 393 | |
394 | 394 | if ($geodir_pagination_more_info != '') { |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | jQuery(function ($) { |
475 | 475 | $("#distance_slider").slider({ |
476 | 476 | range: true, |
477 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
477 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
478 | 478 | min: 0, |
479 | 479 | max: <?php echo $dist; ?>, |
480 | 480 | step: <?php echo $dist_dif; ?>, |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | |
540 | 540 | |
541 | 541 | <script type="text/javascript"> |
542 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
542 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
543 | 543 | var latlng; |
544 | 544 | var Sgeocoder; |
545 | 545 | var address; |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | var $form = jQuery(this).closest('form'); |
553 | 553 | |
554 | 554 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val(); |
555 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s); |
|
555 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s); |
|
556 | 556 | |
557 | 557 | // Disable location based search for disabled location post type. |
558 | 558 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') { |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | } |
567 | 567 | } |
568 | 568 | |
569 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) { |
|
569 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) { |
|
570 | 570 | geodir_setsearch($form); |
571 | 571 | } else { |
572 | 572 | jQuery(".snear", $form).val(''); |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | }); |
587 | 587 | |
588 | 588 | function geodir_setsearch($form) { |
589 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location); |
|
589 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location); |
|
590 | 590 | geocodeAddress($form); |
591 | 591 | } |
592 | 592 | |
@@ -599,8 +599,8 @@ discard block |
||
599 | 599 | function geocodeAddress($form) { |
600 | 600 | Sgeocoder = new google.maps.Geocoder(); // Call the geocode function |
601 | 601 | |
602 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
603 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
602 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
603 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
604 | 604 | jQuery(".snear", $form).val(''); |
605 | 605 | } |
606 | 606 | jQuery($form).submit(); |
@@ -608,24 +608,24 @@ discard block |
||
608 | 608 | |
609 | 609 | var address = jQuery(".snear", $form).val(); |
610 | 610 | |
611 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') { |
|
611 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') { |
|
612 | 612 | initialise2(); |
613 | 613 | } else { |
614 | 614 | |
615 | 615 | Sgeocoder.geocode({'address': address<?php |
616 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';} |
|
617 | - if($near_add2 = |
|
616 | + if ($near_add = get_option('geodir_search_near_addition')) {echo '+", ' . $near_add . '"'; } |
|
617 | + if ($near_add2 = |
|
618 | 618 | /** |
619 | 619 | * Adds any extra info to the near search box query when trying to geolocate it via google api. |
620 | 620 | * |
621 | 621 | * @since 1.0.0 |
622 | 622 | */ |
623 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>}, |
|
623 | + apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>}, |
|
624 | 624 | function (results, status) { |
625 | 625 | if (status == google.maps.GeocoderStatus.OK) { |
626 | 626 | updateSearchPosition(results[0].geometry.location, $form); |
627 | 627 | } else { |
628 | - alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status); |
|
628 | + alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status); |
|
629 | 629 | } |
630 | 630 | }); |
631 | 631 | } |
@@ -656,19 +656,19 @@ discard block |
||
656 | 656 | var msg; |
657 | 657 | switch (err.code) { |
658 | 658 | case err.UNKNOWN_ERROR: |
659 | - msg = "<?php _e('Unable to find your location','geodirectory');?>"; |
|
659 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>"; |
|
660 | 660 | break; |
661 | 661 | case err.PERMISSION_DENINED: |
662 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>"; |
|
662 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>"; |
|
663 | 663 | break; |
664 | 664 | case err.POSITION_UNAVAILABLE: |
665 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>"; |
|
665 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>"; |
|
666 | 666 | break; |
667 | 667 | case err.BREAK: |
668 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>"; |
|
668 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>"; |
|
669 | 669 | break; |
670 | 670 | default: |
671 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>"; |
|
671 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>"; |
|
672 | 672 | } |
673 | 673 | jQuery('#info').html(msg); |
674 | 674 | } |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | * @param object $post The post object. |
710 | 710 | * @param string $link The link to the post. |
711 | 711 | */ |
712 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
712 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>', $post, $link); |
|
713 | 713 | break; |
714 | 714 | case 'new' : |
715 | 715 | /** |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | * @param object $post The post object. |
720 | 720 | * @param string $link The link to the post. |
721 | 721 | */ |
722 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
722 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>', $post, $link); |
|
723 | 723 | break; |
724 | 724 | |
725 | 725 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template tag functions. |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * @package GeoDirectory |
|
7 | - */ |
|
3 | + * Template tag functions. |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * @package GeoDirectory |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Contains all map related templates used by the plugin. |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function geodir_core_dequeue_script() |
24 | 24 | { |
25 | - wp_dequeue_script('flexslider'); |
|
25 | + wp_dequeue_script('flexslider'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100); |
@@ -35,143 +35,143 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function geodir_templates_scripts() |
37 | 37 | { |
38 | - $is_detail_page = false; |
|
39 | - |
|
40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
41 | - $is_detail_page = true; |
|
42 | - } |
|
43 | - |
|
44 | - wp_enqueue_script('jquery'); |
|
45 | - |
|
46 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION); |
|
47 | - wp_enqueue_script('geodirectory-script'); |
|
48 | - |
|
49 | - |
|
50 | - $geodir_vars_data = array( |
|
51 | - 'siteurl' => get_option('siteurl'), |
|
52 | - 'geodir_plugin_url' => geodir_plugin_url(), |
|
53 | - 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
55 | - 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
56 | - ); |
|
57 | - |
|
58 | - /** |
|
59 | - * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
60 | - * |
|
61 | - * This is used by addons to add JS translatable variables. |
|
62 | - * |
|
63 | - * @since 1.4.4 |
|
64 | - * @param array $geodir_vars_data { |
|
65 | - * geodir var data used by addons to add JS translatable variables. |
|
66 | - * |
|
67 | - * @type string $siteurl Site url. |
|
68 | - * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
69 | - * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
70 | - * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
71 | - * @type int $is_rtl Checks if current locale is RTL. |
|
72 | - * |
|
73 | - * } |
|
74 | - */ |
|
75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
76 | - |
|
77 | - wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
|
78 | - |
|
79 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
80 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
81 | - |
|
82 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
83 | - wp_enqueue_script('geodirectory-lightbox-jquery'); |
|
84 | - |
|
85 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
86 | - if ($is_detail_page) { |
|
87 | - wp_enqueue_script('geodirectory-jquery-simplemodal'); |
|
88 | - } |
|
89 | - |
|
90 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
91 | - /** |
|
92 | - * Filter the variables that are added to the end of the google maps script call. |
|
93 | - * |
|
94 | - * This i used to change things like google maps language etc. |
|
95 | - * |
|
96 | - * @since 1.0.0 |
|
97 | - * @param string $var The string to filter, default is empty string. |
|
98 | - */ |
|
99 | - $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
|
100 | - wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL); |
|
38 | + $is_detail_page = false; |
|
39 | + |
|
40 | + if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
41 | + $is_detail_page = true; |
|
42 | + } |
|
43 | + |
|
44 | + wp_enqueue_script('jquery'); |
|
45 | + |
|
46 | + wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION); |
|
47 | + wp_enqueue_script('geodirectory-script'); |
|
48 | + |
|
49 | + |
|
50 | + $geodir_vars_data = array( |
|
51 | + 'siteurl' => get_option('siteurl'), |
|
52 | + 'geodir_plugin_url' => geodir_plugin_url(), |
|
53 | + 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
54 | + 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
55 | + 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
56 | + ); |
|
57 | + |
|
58 | + /** |
|
59 | + * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
60 | + * |
|
61 | + * This is used by addons to add JS translatable variables. |
|
62 | + * |
|
63 | + * @since 1.4.4 |
|
64 | + * @param array $geodir_vars_data { |
|
65 | + * geodir var data used by addons to add JS translatable variables. |
|
66 | + * |
|
67 | + * @type string $siteurl Site url. |
|
68 | + * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
69 | + * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
70 | + * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
71 | + * @type int $is_rtl Checks if current locale is RTL. |
|
72 | + * |
|
73 | + * } |
|
74 | + */ |
|
75 | + $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
76 | + |
|
77 | + wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
|
78 | + |
|
79 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
80 | + if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
81 | + |
|
82 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
83 | + wp_enqueue_script('geodirectory-lightbox-jquery'); |
|
84 | + |
|
85 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
86 | + if ($is_detail_page) { |
|
87 | + wp_enqueue_script('geodirectory-jquery-simplemodal'); |
|
88 | + } |
|
89 | + |
|
90 | + $map_lang = "&language=" . geodir_get_map_default_language(); |
|
91 | + /** |
|
92 | + * Filter the variables that are added to the end of the google maps script call. |
|
93 | + * |
|
94 | + * This i used to change things like google maps language etc. |
|
95 | + * |
|
96 | + * @since 1.0.0 |
|
97 | + * @param string $var The string to filter, default is empty string. |
|
98 | + */ |
|
99 | + $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
|
100 | + wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL); |
|
101 | 101 | |
102 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
103 | - wp_enqueue_script('geodirectory-goMap-script'); |
|
104 | - |
|
105 | - |
|
106 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
107 | - wp_enqueue_script('chosen'); |
|
108 | - |
|
109 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
110 | - wp_enqueue_script('geodirectory-choose-ajax'); |
|
111 | - |
|
112 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
113 | - |
|
114 | - if (is_page() && geodir_is_page('add-listing')) { |
|
115 | - // SCRIPT FOR UPLOAD |
|
116 | - wp_enqueue_script('plupload-all'); |
|
117 | - wp_enqueue_script('jquery-ui-sortable'); |
|
118 | - |
|
119 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
120 | - wp_enqueue_script('geodirectory-plupload-script'); |
|
121 | - // SCRIPT FOR UPLOAD END |
|
122 | - |
|
123 | - // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls |
|
124 | - if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
125 | - $ajax_url = admin_url('admin-ajax.php'); |
|
126 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
127 | - $ajax_url = admin_url('admin-ajax.php'); |
|
128 | - } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
129 | - $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php')); |
|
130 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
131 | - $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php')); |
|
132 | - } else { |
|
133 | - $ajax_url = admin_url('admin-ajax.php'); |
|
134 | - } |
|
102 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
103 | + wp_enqueue_script('geodirectory-goMap-script'); |
|
104 | + |
|
105 | + |
|
106 | + wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
107 | + wp_enqueue_script('chosen'); |
|
108 | + |
|
109 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
110 | + wp_enqueue_script('geodirectory-choose-ajax'); |
|
111 | + |
|
112 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
113 | + |
|
114 | + if (is_page() && geodir_is_page('add-listing')) { |
|
115 | + // SCRIPT FOR UPLOAD |
|
116 | + wp_enqueue_script('plupload-all'); |
|
117 | + wp_enqueue_script('jquery-ui-sortable'); |
|
118 | + |
|
119 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
120 | + wp_enqueue_script('geodirectory-plupload-script'); |
|
121 | + // SCRIPT FOR UPLOAD END |
|
122 | + |
|
123 | + // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls |
|
124 | + if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
125 | + $ajax_url = admin_url('admin-ajax.php'); |
|
126 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
127 | + $ajax_url = admin_url('admin-ajax.php'); |
|
128 | + } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
129 | + $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php')); |
|
130 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
131 | + $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php')); |
|
132 | + } else { |
|
133 | + $ajax_url = admin_url('admin-ajax.php'); |
|
134 | + } |
|
135 | 135 | |
136 | - // place js config array for plupload |
|
137 | - $plupload_init = array( |
|
138 | - 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
139 | - 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
140 | - 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
141 | - 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
142 | - 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
143 | - 'multiple_queues' => true, |
|
144 | - 'max_file_size' => geodir_max_upload_size(), |
|
145 | - 'url' => $ajax_url, |
|
146 | - 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), |
|
147 | - 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), |
|
148 | - 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')), |
|
149 | - 'multipart' => true, |
|
150 | - 'urlstream_upload' => true, |
|
151 | - 'multi_selection' => false, // will be added per uploader |
|
152 | - // additional post data to send to our ajax hook |
|
153 | - 'multipart_params' => array( |
|
154 | - '_ajax_nonce' => "", // will be added per uploader |
|
155 | - 'action' => 'plupload_action', // the ajax action name |
|
156 | - 'imgid' => 0 // will be added per uploader |
|
157 | - ) |
|
158 | - ); |
|
159 | - $base_plupload_config = json_encode($plupload_init); |
|
160 | - |
|
161 | - $gd_plupload_init = array('base_plupload_config' => $base_plupload_config, |
|
162 | - 'upload_img_size' => geodir_max_upload_size()); |
|
163 | - |
|
164 | - wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init); |
|
165 | - |
|
166 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
167 | - } // End if for add place page |
|
168 | - |
|
169 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
170 | - if ($is_detail_page) { |
|
136 | + // place js config array for plupload |
|
137 | + $plupload_init = array( |
|
138 | + 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
139 | + 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
140 | + 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
141 | + 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
142 | + 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
143 | + 'multiple_queues' => true, |
|
144 | + 'max_file_size' => geodir_max_upload_size(), |
|
145 | + 'url' => $ajax_url, |
|
146 | + 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), |
|
147 | + 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), |
|
148 | + 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')), |
|
149 | + 'multipart' => true, |
|
150 | + 'urlstream_upload' => true, |
|
151 | + 'multi_selection' => false, // will be added per uploader |
|
152 | + // additional post data to send to our ajax hook |
|
153 | + 'multipart_params' => array( |
|
154 | + '_ajax_nonce' => "", // will be added per uploader |
|
155 | + 'action' => 'plupload_action', // the ajax action name |
|
156 | + 'imgid' => 0 // will be added per uploader |
|
157 | + ) |
|
158 | + ); |
|
159 | + $base_plupload_config = json_encode($plupload_init); |
|
160 | + |
|
161 | + $gd_plupload_init = array('base_plupload_config' => $base_plupload_config, |
|
162 | + 'upload_img_size' => geodir_max_upload_size()); |
|
163 | + |
|
164 | + wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init); |
|
165 | + |
|
166 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
167 | + } // End if for add place page |
|
168 | + |
|
169 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
170 | + if ($is_detail_page) { |
|
171 | 171 | wp_enqueue_script('geodirectory-post-custom-js'); |
172 | 172 | } |
173 | 173 | |
174 | - // font awesome rating script |
|
174 | + // font awesome rating script |
|
175 | 175 | if (get_option('geodir_reviewrating_enable_font_awesome')) { |
176 | 176 | wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
177 | 177 | wp_enqueue_script('geodir-barrating-js'); |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | wp_enqueue_script('geodir-jRating-js'); |
181 | 181 | } |
182 | 182 | |
183 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
184 | - wp_enqueue_script('geodir-on-document-load'); |
|
183 | + wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
184 | + wp_enqueue_script('geodir-on-document-load'); |
|
185 | 185 | |
186 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
187 | - wp_enqueue_script('google-geometa'); |
|
186 | + wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
187 | + wp_enqueue_script('google-geometa'); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | */ |
199 | 199 | function geodir_header_scripts() |
200 | 200 | { |
201 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>'; |
|
202 | - echo stripslashes(get_option('geodir_header_scripts')); |
|
201 | + echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>'; |
|
202 | + echo stripslashes(get_option('geodir_header_scripts')); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | function geodir_footer_scripts() |
216 | 216 | { |
217 | 217 | echo stripslashes(get_option('geodir_ga_tracking_code')); |
218 | - echo stripslashes(get_option('geodir_footer_scripts')); |
|
218 | + echo stripslashes(get_option('geodir_footer_scripts')); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | |
@@ -229,12 +229,12 @@ discard block |
||
229 | 229 | */ |
230 | 230 | function geodir_add_async_forscript($url) |
231 | 231 | { |
232 | - if (strpos($url, '#asyncload')===false) |
|
233 | - return $url; |
|
234 | - else if (is_admin()) |
|
235 | - return str_replace('#asyncload', '', $url); |
|
236 | - else |
|
237 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
232 | + if (strpos($url, '#asyncload')===false) |
|
233 | + return $url; |
|
234 | + else if (is_admin()) |
|
235 | + return str_replace('#asyncload', '', $url); |
|
236 | + else |
|
237 | + return str_replace('#asyncload', '', $url)."' async='async"; |
|
238 | 238 | } |
239 | 239 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
240 | 240 | |
@@ -248,55 +248,55 @@ discard block |
||
248 | 248 | { |
249 | 249 | |
250 | 250 | |
251 | - if(get_option('geodir_scss_core')) { |
|
251 | + if(get_option('geodir_scss_core')) { |
|
252 | 252 | |
253 | 253 | |
254 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
255 | - wp_enqueue_style('geodirectory-frontend-style'); |
|
254 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
255 | + wp_enqueue_style('geodirectory-frontend-style'); |
|
256 | 256 | |
257 | - wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION); |
|
258 | - wp_enqueue_style('geodirectory-media-style'); |
|
257 | + wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION); |
|
258 | + wp_enqueue_style('geodirectory-media-style'); |
|
259 | 259 | |
260 | 260 | |
261 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
262 | - wp_enqueue_style('geodirectory-jquery-ui-css'); |
|
261 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
262 | + wp_enqueue_style('geodirectory-jquery-ui-css'); |
|
263 | 263 | |
264 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
265 | - wp_enqueue_style('geodirectory-jquery-ui-timepicker-css'); |
|
264 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
265 | + wp_enqueue_style('geodirectory-jquery-ui-timepicker-css'); |
|
266 | 266 | |
267 | - wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION); |
|
268 | - wp_enqueue_style('geodirectory-flexslider-css'); |
|
267 | + wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION); |
|
268 | + wp_enqueue_style('geodirectory-flexslider-css'); |
|
269 | 269 | |
270 | - wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION); |
|
271 | - wp_enqueue_style('geodirectory-thic-box-css'); |
|
270 | + wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION); |
|
271 | + wp_enqueue_style('geodirectory-thic-box-css'); |
|
272 | 272 | |
273 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
274 | - wp_enqueue_style('geodirectory-pluplodar-css'); |
|
273 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
274 | + wp_enqueue_style('geodirectory-pluplodar-css'); |
|
275 | 275 | |
276 | - wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION); |
|
277 | - wp_enqueue_style('geodirectory-lightbox-css'); |
|
276 | + wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION); |
|
277 | + wp_enqueue_style('geodirectory-lightbox-css'); |
|
278 | 278 | |
279 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
280 | - wp_enqueue_style('geodir-rating-style'); |
|
279 | + wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
280 | + wp_enqueue_style('geodir-rating-style'); |
|
281 | 281 | |
282 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
283 | - wp_enqueue_style('geodir-chosen-style'); |
|
282 | + wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
283 | + wp_enqueue_style('geodir-chosen-style'); |
|
284 | 284 | |
285 | - }else{ |
|
286 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
|
287 | - wp_enqueue_style('geodir-core-scss'); |
|
285 | + }else{ |
|
286 | + wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
|
287 | + wp_enqueue_style('geodir-core-scss'); |
|
288 | 288 | |
289 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
289 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
290 | 290 | |
291 | - } |
|
291 | + } |
|
292 | 292 | |
293 | - if(is_rtl()){ |
|
294 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
295 | - wp_enqueue_style('geodirectory-frontend-rtl-style'); |
|
296 | - } |
|
293 | + if(is_rtl()){ |
|
294 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
295 | + wp_enqueue_style('geodirectory-frontend-rtl-style'); |
|
296 | + } |
|
297 | 297 | |
298 | - wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION); |
|
299 | - wp_enqueue_style('geodirectory-font-awesome'); |
|
298 | + wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION); |
|
299 | + wp_enqueue_style('geodirectory-font-awesome'); |
|
300 | 300 | |
301 | 301 | |
302 | 302 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | function geodir_get_sidebar() |
312 | 312 | { |
313 | - get_sidebar('geodirectory'); |
|
313 | + get_sidebar('geodirectory'); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -329,122 +329,122 @@ discard block |
||
329 | 329 | * @param bool $always_show Do you want to show the pagination always? Default: false. |
330 | 330 | */ |
331 | 331 | function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) { |
332 | - global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
332 | + global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
333 | 333 | |
334 | - if (empty($prelabel)) { |
|
335 | - $prelabel = '<strong>«</strong>'; |
|
336 | - } |
|
334 | + if (empty($prelabel)) { |
|
335 | + $prelabel = '<strong>«</strong>'; |
|
336 | + } |
|
337 | 337 | |
338 | - if (empty($nxtlabel)) { |
|
339 | - $nxtlabel = '<strong>»</strong>'; |
|
340 | - } |
|
338 | + if (empty($nxtlabel)) { |
|
339 | + $nxtlabel = '<strong>»</strong>'; |
|
340 | + } |
|
341 | 341 | |
342 | - $half_pages_to_show = round($pages_to_show / 2); |
|
342 | + $half_pages_to_show = round($pages_to_show / 2); |
|
343 | 343 | |
344 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page. |
|
345 | - return; |
|
344 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page. |
|
345 | + return; |
|
346 | 346 | |
347 | - if (!is_single()) { |
|
348 | - if (function_exists('geodir_location_geo_home_link')) { |
|
349 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
350 | - } |
|
351 | - $numposts = $wp_query->found_posts; |
|
347 | + if (!is_single()) { |
|
348 | + if (function_exists('geodir_location_geo_home_link')) { |
|
349 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
350 | + } |
|
351 | + $numposts = $wp_query->found_posts; |
|
352 | 352 | |
353 | - $max_page = ceil($numposts / $posts_per_page); |
|
353 | + $max_page = ceil($numposts / $posts_per_page); |
|
354 | 354 | |
355 | - if (empty($paged)) { |
|
356 | - $paged = 1; |
|
357 | - } |
|
355 | + if (empty($paged)) { |
|
356 | + $paged = 1; |
|
357 | + } |
|
358 | 358 | |
359 | - $post_type = geodir_get_current_posttype(); |
|
360 | - $listing_type_name = get_post_type_plural_label($post_type); |
|
361 | - if (geodir_is_page('listing') || geodir_is_page('search')) { |
|
362 | - $term = array(); |
|
359 | + $post_type = geodir_get_current_posttype(); |
|
360 | + $listing_type_name = get_post_type_plural_label($post_type); |
|
361 | + if (geodir_is_page('listing') || geodir_is_page('search')) { |
|
362 | + $term = array(); |
|
363 | 363 | |
364 | - if (is_tax()) { |
|
365 | - $term_id = get_queried_object_id(); |
|
366 | - $taxonomy = get_query_var('taxonomy'); |
|
364 | + if (is_tax()) { |
|
365 | + $term_id = get_queried_object_id(); |
|
366 | + $taxonomy = get_query_var('taxonomy'); |
|
367 | 367 | |
368 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) { |
|
369 | - $term = get_term($term_id, $post_type . 'category'); |
|
370 | - } |
|
371 | - } |
|
368 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) { |
|
369 | + $term = get_term($term_id, $post_type . 'category'); |
|
370 | + } |
|
371 | + } |
|
372 | 372 | |
373 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) { |
|
374 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
373 | + if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) { |
|
374 | + $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
375 | 375 | |
376 | - if (!is_array($taxonomy_search)) { |
|
377 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
378 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
379 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
380 | - } |
|
381 | - } |
|
376 | + if (!is_array($taxonomy_search)) { |
|
377 | + $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
378 | + } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
379 | + $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
380 | + } |
|
381 | + } |
|
382 | 382 | |
383 | - if (!empty($term) && !is_wp_error($term)) { |
|
384 | - $listing_type_name = $term->name; |
|
385 | - } |
|
386 | - } |
|
383 | + if (!empty($term) && !is_wp_error($term)) { |
|
384 | + $listing_type_name = $term->name; |
|
385 | + } |
|
386 | + } |
|
387 | 387 | |
388 | - if ($max_page > 1 || $always_show) { |
|
389 | - // Extra pagination info |
|
390 | - $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
|
391 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
392 | - $end_no = min($paged * $posts_per_page, $numposts); |
|
388 | + if ($max_page > 1 || $always_show) { |
|
389 | + // Extra pagination info |
|
390 | + $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
|
391 | + $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
392 | + $end_no = min($paged * $posts_per_page, $numposts); |
|
393 | 393 | |
394 | - if ($geodir_pagination_more_info != '') { |
|
395 | - if ($listing_type_name) { |
|
396 | - $listing_type_name = __($listing_type_name, 'geodirectory'); |
|
397 | - $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts); |
|
398 | - } else { |
|
399 | - $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts); |
|
400 | - } |
|
401 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
402 | - /** |
|
403 | - * Adds an extra pagination info above/under pagination. |
|
404 | - * |
|
405 | - * @since 1.5.9 |
|
406 | - * |
|
407 | - * @param string $pagination_info Extra pagination info content. |
|
408 | - * @param string $listing_type_name Listing results type. |
|
409 | - * @param string $start_no First result number. |
|
410 | - * @param string $end_no Last result number. |
|
411 | - * @param string $numposts Total number of listings. |
|
412 | - * @param string $post_type The post type. |
|
413 | - */ |
|
414 | - $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type); |
|
394 | + if ($geodir_pagination_more_info != '') { |
|
395 | + if ($listing_type_name) { |
|
396 | + $listing_type_name = __($listing_type_name, 'geodirectory'); |
|
397 | + $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts); |
|
398 | + } else { |
|
399 | + $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts); |
|
400 | + } |
|
401 | + $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
402 | + /** |
|
403 | + * Adds an extra pagination info above/under pagination. |
|
404 | + * |
|
405 | + * @since 1.5.9 |
|
406 | + * |
|
407 | + * @param string $pagination_info Extra pagination info content. |
|
408 | + * @param string $listing_type_name Listing results type. |
|
409 | + * @param string $start_no First result number. |
|
410 | + * @param string $end_no Last result number. |
|
411 | + * @param string $numposts Total number of listings. |
|
412 | + * @param string $post_type The post type. |
|
413 | + */ |
|
414 | + $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type); |
|
415 | 415 | |
416 | - if ($geodir_pagination_more_info == 'before') { |
|
417 | - $before = $before . $pagination_info; |
|
418 | - } else if ($geodir_pagination_more_info == 'after') { |
|
419 | - $after = $pagination_info . $after; |
|
420 | - } |
|
421 | - } |
|
416 | + if ($geodir_pagination_more_info == 'before') { |
|
417 | + $before = $before . $pagination_info; |
|
418 | + } else if ($geodir_pagination_more_info == 'after') { |
|
419 | + $after = $pagination_info . $after; |
|
420 | + } |
|
421 | + } |
|
422 | 422 | |
423 | - echo "$before <div class='Navi'>"; |
|
424 | - if ($paged >= ($pages_to_show - 1)) { |
|
425 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>'; |
|
426 | - } |
|
427 | - previous_posts_link($prelabel); |
|
428 | - for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { |
|
429 | - if ($i >= 1 && $i <= $max_page) { |
|
430 | - if ($i == $paged) { |
|
431 | - echo "<strong class='on'>$i</strong>"; |
|
432 | - } else { |
|
433 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> '; |
|
434 | - } |
|
435 | - } |
|
436 | - } |
|
437 | - next_posts_link($nxtlabel, $max_page); |
|
438 | - if (($paged + $half_pages_to_show) < ($max_page)) { |
|
439 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>'; |
|
440 | - } |
|
441 | - echo "</div> $after"; |
|
442 | - } |
|
423 | + echo "$before <div class='Navi'>"; |
|
424 | + if ($paged >= ($pages_to_show - 1)) { |
|
425 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>'; |
|
426 | + } |
|
427 | + previous_posts_link($prelabel); |
|
428 | + for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { |
|
429 | + if ($i >= 1 && $i <= $max_page) { |
|
430 | + if ($i == $paged) { |
|
431 | + echo "<strong class='on'>$i</strong>"; |
|
432 | + } else { |
|
433 | + echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> '; |
|
434 | + } |
|
435 | + } |
|
436 | + } |
|
437 | + next_posts_link($nxtlabel, $max_page); |
|
438 | + if (($paged + $half_pages_to_show) < ($max_page)) { |
|
439 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>'; |
|
440 | + } |
|
441 | + echo "</div> $after"; |
|
442 | + } |
|
443 | 443 | |
444 | - if (function_exists('geodir_location_geo_home_link')) { |
|
445 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
446 | - } |
|
447 | - } |
|
444 | + if (function_exists('geodir_location_geo_home_link')) { |
|
445 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
446 | + } |
|
447 | + } |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | /** |
@@ -455,20 +455,20 @@ discard block |
||
455 | 455 | */ |
456 | 456 | function geodir_listingsearch_scripts() |
457 | 457 | { |
458 | - if (get_option('gd_search_dist') != '') { |
|
459 | - $dist = get_option('gd_search_dist'); |
|
460 | - } else { |
|
461 | - $dist = 500; |
|
462 | - } |
|
463 | - $dist_dif = 1000; |
|
464 | - |
|
465 | - if ($dist <= 5000) $dist_dif = 500; |
|
466 | - if ($dist <= 1000) $dist_dif = 100; |
|
467 | - if ($dist <= 500) $dist_dif = 50; |
|
468 | - if ($dist <= 100) $dist_dif = 10; |
|
469 | - if ($dist <= 50) $dist_dif = 5; |
|
470 | - |
|
471 | - ?> |
|
458 | + if (get_option('gd_search_dist') != '') { |
|
459 | + $dist = get_option('gd_search_dist'); |
|
460 | + } else { |
|
461 | + $dist = 500; |
|
462 | + } |
|
463 | + $dist_dif = 1000; |
|
464 | + |
|
465 | + if ($dist <= 5000) $dist_dif = 500; |
|
466 | + if ($dist <= 1000) $dist_dif = 100; |
|
467 | + if ($dist <= 500) $dist_dif = 50; |
|
468 | + if ($dist <= 100) $dist_dif = 10; |
|
469 | + if ($dist <= 50) $dist_dif = 5; |
|
470 | + |
|
471 | + ?> |
|
472 | 472 | <script type="text/javascript"> |
473 | 473 | |
474 | 474 | jQuery(function ($) { |
@@ -527,15 +527,15 @@ discard block |
||
527 | 527 | function geodir_add_sharelocation_scripts() |
528 | 528 | { |
529 | 529 | |
530 | - $default_search_for_text = SEARCH_FOR_TEXT; |
|
531 | - if (get_option('geodir_search_field_default_text')) |
|
532 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
530 | + $default_search_for_text = SEARCH_FOR_TEXT; |
|
531 | + if (get_option('geodir_search_field_default_text')) |
|
532 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
533 | 533 | |
534 | - $default_near_text = NEAR_TEXT; |
|
535 | - if (get_option('geodir_near_field_default_text')) |
|
536 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
534 | + $default_near_text = NEAR_TEXT; |
|
535 | + if (get_option('geodir_near_field_default_text')) |
|
536 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
537 | 537 | |
538 | - ?> |
|
538 | + ?> |
|
539 | 539 | |
540 | 540 | |
541 | 541 | <script type="text/javascript"> |
@@ -613,14 +613,14 @@ discard block |
||
613 | 613 | } else { |
614 | 614 | |
615 | 615 | Sgeocoder.geocode({'address': address<?php |
616 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';} |
|
617 | - if($near_add2 = |
|
618 | - /** |
|
619 | - * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
620 | - * |
|
621 | - * @since 1.0.0 |
|
622 | - */ |
|
623 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>}, |
|
616 | + if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';} |
|
617 | + if($near_add2 = |
|
618 | + /** |
|
619 | + * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
620 | + * |
|
621 | + * @since 1.0.0 |
|
622 | + */ |
|
623 | + apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>}, |
|
624 | 624 | function (results, status) { |
625 | 625 | if (status == google.maps.GeocoderStatus.OK) { |
626 | 626 | updateSearchPosition(results[0].geometry.location, $form); |
@@ -699,30 +699,30 @@ discard block |
||
699 | 699 | */ |
700 | 700 | function geodir_show_badges_on_image($which, $post, $link) |
701 | 701 | { |
702 | - $return = ''; |
|
703 | - switch ($which) { |
|
704 | - case 'featured': |
|
705 | - /** |
|
706 | - * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
707 | - * |
|
708 | - * @since 1.0.0 |
|
709 | - * @param object $post The post object. |
|
710 | - * @param string $link The link to the post. |
|
711 | - */ |
|
712 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
713 | - break; |
|
714 | - case 'new' : |
|
715 | - /** |
|
716 | - * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
717 | - * |
|
718 | - * @since 1.0.0 |
|
719 | - * @param object $post The post object. |
|
720 | - * @param string $link The link to the post. |
|
721 | - */ |
|
722 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
723 | - break; |
|
724 | - |
|
725 | - } |
|
702 | + $return = ''; |
|
703 | + switch ($which) { |
|
704 | + case 'featured': |
|
705 | + /** |
|
706 | + * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
707 | + * |
|
708 | + * @since 1.0.0 |
|
709 | + * @param object $post The post object. |
|
710 | + * @param string $link The link to the post. |
|
711 | + */ |
|
712 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
713 | + break; |
|
714 | + case 'new' : |
|
715 | + /** |
|
716 | + * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
717 | + * |
|
718 | + * @since 1.0.0 |
|
719 | + * @param object $post The post object. |
|
720 | + * @param string $link The link to the post. |
|
721 | + */ |
|
722 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
723 | + break; |
|
724 | + |
|
725 | + } |
|
726 | 726 | |
727 | - return $return; |
|
727 | + return $return; |
|
728 | 728 | } |
@@ -118,10 +118,11 @@ discard block |
||
118 | 118 | $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
119 | 119 | $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
120 | 120 | $instance['character_count'] = $new_instance['character_count']; |
121 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
122 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
123 | - else |
|
124 | - $instance['add_location_filter'] = '0'; |
|
121 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') { |
|
122 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
123 | + } else { |
|
124 | + $instance['add_location_filter'] = '0'; |
|
125 | + } |
|
125 | 126 | |
126 | 127 | return $instance; |
127 | 128 | } |
@@ -279,7 +280,10 @@ discard block |
||
279 | 280 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
280 | 281 | <?php _e('Enable Location Filter:', 'geodirectory');?> |
281 | 282 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
282 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
283 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) { |
|
284 | + echo 'checked="checked"'; |
|
285 | +} |
|
286 | +?> |
|
283 | 287 | value="1"/> |
284 | 288 | </label> |
285 | 289 | </p> |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | |
205 | - echo $before_title . __($title,'geodirectory') . $after_title; |
|
205 | + echo $before_title . __($title, 'geodirectory') . $after_title; |
|
206 | 206 | |
207 | 207 | //term navigation - start |
208 | 208 | echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">'; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | */ |
379 | 379 | public function form($instance) |
380 | 380 | { |
381 | - $instance = wp_parse_args((array)$instance, |
|
381 | + $instance = wp_parse_args((array) $instance, |
|
382 | 382 | array( |
383 | 383 | 'title' => '', |
384 | 384 | 'post_type' => '', |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | ?> |
405 | 405 | <p> |
406 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
|
406 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?> |
|
407 | 407 | |
408 | 408 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
409 | 409 | name="<?php echo $this->get_field_name('title'); ?>" type="text" |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | <p> |
415 | 415 | <label |
416 | - for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?> |
|
416 | + for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?> |
|
417 | 417 | |
418 | 418 | <?php $postypes = geodir_get_posttypes(); |
419 | 419 | /** |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | <p> |
446 | 446 | |
447 | 447 | <label |
448 | - for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory');?> |
|
448 | + for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?> |
|
449 | 449 | |
450 | 450 | <input class="widefat" id="<?php echo $this->get_field_id('post_limit'); ?>" |
451 | 451 | name="<?php echo $this->get_field_name('post_limit'); ?>" type="text" |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | <p> |
457 | 457 | |
458 | 458 | <label |
459 | - for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory');?> |
|
459 | + for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory'); ?> |
|
460 | 460 | |
461 | 461 | <input class="widefat" id="<?php echo $this->get_field_id('categ_limit'); ?>" |
462 | 462 | name="<?php echo $this->get_field_name('categ_limit'); ?>" type="text" |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | |
467 | 467 | <p> |
468 | 468 | <label |
469 | - for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?> |
|
469 | + for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?> |
|
470 | 470 | <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>" |
471 | 471 | name="<?php echo $this->get_field_name('character_count'); ?>" type="text" |
472 | 472 | value="<?php echo esc_attr($character_count); ?>"/> |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | </p> |
475 | 475 | <p> |
476 | 476 | <label |
477 | - for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory');?> |
|
477 | + for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory'); ?> |
|
478 | 478 | |
479 | 479 | <select class="widefat" id="<?php echo $this->get_field_id('tab_layout'); ?>" |
480 | 480 | name="<?php echo $this->get_field_name('tab_layout'); ?>"> |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | |
496 | 496 | <p> |
497 | 497 | <label |
498 | - for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory');?> |
|
498 | + for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory'); ?> |
|
499 | 499 | |
500 | 500 | <select class="widefat" id="<?php echo $this->get_field_id('excerpt_type'); ?>" |
501 | 501 | name="<?php echo $this->get_field_name('excerpt_type'); ?>"> |
@@ -512,9 +512,9 @@ discard block |
||
512 | 512 | |
513 | 513 | <p> |
514 | 514 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
515 | - <?php _e('Enable Location Filter:', 'geodirectory');?> |
|
515 | + <?php _e('Enable Location Filter:', 'geodirectory'); ?> |
|
516 | 516 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
517 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
517 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?> |
|
518 | 518 | value="1"/> |
519 | 519 | </label> |
520 | 520 | </p> |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * GeoDirectory Best of widget |
|
4 | - * |
|
5 | - * @since 1.3.9 |
|
6 | - * |
|
7 | - * @package GeoDirectory |
|
8 | - */ |
|
3 | + * GeoDirectory Best of widget |
|
4 | + * |
|
5 | + * @since 1.3.9 |
|
6 | + * |
|
7 | + * @package GeoDirectory |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * GeoDirectory Best of widget widget class. |
@@ -14,280 +14,280 @@ discard block |
||
14 | 14 | */ |
15 | 15 | class geodir_bestof_widget extends WP_Widget |
16 | 16 | { |
17 | - /** |
|
18 | - * Register the best of widget with WordPress. |
|
19 | - * |
|
20 | - * @since 1.3.9 |
|
21 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
22 | - */ |
|
23 | - public function __construct() |
|
24 | - { |
|
25 | - $widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory')); |
|
26 | - parent::__construct( |
|
27 | - 'bestof_widget', // Base ID |
|
28 | - __('GD > Best of widget', 'geodirectory'), // Name |
|
29 | - $widget_ops// Args |
|
30 | - ); |
|
31 | - } |
|
32 | - |
|
33 | - /** |
|
34 | - * Front-end display content for best of widget. |
|
35 | - * |
|
36 | - * @since 1.3.9 |
|
37 | - * @since 1.5.1 Added filter to view all link. |
|
38 | - * @since 1.5.1 Declare function public. |
|
39 | - * |
|
40 | - * @param array $args Widget arguments. |
|
41 | - * @param array $instance Saved values from database. |
|
42 | - */ |
|
43 | - public function widget($args, $instance) |
|
44 | - { |
|
45 | - extract($args); |
|
46 | - /** |
|
47 | - * Filter the best of widget tab layout. |
|
48 | - * |
|
49 | - * @since 1.3.9 |
|
50 | - * |
|
51 | - * @param string $instance ['tab_layout'] Best of widget tab layout name. |
|
52 | - */ |
|
53 | - $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']); |
|
54 | - echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">'; |
|
55 | - echo $before_widget; |
|
56 | - $loc_terms = geodir_get_current_location_terms(); |
|
57 | - if (!empty($loc_terms)) { |
|
58 | - $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms))); |
|
59 | - } else { |
|
60 | - $cur_location = ''; |
|
61 | - } |
|
62 | - |
|
63 | - /** |
|
64 | - * Filter the current location name. |
|
65 | - * |
|
66 | - * @since 1.3.9 |
|
67 | - * |
|
68 | - * @param string $cur_location Current location name. |
|
69 | - */ |
|
70 | - $cur_location = apply_filters('bestof_widget_cur_location', $cur_location); |
|
71 | - |
|
72 | - /** |
|
73 | - * Filter the widget title. |
|
74 | - * |
|
75 | - * @since 1.3.9 |
|
76 | - * |
|
77 | - * @param string $instance ['title'] The widget title. |
|
78 | - */ |
|
79 | - $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory')); |
|
80 | - |
|
81 | - /** |
|
82 | - * Filter the post type. |
|
83 | - * |
|
84 | - * @since 1.3.9 |
|
85 | - * |
|
86 | - * @param string $instance ['post_type'] The post type. |
|
87 | - */ |
|
88 | - $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']); |
|
89 | - |
|
90 | - /** |
|
91 | - * Filter the excerpt type. |
|
92 | - * |
|
93 | - * @since 1.5.4 |
|
94 | - * |
|
95 | - * @param string $instance ['excerpt_type'] The excerpt type. |
|
96 | - */ |
|
97 | - $excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']); |
|
98 | - |
|
99 | - |
|
100 | - /** |
|
101 | - * Filter the listing limit. |
|
102 | - * |
|
103 | - * @since 1.3.9 |
|
104 | - * |
|
105 | - * @param int $instance ['post_limit'] No. of posts to display. |
|
106 | - */ |
|
107 | - $post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']); |
|
108 | - |
|
109 | - /** |
|
110 | - * Filter the category limit. |
|
111 | - * |
|
112 | - * @since 1.3.9 |
|
113 | - * |
|
114 | - * @param int $instance ['categ_limit'] No. of categories to display. |
|
115 | - */ |
|
116 | - $categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']); |
|
117 | - $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false; |
|
118 | - |
|
119 | - /** |
|
120 | - * Filter the use of location filter. |
|
121 | - * |
|
122 | - * @since 1.3.9 |
|
123 | - * |
|
124 | - * @param int|bool $instance ['add_location_filter'] Filter listings using current location. |
|
125 | - */ |
|
126 | - $add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']); |
|
127 | - |
|
128 | - // set post type to current viewing post type |
|
129 | - if ($use_viewing_post_type) { |
|
130 | - $current_post_type = geodir_get_current_posttype(); |
|
131 | - if ($current_post_type != '' && $current_post_type != $post_type) { |
|
132 | - $post_type = $current_post_type; |
|
133 | - } |
|
134 | - } |
|
135 | - |
|
136 | - if (isset($instance['character_count'])) { |
|
137 | - /** |
|
138 | - * Filter the widget's excerpt character count. |
|
139 | - * |
|
140 | - * @since 1.3.9 |
|
141 | - * |
|
142 | - * @param int $instance ['character_count'] Excerpt character count. |
|
143 | - */ |
|
144 | - $character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']); |
|
145 | - } else { |
|
146 | - $character_count = ''; |
|
147 | - } |
|
148 | - |
|
149 | - $category_taxonomy = geodir_get_taxonomies($post_type); |
|
150 | - |
|
151 | - $term_args = array( |
|
152 | - 'hide_empty' => true, |
|
153 | - 'parent' => 0 |
|
154 | - ); |
|
155 | - |
|
156 | - if (is_tax()) { |
|
157 | - $taxonomy = get_query_var('taxonomy'); |
|
158 | - $cur_term = get_query_var('term'); |
|
159 | - $term_data = get_term_by('name', $cur_term, $taxonomy); |
|
160 | - $term_args['parent'] = $term_data->term_id; |
|
161 | - } |
|
162 | - |
|
163 | - $terms = get_terms($category_taxonomy[0], $term_args); |
|
164 | - |
|
165 | - $term_reviews = geodir_count_reviews_by_terms(); |
|
166 | - $a_terms = array(); |
|
167 | - foreach ($terms as $term) { |
|
168 | - |
|
169 | - |
|
170 | - if ($term->count > 0) { |
|
171 | - if (isset($term_reviews[$term->term_id])) { |
|
172 | - $term->review_count = $term_reviews[$term->term_id]; |
|
173 | - } else { |
|
174 | - $term->review_count = '0'; |
|
175 | - } |
|
176 | - |
|
177 | - $a_terms[] = $term; |
|
178 | - } |
|
179 | - |
|
180 | - } |
|
181 | - |
|
182 | - |
|
183 | - $terms = geodir_sort_terms($a_terms, 'review_count'); |
|
184 | - |
|
185 | - $query_args = array( |
|
186 | - 'posts_per_page' => $post_limit, |
|
187 | - 'is_geodir_loop' => true, |
|
188 | - 'post_type' => $post_type, |
|
189 | - 'gd_location' => $add_location_filter ? true : false, |
|
190 | - 'order_by' => 'high_review' |
|
191 | - ); |
|
192 | - if ($character_count >= 0) { |
|
193 | - $query_args['excerpt_length'] = $character_count; |
|
194 | - } |
|
195 | - |
|
196 | - $layout = array(); |
|
197 | - if ($tab_layout == 'bestof-tabs-as-dropdown') { |
|
198 | - $layout[] = $tab_layout; |
|
199 | - } else { |
|
200 | - $layout[] = 'bestof-tabs-as-dropdown'; |
|
201 | - $layout[] = $tab_layout; |
|
202 | - } |
|
203 | - |
|
204 | - |
|
205 | - echo $before_title . __($title,'geodirectory') . $after_title; |
|
206 | - |
|
207 | - //term navigation - start |
|
208 | - echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">'; |
|
209 | - |
|
210 | - $final_html = ''; |
|
211 | - foreach ($layout as $tab_layout) { |
|
212 | - $nav_html = ''; |
|
213 | - $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false; |
|
214 | - |
|
215 | - if ($is_dropdown) { |
|
216 | - $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">'; |
|
217 | - } else { |
|
218 | - $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">'; |
|
219 | - $nav_html .= '<dt></dt>'; |
|
220 | - } |
|
221 | - |
|
222 | - |
|
223 | - $term_icon = geodir_get_term_icon(); |
|
224 | - $cat_count = 0; |
|
225 | - if (!empty($terms)) { |
|
226 | - foreach ($terms as $cat) { |
|
227 | - $cat_count++; |
|
228 | - if ($cat_count > $categ_limit) { |
|
229 | - break; |
|
230 | - } |
|
231 | - if ($is_dropdown) { |
|
232 | - $selected = ($cat_count == 1) ? 'selected="selected"' : ''; |
|
233 | - $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>'; |
|
234 | - } else { |
|
235 | - if ($cat_count == 1) { |
|
236 | - $nav_html .= '<dd class="geodir-tab-active">'; |
|
237 | - } else { |
|
238 | - $nav_html .= '<dd class="">'; |
|
239 | - } |
|
240 | - $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : ''; |
|
241 | - $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">'; |
|
242 | - $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>'; |
|
243 | - $nav_html .= '<span>'; |
|
244 | - $nav_html .= geodir_ucwords($cat->name); |
|
245 | - $nav_html .= '<small>'; |
|
246 | - if (isset($cat->review_count)) { |
|
247 | - $num_reviews = $cat->review_count; |
|
248 | - if ($num_reviews == 0) { |
|
249 | - $reviews = __('No Reviews', 'geodirectory'); |
|
250 | - } elseif ($num_reviews > 1) { |
|
251 | - $reviews = $num_reviews . __(' Reviews', 'geodirectory'); |
|
252 | - } else { |
|
253 | - $reviews = __('1 Review', 'geodirectory'); |
|
254 | - } |
|
255 | - $nav_html .= $reviews; |
|
256 | - } |
|
257 | - $nav_html .= '</small>'; |
|
258 | - $nav_html .= '</span>'; |
|
259 | - $nav_html .= '</a>'; |
|
260 | - $nav_html .= '</dd>'; |
|
261 | - } |
|
262 | - } |
|
263 | - } |
|
264 | - |
|
265 | - if ($is_dropdown) { |
|
266 | - $nav_html .= '</select>'; |
|
267 | - } else { |
|
268 | - $nav_html .= '</dl>'; |
|
269 | - } |
|
270 | - $final_html .= $nav_html; |
|
271 | - } |
|
272 | - if ($terms) { |
|
273 | - echo $final_html; |
|
274 | - } |
|
275 | - echo '</div>'; |
|
276 | - //term navigation - end |
|
277 | - |
|
278 | - //first term listings by default - start |
|
279 | - $first_term = ''; |
|
280 | - if ($terms) { |
|
281 | - $first_term = $terms[0]; |
|
282 | - $tax_query = array( |
|
283 | - 'taxonomy' => $category_taxonomy[0], |
|
284 | - 'field' => 'id', |
|
285 | - 'terms' => $first_term->term_id |
|
286 | - ); |
|
287 | - $query_args['tax_query'] = array($tax_query); |
|
288 | - } |
|
289 | - |
|
290 | - ?> |
|
17 | + /** |
|
18 | + * Register the best of widget with WordPress. |
|
19 | + * |
|
20 | + * @since 1.3.9 |
|
21 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
22 | + */ |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | + $widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory')); |
|
26 | + parent::__construct( |
|
27 | + 'bestof_widget', // Base ID |
|
28 | + __('GD > Best of widget', 'geodirectory'), // Name |
|
29 | + $widget_ops// Args |
|
30 | + ); |
|
31 | + } |
|
32 | + |
|
33 | + /** |
|
34 | + * Front-end display content for best of widget. |
|
35 | + * |
|
36 | + * @since 1.3.9 |
|
37 | + * @since 1.5.1 Added filter to view all link. |
|
38 | + * @since 1.5.1 Declare function public. |
|
39 | + * |
|
40 | + * @param array $args Widget arguments. |
|
41 | + * @param array $instance Saved values from database. |
|
42 | + */ |
|
43 | + public function widget($args, $instance) |
|
44 | + { |
|
45 | + extract($args); |
|
46 | + /** |
|
47 | + * Filter the best of widget tab layout. |
|
48 | + * |
|
49 | + * @since 1.3.9 |
|
50 | + * |
|
51 | + * @param string $instance ['tab_layout'] Best of widget tab layout name. |
|
52 | + */ |
|
53 | + $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']); |
|
54 | + echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">'; |
|
55 | + echo $before_widget; |
|
56 | + $loc_terms = geodir_get_current_location_terms(); |
|
57 | + if (!empty($loc_terms)) { |
|
58 | + $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms))); |
|
59 | + } else { |
|
60 | + $cur_location = ''; |
|
61 | + } |
|
62 | + |
|
63 | + /** |
|
64 | + * Filter the current location name. |
|
65 | + * |
|
66 | + * @since 1.3.9 |
|
67 | + * |
|
68 | + * @param string $cur_location Current location name. |
|
69 | + */ |
|
70 | + $cur_location = apply_filters('bestof_widget_cur_location', $cur_location); |
|
71 | + |
|
72 | + /** |
|
73 | + * Filter the widget title. |
|
74 | + * |
|
75 | + * @since 1.3.9 |
|
76 | + * |
|
77 | + * @param string $instance ['title'] The widget title. |
|
78 | + */ |
|
79 | + $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory')); |
|
80 | + |
|
81 | + /** |
|
82 | + * Filter the post type. |
|
83 | + * |
|
84 | + * @since 1.3.9 |
|
85 | + * |
|
86 | + * @param string $instance ['post_type'] The post type. |
|
87 | + */ |
|
88 | + $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']); |
|
89 | + |
|
90 | + /** |
|
91 | + * Filter the excerpt type. |
|
92 | + * |
|
93 | + * @since 1.5.4 |
|
94 | + * |
|
95 | + * @param string $instance ['excerpt_type'] The excerpt type. |
|
96 | + */ |
|
97 | + $excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']); |
|
98 | + |
|
99 | + |
|
100 | + /** |
|
101 | + * Filter the listing limit. |
|
102 | + * |
|
103 | + * @since 1.3.9 |
|
104 | + * |
|
105 | + * @param int $instance ['post_limit'] No. of posts to display. |
|
106 | + */ |
|
107 | + $post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']); |
|
108 | + |
|
109 | + /** |
|
110 | + * Filter the category limit. |
|
111 | + * |
|
112 | + * @since 1.3.9 |
|
113 | + * |
|
114 | + * @param int $instance ['categ_limit'] No. of categories to display. |
|
115 | + */ |
|
116 | + $categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']); |
|
117 | + $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false; |
|
118 | + |
|
119 | + /** |
|
120 | + * Filter the use of location filter. |
|
121 | + * |
|
122 | + * @since 1.3.9 |
|
123 | + * |
|
124 | + * @param int|bool $instance ['add_location_filter'] Filter listings using current location. |
|
125 | + */ |
|
126 | + $add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']); |
|
127 | + |
|
128 | + // set post type to current viewing post type |
|
129 | + if ($use_viewing_post_type) { |
|
130 | + $current_post_type = geodir_get_current_posttype(); |
|
131 | + if ($current_post_type != '' && $current_post_type != $post_type) { |
|
132 | + $post_type = $current_post_type; |
|
133 | + } |
|
134 | + } |
|
135 | + |
|
136 | + if (isset($instance['character_count'])) { |
|
137 | + /** |
|
138 | + * Filter the widget's excerpt character count. |
|
139 | + * |
|
140 | + * @since 1.3.9 |
|
141 | + * |
|
142 | + * @param int $instance ['character_count'] Excerpt character count. |
|
143 | + */ |
|
144 | + $character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']); |
|
145 | + } else { |
|
146 | + $character_count = ''; |
|
147 | + } |
|
148 | + |
|
149 | + $category_taxonomy = geodir_get_taxonomies($post_type); |
|
150 | + |
|
151 | + $term_args = array( |
|
152 | + 'hide_empty' => true, |
|
153 | + 'parent' => 0 |
|
154 | + ); |
|
155 | + |
|
156 | + if (is_tax()) { |
|
157 | + $taxonomy = get_query_var('taxonomy'); |
|
158 | + $cur_term = get_query_var('term'); |
|
159 | + $term_data = get_term_by('name', $cur_term, $taxonomy); |
|
160 | + $term_args['parent'] = $term_data->term_id; |
|
161 | + } |
|
162 | + |
|
163 | + $terms = get_terms($category_taxonomy[0], $term_args); |
|
164 | + |
|
165 | + $term_reviews = geodir_count_reviews_by_terms(); |
|
166 | + $a_terms = array(); |
|
167 | + foreach ($terms as $term) { |
|
168 | + |
|
169 | + |
|
170 | + if ($term->count > 0) { |
|
171 | + if (isset($term_reviews[$term->term_id])) { |
|
172 | + $term->review_count = $term_reviews[$term->term_id]; |
|
173 | + } else { |
|
174 | + $term->review_count = '0'; |
|
175 | + } |
|
176 | + |
|
177 | + $a_terms[] = $term; |
|
178 | + } |
|
179 | + |
|
180 | + } |
|
181 | + |
|
182 | + |
|
183 | + $terms = geodir_sort_terms($a_terms, 'review_count'); |
|
184 | + |
|
185 | + $query_args = array( |
|
186 | + 'posts_per_page' => $post_limit, |
|
187 | + 'is_geodir_loop' => true, |
|
188 | + 'post_type' => $post_type, |
|
189 | + 'gd_location' => $add_location_filter ? true : false, |
|
190 | + 'order_by' => 'high_review' |
|
191 | + ); |
|
192 | + if ($character_count >= 0) { |
|
193 | + $query_args['excerpt_length'] = $character_count; |
|
194 | + } |
|
195 | + |
|
196 | + $layout = array(); |
|
197 | + if ($tab_layout == 'bestof-tabs-as-dropdown') { |
|
198 | + $layout[] = $tab_layout; |
|
199 | + } else { |
|
200 | + $layout[] = 'bestof-tabs-as-dropdown'; |
|
201 | + $layout[] = $tab_layout; |
|
202 | + } |
|
203 | + |
|
204 | + |
|
205 | + echo $before_title . __($title,'geodirectory') . $after_title; |
|
206 | + |
|
207 | + //term navigation - start |
|
208 | + echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">'; |
|
209 | + |
|
210 | + $final_html = ''; |
|
211 | + foreach ($layout as $tab_layout) { |
|
212 | + $nav_html = ''; |
|
213 | + $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false; |
|
214 | + |
|
215 | + if ($is_dropdown) { |
|
216 | + $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">'; |
|
217 | + } else { |
|
218 | + $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">'; |
|
219 | + $nav_html .= '<dt></dt>'; |
|
220 | + } |
|
221 | + |
|
222 | + |
|
223 | + $term_icon = geodir_get_term_icon(); |
|
224 | + $cat_count = 0; |
|
225 | + if (!empty($terms)) { |
|
226 | + foreach ($terms as $cat) { |
|
227 | + $cat_count++; |
|
228 | + if ($cat_count > $categ_limit) { |
|
229 | + break; |
|
230 | + } |
|
231 | + if ($is_dropdown) { |
|
232 | + $selected = ($cat_count == 1) ? 'selected="selected"' : ''; |
|
233 | + $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>'; |
|
234 | + } else { |
|
235 | + if ($cat_count == 1) { |
|
236 | + $nav_html .= '<dd class="geodir-tab-active">'; |
|
237 | + } else { |
|
238 | + $nav_html .= '<dd class="">'; |
|
239 | + } |
|
240 | + $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : ''; |
|
241 | + $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">'; |
|
242 | + $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>'; |
|
243 | + $nav_html .= '<span>'; |
|
244 | + $nav_html .= geodir_ucwords($cat->name); |
|
245 | + $nav_html .= '<small>'; |
|
246 | + if (isset($cat->review_count)) { |
|
247 | + $num_reviews = $cat->review_count; |
|
248 | + if ($num_reviews == 0) { |
|
249 | + $reviews = __('No Reviews', 'geodirectory'); |
|
250 | + } elseif ($num_reviews > 1) { |
|
251 | + $reviews = $num_reviews . __(' Reviews', 'geodirectory'); |
|
252 | + } else { |
|
253 | + $reviews = __('1 Review', 'geodirectory'); |
|
254 | + } |
|
255 | + $nav_html .= $reviews; |
|
256 | + } |
|
257 | + $nav_html .= '</small>'; |
|
258 | + $nav_html .= '</span>'; |
|
259 | + $nav_html .= '</a>'; |
|
260 | + $nav_html .= '</dd>'; |
|
261 | + } |
|
262 | + } |
|
263 | + } |
|
264 | + |
|
265 | + if ($is_dropdown) { |
|
266 | + $nav_html .= '</select>'; |
|
267 | + } else { |
|
268 | + $nav_html .= '</dl>'; |
|
269 | + } |
|
270 | + $final_html .= $nav_html; |
|
271 | + } |
|
272 | + if ($terms) { |
|
273 | + echo $final_html; |
|
274 | + } |
|
275 | + echo '</div>'; |
|
276 | + //term navigation - end |
|
277 | + |
|
278 | + //first term listings by default - start |
|
279 | + $first_term = ''; |
|
280 | + if ($terms) { |
|
281 | + $first_term = $terms[0]; |
|
282 | + $tax_query = array( |
|
283 | + 'taxonomy' => $category_taxonomy[0], |
|
284 | + 'field' => 'id', |
|
285 | + 'terms' => $first_term->term_id |
|
286 | + ); |
|
287 | + $query_args['tax_query'] = array($tax_query); |
|
288 | + } |
|
289 | + |
|
290 | + ?> |
|
291 | 291 | <input type="hidden" id="bestof_widget_post_type" name="bestof_widget_post_type" |
292 | 292 | value="<?php echo $post_type; ?>"> |
293 | 293 | <input type="hidden" id="bestof_widget_excerpt_type" name="bestof_widget_excerpt_type" |
@@ -298,110 +298,110 @@ discard block |
||
298 | 298 | value="<?php echo $category_taxonomy[0]; ?>"> |
299 | 299 | <input type="hidden" id="bestof_widget_location_filter" name="bestof_widget_location_filter" |
300 | 300 | value="<?php if ($add_location_filter) { |
301 | - echo 1; |
|
302 | - } else { |
|
303 | - echo 0; |
|
304 | - } ?>"> |
|
301 | + echo 1; |
|
302 | + } else { |
|
303 | + echo 0; |
|
304 | + } ?>"> |
|
305 | 305 | <input type="hidden" id="bestof_widget_char_count" name="bestof_widget_char_count" |
306 | 306 | value="<?php echo $character_count; ?>"> |
307 | 307 | <div class="geo-bestof-contentwrap geodir-tabs-content" style="position: relative; z-index: 0;"> |
308 | 308 | <p id="geodir-bestof-loading" class="geodir-bestof-loading"><i class="fa fa-cog fa-spin"></i></p> |
309 | 309 | <?php |
310 | - echo '<div id="geodir-bestof-places">'; |
|
311 | - if ($terms) { |
|
312 | - $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy)); |
|
313 | - /** |
|
314 | - * Filter the page link to view all lisitngs. |
|
315 | - * |
|
316 | - * @since 1.5.1 |
|
317 | - * |
|
318 | - * @param array $view_all_link View all listings page link. |
|
319 | - * @param array $post_type The Post type. |
|
320 | - * @param array $first_term The category term object. |
|
321 | - */ |
|
322 | - $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term); |
|
323 | - |
|
324 | - echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
325 | - } |
|
326 | - if ($excerpt_type == 'show-reviews') { |
|
327 | - add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
328 | - } |
|
329 | - geodir_bestof_places_by_term($query_args); |
|
330 | - if ($excerpt_type == 'show-reviews') { |
|
331 | - remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
332 | - } |
|
333 | - echo "</div>"; |
|
334 | - ?> |
|
310 | + echo '<div id="geodir-bestof-places">'; |
|
311 | + if ($terms) { |
|
312 | + $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy)); |
|
313 | + /** |
|
314 | + * Filter the page link to view all lisitngs. |
|
315 | + * |
|
316 | + * @since 1.5.1 |
|
317 | + * |
|
318 | + * @param array $view_all_link View all listings page link. |
|
319 | + * @param array $post_type The Post type. |
|
320 | + * @param array $first_term The category term object. |
|
321 | + */ |
|
322 | + $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term); |
|
323 | + |
|
324 | + echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
325 | + } |
|
326 | + if ($excerpt_type == 'show-reviews') { |
|
327 | + add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
328 | + } |
|
329 | + geodir_bestof_places_by_term($query_args); |
|
330 | + if ($excerpt_type == 'show-reviews') { |
|
331 | + remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
332 | + } |
|
333 | + echo "</div>"; |
|
334 | + ?> |
|
335 | 335 | </div> |
336 | 336 | <?php //first term listings by default - end |
337 | - ?> |
|
337 | + ?> |
|
338 | 338 | <?php echo $after_widget; |
339 | - echo "</div>"; |
|
340 | - } |
|
341 | - |
|
342 | - /** |
|
343 | - * Sanitize best of widget form values as they are saved. |
|
344 | - * |
|
345 | - * @since 1.3.9 |
|
346 | - * @since 1.5.1 Declare function public. |
|
347 | - * |
|
348 | - * @param array $new_instance Values just sent to be saved. |
|
349 | - * @param array $old_instance Previously saved values from database. |
|
350 | - * |
|
351 | - * @return array Updated safe values to be saved. |
|
352 | - */ |
|
353 | - public function update($new_instance, $old_instance) |
|
354 | - { |
|
355 | - $instance = $old_instance; |
|
356 | - $instance['title'] = strip_tags($new_instance['title']); |
|
357 | - $instance['post_type'] = strip_tags($new_instance['post_type']); |
|
358 | - $instance['post_limit'] = strip_tags($new_instance['post_limit']); |
|
359 | - $instance['categ_limit'] = strip_tags($new_instance['categ_limit']); |
|
360 | - $instance['character_count'] = $new_instance['character_count']; |
|
361 | - $instance['tab_layout'] = $new_instance['tab_layout']; |
|
362 | - $instance['excerpt_type'] = $new_instance['excerpt_type']; |
|
363 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
364 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
365 | - else |
|
366 | - $instance['add_location_filter'] = '0'; |
|
367 | - $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0; |
|
368 | - return $instance; |
|
369 | - } |
|
370 | - |
|
371 | - /** |
|
372 | - * Back-end best of widget settings form. |
|
373 | - * |
|
374 | - * @since 1.3.9 |
|
375 | - * @since 1.5.1 Declare function public. |
|
376 | - * |
|
377 | - * @param array $instance Previously saved values from database. |
|
378 | - */ |
|
379 | - public function form($instance) |
|
380 | - { |
|
381 | - $instance = wp_parse_args((array)$instance, |
|
382 | - array( |
|
383 | - 'title' => '', |
|
384 | - 'post_type' => '', |
|
385 | - 'post_limit' => '5', |
|
386 | - 'categ_limit' => '3', |
|
387 | - 'character_count' => '20', |
|
388 | - 'add_location_filter' => '1', |
|
389 | - 'tab_layout' => 'bestof-tabs-on-top', |
|
390 | - 'excerpt_type' => 'show-desc', |
|
391 | - 'use_viewing_post_type' => '' |
|
392 | - ) |
|
393 | - ); |
|
394 | - $title = strip_tags($instance['title']); |
|
395 | - $post_type = strip_tags($instance['post_type']); |
|
396 | - $post_limit = strip_tags($instance['post_limit']); |
|
397 | - $categ_limit = strip_tags($instance['categ_limit']); |
|
398 | - $character_count = strip_tags($instance['character_count']); |
|
399 | - $tab_layout = strip_tags($instance['tab_layout']); |
|
400 | - $excerpt_type = strip_tags($instance['excerpt_type']); |
|
401 | - $add_location_filter = strip_tags($instance['add_location_filter']); |
|
402 | - $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false; |
|
403 | - |
|
404 | - ?> |
|
339 | + echo "</div>"; |
|
340 | + } |
|
341 | + |
|
342 | + /** |
|
343 | + * Sanitize best of widget form values as they are saved. |
|
344 | + * |
|
345 | + * @since 1.3.9 |
|
346 | + * @since 1.5.1 Declare function public. |
|
347 | + * |
|
348 | + * @param array $new_instance Values just sent to be saved. |
|
349 | + * @param array $old_instance Previously saved values from database. |
|
350 | + * |
|
351 | + * @return array Updated safe values to be saved. |
|
352 | + */ |
|
353 | + public function update($new_instance, $old_instance) |
|
354 | + { |
|
355 | + $instance = $old_instance; |
|
356 | + $instance['title'] = strip_tags($new_instance['title']); |
|
357 | + $instance['post_type'] = strip_tags($new_instance['post_type']); |
|
358 | + $instance['post_limit'] = strip_tags($new_instance['post_limit']); |
|
359 | + $instance['categ_limit'] = strip_tags($new_instance['categ_limit']); |
|
360 | + $instance['character_count'] = $new_instance['character_count']; |
|
361 | + $instance['tab_layout'] = $new_instance['tab_layout']; |
|
362 | + $instance['excerpt_type'] = $new_instance['excerpt_type']; |
|
363 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
364 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
365 | + else |
|
366 | + $instance['add_location_filter'] = '0'; |
|
367 | + $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0; |
|
368 | + return $instance; |
|
369 | + } |
|
370 | + |
|
371 | + /** |
|
372 | + * Back-end best of widget settings form. |
|
373 | + * |
|
374 | + * @since 1.3.9 |
|
375 | + * @since 1.5.1 Declare function public. |
|
376 | + * |
|
377 | + * @param array $instance Previously saved values from database. |
|
378 | + */ |
|
379 | + public function form($instance) |
|
380 | + { |
|
381 | + $instance = wp_parse_args((array)$instance, |
|
382 | + array( |
|
383 | + 'title' => '', |
|
384 | + 'post_type' => '', |
|
385 | + 'post_limit' => '5', |
|
386 | + 'categ_limit' => '3', |
|
387 | + 'character_count' => '20', |
|
388 | + 'add_location_filter' => '1', |
|
389 | + 'tab_layout' => 'bestof-tabs-on-top', |
|
390 | + 'excerpt_type' => 'show-desc', |
|
391 | + 'use_viewing_post_type' => '' |
|
392 | + ) |
|
393 | + ); |
|
394 | + $title = strip_tags($instance['title']); |
|
395 | + $post_type = strip_tags($instance['post_type']); |
|
396 | + $post_limit = strip_tags($instance['post_limit']); |
|
397 | + $categ_limit = strip_tags($instance['categ_limit']); |
|
398 | + $character_count = strip_tags($instance['character_count']); |
|
399 | + $tab_layout = strip_tags($instance['tab_layout']); |
|
400 | + $excerpt_type = strip_tags($instance['excerpt_type']); |
|
401 | + $add_location_filter = strip_tags($instance['add_location_filter']); |
|
402 | + $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false; |
|
403 | + |
|
404 | + ?> |
|
405 | 405 | <p> |
406 | 406 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
407 | 407 | |
@@ -416,14 +416,14 @@ discard block |
||
416 | 416 | for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?> |
417 | 417 | |
418 | 418 | <?php $postypes = geodir_get_posttypes(); |
419 | - /** |
|
420 | - * Filter the post types to display in widget. |
|
421 | - * |
|
422 | - * @since 1.3.9 |
|
423 | - * |
|
424 | - * @param array $postypes Post types array. |
|
425 | - */ |
|
426 | - $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?> |
|
419 | + /** |
|
420 | + * Filter the post types to display in widget. |
|
421 | + * |
|
422 | + * @since 1.3.9 |
|
423 | + * |
|
424 | + * @param array $postypes Post types array. |
|
425 | + */ |
|
426 | + $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?> |
|
427 | 427 | |
428 | 428 | <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>" |
429 | 429 | name="<?php echo $this->get_field_name('post_type'); ?>" |
@@ -432,9 +432,9 @@ discard block |
||
432 | 432 | <?php foreach ($postypes as $postypes_obj) { ?> |
433 | 433 | |
434 | 434 | <option <?php if ($post_type == $postypes_obj) { |
435 | - echo 'selected="selected"'; |
|
436 | - } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj); |
|
437 | - echo ucfirst($extvalue[1]); ?></option> |
|
435 | + echo 'selected="selected"'; |
|
436 | + } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj); |
|
437 | + echo ucfirst($extvalue[1]); ?></option> |
|
438 | 438 | |
439 | 439 | <?php } ?> |
440 | 440 | |
@@ -480,14 +480,14 @@ discard block |
||
480 | 480 | name="<?php echo $this->get_field_name('tab_layout'); ?>"> |
481 | 481 | |
482 | 482 | <option <?php if ($tab_layout == 'bestof-tabs-on-top') { |
483 | - echo 'selected="selected"'; |
|
484 | - } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option> |
|
483 | + echo 'selected="selected"'; |
|
484 | + } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option> |
|
485 | 485 | <option <?php if ($tab_layout == 'bestof-tabs-on-left') { |
486 | - echo 'selected="selected"'; |
|
487 | - } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option> |
|
486 | + echo 'selected="selected"'; |
|
487 | + } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option> |
|
488 | 488 | <option <?php if ($tab_layout == 'bestof-tabs-as-dropdown') { |
489 | - echo 'selected="selected"'; |
|
490 | - } ?> |
|
489 | + echo 'selected="selected"'; |
|
490 | + } ?> |
|
491 | 491 | value="bestof-tabs-as-dropdown"><?php _e('Tabs as Dropdown', 'geodirectory'); ?></option> |
492 | 492 | </select> |
493 | 493 | </label> |
@@ -501,11 +501,11 @@ discard block |
||
501 | 501 | name="<?php echo $this->get_field_name('excerpt_type'); ?>"> |
502 | 502 | |
503 | 503 | <option <?php if ($excerpt_type == 'show-desc') { |
504 | - echo 'selected="selected"'; |
|
505 | - } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option> |
|
504 | + echo 'selected="selected"'; |
|
505 | + } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option> |
|
506 | 506 | <option <?php if ($excerpt_type == 'show-reviews') { |
507 | - echo 'selected="selected"'; |
|
508 | - } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option> |
|
507 | + echo 'selected="selected"'; |
|
508 | + } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option> |
|
509 | 509 | </select> |
510 | 510 | </label> |
511 | 511 | </p> |
@@ -524,12 +524,12 @@ discard block |
||
524 | 524 | for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?> |
525 | 525 | <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>" |
526 | 526 | name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) { |
527 | - echo 'checked="checked"'; |
|
528 | - } ?> value="1"/> |
|
527 | + echo 'checked="checked"'; |
|
528 | + } ?> value="1"/> |
|
529 | 529 | </label> |
530 | 530 | </p> |
531 | 531 | <?php |
532 | - } |
|
532 | + } |
|
533 | 533 | } // class geodir_bestof_widget |
534 | 534 | |
535 | 535 | register_widget('geodir_bestof_widget'); |
@@ -549,68 +549,68 @@ discard block |
||
549 | 549 | */ |
550 | 550 | function geodir_bestof_places_by_term($query_args) |
551 | 551 | { |
552 | - global $gd_session; |
|
553 | - |
|
554 | - /** |
|
555 | - * This action called before querying widget listings. |
|
556 | - * |
|
557 | - * @since 1.0.0 |
|
558 | - */ |
|
559 | - do_action('geodir_bestof_get_widget_listings_before'); |
|
560 | - |
|
561 | - $widget_listings = geodir_get_widget_listings($query_args); |
|
562 | - |
|
563 | - /** |
|
564 | - * This action called after querying widget listings. |
|
565 | - * |
|
566 | - * @since 1.0.0 |
|
567 | - */ |
|
568 | - do_action('geodir_bestof_get_widget_listings_after'); |
|
569 | - |
|
570 | - $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : ''; |
|
571 | - |
|
572 | - if (!isset($character_count)) { |
|
573 | - /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
574 | - $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count); |
|
575 | - } |
|
576 | - |
|
577 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
578 | - $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview')); |
|
579 | - |
|
580 | - global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing; |
|
581 | - $current_post = $post; |
|
582 | - $current_map_jason = $map_jason; |
|
583 | - $current_map_canvas_arr = $map_canvas_arr; |
|
584 | - $current_grid_view = $gridview_columns_widget; |
|
585 | - $gridview_columns_widget = null; |
|
586 | - |
|
587 | - $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false; |
|
588 | - $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : ''; |
|
589 | - |
|
590 | - $gd_session->set('gd_listing_view', '1'); |
|
591 | - $geodir_is_widget_listing = true; |
|
592 | - |
|
593 | - /** |
|
594 | - * Includes the template for the listing listview. |
|
595 | - * |
|
596 | - * @since 1.3.9 |
|
597 | - */ |
|
598 | - include($template); |
|
599 | - |
|
600 | - $geodir_is_widget_listing = false; |
|
601 | - |
|
602 | - $GLOBALS['post'] = $current_post; |
|
603 | - if (!empty($current_post)) { |
|
604 | - setup_postdata($current_post); |
|
605 | - } |
|
606 | - if ($gd_listing_view_set) { // Set back previous value |
|
607 | - $gd_session->set('gd_listing_view', $gd_listing_view_old); |
|
608 | - } else { |
|
609 | - $gd_session->un_set('gd_listing_view'); |
|
610 | - } |
|
611 | - $map_jason = $current_map_jason; |
|
612 | - $map_canvas_arr = $current_map_canvas_arr; |
|
613 | - $gridview_columns_widget = $current_grid_view; |
|
552 | + global $gd_session; |
|
553 | + |
|
554 | + /** |
|
555 | + * This action called before querying widget listings. |
|
556 | + * |
|
557 | + * @since 1.0.0 |
|
558 | + */ |
|
559 | + do_action('geodir_bestof_get_widget_listings_before'); |
|
560 | + |
|
561 | + $widget_listings = geodir_get_widget_listings($query_args); |
|
562 | + |
|
563 | + /** |
|
564 | + * This action called after querying widget listings. |
|
565 | + * |
|
566 | + * @since 1.0.0 |
|
567 | + */ |
|
568 | + do_action('geodir_bestof_get_widget_listings_after'); |
|
569 | + |
|
570 | + $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : ''; |
|
571 | + |
|
572 | + if (!isset($character_count)) { |
|
573 | + /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
574 | + $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count); |
|
575 | + } |
|
576 | + |
|
577 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
578 | + $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview')); |
|
579 | + |
|
580 | + global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing; |
|
581 | + $current_post = $post; |
|
582 | + $current_map_jason = $map_jason; |
|
583 | + $current_map_canvas_arr = $map_canvas_arr; |
|
584 | + $current_grid_view = $gridview_columns_widget; |
|
585 | + $gridview_columns_widget = null; |
|
586 | + |
|
587 | + $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false; |
|
588 | + $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : ''; |
|
589 | + |
|
590 | + $gd_session->set('gd_listing_view', '1'); |
|
591 | + $geodir_is_widget_listing = true; |
|
592 | + |
|
593 | + /** |
|
594 | + * Includes the template for the listing listview. |
|
595 | + * |
|
596 | + * @since 1.3.9 |
|
597 | + */ |
|
598 | + include($template); |
|
599 | + |
|
600 | + $geodir_is_widget_listing = false; |
|
601 | + |
|
602 | + $GLOBALS['post'] = $current_post; |
|
603 | + if (!empty($current_post)) { |
|
604 | + setup_postdata($current_post); |
|
605 | + } |
|
606 | + if ($gd_listing_view_set) { // Set back previous value |
|
607 | + $gd_session->set('gd_listing_view', $gd_listing_view_old); |
|
608 | + } else { |
|
609 | + $gd_session->un_set('gd_listing_view'); |
|
610 | + } |
|
611 | + $map_jason = $current_map_jason; |
|
612 | + $map_canvas_arr = $current_map_canvas_arr; |
|
613 | + $gridview_columns_widget = $current_grid_view; |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | //Ajax functions |
@@ -627,51 +627,51 @@ discard block |
||
627 | 627 | */ |
628 | 628 | function geodir_bestof_callback() |
629 | 629 | { |
630 | - check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce'); |
|
631 | - //set variables |
|
632 | - $post_type = strip_tags(esc_sql($_POST['post_type'])); |
|
633 | - $post_limit = strip_tags(esc_sql($_POST['post_limit'])); |
|
634 | - $character_count = strip_tags(esc_sql($_POST['char_count'])); |
|
635 | - $taxonomy = strip_tags(esc_sql($_POST['taxonomy'])); |
|
636 | - $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter'])); |
|
637 | - $term_id = strip_tags(esc_sql($_POST['term_id'])); |
|
638 | - $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type'])); |
|
639 | - |
|
640 | - $query_args = array( |
|
641 | - 'posts_per_page' => $post_limit, |
|
642 | - 'is_geodir_loop' => true, |
|
643 | - 'post_type' => $post_type, |
|
644 | - 'gd_location' => $add_location_filter ? true : false, |
|
645 | - 'order_by' => 'high_review' |
|
646 | - ); |
|
647 | - |
|
648 | - if ($character_count >= 0) { |
|
649 | - $query_args['excerpt_length'] = $character_count; |
|
650 | - } |
|
651 | - |
|
652 | - $tax_query = array( |
|
653 | - 'taxonomy' => $taxonomy, |
|
654 | - 'field' => 'id', |
|
655 | - 'terms' => $term_id |
|
656 | - ); |
|
657 | - |
|
658 | - $query_args['tax_query'] = array($tax_query); |
|
659 | - if ($term_id && $taxonomy) { |
|
660 | - $term = get_term_by('id', $term_id, $taxonomy); |
|
661 | - $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term)); |
|
662 | - /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
663 | - $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term); |
|
664 | - |
|
665 | - echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
666 | - } |
|
667 | - if ($excerpt_type == 'show-reviews') { |
|
668 | - add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
669 | - } |
|
670 | - geodir_bestof_places_by_term($query_args); |
|
671 | - if ($excerpt_type == 'show-reviews') { |
|
672 | - remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
673 | - } |
|
674 | - wp_die(); |
|
630 | + check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce'); |
|
631 | + //set variables |
|
632 | + $post_type = strip_tags(esc_sql($_POST['post_type'])); |
|
633 | + $post_limit = strip_tags(esc_sql($_POST['post_limit'])); |
|
634 | + $character_count = strip_tags(esc_sql($_POST['char_count'])); |
|
635 | + $taxonomy = strip_tags(esc_sql($_POST['taxonomy'])); |
|
636 | + $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter'])); |
|
637 | + $term_id = strip_tags(esc_sql($_POST['term_id'])); |
|
638 | + $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type'])); |
|
639 | + |
|
640 | + $query_args = array( |
|
641 | + 'posts_per_page' => $post_limit, |
|
642 | + 'is_geodir_loop' => true, |
|
643 | + 'post_type' => $post_type, |
|
644 | + 'gd_location' => $add_location_filter ? true : false, |
|
645 | + 'order_by' => 'high_review' |
|
646 | + ); |
|
647 | + |
|
648 | + if ($character_count >= 0) { |
|
649 | + $query_args['excerpt_length'] = $character_count; |
|
650 | + } |
|
651 | + |
|
652 | + $tax_query = array( |
|
653 | + 'taxonomy' => $taxonomy, |
|
654 | + 'field' => 'id', |
|
655 | + 'terms' => $term_id |
|
656 | + ); |
|
657 | + |
|
658 | + $query_args['tax_query'] = array($tax_query); |
|
659 | + if ($term_id && $taxonomy) { |
|
660 | + $term = get_term_by('id', $term_id, $taxonomy); |
|
661 | + $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term)); |
|
662 | + /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */ |
|
663 | + $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term); |
|
664 | + |
|
665 | + echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>'; |
|
666 | + } |
|
667 | + if ($excerpt_type == 'show-reviews') { |
|
668 | + add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
669 | + } |
|
670 | + geodir_bestof_places_by_term($query_args); |
|
671 | + if ($excerpt_type == 'show-reviews') { |
|
672 | + remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt'); |
|
673 | + } |
|
674 | + wp_die(); |
|
675 | 675 | } |
676 | 676 | |
677 | 677 | //Javascript |
@@ -684,8 +684,8 @@ discard block |
||
684 | 684 | */ |
685 | 685 | function geodir_bestof_js() |
686 | 686 | { |
687 | - $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
688 | - ?> |
|
687 | + $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
688 | + ?> |
|
689 | 689 | <script type="text/javascript"> |
690 | 690 | jQuery(document).ready(function () { |
691 | 691 | jQuery('.geodir-bestof-cat-list a, #geodir_bestof_tab_dd').on("click change", function (e) { |
@@ -758,18 +758,18 @@ discard block |
||
758 | 758 | |
759 | 759 | function best_of_show_review_in_excerpt($excerpt) |
760 | 760 | { |
761 | - global $wpdb, $post; |
|
762 | - $review_table = GEODIR_REVIEW_TABLE; |
|
763 | - $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1"; |
|
764 | - $comments = $wpdb->get_results($request); |
|
765 | - |
|
766 | - if ($comments) { |
|
767 | - foreach ($comments as $comment) { |
|
768 | - // Set the extra comment info needed. |
|
769 | - $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"); |
|
770 | - $comment_content = $comment_extra->comment_content; |
|
771 | - $excerpt = strip_tags($comment_content); |
|
772 | - } |
|
773 | - } |
|
774 | - return $excerpt; |
|
761 | + global $wpdb, $post; |
|
762 | + $review_table = GEODIR_REVIEW_TABLE; |
|
763 | + $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1"; |
|
764 | + $comments = $wpdb->get_results($request); |
|
765 | + |
|
766 | + if ($comments) { |
|
767 | + foreach ($comments as $comment) { |
|
768 | + // Set the extra comment info needed. |
|
769 | + $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID"); |
|
770 | + $comment_content = $comment_extra->comment_content; |
|
771 | + $excerpt = strip_tags($comment_content); |
|
772 | + } |
|
773 | + } |
|
774 | + return $excerpt; |
|
775 | 775 | } |
776 | 776 | \ No newline at end of file |