@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @category content |
18 | 18 | */ |
19 | 19 | function lsx_to_team_content( $slug, $name = null ) { |
20 | - do_action( 'lsx_to_team_content',$slug, $name ); |
|
20 | + do_action( 'lsx_to_team_content',$slug, $name ); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @subpackage template-tags |
33 | 33 | */ |
34 | 34 | function lsx_to_team_role( $before = '', $after = '', $echo = true ) { |
35 | - lsx_to_custom_field_query( 'role',$before,$after,$echo ); |
|
35 | + lsx_to_custom_field_query( 'role',$before,$after,$echo ); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -47,17 +47,17 @@ discard block |
||
47 | 47 | * @subpackage template-tags |
48 | 48 | */ |
49 | 49 | function lsx_to_team_contact_number( $before = '', $after = '', $echo = true ) { |
50 | - $contact_number = get_post_meta( get_the_ID(), 'contact_number', true ); |
|
50 | + $contact_number = get_post_meta( get_the_ID(), 'contact_number', true ); |
|
51 | 51 | |
52 | - if ( false !== $contact_number && '' !== $contact_number ) { |
|
53 | - $contact_html = $before . '<a href="tel:+' . $contact_number . '">' . $contact_number . '</a>' . $after; |
|
52 | + if ( false !== $contact_number && '' !== $contact_number ) { |
|
53 | + $contact_html = $before . '<a href="tel:+' . $contact_number . '">' . $contact_number . '</a>' . $after; |
|
54 | 54 | |
55 | - if ( $echo ) { |
|
56 | - echo wp_kses_post( $contact_html ); |
|
57 | - } else { |
|
58 | - return $contact_html; |
|
59 | - } |
|
60 | - } |
|
55 | + if ( $echo ) { |
|
56 | + echo wp_kses_post( $contact_html ); |
|
57 | + } else { |
|
58 | + return $contact_html; |
|
59 | + } |
|
60 | + } |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | * @subpackage template-tags |
73 | 73 | */ |
74 | 74 | function lsx_to_team_contact_email( $before = '', $after = '', $echo = true ) { |
75 | - $contact_email = get_post_meta( get_the_ID(), 'contact_email', true ); |
|
75 | + $contact_email = get_post_meta( get_the_ID(), 'contact_email', true ); |
|
76 | 76 | |
77 | - if ( false !== $contact_email && '' !== $contact_email ) { |
|
78 | - $contact_html = $before . '<a href="mailto:' . $contact_email . '">' . $contact_email . '</a>' . $after; |
|
77 | + if ( false !== $contact_email && '' !== $contact_email ) { |
|
78 | + $contact_html = $before . '<a href="mailto:' . $contact_email . '">' . $contact_email . '</a>' . $after; |
|
79 | 79 | |
80 | - if ( $echo ) { |
|
81 | - echo wp_kses_post( $contact_html ); |
|
82 | - } else { |
|
83 | - return $contact_html; |
|
84 | - } |
|
85 | - } |
|
80 | + if ( $echo ) { |
|
81 | + echo wp_kses_post( $contact_html ); |
|
82 | + } else { |
|
83 | + return $contact_html; |
|
84 | + } |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -97,17 +97,17 @@ discard block |
||
97 | 97 | * @subpackage template-tags |
98 | 98 | */ |
99 | 99 | function lsx_to_team_contact_skype( $before = '', $after = '', $echo = true ) { |
100 | - $contact_skype = get_post_meta( get_the_ID(), 'skype', true ); |
|
100 | + $contact_skype = get_post_meta( get_the_ID(), 'skype', true ); |
|
101 | 101 | |
102 | - if ( false !== $contact_skype && '' !== $contact_skype ) { |
|
103 | - $contact_html = $before . '<span>' . $contact_skype . '</span>' . $after; |
|
102 | + if ( false !== $contact_skype && '' !== $contact_skype ) { |
|
103 | + $contact_html = $before . '<span>' . $contact_skype . '</span>' . $after; |
|
104 | 104 | |
105 | - if ( $echo ) { |
|
106 | - echo wp_kses_post( $contact_html ); |
|
107 | - } else { |
|
108 | - return $contact_html; |
|
109 | - } |
|
110 | - } |
|
105 | + if ( $echo ) { |
|
106 | + echo wp_kses_post( $contact_html ); |
|
107 | + } else { |
|
108 | + return $contact_html; |
|
109 | + } |
|
110 | + } |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -122,52 +122,52 @@ discard block |
||
122 | 122 | * @subpackage template-tags |
123 | 123 | */ |
124 | 124 | function lsx_to_team_social_profiles( $before = '', $after = '', $echo = true ) { |
125 | - $social_profiles = array( 'facebook', 'twitter', 'googleplus', 'linkedin', 'pinterest' ); |
|
126 | - $social_profile_html = false; |
|
125 | + $social_profiles = array( 'facebook', 'twitter', 'googleplus', 'linkedin', 'pinterest' ); |
|
126 | + $social_profile_html = false; |
|
127 | 127 | |
128 | - foreach ( $social_profiles as $meta_key ) { |
|
129 | - $meta_value = get_post_meta( get_the_ID(),$meta_key,true ); |
|
128 | + foreach ( $social_profiles as $meta_key ) { |
|
129 | + $meta_value = get_post_meta( get_the_ID(),$meta_key,true ); |
|
130 | 130 | |
131 | - if ( false !== $meta_value && '' !== $meta_value ) { |
|
132 | - $icon_class = ''; |
|
131 | + if ( false !== $meta_value && '' !== $meta_value ) { |
|
132 | + $icon_class = ''; |
|
133 | 133 | |
134 | - switch ( $meta_key ) { |
|
135 | - case 'facebook': |
|
136 | - $icon_class = 'facebook'; |
|
137 | - break; |
|
134 | + switch ( $meta_key ) { |
|
135 | + case 'facebook': |
|
136 | + $icon_class = 'facebook'; |
|
137 | + break; |
|
138 | 138 | |
139 | - case 'twitter': |
|
140 | - $icon_class = 'twitter'; |
|
141 | - break; |
|
139 | + case 'twitter': |
|
140 | + $icon_class = 'twitter'; |
|
141 | + break; |
|
142 | 142 | |
143 | - case 'googleplus': |
|
144 | - $icon_class = 'google-plus'; |
|
145 | - break; |
|
143 | + case 'googleplus': |
|
144 | + $icon_class = 'google-plus'; |
|
145 | + break; |
|
146 | 146 | |
147 | - case 'linkedin': |
|
148 | - $icon_class = 'linkedin'; |
|
149 | - break; |
|
147 | + case 'linkedin': |
|
148 | + $icon_class = 'linkedin'; |
|
149 | + break; |
|
150 | 150 | |
151 | - case 'pinterest': |
|
152 | - $icon_class = 'pinterest-p'; |
|
151 | + case 'pinterest': |
|
152 | + $icon_class = 'pinterest-p'; |
|
153 | 153 | |
154 | - default: |
|
155 | - break; |
|
156 | - } |
|
154 | + default: |
|
155 | + break; |
|
156 | + } |
|
157 | 157 | |
158 | - $social_profile_html .= '<a target="_blank" rel="noopener noreferrer" href="' . $meta_value . '"><i class="fa fa-' . $icon_class . '" aria-hidden="true"></i></a>'; |
|
159 | - } |
|
160 | - } |
|
158 | + $social_profile_html .= '<a target="_blank" rel="noopener noreferrer" href="' . $meta_value . '"><i class="fa fa-' . $icon_class . '" aria-hidden="true"></i></a>'; |
|
159 | + } |
|
160 | + } |
|
161 | 161 | |
162 | - if ( false !== $social_profile_html && '' !== $social_profile_html ) { |
|
163 | - $social_profile_html = $before . $social_profile_html . $after; |
|
162 | + if ( false !== $social_profile_html && '' !== $social_profile_html ) { |
|
163 | + $social_profile_html = $before . $social_profile_html . $after; |
|
164 | 164 | |
165 | - if ( $echo ) { |
|
166 | - echo wp_kses_post( $social_profile_html ); |
|
167 | - } else { |
|
168 | - return $social_profile_html; |
|
169 | - } |
|
170 | - } |
|
165 | + if ( $echo ) { |
|
166 | + echo wp_kses_post( $social_profile_html ); |
|
167 | + } else { |
|
168 | + return $social_profile_html; |
|
169 | + } |
|
170 | + } |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @subpackage template-tags |
183 | 183 | */ |
184 | 184 | function lsx_to_team_tagline( $before = '', $after = '', $echo = true ) { |
185 | - lsx_to_tagline( $before,$after,$echo ); |
|
185 | + lsx_to_tagline( $before,$after,$echo ); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -194,37 +194,37 @@ discard block |
||
194 | 194 | * @category team |
195 | 195 | */ |
196 | 196 | function lsx_to_has_team_member() { |
197 | - $tour_operator = tour_operator(); |
|
198 | - $tab = 'team'; |
|
199 | - $start_with = 'expert-'; |
|
200 | - $has_team = false; |
|
201 | - |
|
202 | - // Check if the team member panel has been disabled. |
|
203 | - if ( ! is_singular( 'team' ) && ! is_singular( 'review' ) ) { |
|
204 | - if ( is_object( $tour_operator ) && isset( $tour_operator->options[ $tab ] ) && is_array( $tour_operator->options[ $tab ] ) && isset( $tour_operator->options[ $tab ]['disable_team_panel'] ) ) { |
|
205 | - return false; |
|
206 | - } |
|
207 | - } |
|
208 | - |
|
209 | - if ( is_singular( 'team' ) || is_singular( 'review' ) ) { |
|
210 | - $has_team = has_post_thumbnail(); |
|
211 | - } elseif ( is_tax() ) { |
|
212 | - $has_team = lsx_to_has_custom_field_query( 'expert', get_queried_object()->term_id, true ); |
|
213 | - } else { |
|
214 | - $has_team = lsx_to_has_custom_field_query( 'team_to_' . get_post_type(), get_the_ID() ); |
|
215 | - } |
|
216 | - |
|
217 | - if ( false === $has_team ) { |
|
218 | - if ( is_object( $tour_operator ) && isset( $tour_operator->options[ $tab ] ) && is_array( $tour_operator->options[ $tab ] ) ) { |
|
219 | - foreach ( $tour_operator->options[ $tab ] as $key => $value ) { |
|
220 | - if ( substr( $key, 0, strlen( $start_with ) ) === $start_with ) { |
|
221 | - $has_team = true; |
|
222 | - break; |
|
223 | - } |
|
224 | - } |
|
225 | - } |
|
226 | - } |
|
227 | - return $has_team; |
|
197 | + $tour_operator = tour_operator(); |
|
198 | + $tab = 'team'; |
|
199 | + $start_with = 'expert-'; |
|
200 | + $has_team = false; |
|
201 | + |
|
202 | + // Check if the team member panel has been disabled. |
|
203 | + if ( ! is_singular( 'team' ) && ! is_singular( 'review' ) ) { |
|
204 | + if ( is_object( $tour_operator ) && isset( $tour_operator->options[ $tab ] ) && is_array( $tour_operator->options[ $tab ] ) && isset( $tour_operator->options[ $tab ]['disable_team_panel'] ) ) { |
|
205 | + return false; |
|
206 | + } |
|
207 | + } |
|
208 | + |
|
209 | + if ( is_singular( 'team' ) || is_singular( 'review' ) ) { |
|
210 | + $has_team = has_post_thumbnail(); |
|
211 | + } elseif ( is_tax() ) { |
|
212 | + $has_team = lsx_to_has_custom_field_query( 'expert', get_queried_object()->term_id, true ); |
|
213 | + } else { |
|
214 | + $has_team = lsx_to_has_custom_field_query( 'team_to_' . get_post_type(), get_the_ID() ); |
|
215 | + } |
|
216 | + |
|
217 | + if ( false === $has_team ) { |
|
218 | + if ( is_object( $tour_operator ) && isset( $tour_operator->options[ $tab ] ) && is_array( $tour_operator->options[ $tab ] ) ) { |
|
219 | + foreach ( $tour_operator->options[ $tab ] as $key => $value ) { |
|
220 | + if ( substr( $key, 0, strlen( $start_with ) ) === $start_with ) { |
|
221 | + $has_team = true; |
|
222 | + break; |
|
223 | + } |
|
224 | + } |
|
225 | + } |
|
226 | + } |
|
227 | + return $has_team; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -240,62 +240,62 @@ discard block |
||
240 | 240 | * @category team |
241 | 241 | */ |
242 | 242 | function lsx_to_team_member_panel( $before = '', $after = '' ) { |
243 | - $team_id = false; |
|
244 | - |
|
245 | - if ( is_tax() ) { |
|
246 | - $meta_key = 'expert'; |
|
247 | - $team_id = get_transient( get_queried_object()->term_id . '_' . $meta_key ); |
|
248 | - } else { |
|
249 | - $meta_key = 'team_to_' . get_post_type(); |
|
250 | - $team_id = get_transient( get_the_ID() . '_' . $meta_key ); |
|
251 | - } |
|
252 | - |
|
253 | - if ( false === $team_id ) { |
|
254 | - $tour_operator = tour_operator(); |
|
255 | - $tab = 'team'; |
|
256 | - $start_with = 'expert-'; |
|
257 | - $team_ids = array(); |
|
258 | - |
|
259 | - if ( is_object( $tour_operator ) && isset( $tour_operator->options[ $tab ] ) && is_array( $tour_operator->options[ $tab ] ) ) { |
|
260 | - foreach ( $tour_operator->options[ $tab ] as $key => $value ) { |
|
261 | - if ( substr( $key, 0, strlen( $start_with ) ) === $start_with ) { |
|
262 | - $team_ids[] = $value; |
|
263 | - } |
|
264 | - } |
|
265 | - } |
|
266 | - |
|
267 | - if ( count( $team_ids ) > 0 ) { |
|
268 | - $team_id = $team_ids[ array_rand( $team_ids ) ]; |
|
269 | - } |
|
270 | - } |
|
271 | - |
|
272 | - if ( false !== $team_id ) { |
|
273 | - $team_args = array( |
|
274 | - 'post_type' => 'team', |
|
275 | - 'post_status' => 'publish', |
|
276 | - 'p' => $team_id, |
|
277 | - ); |
|
278 | - |
|
279 | - $team = new WP_Query( $team_args ); |
|
280 | - |
|
281 | - if ( $team->have_posts() ) : |
|
282 | - echo wp_kses_post( $before ); |
|
283 | - |
|
284 | - while ( $team->have_posts() ) : |
|
285 | - global $post; |
|
286 | - |
|
287 | - $team->the_post(); |
|
288 | - |
|
289 | - $has_single = ! lsx_to_is_single_disabled(); |
|
290 | - $permalink = ''; |
|
291 | - |
|
292 | - if ( $has_single ) { |
|
293 | - $permalink = get_the_permalink(); |
|
294 | - } elseif ( ! is_post_type_archive( 'team' ) ) { |
|
295 | - $has_single = true; |
|
296 | - $permalink = get_post_type_archive_link( 'team' ) . '#team-' . $post->post_name; |
|
297 | - } |
|
298 | - ?> |
|
243 | + $team_id = false; |
|
244 | + |
|
245 | + if ( is_tax() ) { |
|
246 | + $meta_key = 'expert'; |
|
247 | + $team_id = get_transient( get_queried_object()->term_id . '_' . $meta_key ); |
|
248 | + } else { |
|
249 | + $meta_key = 'team_to_' . get_post_type(); |
|
250 | + $team_id = get_transient( get_the_ID() . '_' . $meta_key ); |
|
251 | + } |
|
252 | + |
|
253 | + if ( false === $team_id ) { |
|
254 | + $tour_operator = tour_operator(); |
|
255 | + $tab = 'team'; |
|
256 | + $start_with = 'expert-'; |
|
257 | + $team_ids = array(); |
|
258 | + |
|
259 | + if ( is_object( $tour_operator ) && isset( $tour_operator->options[ $tab ] ) && is_array( $tour_operator->options[ $tab ] ) ) { |
|
260 | + foreach ( $tour_operator->options[ $tab ] as $key => $value ) { |
|
261 | + if ( substr( $key, 0, strlen( $start_with ) ) === $start_with ) { |
|
262 | + $team_ids[] = $value; |
|
263 | + } |
|
264 | + } |
|
265 | + } |
|
266 | + |
|
267 | + if ( count( $team_ids ) > 0 ) { |
|
268 | + $team_id = $team_ids[ array_rand( $team_ids ) ]; |
|
269 | + } |
|
270 | + } |
|
271 | + |
|
272 | + if ( false !== $team_id ) { |
|
273 | + $team_args = array( |
|
274 | + 'post_type' => 'team', |
|
275 | + 'post_status' => 'publish', |
|
276 | + 'p' => $team_id, |
|
277 | + ); |
|
278 | + |
|
279 | + $team = new WP_Query( $team_args ); |
|
280 | + |
|
281 | + if ( $team->have_posts() ) : |
|
282 | + echo wp_kses_post( $before ); |
|
283 | + |
|
284 | + while ( $team->have_posts() ) : |
|
285 | + global $post; |
|
286 | + |
|
287 | + $team->the_post(); |
|
288 | + |
|
289 | + $has_single = ! lsx_to_is_single_disabled(); |
|
290 | + $permalink = ''; |
|
291 | + |
|
292 | + if ( $has_single ) { |
|
293 | + $permalink = get_the_permalink(); |
|
294 | + } elseif ( ! is_post_type_archive( 'team' ) ) { |
|
295 | + $has_single = true; |
|
296 | + $permalink = get_post_type_archive_link( 'team' ) . '#team-' . $post->post_name; |
|
297 | + } |
|
298 | + ?> |
|
299 | 299 | <article <?php post_class(); ?>> |
300 | 300 | <div class="lsx-to-contact-thumb"> |
301 | 301 | <?php if ( $has_single ) { ?><a href="<?php echo esc_url( $permalink ); ?>"><?php } ?> |
@@ -315,21 +315,21 @@ discard block |
||
315 | 315 | |
316 | 316 | <div class="lsx-to-contact-meta-data text-center hidden"> |
317 | 317 | <?php |
318 | - lsx_to_team_contact_number( '<span class="lsx-to-meta-data contact-number"><i class="fa fa-phone orange"></i> ', '</span>' ); |
|
319 | - lsx_to_team_contact_email( '<span class="lsx-to-meta-data email"><i class="fa fa-envelope orange"></i> ', '</span>' ); |
|
320 | - lsx_to_team_contact_skype( '<span class="lsx-to-meta-data skype"><i class="fa fa-skype orange"></i> ', '</span>' ); |
|
321 | - lsx_to_team_social_profiles( '<div class="lsx-to-meta-data lsx-to-contact-socials">', '</div>' ); |
|
322 | - ?> |
|
318 | + lsx_to_team_contact_number( '<span class="lsx-to-meta-data contact-number"><i class="fa fa-phone orange"></i> ', '</span>' ); |
|
319 | + lsx_to_team_contact_email( '<span class="lsx-to-meta-data email"><i class="fa fa-envelope orange"></i> ', '</span>' ); |
|
320 | + lsx_to_team_contact_skype( '<span class="lsx-to-meta-data skype"><i class="fa fa-skype orange"></i> ', '</span>' ); |
|
321 | + lsx_to_team_social_profiles( '<div class="lsx-to-meta-data lsx-to-contact-socials">', '</div>' ); |
|
322 | + ?> |
|
323 | 323 | </div> |
324 | 324 | </article> |
325 | 325 | <?php |
326 | - endwhile; |
|
326 | + endwhile; |
|
327 | 327 | |
328 | - echo wp_kses_post( $after ); |
|
328 | + echo wp_kses_post( $after ); |
|
329 | 329 | |
330 | - wp_reset_postdata(); |
|
331 | - endif; |
|
332 | - } |
|
330 | + wp_reset_postdata(); |
|
331 | + endif; |
|
332 | + } |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | /** |
@@ -340,20 +340,20 @@ discard block |
||
340 | 340 | * @category team |
341 | 341 | */ |
342 | 342 | function lsx_to_team_accommodation() { |
343 | - global $lsx_to_archive; |
|
344 | - |
|
345 | - if ( post_type_exists( 'accommodation' ) && is_singular( 'team' ) ) { |
|
346 | - $args = array( |
|
347 | - 'from' => 'accommodation', |
|
348 | - 'to' => 'team', |
|
349 | - 'column' => '3', |
|
350 | - // @codingStandardsIgnoreLine |
|
351 | - 'before' => '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __( lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ), 'to-team' ) . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', |
|
352 | - 'after' => '</div></div></section>', |
|
353 | - ); |
|
354 | - |
|
355 | - lsx_to_connected_panel_query( $args ); |
|
356 | - } |
|
343 | + global $lsx_to_archive; |
|
344 | + |
|
345 | + if ( post_type_exists( 'accommodation' ) && is_singular( 'team' ) ) { |
|
346 | + $args = array( |
|
347 | + 'from' => 'accommodation', |
|
348 | + 'to' => 'team', |
|
349 | + 'column' => '3', |
|
350 | + // @codingStandardsIgnoreLine |
|
351 | + 'before' => '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __( lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ), 'to-team' ) . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', |
|
352 | + 'after' => '</div></div></section>', |
|
353 | + ); |
|
354 | + |
|
355 | + lsx_to_connected_panel_query( $args ); |
|
356 | + } |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | /** |
@@ -364,20 +364,20 @@ discard block |
||
364 | 364 | * @category team |
365 | 365 | */ |
366 | 366 | function lsx_to_team_destination() { |
367 | - global $lsx_to_archive; |
|
368 | - |
|
369 | - if ( post_type_exists( 'destination' ) && is_singular( 'team' ) ) { |
|
370 | - $args = array( |
|
371 | - 'from' => 'destination', |
|
372 | - 'to' => 'team', |
|
373 | - 'column' => '3', |
|
374 | - // @codingStandardsIgnoreLine |
|
375 | - 'before' => '<section id="destination" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-destination">' . __( lsx_to_get_post_type_section_title( 'destination', '', 'Featured Destinations' ), 'to-team' ) . '</h2><div id="collapse-destination" class="collapse in"><div class="collapse-inner">', |
|
376 | - 'after' => '</div></div></section>', |
|
377 | - ); |
|
378 | - |
|
379 | - lsx_to_connected_panel_query( $args ); |
|
380 | - } |
|
367 | + global $lsx_to_archive; |
|
368 | + |
|
369 | + if ( post_type_exists( 'destination' ) && is_singular( 'team' ) ) { |
|
370 | + $args = array( |
|
371 | + 'from' => 'destination', |
|
372 | + 'to' => 'team', |
|
373 | + 'column' => '3', |
|
374 | + // @codingStandardsIgnoreLine |
|
375 | + 'before' => '<section id="destination" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-destination">' . __( lsx_to_get_post_type_section_title( 'destination', '', 'Featured Destinations' ), 'to-team' ) . '</h2><div id="collapse-destination" class="collapse in"><div class="collapse-inner">', |
|
376 | + 'after' => '</div></div></section>', |
|
377 | + ); |
|
378 | + |
|
379 | + lsx_to_connected_panel_query( $args ); |
|
380 | + } |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | /** |
@@ -388,20 +388,20 @@ discard block |
||
388 | 388 | * @category team |
389 | 389 | */ |
390 | 390 | function lsx_to_team_tours() { |
391 | - global $lsx_to_archive; |
|
392 | - |
|
393 | - if ( post_type_exists( 'tour' ) && is_singular( 'team' ) ) { |
|
394 | - $args = array( |
|
395 | - 'from' => 'tour', |
|
396 | - 'to' => 'team', |
|
397 | - 'column' => '3', |
|
398 | - // @codingStandardsIgnoreLine |
|
399 | - 'before' => '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __( lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ), 'to-team' ) . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', |
|
400 | - 'after' => '</div></div></section>', |
|
401 | - ); |
|
402 | - |
|
403 | - lsx_to_connected_panel_query( $args ); |
|
404 | - } |
|
391 | + global $lsx_to_archive; |
|
392 | + |
|
393 | + if ( post_type_exists( 'tour' ) && is_singular( 'team' ) ) { |
|
394 | + $args = array( |
|
395 | + 'from' => 'tour', |
|
396 | + 'to' => 'team', |
|
397 | + 'column' => '3', |
|
398 | + // @codingStandardsIgnoreLine |
|
399 | + 'before' => '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __( lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ), 'to-team' ) . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', |
|
400 | + 'after' => '</div></div></section>', |
|
401 | + ); |
|
402 | + |
|
403 | + lsx_to_connected_panel_query( $args ); |
|
404 | + } |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | /** |
@@ -412,20 +412,20 @@ discard block |
||
412 | 412 | * @category team |
413 | 413 | */ |
414 | 414 | function lsx_to_team_reviews() { |
415 | - global $lsx_to_archive; |
|
416 | - |
|
417 | - if ( post_type_exists( 'review' ) && is_singular( 'team' ) ) { |
|
418 | - $args = array( |
|
419 | - 'from' => 'review', |
|
420 | - 'to' => 'team', |
|
421 | - 'column' => '2', |
|
422 | - // @codingStandardsIgnoreLine |
|
423 | - 'before' => '<section id="reviews" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-reviews">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Featured Reviews' ), 'to-team' ) . '</h2><div id="collapse-reviews" class="collapse in"><div class="collapse-inner">', |
|
424 | - 'after' => '</div></div></section>', |
|
425 | - ); |
|
426 | - |
|
427 | - lsx_to_connected_panel_query( $args ); |
|
428 | - } |
|
415 | + global $lsx_to_archive; |
|
416 | + |
|
417 | + if ( post_type_exists( 'review' ) && is_singular( 'team' ) ) { |
|
418 | + $args = array( |
|
419 | + 'from' => 'review', |
|
420 | + 'to' => 'team', |
|
421 | + 'column' => '2', |
|
422 | + // @codingStandardsIgnoreLine |
|
423 | + 'before' => '<section id="reviews" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-reviews">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Featured Reviews' ), 'to-team' ) . '</h2><div id="collapse-reviews" class="collapse in"><div class="collapse-inner">', |
|
424 | + 'after' => '</div></div></section>', |
|
425 | + ); |
|
426 | + |
|
427 | + lsx_to_connected_panel_query( $args ); |
|
428 | + } |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | /** |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | * @category connections |
442 | 442 | */ |
443 | 443 | function lsx_to_connected_team( $before = '', $after = '', $echo = true ) { |
444 | - lsx_to_connected_items_query( 'team', get_post_type(), $before, $after, $echo ); |
|
444 | + lsx_to_connected_items_query( 'team', get_post_type(), $before, $after, $echo ); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | /** |
@@ -452,18 +452,18 @@ discard block |
||
452 | 452 | * @category team |
453 | 453 | */ |
454 | 454 | function lsx_to_team_posts() { |
455 | - //$site_user = get_post_meta( get_the_ID(), 'site_user', true ); |
|
456 | - |
|
457 | - if ( post_type_exists( 'post' ) && is_singular( 'team' ) ) { |
|
458 | - $args = array( |
|
459 | - 'from' => 'post', |
|
460 | - 'to' => 'team', |
|
461 | - 'column' => '3', |
|
462 | - // @codingStandardsIgnoreLine |
|
463 | - 'before' => '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . __( lsx_to_get_post_type_section_title( 'post', '', 'Featured Posts' ), 'to-team' ) . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', |
|
464 | - 'after' => '</div></div></section>', |
|
465 | - ); |
|
466 | - |
|
467 | - lsx_to_connected_panel_query( $args ); |
|
468 | - } |
|
455 | + //$site_user = get_post_meta( get_the_ID(), 'site_user', true ); |
|
456 | + |
|
457 | + if ( post_type_exists( 'post' ) && is_singular( 'team' ) ) { |
|
458 | + $args = array( |
|
459 | + 'from' => 'post', |
|
460 | + 'to' => 'team', |
|
461 | + 'column' => '3', |
|
462 | + // @codingStandardsIgnoreLine |
|
463 | + 'before' => '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . __( lsx_to_get_post_type_section_title( 'post', '', 'Featured Posts' ), 'to-team' ) . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', |
|
464 | + 'after' => '</div></div></section>', |
|
465 | + ); |
|
466 | + |
|
467 | + lsx_to_connected_panel_query( $args ); |
|
468 | + } |
|
469 | 469 | } |
@@ -12,190 +12,190 @@ |
||
12 | 12 | global $lsx_to_team; |
13 | 13 | |
14 | 14 | $metabox = array( |
15 | - 'title' => esc_html__( 'Tour Operator Plugin', 'to-team' ), |
|
16 | - 'pages' => 'team', |
|
17 | - 'fields' => array(), |
|
15 | + 'title' => esc_html__( 'Tour Operator Plugin', 'to-team' ), |
|
16 | + 'pages' => 'team', |
|
17 | + 'fields' => array(), |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | $metabox['fields'][] = array( |
21 | - 'id' => 'featured', |
|
22 | - 'name' => esc_html__( 'Featured', 'to-team' ), |
|
23 | - 'type' => 'checkbox', |
|
21 | + 'id' => 'featured', |
|
22 | + 'name' => esc_html__( 'Featured', 'to-team' ), |
|
23 | + 'type' => 'checkbox', |
|
24 | 24 | ); |
25 | 25 | |
26 | 26 | $metabox['fields'][] = array( |
27 | - 'id' => 'disable_single', |
|
28 | - 'name' => esc_html__( 'Disable Single', 'to-team' ), |
|
29 | - 'type' => 'checkbox', |
|
27 | + 'id' => 'disable_single', |
|
28 | + 'name' => esc_html__( 'Disable Single', 'to-team' ), |
|
29 | + 'type' => 'checkbox', |
|
30 | 30 | ); |
31 | 31 | |
32 | 32 | if ( ! class_exists( 'LSX_Banners' ) ) { |
33 | - $metabox['fields'][] = array( |
|
34 | - 'id' => 'tagline', |
|
35 | - 'name' => esc_html__( 'Tagline', 'to-team' ), |
|
36 | - 'type' => 'text', |
|
37 | - ); |
|
33 | + $metabox['fields'][] = array( |
|
34 | + 'id' => 'tagline', |
|
35 | + 'name' => esc_html__( 'Tagline', 'to-team' ), |
|
36 | + 'type' => 'text', |
|
37 | + ); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $metabox['fields'][] = array( |
41 | - 'id' => 'role', |
|
42 | - 'name' => esc_html__( 'Role', 'to-team' ), |
|
43 | - 'type' => 'text', |
|
41 | + 'id' => 'role', |
|
42 | + 'name' => esc_html__( 'Role', 'to-team' ), |
|
43 | + 'type' => 'text', |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | $metabox['fields'][] = array( |
47 | - 'name' => esc_html__( 'Site User', 'to-team' ), |
|
48 | - 'id' => 'site_user', |
|
49 | - 'allow_none' => true, |
|
50 | - 'type' => 'select', |
|
51 | - 'options' => $lsx_to_team->site_users, |
|
47 | + 'name' => esc_html__( 'Site User', 'to-team' ), |
|
48 | + 'id' => 'site_user', |
|
49 | + 'allow_none' => true, |
|
50 | + 'type' => 'select', |
|
51 | + 'options' => $lsx_to_team->site_users, |
|
52 | 52 | ); |
53 | 53 | |
54 | 54 | $metabox['fields'][] = array( |
55 | - 'id' => 'contact_title', |
|
56 | - 'name' => esc_html__( 'Contact', 'to-team' ), |
|
57 | - 'type' => 'title', |
|
55 | + 'id' => 'contact_title', |
|
56 | + 'name' => esc_html__( 'Contact', 'to-team' ), |
|
57 | + 'type' => 'title', |
|
58 | 58 | ); |
59 | 59 | |
60 | 60 | $metabox['fields'][] = array( |
61 | - 'id' => 'contact_email', |
|
62 | - 'name' => esc_html__( 'Email', 'to-team' ), |
|
63 | - 'type' => 'text', |
|
61 | + 'id' => 'contact_email', |
|
62 | + 'name' => esc_html__( 'Email', 'to-team' ), |
|
63 | + 'type' => 'text', |
|
64 | 64 | ); |
65 | 65 | |
66 | 66 | $metabox['fields'][] = array( |
67 | - 'id' => 'contact_number', |
|
68 | - 'name' => esc_html__( 'Number (international format)', 'to-team' ), |
|
69 | - 'type' => 'text', |
|
67 | + 'id' => 'contact_number', |
|
68 | + 'name' => esc_html__( 'Number (international format)', 'to-team' ), |
|
69 | + 'type' => 'text', |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | $metabox['fields'][] = array( |
73 | - 'id' => 'skype', |
|
74 | - 'name' => esc_html__( 'Skype', 'to-team' ), |
|
75 | - 'type' => 'text', |
|
73 | + 'id' => 'skype', |
|
74 | + 'name' => esc_html__( 'Skype', 'to-team' ), |
|
75 | + 'type' => 'text', |
|
76 | 76 | ); |
77 | 77 | |
78 | 78 | $metabox['fields'][] = array( |
79 | - 'id' => 'social_title', |
|
80 | - 'name' => esc_html__( 'Social Profiles', 'to-team' ), |
|
81 | - 'type' => 'title', |
|
79 | + 'id' => 'social_title', |
|
80 | + 'name' => esc_html__( 'Social Profiles', 'to-team' ), |
|
81 | + 'type' => 'title', |
|
82 | 82 | ); |
83 | 83 | |
84 | 84 | $metabox['fields'][] = array( |
85 | - 'id' => 'facebook', |
|
86 | - 'name' => esc_html__( 'Facebook', 'to-team' ), |
|
87 | - 'type' => 'text', |
|
85 | + 'id' => 'facebook', |
|
86 | + 'name' => esc_html__( 'Facebook', 'to-team' ), |
|
87 | + 'type' => 'text', |
|
88 | 88 | ); |
89 | 89 | |
90 | 90 | $metabox['fields'][] = array( |
91 | - 'id' => 'twitter', |
|
92 | - 'name' => esc_html__( 'Twitter', 'to-team' ), |
|
93 | - 'type' => 'text', |
|
91 | + 'id' => 'twitter', |
|
92 | + 'name' => esc_html__( 'Twitter', 'to-team' ), |
|
93 | + 'type' => 'text', |
|
94 | 94 | ); |
95 | 95 | |
96 | 96 | $metabox['fields'][] = array( |
97 | - 'id' => 'googleplus', |
|
98 | - 'name' => esc_html__( 'Google Plus', 'to-team' ), |
|
99 | - 'type' => 'text', |
|
97 | + 'id' => 'googleplus', |
|
98 | + 'name' => esc_html__( 'Google Plus', 'to-team' ), |
|
99 | + 'type' => 'text', |
|
100 | 100 | ); |
101 | 101 | |
102 | 102 | $metabox['fields'][] = array( |
103 | - 'id' => 'linkedin', |
|
104 | - 'name' => esc_html__( 'LinkedIn', 'to-team' ), |
|
105 | - 'type' => 'text', |
|
103 | + 'id' => 'linkedin', |
|
104 | + 'name' => esc_html__( 'LinkedIn', 'to-team' ), |
|
105 | + 'type' => 'text', |
|
106 | 106 | ); |
107 | 107 | |
108 | 108 | $metabox['fields'][] = array( |
109 | - 'id' => 'pinterest', |
|
110 | - 'name' => esc_html__( 'Pinterest', 'to-team' ), |
|
111 | - 'type' => 'text', |
|
109 | + 'id' => 'pinterest', |
|
110 | + 'name' => esc_html__( 'Pinterest', 'to-team' ), |
|
111 | + 'type' => 'text', |
|
112 | 112 | ); |
113 | 113 | |
114 | 114 | $metabox['fields'][] = array( |
115 | - 'id' => 'gallery_title', |
|
116 | - 'name' => esc_html__( 'Gallery', 'to-team' ), |
|
117 | - 'type' => 'title', |
|
115 | + 'id' => 'gallery_title', |
|
116 | + 'name' => esc_html__( 'Gallery', 'to-team' ), |
|
117 | + 'type' => 'title', |
|
118 | 118 | ); |
119 | 119 | |
120 | 120 | $metabox['fields'][] = array( |
121 | - 'id' => 'gallery', |
|
122 | - 'name' => '', |
|
123 | - 'type' => 'image', |
|
124 | - 'repeatable' => true, |
|
125 | - 'show_size' => false, |
|
126 | - 'sortable' => true, |
|
127 | - 'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ), |
|
121 | + 'id' => 'gallery', |
|
122 | + 'name' => '', |
|
123 | + 'type' => 'image', |
|
124 | + 'repeatable' => true, |
|
125 | + 'show_size' => false, |
|
126 | + 'sortable' => true, |
|
127 | + 'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ), |
|
128 | 128 | ); |
129 | 129 | |
130 | 130 | if ( class_exists( 'Envira_Gallery' ) ) { |
131 | - $metabox['fields'][] = array( |
|
132 | - 'id' => 'envira_title', |
|
133 | - 'name' => esc_html__( 'Envira Gallery', 'to-team' ), |
|
134 | - 'type' => 'title', |
|
135 | - ); |
|
136 | - |
|
137 | - $metabox['fields'][] = array( |
|
138 | - 'id' => 'envira_gallery', |
|
139 | - 'name' => esc_html__( 'Envira Gallery', 'to-team' ), |
|
140 | - 'type' => 'post_select', |
|
141 | - 'use_ajax' => false, |
|
142 | - 'allow_none' => true, |
|
143 | - 'query' => array( |
|
144 | - 'post_type' => 'envira', |
|
145 | - 'nopagin' => true, |
|
146 | - 'posts_per_page' => '-1', |
|
147 | - 'orderby' => 'title', |
|
148 | - 'order' => 'ASC', |
|
149 | - ), |
|
150 | - ); |
|
151 | - |
|
152 | - if ( class_exists( 'Envira_Videos' ) ) { |
|
153 | - $metabox['fields'][] = array( |
|
154 | - 'id' => 'envira_video', |
|
155 | - 'name' => esc_html__( 'Envira Video Gallery', 'to-team' ), |
|
156 | - 'type' => 'post_select', |
|
157 | - 'use_ajax' => false, |
|
158 | - 'allow_none' => true, |
|
159 | - 'query' => array( |
|
160 | - 'post_type' => 'envira', |
|
161 | - 'nopagin' => true, |
|
162 | - 'posts_per_page' => '-1', |
|
163 | - 'orderby' => 'title', |
|
164 | - 'order' => 'ASC', |
|
165 | - ), |
|
166 | - ); |
|
167 | - } |
|
131 | + $metabox['fields'][] = array( |
|
132 | + 'id' => 'envira_title', |
|
133 | + 'name' => esc_html__( 'Envira Gallery', 'to-team' ), |
|
134 | + 'type' => 'title', |
|
135 | + ); |
|
136 | + |
|
137 | + $metabox['fields'][] = array( |
|
138 | + 'id' => 'envira_gallery', |
|
139 | + 'name' => esc_html__( 'Envira Gallery', 'to-team' ), |
|
140 | + 'type' => 'post_select', |
|
141 | + 'use_ajax' => false, |
|
142 | + 'allow_none' => true, |
|
143 | + 'query' => array( |
|
144 | + 'post_type' => 'envira', |
|
145 | + 'nopagin' => true, |
|
146 | + 'posts_per_page' => '-1', |
|
147 | + 'orderby' => 'title', |
|
148 | + 'order' => 'ASC', |
|
149 | + ), |
|
150 | + ); |
|
151 | + |
|
152 | + if ( class_exists( 'Envira_Videos' ) ) { |
|
153 | + $metabox['fields'][] = array( |
|
154 | + 'id' => 'envira_video', |
|
155 | + 'name' => esc_html__( 'Envira Video Gallery', 'to-team' ), |
|
156 | + 'type' => 'post_select', |
|
157 | + 'use_ajax' => false, |
|
158 | + 'allow_none' => true, |
|
159 | + 'query' => array( |
|
160 | + 'post_type' => 'envira', |
|
161 | + 'nopagin' => true, |
|
162 | + 'posts_per_page' => '-1', |
|
163 | + 'orderby' => 'title', |
|
164 | + 'order' => 'ASC', |
|
165 | + ), |
|
166 | + ); |
|
167 | + } |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $post_types = array( |
171 | - 'accommodation' => esc_html__( 'Accommodation', 'to-team' ), |
|
172 | - 'destination' => esc_html__( 'Destinations', 'to-team' ), |
|
173 | - 'tour' => esc_html__( 'Tours', 'to-team' ), |
|
174 | - 'post' => esc_html__( 'Posts', 'to-team' ), |
|
171 | + 'accommodation' => esc_html__( 'Accommodation', 'to-team' ), |
|
172 | + 'destination' => esc_html__( 'Destinations', 'to-team' ), |
|
173 | + 'tour' => esc_html__( 'Tours', 'to-team' ), |
|
174 | + 'post' => esc_html__( 'Posts', 'to-team' ), |
|
175 | 175 | ); |
176 | 176 | |
177 | 177 | foreach ( $post_types as $slug => $label ) { |
178 | - $metabox['fields'][] = array( |
|
179 | - 'id' => $slug . '_title', |
|
180 | - 'name' => $label, |
|
181 | - 'type' => 'title', |
|
182 | - ); |
|
183 | - |
|
184 | - $metabox['fields'][] = array( |
|
185 | - 'id' => $slug . '_to_team', |
|
186 | - 'name' => $label . esc_html__( ' related with this team', 'to-team' ), |
|
187 | - 'type' => 'post_select', |
|
188 | - 'use_ajax' => false, |
|
189 | - 'repeatable' => true, |
|
190 | - 'allow_none' => true, |
|
191 | - 'query' => array( |
|
192 | - 'post_type' => $slug, |
|
193 | - 'nopagin' => true, |
|
194 | - 'posts_per_page' => '-1', |
|
195 | - 'orderby' => 'title', |
|
196 | - 'order' => 'ASC', |
|
197 | - ), |
|
198 | - ); |
|
178 | + $metabox['fields'][] = array( |
|
179 | + 'id' => $slug . '_title', |
|
180 | + 'name' => $label, |
|
181 | + 'type' => 'title', |
|
182 | + ); |
|
183 | + |
|
184 | + $metabox['fields'][] = array( |
|
185 | + 'id' => $slug . '_to_team', |
|
186 | + 'name' => $label . esc_html__( ' related with this team', 'to-team' ), |
|
187 | + 'type' => 'post_select', |
|
188 | + 'use_ajax' => false, |
|
189 | + 'repeatable' => true, |
|
190 | + 'allow_none' => true, |
|
191 | + 'query' => array( |
|
192 | + 'post_type' => $slug, |
|
193 | + 'nopagin' => true, |
|
194 | + 'posts_per_page' => '-1', |
|
195 | + 'orderby' => 'title', |
|
196 | + 'order' => 'ASC', |
|
197 | + ), |
|
198 | + ); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | $metabox['fields'] = apply_filters( 'lsx_to_team_custom_fields', $metabox['fields'] ); |
@@ -10,31 +10,31 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | $taxonomy = array( |
13 | - 'object_types' => 'team', |
|
14 | - 'menu_position' => 77, |
|
15 | - 'args' => array( |
|
16 | - 'hierarchical' => true, |
|
17 | - 'labels' => array( |
|
18 | - 'name' => esc_html__( 'Roles', 'to-team' ), |
|
19 | - 'singular_name' => esc_html__( 'Role', 'to-team' ), |
|
20 | - 'search_items' => esc_html__( 'Search Roles', 'to-team' ), |
|
21 | - 'all_items' => esc_html__( 'Roles', 'to-team' ), |
|
22 | - 'parent_item' => esc_html__( 'Parent', 'to-team' ), |
|
23 | - 'parent_item_colon' => esc_html__( 'Parent:', 'to-team' ), |
|
24 | - 'edit_item' => esc_html__( 'Edit Role', 'to-team' ), |
|
25 | - 'update_item' => esc_html__( 'Update Role', 'to-team' ), |
|
26 | - 'add_new_item' => esc_html__( 'Add New Role', 'to-team' ), |
|
27 | - 'new_item_name' => esc_html__( 'New Role', 'to-team' ), |
|
28 | - 'menu_name' => esc_html__( 'Roles', 'to-team' ), |
|
29 | - ), |
|
30 | - 'show_ui' => true, |
|
31 | - 'public' => true, |
|
32 | - 'show_tagcloud' => false, |
|
33 | - 'exclude_from_search' => true, |
|
34 | - 'show_admin_column' => true, |
|
35 | - 'query_var' => true, |
|
36 | - 'rewrite' => array( 'role' ), |
|
37 | - ), |
|
13 | + 'object_types' => 'team', |
|
14 | + 'menu_position' => 77, |
|
15 | + 'args' => array( |
|
16 | + 'hierarchical' => true, |
|
17 | + 'labels' => array( |
|
18 | + 'name' => esc_html__( 'Roles', 'to-team' ), |
|
19 | + 'singular_name' => esc_html__( 'Role', 'to-team' ), |
|
20 | + 'search_items' => esc_html__( 'Search Roles', 'to-team' ), |
|
21 | + 'all_items' => esc_html__( 'Roles', 'to-team' ), |
|
22 | + 'parent_item' => esc_html__( 'Parent', 'to-team' ), |
|
23 | + 'parent_item_colon' => esc_html__( 'Parent:', 'to-team' ), |
|
24 | + 'edit_item' => esc_html__( 'Edit Role', 'to-team' ), |
|
25 | + 'update_item' => esc_html__( 'Update Role', 'to-team' ), |
|
26 | + 'add_new_item' => esc_html__( 'Add New Role', 'to-team' ), |
|
27 | + 'new_item_name' => esc_html__( 'New Role', 'to-team' ), |
|
28 | + 'menu_name' => esc_html__( 'Roles', 'to-team' ), |
|
29 | + ), |
|
30 | + 'show_ui' => true, |
|
31 | + 'public' => true, |
|
32 | + 'show_tagcloud' => false, |
|
33 | + 'exclude_from_search' => true, |
|
34 | + 'show_admin_column' => true, |
|
35 | + 'query_var' => true, |
|
36 | + 'rewrite' => array( 'role' ), |
|
37 | + ), |
|
38 | 38 | ); |
39 | 39 | |
40 | 40 | return $taxonomy; |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | ?> |
9 | 9 | |
10 | 10 | <?php |
11 | - $description = term_description(); |
|
12 | - if ( ! empty( $description ) ) : |
|
11 | + $description = term_description(); |
|
12 | + if ( ! empty( $description ) ) : |
|
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class="lsx-to-archive-header row"> |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | <div class="col-xs-12 col-sm-12 col-md-6"> |
22 | 22 | <div class="lsx-to-contact-widget"> |
23 | 23 | <?php |
24 | - if ( function_exists( 'lsx_to_has_team_member' ) && lsx_to_has_team_member() ) { |
|
25 | - lsx_to_team_member_panel( '<div class="lsx-to-contact">', '</div>' ); |
|
26 | - } else { |
|
27 | - lsx_to_enquiry_contact( '<div class="lsx-to-contact">', '</div>' ); |
|
28 | - } |
|
24 | + if ( function_exists( 'lsx_to_has_team_member' ) && lsx_to_has_team_member() ) { |
|
25 | + lsx_to_team_member_panel( '<div class="lsx-to-contact">', '</div>' ); |
|
26 | + } else { |
|
27 | + lsx_to_enquiry_contact( '<div class="lsx-to-contact">', '</div>' ); |
|
28 | + } |
|
29 | 29 | |
30 | - lsx_to_enquire_modal(); |
|
31 | - ?> |
|
30 | + lsx_to_enquire_modal(); |
|
31 | + ?> |
|
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <?php endif ?> |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | $permalink = ''; |
16 | 16 | |
17 | 17 | if ( $has_single ) { |
18 | - $permalink = get_the_permalink(); |
|
18 | + $permalink = get_the_permalink(); |
|
19 | 19 | } elseif ( ! is_post_type_archive( 'team' ) ) { |
20 | - $has_single = true; |
|
21 | - $permalink = get_post_type_archive_link( 'team' ) . '#team-' . $post->post_name; |
|
20 | + $has_single = true; |
|
21 | + $permalink = get_post_type_archive_link( 'team' ) . '#team-' . $post->post_name; |
|
22 | 22 | } |
23 | 23 | ?> |
24 | 24 | <article <?php post_class(); ?>> |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | </h4> |
38 | 38 | |
39 | 39 | <?php |
40 | - if ( empty( $disable_text ) ) { |
|
41 | - lsx_to_team_role( '<p class="lsx-to-widget-tagline text-center">', '</p>' ); |
|
40 | + if ( empty( $disable_text ) ) { |
|
41 | + lsx_to_team_role( '<p class="lsx-to-widget-tagline text-center">', '</p>' ); |
|
42 | 42 | |
43 | - $member_description = apply_filters( 'the_excerpt', get_the_excerpt() ); |
|
43 | + $member_description = apply_filters( 'the_excerpt', get_the_excerpt() ); |
|
44 | 44 | |
45 | - if ( empty( $member_description ) ) { |
|
46 | - $member_description = apply_filters( 'the_excerpt', wp_trim_words( $post->post_content, 20 ) ); |
|
47 | - } |
|
45 | + if ( empty( $member_description ) ) { |
|
46 | + $member_description = apply_filters( 'the_excerpt', wp_trim_words( $post->post_content, 20 ) ); |
|
47 | + } |
|
48 | 48 | |
49 | - $member_description = ! empty( $member_description ) ? "<div class='lsx-team-description'>$member_description</div>" : ''; |
|
50 | - echo wp_kses_post( $member_description ); |
|
51 | - } |
|
52 | - ?> |
|
49 | + $member_description = ! empty( $member_description ) ? "<div class='lsx-team-description'>$member_description</div>" : ''; |
|
50 | + echo wp_kses_post( $member_description ); |
|
51 | + } |
|
52 | + ?> |
|
53 | 53 | |
54 | 54 | <?php if ( $has_single && empty( $disable_view_more ) ) { ?> |
55 | 55 | <p class="text-center lsx-to-single-link"><a href="<?php echo esc_url( $permalink ); ?>"><?php echo esc_html__( 'More about', 'to-team' ) . ' ' . esc_html( strtok( $member_name, ' ' ) ); ?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></p> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | global $lsx_to_archive, $post; |
10 | 10 | |
11 | 11 | if ( 1 !== $lsx_to_archive ) { |
12 | - $lsx_to_archive = false; |
|
12 | + $lsx_to_archive = false; |
|
13 | 13 | } |
14 | 14 | ?> |
15 | 15 | |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | |
30 | 30 | <ul class="lsx-to-team-contact list-inline"> |
31 | 31 | <?php |
32 | - lsx_to_team_contact_number( '<li><i class="fa fa-phone orange"></i> ', '</li>' ); |
|
33 | - lsx_to_team_contact_email( '<li><i class="fa fa-envelope orange"></i> ', '</li>' ); |
|
34 | - lsx_to_team_contact_skype( '<li><i class="fa fa-skype orange"></i> ', '</li>' ); |
|
35 | - ?> |
|
32 | + lsx_to_team_contact_number( '<li><i class="fa fa-phone orange"></i> ', '</li>' ); |
|
33 | + lsx_to_team_contact_email( '<li><i class="fa fa-envelope orange"></i> ', '</li>' ); |
|
34 | + lsx_to_team_contact_skype( '<li><i class="fa fa-skype orange"></i> ', '</li>' ); |
|
35 | + ?> |
|
36 | 36 | </ul> |
37 | 37 | </div> |
38 | 38 | </div> |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | |
42 | 42 | <div <?php lsx_to_entry_class( 'entry-content' ); ?>> |
43 | 43 | <?php |
44 | - lsx_to_entry_content_top(); |
|
45 | - the_excerpt(); |
|
46 | - lsx_to_entry_content_bottom(); |
|
47 | - ?> |
|
44 | + lsx_to_entry_content_top(); |
|
45 | + the_excerpt(); |
|
46 | + lsx_to_entry_content_bottom(); |
|
47 | + ?> |
|
48 | 48 | </div> |
49 | 49 | |
50 | 50 | <?php } ?> |
@@ -21,35 +21,35 @@ |
||
21 | 21 | <?php if ( have_posts() ) : ?> |
22 | 22 | |
23 | 23 | <?php |
24 | - $header_before = ''; |
|
25 | - $group_items_by_role = false; |
|
24 | + $header_before = ''; |
|
25 | + $group_items_by_role = false; |
|
26 | 26 | |
27 | - if ( isset( tour_operator()->options['team'] ) && isset( tour_operator()->options['team']['group_items_by_role'] ) ) { |
|
28 | - $group_items_by_role = true; |
|
29 | - } |
|
27 | + if ( isset( tour_operator()->options['team'] ) && isset( tour_operator()->options['team']['group_items_by_role'] ) ) { |
|
28 | + $group_items_by_role = true; |
|
29 | + } |
|
30 | 30 | |
31 | - $count = 0; |
|
32 | - ?> |
|
31 | + $count = 0; |
|
32 | + ?> |
|
33 | 33 | |
34 | 34 | <?php while ( have_posts() ) : the_post(); ?> |
35 | 35 | |
36 | 36 | <?php |
37 | - if ( true === $group_items_by_role ) { |
|
38 | - $header_current = get_the_terms( get_the_id(), 'role' ); |
|
39 | - $header_html = ''; |
|
40 | - |
|
41 | - if ( ! is_wp_error( $header_current ) && is_array( $header_current ) && ! empty( $header_current ) ) { |
|
42 | - $header_current = $header_current[0]->name; |
|
43 | - |
|
44 | - if ( $header_before !== $header_current ) { |
|
45 | - $header_html = '<h3 class="lsx-to-archive-items-separator lsx-title">' . $header_current . '</h3>'; |
|
46 | - $header_before = $header_current; |
|
47 | - } |
|
48 | - } |
|
49 | - } |
|
50 | - |
|
51 | - $count++; |
|
52 | - ?> |
|
37 | + if ( true === $group_items_by_role ) { |
|
38 | + $header_current = get_the_terms( get_the_id(), 'role' ); |
|
39 | + $header_html = ''; |
|
40 | + |
|
41 | + if ( ! is_wp_error( $header_current ) && is_array( $header_current ) && ! empty( $header_current ) ) { |
|
42 | + $header_current = $header_current[0]->name; |
|
43 | + |
|
44 | + if ( $header_before !== $header_current ) { |
|
45 | + $header_html = '<h3 class="lsx-to-archive-items-separator lsx-title">' . $header_current . '</h3>'; |
|
46 | + $header_before = $header_current; |
|
47 | + } |
|
48 | + } |
|
49 | + } |
|
50 | + |
|
51 | + $count++; |
|
52 | + ?> |
|
53 | 53 | |
54 | 54 | <?php if ( $count > 1 && true === $group_items_by_role && ! empty( $header_html ) ) { ?> |
55 | 55 | </div> |
@@ -11,256 +11,256 @@ |
||
11 | 11 | |
12 | 12 | if ( ! class_exists( 'LSX_TO_Team' ) ) { |
13 | 13 | |
14 | - /** |
|
15 | - * Main plugin class. |
|
16 | - * |
|
17 | - * @package LSX_TO_Team |
|
18 | - * @author LightSpeed |
|
19 | - */ |
|
20 | - class LSX_TO_Team { |
|
21 | - |
|
22 | - /** |
|
23 | - * The plugins id |
|
24 | - */ |
|
25 | - public $plugin_slug = 'to-team'; |
|
26 | - |
|
27 | - /** |
|
28 | - * The post types the plugin registers |
|
29 | - */ |
|
30 | - public $post_types = false; |
|
31 | - |
|
32 | - /** |
|
33 | - * The singular post types the plugin registers |
|
34 | - */ |
|
35 | - public $post_types_singular = false; |
|
36 | - |
|
37 | - /** |
|
38 | - * An array of the post types slugs plugin registers |
|
39 | - */ |
|
40 | - public $post_type_slugs = false; |
|
41 | - |
|
42 | - /** |
|
43 | - * The taxonomies the plugin registers |
|
44 | - */ |
|
45 | - public $taxonomies = false; |
|
46 | - |
|
47 | - /** |
|
48 | - * The taxonomies the plugin registers (plural) |
|
49 | - */ |
|
50 | - public $taxonomies_plural = false; |
|
51 | - |
|
52 | - /** |
|
53 | - * Site users |
|
54 | - */ |
|
55 | - public $site_users = array(); |
|
56 | - |
|
57 | - /** |
|
58 | - * Constructor |
|
59 | - */ |
|
60 | - public function __construct() { |
|
61 | - // Set the variables. |
|
62 | - $this->set_vars(); |
|
63 | - $this->lsx_to_search_integration(); |
|
64 | - |
|
65 | - // Make TO last plugin to load. |
|
66 | - add_action( 'activated_plugin', array( $this, 'activated_plugin' ) ); |
|
67 | - |
|
68 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
69 | - |
|
70 | - if ( false !== $this->post_types ) { |
|
71 | - add_filter( 'lsx_to_framework_post_types', array( $this, 'post_types_filter' ) ); |
|
72 | - add_filter( 'lsx_to_post_types', array( $this, 'post_types_filter' ) ); |
|
73 | - add_filter( 'lsx_to_post_types_singular', array( $this, 'post_types_singular_filter' ) ); |
|
74 | - add_filter( 'lsx_to_settings_path', array( $this, 'plugin_path' ), 10, 2 ); |
|
75 | - } |
|
76 | - if ( false !== $this->taxonomies ) { |
|
77 | - add_filter( 'lsx_to_framework_taxonomies', array( $this, 'taxonomies_filter' ) ); |
|
78 | - add_filter( 'lsx_to_framework_taxonomies_plural', array( $this, 'taxonomies_plural_filter' ) ); |
|
79 | - } |
|
80 | - |
|
81 | - require_once LSX_TO_TEAM_PATH . '/classes/class-lsx-to-team-admin.php'; |
|
82 | - require_once LSX_TO_TEAM_PATH . '/classes/class-lsx-to-team-frontend.php'; |
|
83 | - require_once LSX_TO_TEAM_PATH . '/includes/template-tags.php'; |
|
84 | - |
|
85 | - // flush_rewrite_rules. |
|
86 | - register_activation_hook( LSX_TO_TEAM_CORE, array( $this, 'register_activation_hook' ) ); |
|
87 | - add_action( 'admin_init', array( $this, 'register_activation_hook_check' ) ); |
|
88 | - add_filter( 'wpseo_schema_graph_pieces', array( $this, 'add_graph_pieces' ), 11, 2 ); |
|
89 | - } |
|
90 | - |
|
91 | - /** |
|
92 | - * Include the post type for the search integration |
|
93 | - */ |
|
94 | - public function lsx_to_search_integration() { |
|
95 | - add_filter( 'lsx_to_search_post_types', array( $this, 'post_types_filter' ) ); |
|
96 | - add_filter( 'lsx_to_search_taxonomies', array( $this, 'taxonomies_filter' ) ); |
|
97 | - } |
|
98 | - |
|
99 | - /** |
|
100 | - * Load the plugin text domain for translation. |
|
101 | - */ |
|
102 | - public function load_plugin_textdomain() { |
|
103 | - load_plugin_textdomain( 'to-team', false, basename( LSX_TO_TEAM_PATH ) . '/languages' ); |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * Sets the plugins variables |
|
108 | - */ |
|
109 | - public function set_vars() { |
|
110 | - $this->post_types = array( |
|
111 | - 'team' => __( 'Team', 'to-team' ), |
|
112 | - ); |
|
113 | - |
|
114 | - $this->post_types_singular = array( |
|
115 | - 'team' => __( 'Team Member', 'to-team' ), |
|
116 | - ); |
|
117 | - |
|
118 | - $this->post_type_slugs = array_keys( $this->post_types ); |
|
119 | - |
|
120 | - $users = get_users(); |
|
121 | - |
|
122 | - foreach ( $users as $user ) { |
|
123 | - $this->site_users[] = array( |
|
124 | - 'name' => $user->display_name, |
|
125 | - 'value' => $user->ID, |
|
126 | - ); |
|
127 | - } |
|
128 | - } |
|
129 | - |
|
130 | - /** |
|
131 | - * Adds our post types to an array via a filter |
|
132 | - */ |
|
133 | - public function plugin_path( $path, $post_type ) { |
|
134 | - if ( false !== $this->post_types && array_key_exists( $post_type, $this->post_types ) ) { |
|
135 | - $path = LSX_TO_TEAM_PATH; |
|
136 | - } |
|
137 | - |
|
138 | - return $path; |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * Adds our post types to an array via a filter |
|
143 | - */ |
|
144 | - public function post_types_slugs_filter( $post_types ) { |
|
145 | - if ( is_array( $post_types ) ) { |
|
146 | - $post_types = array_merge( $post_types, $this->post_type_slugs ); |
|
147 | - } else { |
|
148 | - $post_types = $this->post_type_slugs; |
|
149 | - } |
|
150 | - |
|
151 | - return $post_types; |
|
152 | - } |
|
153 | - |
|
154 | - /** |
|
155 | - * Adds our post types to an array via a filter |
|
156 | - */ |
|
157 | - public function post_types_filter( $post_types ) { |
|
158 | - if ( is_array( $post_types ) && is_array( $this->post_types ) ) { |
|
159 | - $post_types = array_merge( $post_types, $this->post_types ); |
|
160 | - } elseif ( is_array( $this->post_types ) ) { |
|
161 | - $post_types = $this->post_types; |
|
162 | - } |
|
163 | - |
|
164 | - return $post_types; |
|
165 | - } |
|
166 | - |
|
167 | - /** |
|
168 | - * Adds our post types to an array via a filter |
|
169 | - */ |
|
170 | - public function post_types_singular_filter( $post_types_singular ) { |
|
171 | - if ( is_array( $post_types_singular ) && is_array( $this->post_types_singular ) ) { |
|
172 | - $post_types_singular = array_merge( $post_types_singular, $this->post_types_singular ); |
|
173 | - } elseif ( is_array( $this->post_types_singular ) ) { |
|
174 | - $post_types_singular = $this->post_types_singular; |
|
175 | - } |
|
176 | - |
|
177 | - return $post_types_singular; |
|
178 | - } |
|
179 | - |
|
180 | - /** |
|
181 | - * Adds our taxonomies to an array via a filter |
|
182 | - */ |
|
183 | - public function taxonomies_filter( $taxonomies ) { |
|
184 | - if ( is_array( $taxonomies ) && is_array( $this->taxonomies ) ) { |
|
185 | - $taxonomies = array_merge( $taxonomies, $this->taxonomies ); |
|
186 | - } elseif ( is_array( $this->taxonomies ) ) { |
|
187 | - $taxonomies = $this->taxonomies; |
|
188 | - } |
|
189 | - |
|
190 | - return $taxonomies; |
|
191 | - } |
|
192 | - |
|
193 | - /** |
|
194 | - * Adds our taxonomies_plural to an array via a filter |
|
195 | - */ |
|
196 | - public function taxonomies_plural_filter( $taxonomies_plural ) { |
|
197 | - if ( is_array( $taxonomies_plural ) && is_array( $this->taxonomies_plural ) ) { |
|
198 | - $taxonomies_plural = array_merge( $taxonomies_plural, $this->taxonomies_plural ); |
|
199 | - } elseif ( is_array( $this->taxonomies_plural ) ) { |
|
200 | - $taxonomies_plural = $this->taxonomies_plural; |
|
201 | - } |
|
202 | - |
|
203 | - return $taxonomies_plural; |
|
204 | - } |
|
205 | - |
|
206 | - /** |
|
207 | - * Make TO last plugin to load. |
|
208 | - */ |
|
209 | - public function activated_plugin() { |
|
210 | - // @codingStandardsIgnoreLine |
|
211 | - if ( $plugins = get_option( 'active_plugins' ) ) { |
|
212 | - $search = preg_grep( '/.*\/tour-operator\.php/', $plugins ); |
|
213 | - $key = array_search( $search, $plugins ); |
|
214 | - |
|
215 | - if ( is_array( $search ) && count( $search ) ) { |
|
216 | - foreach ( $search as $key => $path ) { |
|
217 | - array_splice( $plugins, $key, 1 ); |
|
218 | - array_push( $plugins, $path ); |
|
219 | - update_option( 'active_plugins', $plugins ); |
|
220 | - } |
|
221 | - } |
|
222 | - } |
|
223 | - } |
|
224 | - |
|
225 | - /** |
|
226 | - * On plugin activation |
|
227 | - */ |
|
228 | - public function register_activation_hook() { |
|
229 | - if ( ! is_network_admin() && ! isset( $_GET['activate-multi'] ) ) { |
|
230 | - set_transient( '_tour_operators_team_flush_rewrite_rules', 1, 30 ); |
|
231 | - } |
|
232 | - } |
|
233 | - |
|
234 | - /** |
|
235 | - * On plugin activation (check) |
|
236 | - */ |
|
237 | - public function register_activation_hook_check() { |
|
238 | - if ( ! get_transient( '_tour_operators_team_flush_rewrite_rules' ) ) { |
|
239 | - return; |
|
240 | - } |
|
241 | - |
|
242 | - delete_transient( '_tour_operators_team_flush_rewrite_rules' ); |
|
243 | - flush_rewrite_rules(); |
|
244 | - } |
|
245 | - |
|
246 | - /** |
|
247 | - * Adds Schema pieces to our output. |
|
248 | - * |
|
249 | - * @param array $pieces Graph pieces to output. |
|
250 | - * @param \WPSEO_Schema_Context $context Object with context variables. |
|
251 | - * |
|
252 | - * @return array $pieces Graph pieces to output. |
|
253 | - */ |
|
254 | - public function add_graph_pieces( $pieces, $context ) { |
|
255 | - if ( class_exists( 'LSX_TO_Schema_Graph_Piece' ) ) { |
|
256 | - require_once LSX_TO_TEAM_PATH . 'classes/class-lsx-to-team-schema.php'; |
|
257 | - $pieces[] = new LSX_TO_Team_Schema( $context ); |
|
258 | - } |
|
259 | - return $pieces; |
|
260 | - } |
|
261 | - } |
|
262 | - |
|
263 | - global $lsx_to_team; |
|
264 | - $lsx_to_team = new LSX_TO_Team(); |
|
14 | + /** |
|
15 | + * Main plugin class. |
|
16 | + * |
|
17 | + * @package LSX_TO_Team |
|
18 | + * @author LightSpeed |
|
19 | + */ |
|
20 | + class LSX_TO_Team { |
|
21 | + |
|
22 | + /** |
|
23 | + * The plugins id |
|
24 | + */ |
|
25 | + public $plugin_slug = 'to-team'; |
|
26 | + |
|
27 | + /** |
|
28 | + * The post types the plugin registers |
|
29 | + */ |
|
30 | + public $post_types = false; |
|
31 | + |
|
32 | + /** |
|
33 | + * The singular post types the plugin registers |
|
34 | + */ |
|
35 | + public $post_types_singular = false; |
|
36 | + |
|
37 | + /** |
|
38 | + * An array of the post types slugs plugin registers |
|
39 | + */ |
|
40 | + public $post_type_slugs = false; |
|
41 | + |
|
42 | + /** |
|
43 | + * The taxonomies the plugin registers |
|
44 | + */ |
|
45 | + public $taxonomies = false; |
|
46 | + |
|
47 | + /** |
|
48 | + * The taxonomies the plugin registers (plural) |
|
49 | + */ |
|
50 | + public $taxonomies_plural = false; |
|
51 | + |
|
52 | + /** |
|
53 | + * Site users |
|
54 | + */ |
|
55 | + public $site_users = array(); |
|
56 | + |
|
57 | + /** |
|
58 | + * Constructor |
|
59 | + */ |
|
60 | + public function __construct() { |
|
61 | + // Set the variables. |
|
62 | + $this->set_vars(); |
|
63 | + $this->lsx_to_search_integration(); |
|
64 | + |
|
65 | + // Make TO last plugin to load. |
|
66 | + add_action( 'activated_plugin', array( $this, 'activated_plugin' ) ); |
|
67 | + |
|
68 | + add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
69 | + |
|
70 | + if ( false !== $this->post_types ) { |
|
71 | + add_filter( 'lsx_to_framework_post_types', array( $this, 'post_types_filter' ) ); |
|
72 | + add_filter( 'lsx_to_post_types', array( $this, 'post_types_filter' ) ); |
|
73 | + add_filter( 'lsx_to_post_types_singular', array( $this, 'post_types_singular_filter' ) ); |
|
74 | + add_filter( 'lsx_to_settings_path', array( $this, 'plugin_path' ), 10, 2 ); |
|
75 | + } |
|
76 | + if ( false !== $this->taxonomies ) { |
|
77 | + add_filter( 'lsx_to_framework_taxonomies', array( $this, 'taxonomies_filter' ) ); |
|
78 | + add_filter( 'lsx_to_framework_taxonomies_plural', array( $this, 'taxonomies_plural_filter' ) ); |
|
79 | + } |
|
80 | + |
|
81 | + require_once LSX_TO_TEAM_PATH . '/classes/class-lsx-to-team-admin.php'; |
|
82 | + require_once LSX_TO_TEAM_PATH . '/classes/class-lsx-to-team-frontend.php'; |
|
83 | + require_once LSX_TO_TEAM_PATH . '/includes/template-tags.php'; |
|
84 | + |
|
85 | + // flush_rewrite_rules. |
|
86 | + register_activation_hook( LSX_TO_TEAM_CORE, array( $this, 'register_activation_hook' ) ); |
|
87 | + add_action( 'admin_init', array( $this, 'register_activation_hook_check' ) ); |
|
88 | + add_filter( 'wpseo_schema_graph_pieces', array( $this, 'add_graph_pieces' ), 11, 2 ); |
|
89 | + } |
|
90 | + |
|
91 | + /** |
|
92 | + * Include the post type for the search integration |
|
93 | + */ |
|
94 | + public function lsx_to_search_integration() { |
|
95 | + add_filter( 'lsx_to_search_post_types', array( $this, 'post_types_filter' ) ); |
|
96 | + add_filter( 'lsx_to_search_taxonomies', array( $this, 'taxonomies_filter' ) ); |
|
97 | + } |
|
98 | + |
|
99 | + /** |
|
100 | + * Load the plugin text domain for translation. |
|
101 | + */ |
|
102 | + public function load_plugin_textdomain() { |
|
103 | + load_plugin_textdomain( 'to-team', false, basename( LSX_TO_TEAM_PATH ) . '/languages' ); |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * Sets the plugins variables |
|
108 | + */ |
|
109 | + public function set_vars() { |
|
110 | + $this->post_types = array( |
|
111 | + 'team' => __( 'Team', 'to-team' ), |
|
112 | + ); |
|
113 | + |
|
114 | + $this->post_types_singular = array( |
|
115 | + 'team' => __( 'Team Member', 'to-team' ), |
|
116 | + ); |
|
117 | + |
|
118 | + $this->post_type_slugs = array_keys( $this->post_types ); |
|
119 | + |
|
120 | + $users = get_users(); |
|
121 | + |
|
122 | + foreach ( $users as $user ) { |
|
123 | + $this->site_users[] = array( |
|
124 | + 'name' => $user->display_name, |
|
125 | + 'value' => $user->ID, |
|
126 | + ); |
|
127 | + } |
|
128 | + } |
|
129 | + |
|
130 | + /** |
|
131 | + * Adds our post types to an array via a filter |
|
132 | + */ |
|
133 | + public function plugin_path( $path, $post_type ) { |
|
134 | + if ( false !== $this->post_types && array_key_exists( $post_type, $this->post_types ) ) { |
|
135 | + $path = LSX_TO_TEAM_PATH; |
|
136 | + } |
|
137 | + |
|
138 | + return $path; |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * Adds our post types to an array via a filter |
|
143 | + */ |
|
144 | + public function post_types_slugs_filter( $post_types ) { |
|
145 | + if ( is_array( $post_types ) ) { |
|
146 | + $post_types = array_merge( $post_types, $this->post_type_slugs ); |
|
147 | + } else { |
|
148 | + $post_types = $this->post_type_slugs; |
|
149 | + } |
|
150 | + |
|
151 | + return $post_types; |
|
152 | + } |
|
153 | + |
|
154 | + /** |
|
155 | + * Adds our post types to an array via a filter |
|
156 | + */ |
|
157 | + public function post_types_filter( $post_types ) { |
|
158 | + if ( is_array( $post_types ) && is_array( $this->post_types ) ) { |
|
159 | + $post_types = array_merge( $post_types, $this->post_types ); |
|
160 | + } elseif ( is_array( $this->post_types ) ) { |
|
161 | + $post_types = $this->post_types; |
|
162 | + } |
|
163 | + |
|
164 | + return $post_types; |
|
165 | + } |
|
166 | + |
|
167 | + /** |
|
168 | + * Adds our post types to an array via a filter |
|
169 | + */ |
|
170 | + public function post_types_singular_filter( $post_types_singular ) { |
|
171 | + if ( is_array( $post_types_singular ) && is_array( $this->post_types_singular ) ) { |
|
172 | + $post_types_singular = array_merge( $post_types_singular, $this->post_types_singular ); |
|
173 | + } elseif ( is_array( $this->post_types_singular ) ) { |
|
174 | + $post_types_singular = $this->post_types_singular; |
|
175 | + } |
|
176 | + |
|
177 | + return $post_types_singular; |
|
178 | + } |
|
179 | + |
|
180 | + /** |
|
181 | + * Adds our taxonomies to an array via a filter |
|
182 | + */ |
|
183 | + public function taxonomies_filter( $taxonomies ) { |
|
184 | + if ( is_array( $taxonomies ) && is_array( $this->taxonomies ) ) { |
|
185 | + $taxonomies = array_merge( $taxonomies, $this->taxonomies ); |
|
186 | + } elseif ( is_array( $this->taxonomies ) ) { |
|
187 | + $taxonomies = $this->taxonomies; |
|
188 | + } |
|
189 | + |
|
190 | + return $taxonomies; |
|
191 | + } |
|
192 | + |
|
193 | + /** |
|
194 | + * Adds our taxonomies_plural to an array via a filter |
|
195 | + */ |
|
196 | + public function taxonomies_plural_filter( $taxonomies_plural ) { |
|
197 | + if ( is_array( $taxonomies_plural ) && is_array( $this->taxonomies_plural ) ) { |
|
198 | + $taxonomies_plural = array_merge( $taxonomies_plural, $this->taxonomies_plural ); |
|
199 | + } elseif ( is_array( $this->taxonomies_plural ) ) { |
|
200 | + $taxonomies_plural = $this->taxonomies_plural; |
|
201 | + } |
|
202 | + |
|
203 | + return $taxonomies_plural; |
|
204 | + } |
|
205 | + |
|
206 | + /** |
|
207 | + * Make TO last plugin to load. |
|
208 | + */ |
|
209 | + public function activated_plugin() { |
|
210 | + // @codingStandardsIgnoreLine |
|
211 | + if ( $plugins = get_option( 'active_plugins' ) ) { |
|
212 | + $search = preg_grep( '/.*\/tour-operator\.php/', $plugins ); |
|
213 | + $key = array_search( $search, $plugins ); |
|
214 | + |
|
215 | + if ( is_array( $search ) && count( $search ) ) { |
|
216 | + foreach ( $search as $key => $path ) { |
|
217 | + array_splice( $plugins, $key, 1 ); |
|
218 | + array_push( $plugins, $path ); |
|
219 | + update_option( 'active_plugins', $plugins ); |
|
220 | + } |
|
221 | + } |
|
222 | + } |
|
223 | + } |
|
224 | + |
|
225 | + /** |
|
226 | + * On plugin activation |
|
227 | + */ |
|
228 | + public function register_activation_hook() { |
|
229 | + if ( ! is_network_admin() && ! isset( $_GET['activate-multi'] ) ) { |
|
230 | + set_transient( '_tour_operators_team_flush_rewrite_rules', 1, 30 ); |
|
231 | + } |
|
232 | + } |
|
233 | + |
|
234 | + /** |
|
235 | + * On plugin activation (check) |
|
236 | + */ |
|
237 | + public function register_activation_hook_check() { |
|
238 | + if ( ! get_transient( '_tour_operators_team_flush_rewrite_rules' ) ) { |
|
239 | + return; |
|
240 | + } |
|
241 | + |
|
242 | + delete_transient( '_tour_operators_team_flush_rewrite_rules' ); |
|
243 | + flush_rewrite_rules(); |
|
244 | + } |
|
245 | + |
|
246 | + /** |
|
247 | + * Adds Schema pieces to our output. |
|
248 | + * |
|
249 | + * @param array $pieces Graph pieces to output. |
|
250 | + * @param \WPSEO_Schema_Context $context Object with context variables. |
|
251 | + * |
|
252 | + * @return array $pieces Graph pieces to output. |
|
253 | + */ |
|
254 | + public function add_graph_pieces( $pieces, $context ) { |
|
255 | + if ( class_exists( 'LSX_TO_Schema_Graph_Piece' ) ) { |
|
256 | + require_once LSX_TO_TEAM_PATH . 'classes/class-lsx-to-team-schema.php'; |
|
257 | + $pieces[] = new LSX_TO_Team_Schema( $context ); |
|
258 | + } |
|
259 | + return $pieces; |
|
260 | + } |
|
261 | + } |
|
262 | + |
|
263 | + global $lsx_to_team; |
|
264 | + $lsx_to_team = new LSX_TO_Team(); |
|
265 | 265 | |
266 | 266 | } |
@@ -12,62 +12,62 @@ |
||
12 | 12 | */ |
13 | 13 | class LSX_TO_Team_Schema extends LSX_TO_Schema_Graph_Piece { |
14 | 14 | |
15 | - /** |
|
16 | - * Constructor. |
|
17 | - * |
|
18 | - * @param \WPSEO_Schema_Context $context A value object with context variables. |
|
19 | - */ |
|
20 | - public function __construct( WPSEO_Schema_Context $context ) { |
|
21 | - $this->post_type = 'team'; |
|
22 | - parent::__construct( $context ); |
|
23 | - } |
|
15 | + /** |
|
16 | + * Constructor. |
|
17 | + * |
|
18 | + * @param \WPSEO_Schema_Context $context A value object with context variables. |
|
19 | + */ |
|
20 | + public function __construct( WPSEO_Schema_Context $context ) { |
|
21 | + $this->post_type = 'team'; |
|
22 | + parent::__construct( $context ); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * Returns Review data. |
|
27 | - * |
|
28 | - * @return array $data Review data. |
|
29 | - */ |
|
30 | - public function generate() { |
|
31 | - $data = array( |
|
32 | - '@type' => array( |
|
33 | - 'Person', |
|
34 | - ), |
|
35 | - '@id' => $this->context->canonical . '#person', |
|
36 | - 'name' => $this->post->post_title, |
|
37 | - 'description' => wp_strip_all_tags( $this->post->post_content ), |
|
38 | - 'url' => $this->post_url, |
|
39 | - 'mainEntityOfPage' => array( |
|
40 | - '@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH, |
|
41 | - ), |
|
42 | - ); |
|
25 | + /** |
|
26 | + * Returns Review data. |
|
27 | + * |
|
28 | + * @return array $data Review data. |
|
29 | + */ |
|
30 | + public function generate() { |
|
31 | + $data = array( |
|
32 | + '@type' => array( |
|
33 | + 'Person', |
|
34 | + ), |
|
35 | + '@id' => $this->context->canonical . '#person', |
|
36 | + 'name' => $this->post->post_title, |
|
37 | + 'description' => wp_strip_all_tags( $this->post->post_content ), |
|
38 | + 'url' => $this->post_url, |
|
39 | + 'mainEntityOfPage' => array( |
|
40 | + '@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH, |
|
41 | + ), |
|
42 | + ); |
|
43 | 43 | |
44 | - if ( $this->context->site_represents_reference ) { |
|
45 | - $data['worksFor'] = $this->context->site_represents_reference; |
|
46 | - $data['memberOf'] = $this->context->site_represents_reference; |
|
47 | - } |
|
44 | + if ( $this->context->site_represents_reference ) { |
|
45 | + $data['worksFor'] = $this->context->site_represents_reference; |
|
46 | + $data['memberOf'] = $this->context->site_represents_reference; |
|
47 | + } |
|
48 | 48 | |
49 | - $data = $this->add_taxonomy_terms( $data, 'jobTitle', 'role' ); |
|
50 | - $data = $this->add_custom_field( $data, 'email', 'contact_email' ); |
|
51 | - $data = $this->add_custom_field( $data, 'telephone', 'contact_number' ); |
|
52 | - $data = $this->add_products( $data ); |
|
53 | - $data = $this->add_offers( $data, 'makesOffer' ); |
|
54 | - $data = \lsx\legacy\Schema_Utils::add_image( $data, $this->context ); |
|
55 | - return $data; |
|
56 | - } |
|
49 | + $data = $this->add_taxonomy_terms( $data, 'jobTitle', 'role' ); |
|
50 | + $data = $this->add_custom_field( $data, 'email', 'contact_email' ); |
|
51 | + $data = $this->add_custom_field( $data, 'telephone', 'contact_number' ); |
|
52 | + $data = $this->add_products( $data ); |
|
53 | + $data = $this->add_offers( $data, 'makesOffer' ); |
|
54 | + $data = \lsx\legacy\Schema_Utils::add_image( $data, $this->context ); |
|
55 | + return $data; |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * Adds the accommodation and tour products under the 'owns' parameter |
|
60 | - * |
|
61 | - * @param array $data |
|
62 | - * @return array |
|
63 | - */ |
|
64 | - public function add_products( $data ) { |
|
65 | - $places_array = array(); |
|
66 | - $places_array = $this->add_accommodation( $places_array ); |
|
67 | - $places_array = $this->add_tours( $places_array ); |
|
68 | - if ( ! empty( $places_array ) ) { |
|
69 | - $data['owns'] = $places_array; |
|
70 | - } |
|
71 | - return $data; |
|
72 | - } |
|
58 | + /** |
|
59 | + * Adds the accommodation and tour products under the 'owns' parameter |
|
60 | + * |
|
61 | + * @param array $data |
|
62 | + * @return array |
|
63 | + */ |
|
64 | + public function add_products( $data ) { |
|
65 | + $places_array = array(); |
|
66 | + $places_array = $this->add_accommodation( $places_array ); |
|
67 | + $places_array = $this->add_tours( $places_array ); |
|
68 | + if ( ! empty( $places_array ) ) { |
|
69 | + $data['owns'] = $places_array; |
|
70 | + } |
|
71 | + return $data; |
|
72 | + } |
|
73 | 73 | } |