tec_get_social_links()
Source
File: templates/speaker-template.php
function tec_get_social_links() {
$social_icons = [];
foreach ( [ 'facebook', 'twitter', 'instagram', 'linkedin', 'youtube', 'website' ] as $social_icon ) {
$url = get_post_meta( get_the_ID(), 'tec_' . $social_icon . '_url', true );
if ( $url ) {
$social_label = $social_icon;
if ( $social_icon == 'website' ) {
$social_icon = 'admin-site-alt3';
}
if ( $social_icon == 'facebook' ) {
$social_icon = 'facebook-alt';
}
$social_icons[] = '<a class="tec-speaker-social-icon-link" href="' . esc_url( $url ) . '" target="_blank" aria-label="' . esc_html( $social_label ) . '"><span class="dashicons dashicons-' . esc_html( $social_icon ) . '"></span></a>';
}
}
return $social_icons;
}