Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
Created November 14, 2016 07:18
Show Gist options
  • Select an option

  • Save farookibrahim/e9f85a1c14a49ffc20d1a54475254287 to your computer and use it in GitHub Desktop.

Select an option

Save farookibrahim/e9f85a1c14a49ffc20d1a54475254287 to your computer and use it in GitHub Desktop.
Bewear Header Social Links
if ( ! function_exists( 'bewear_header_social_link' ) ) {
/**
* Displays a link to social profile in website header
*
*/
function bewear_header_social_link() {
$social_networks = apply_filters( 'bewear_set_social_networks', bewear_get_social_networks() );
$social_links_output = '';
$social_link_html = apply_filters( 'bewear_header_social_link_html', '<a class="%1$s" href="%2$s"></a>' );
foreach ( $social_networks as $social_network ) {
if ( isset( $social_network[ 'link' ] ) && !empty( $social_network[ 'link' ] ) ) {
$social_links_output .= sprintf( '<li>' . $social_link_html . '</li>', $social_network[ 'icon' ], $social_network[ 'link' ] );
}
}
?>
<div class="header-social-icons">
<ul class="social-icons">
<?php echo wp_kses_post( $social_links_output ); ?>
</ul>
</div>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment