@@ -10,49 +10,49 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | $post_type = array( |
| 13 | - 'class' => 'LSX_TO_Team', |
|
| 14 | - 'menu_icon' => 'dashicons-id-alt', |
|
| 15 | - 'labels' => array( |
|
| 16 | - 'name' => esc_html__( 'Team', 'to-team' ), |
|
| 17 | - 'singular_name' => esc_html__( 'Team Member', 'to-team' ), |
|
| 18 | - 'add_new' => esc_html__( 'Add New', 'to-team' ), |
|
| 19 | - 'add_new_item' => esc_html__( 'Add New Team Member', 'to-team' ), |
|
| 20 | - 'edit_item' => esc_html__( 'Edit', 'to-team' ), |
|
| 21 | - 'new_item' => esc_html__( 'New', 'to-team' ), |
|
| 22 | - 'all_items' => esc_html__( 'Team', 'to-team' ), |
|
| 23 | - 'view_item' => esc_html__( 'View', 'to-team' ), |
|
| 24 | - 'search_items' => esc_html__( 'Search the Team', 'to-team' ), |
|
| 25 | - 'not_found' => esc_html__( 'No team member found', 'to-team' ), |
|
| 26 | - 'not_found_in_trash' => esc_html__( 'No team member found in Trash', 'to-team' ), |
|
| 27 | - 'parent_item_colon' => '', |
|
| 28 | - 'menu_name' => esc_html__( 'Team', 'lsx-team' ), |
|
| 29 | - 'featured_image' => esc_html__( 'Profile Picture', 'to-team' ), |
|
| 30 | - 'set_featured_image' => esc_html__( 'Set Profile Picture', 'to-team' ), |
|
| 31 | - 'remove_featured_image' => esc_html__( 'Remove profile picture', 'to-team' ), |
|
| 32 | - 'use_featured_image' => esc_html__( 'Use as profile picture', 'to-team' ), |
|
| 33 | - ), |
|
| 34 | - 'public' => true, |
|
| 35 | - 'publicly_queryable' => true, |
|
| 36 | - 'show_ui' => true, |
|
| 37 | - 'show_in_menu' => 'tour-operator', |
|
| 38 | - 'menu_position' => 75, |
|
| 39 | - 'query_var' => true, |
|
| 40 | - 'rewrite' => array( |
|
| 41 | - 'slug' => 'team', |
|
| 42 | - 'with_front' => false, |
|
| 43 | - ), |
|
| 44 | - 'exclude_from_search' => false, |
|
| 45 | - 'capability_type' => 'post', |
|
| 46 | - 'has_archive' => 'team', |
|
| 47 | - 'hierarchical' => false, |
|
| 48 | - 'supports' => array( |
|
| 49 | - 'title', |
|
| 50 | - 'slug', |
|
| 51 | - 'editor', |
|
| 52 | - 'thumbnail', |
|
| 53 | - 'excerpt', |
|
| 54 | - 'custom-fields', |
|
| 55 | - ), |
|
| 13 | + 'class' => 'LSX_TO_Team', |
|
| 14 | + 'menu_icon' => 'dashicons-id-alt', |
|
| 15 | + 'labels' => array( |
|
| 16 | + 'name' => esc_html__( 'Team', 'to-team' ), |
|
| 17 | + 'singular_name' => esc_html__( 'Team Member', 'to-team' ), |
|
| 18 | + 'add_new' => esc_html__( 'Add New', 'to-team' ), |
|
| 19 | + 'add_new_item' => esc_html__( 'Add New Team Member', 'to-team' ), |
|
| 20 | + 'edit_item' => esc_html__( 'Edit', 'to-team' ), |
|
| 21 | + 'new_item' => esc_html__( 'New', 'to-team' ), |
|
| 22 | + 'all_items' => esc_html__( 'Team', 'to-team' ), |
|
| 23 | + 'view_item' => esc_html__( 'View', 'to-team' ), |
|
| 24 | + 'search_items' => esc_html__( 'Search the Team', 'to-team' ), |
|
| 25 | + 'not_found' => esc_html__( 'No team member found', 'to-team' ), |
|
| 26 | + 'not_found_in_trash' => esc_html__( 'No team member found in Trash', 'to-team' ), |
|
| 27 | + 'parent_item_colon' => '', |
|
| 28 | + 'menu_name' => esc_html__( 'Team', 'lsx-team' ), |
|
| 29 | + 'featured_image' => esc_html__( 'Profile Picture', 'to-team' ), |
|
| 30 | + 'set_featured_image' => esc_html__( 'Set Profile Picture', 'to-team' ), |
|
| 31 | + 'remove_featured_image' => esc_html__( 'Remove profile picture', 'to-team' ), |
|
| 32 | + 'use_featured_image' => esc_html__( 'Use as profile picture', 'to-team' ), |
|
| 33 | + ), |
|
| 34 | + 'public' => true, |
|
| 35 | + 'publicly_queryable' => true, |
|
| 36 | + 'show_ui' => true, |
|
| 37 | + 'show_in_menu' => 'tour-operator', |
|
| 38 | + 'menu_position' => 75, |
|
| 39 | + 'query_var' => true, |
|
| 40 | + 'rewrite' => array( |
|
| 41 | + 'slug' => 'team', |
|
| 42 | + 'with_front' => false, |
|
| 43 | + ), |
|
| 44 | + 'exclude_from_search' => false, |
|
| 45 | + 'capability_type' => 'post', |
|
| 46 | + 'has_archive' => 'team', |
|
| 47 | + 'hierarchical' => false, |
|
| 48 | + 'supports' => array( |
|
| 49 | + 'title', |
|
| 50 | + 'slug', |
|
| 51 | + 'editor', |
|
| 52 | + 'thumbnail', |
|
| 53 | + 'excerpt', |
|
| 54 | + 'custom-fields', |
|
| 55 | + ), |
|
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | 58 | return $post_type; |
@@ -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; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | // If this file is called directly, abort. |
| 16 | 16 | if ( ! defined( 'WPINC' ) ) { |
| 17 | - die; |
|
| 17 | + die; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | define( 'LSX_TO_TEAM_PATH', plugin_dir_path( __FILE__ ) ); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | define( 'LSX_TO_TEAM_VER', '1.2.2' ); |
| 24 | 24 | |
| 25 | 25 | if ( ! defined( 'TEAM_ARCHIVE_URL' ) ) { |
| 26 | - define( 'TEAM_ARCHIVE_URL', 'team-members' ); |
|
| 26 | + define( 'TEAM_ARCHIVE_URL', 'team-members' ); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /* ======================= Below is the Plugin Class init ========================= */ |
@@ -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> |