initialize_members_list(); if ( empty( $this->members_to_display ) ) { return; } $hestia_authors_on_blog_background = get_theme_mod( 'hestia_authors_on_blog_background' ); $background_inline = ! empty( $hestia_authors_on_blog_background ) ? 'style="background-image: url(' . esc_url( $hestia_authors_on_blog_background ) . ');"' : ''; $section_class = ! empty( $hestia_authors_on_blog_background ) ? 'authors-on-blog section-image' : 'authors-on-blog'; echo '
'; echo '
'; foreach ( $this->members_to_display as $team_item ) { $image = ! empty( $team_item['image_url'] ) ? apply_filters( 'hestia_translate_single_string', $team_item['image_url'], 'Team section', 'Image' ) : ''; $title = ! empty( $team_item['title'] ) ? apply_filters( 'hestia_translate_single_string', $team_item['title'], 'Team section', 'Title' ) : ''; $subtitle = ! empty( $team_item['subtitle'] ) ? apply_filters( 'hestia_translate_single_string', $team_item['subtitle'], 'Team section', 'Subtitle' ) : ''; $text = ! empty( $team_item['text'] ) ? apply_filters( 'hestia_translate_single_string', $team_item['text'], 'Team section', 'Text' ) : ''; $link = ! empty( $team_item['link'] ) ? apply_filters( 'hestia_translate_single_string', $team_item['link'], 'Team section', 'Link' ) : ''; $icons = ! empty( $team_item['social_repeater'] ) ? $team_item['social_repeater'] : ''; echo '
'; echo '
'; if ( ! empty( $image ) ) { if ( ! empty( $link ) ) { echo ''; } echo ''; if ( ! empty( $link ) ) { echo ''; } } echo '
'; echo '
'; if ( ! empty( $title ) ) { echo '

' . wp_kses_post( html_entity_decode( $title ) ) . '

'; } if ( ! empty( $subtitle ) ) { echo '
' . wp_kses_post( html_entity_decode( $subtitle ) ) . '
'; } if ( ! empty( $text ) ) { echo '

' . wp_kses_post( html_entity_decode( $text ) ) . '

'; } if ( ! empty( $icons ) ) { $icons = html_entity_decode( $icons ); $icons_decoded = json_decode( $icons, true ); if ( ! empty( $icons_decoded ) ) { echo ''; } } echo '
'; echo '
'; } echo '
'; echo '
'; } /** * Select from team members just those members that were selected in hestia_authors_on_blog control * * @access private * @return void */ private function initialize_members_list() { $hestia_authors_on_blog = get_theme_mod( 'hestia_authors_on_blog' ); if ( empty( $hestia_authors_on_blog ) || ( sizeof( $hestia_authors_on_blog ) === 1 && empty( $hestia_authors_on_blog[0] ) ) ) { return; } $default_content = Hestia_Defaults_Models::instance()->get_team_default(); $hestia_team_content = get_theme_mod( 'hestia_team_content', $default_content ); if ( empty( $hestia_team_content ) ) { return; } $hestia_team_content = json_decode( $hestia_team_content, true ); if ( ! empty( $hestia_team_content ) ) { $this->members_to_display = array_filter( $hestia_team_content, array( $this, 'selected_authors' ) ); } } /** * Filter function to check if the id is in team members. * * @access private * @return bool */ private function selected_authors( $arr ) { $hestia_authors_on_blog = (array) get_theme_mod( 'hestia_authors_on_blog' ); if ( empty( $hestia_authors_on_blog ) ) { return false; } return in_array( $arr['id'], $hestia_authors_on_blog ); } }