| 1 |
<?php |
| 2 |
/** |
| 3 |
* Social Info Template Part. |
| 4 |
* |
| 5 |
* @package awsm-team |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! empty( $teamdata['awsm_social'] ) ) { |
| 9 |
echo '<div class="awsm-social-icons">'; |
| 10 |
foreach ( $teamdata['awsm_social'] as $social ) { |
| 11 |
|
| 12 |
$social_link = ''; |
| 13 |
$links = isset( $social['link'] ) ? $social['link'] : ''; |
| 14 |
$icon = isset( $social['icon'] ) ? $social['icon'] : ''; |
| 15 |
if ( filter_var( $links, FILTER_VALIDATE_EMAIL ) ) { |
| 16 |
$social_link = sprintf( 'href="mailto:%1$s"', esc_attr( $links ) ); |
| 17 |
} elseif ( $this->validate_phone_number( $links ) === true ) { |
| 18 |
$social_link = sprintf( 'href="tel:%1$s"', esc_attr( $links ) ); |
| 19 |
} else { |
| 20 |
|
| 21 |
$social_link = sprintf( 'href="%1$s" target="_blank"', esc_url( $links ) ); |
| 22 |
} |
| 23 |
|
| 24 |
echo '<span><a ' . $social_link . '><i class="awsm-icon-' . esc_attr( $icon ) . '" aria-hidden="true"></i></a></span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 25 |
} |
| 26 |
echo '</div>'; |
| 27 |
} |
| 28 |
|
| 29 |
|