$term, 'taxonomy' => 'aiopod_participants', 'placeholder' => AIOPOD_PLUGIN_PLACEHOLDER_AVATAR_URL ) ); // Build tab URLs $base_url = aiopod_get_participant_page_url( $term ); $podcasts_url = remove_query_arg( 'view', $base_url ); $episodes_url = add_query_arg( 'view', 'episodes', $base_url ); // Get active tab $allowed_views = array( 'podcasts', 'episodes' ); $current_view = get_query_var( 'view' ); $active_tab = in_array( $current_view, $allowed_views ) ? $current_view : 'podcasts'; // Podcasts HTML $podcasts = ''; if ( ! empty( $attributes['show_podcasts'] ) ) { $podcasts_args = array( 'participants' => $term->term_id, 'echo' => 0 ); $podcasts_args = apply_filters( 'aiopod_single_participant_podcasts_args', $podcasts_args ); $podcasts = aiopod_the_podcasts( $podcasts_args ); } // Podcasts title $podcasts_title = trim( $attributes['podcasts_title'] ); if ( '' === $podcasts_title ) { $podcasts_title = __( 'Podcasts', 'aio-podcast-studio' ); } // Episodes HTML $episodes = ''; if ( ! empty( $attributes['show_episodes'] ) ) { $episodes_args = array( 'participants' => $term->term_id, 'echo' => 0 ); $episodes_args = apply_filters( 'aiopod_single_participant_episodes_args', $episodes_args ); $episodes = aiopod_the_episodes( $episodes_args ); } // Episodes title $episodes_title = trim( $attributes['episodes_title'] ); if ( '' === $episodes_title ) { $episodes_title = __( 'Episodes', 'aio-podcast-studio' ); } ?>
term_id, 'job_title', true ); if ( ! empty( $job_title ) ) { $primary_meta[] = sprintf( '%s', esc_html( $job_title ) ); } } // Company name if ( ! empty( $attributes['show_company_name'] ) ) { $company_name = get_term_meta( $term->term_id, 'company_name', true ); if ( ! empty( $company_name ) ) { $primary_meta[] = sprintf( '%s', esc_html( $company_name ) ); } } // Website url if ( ! empty( $attributes['show_website_url'] ) ) { $website_url = get_term_meta( $term->term_id, 'website_url', true ); if ( ! empty( $website_url ) ) { $primary_meta[] = sprintf( '%1$s %2$s', aiopod_get_svg( 'globe' ), esc_url( $website_url ) ); } } } if ( ! empty( $primary_meta ) ) { $participant_content .= '
'; $participant_content .= implode( '', $primary_meta ); $participant_content .= '
'; } // Secondary metadata $secondary_meta = array(); if ( ! empty( $attributes['show_podcasts_count'] ) || ! empty( $attributes['show_episodes_count'] ) ) { // Podcasts count if ( ! empty( $attributes['show_podcasts_count'] ) ) { $podcasts_count = aiopod_get_participant_posts_count( $term->term_id, 'aiopod_podcasts' ); $html = ''; $html .= aiopod_get_svg( 'microphone' ); $html .= esc_html( sprintf( _n( '%s podcast', '%s podcasts', $podcasts_count, 'aio-podcast-studio' ), number_format_i18n( $podcasts_count ) ) ); $html .= ''; $secondary_meta[] = $html; } // Episodes count if ( ! empty( $attributes['show_episodes_count'] ) ) { $episodes_count = aiopod_get_participant_posts_count( $term->term_id, 'aiopod_episodes' ); $html = ''; $html .= aiopod_get_svg( 'episodes' ); $html .= esc_html( sprintf( _n( '%s episode', '%s episodes', $episodes_count, 'aio-podcast-studio' ), number_format_i18n( $episodes_count ) ) ); $html .= ''; $secondary_meta[] = $html; } if ( ! empty( $secondary_meta ) ) { $participant_content .= '
'; $participant_content .= implode( '', $secondary_meta ); $participant_content .= '
'; } } // Description if ( ! empty( $term->description ) ) { $participant_content .= '
'; $participant_content .= wp_kses_post( wpautop( $term->description ) ); $participant_content .= '
'; } // Follow Us Buttons if ( ! empty( $attributes['show_follow_buttons'] ) ) { $follow_buttons = aiopod_get_follow_buttons( $term->term_id, 'term' ); if ( ! empty( $follow_buttons ) ) { $participant_content .= '
'; foreach ( $follow_buttons as $follow_button ) { $participant_content .= sprintf( '', esc_url( $follow_button['url'] ), esc_attr( $follow_button['label'] ), esc_attr( $follow_button['icon'] ) ); } $participant_content .= '
'; } } // Output the participant content if ( ! empty( $participant_content ) ) { echo '
'; echo wp_kses_post( $participant_content ); echo '
'; } ?>