
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php

/* -----------------------------------------------------------------------------
 * Render Social Icon
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_render_social_icon' ) ) {
	function presso_render_social_icon( $label, $icon, $url, $size='' ) {

		if ( empty( $url ) ) return;

		if ( 'Skype' == $label ) {
			$url = esc_html( $url );
		} else {
			$url = esc_url( $url );
		}

		$classes = array();
		$classes[] = sprintf( 'vw-%1$s', $icon );

		if ( empty( $size ) ) {
			$size = 'small';
		}
		$classes[] = sprintf( 'vw-social-icon--%s', $size );
		?>
		<a class="vw-social-icon <?php echo esc_attr( implode( ' ', $classes ) ); ?>" rel="author" href="<?php echo esc_attr( $url ); ?>" title="<?php echo esc_attr( $label ); ?>" target="_blank">
			<i class="vw-icon <?php echo esc_attr( $icon ); ?>"></i>
			<span class="vw-social-icon__label"><?php echo esc_html( $label ); ?></span>
		</a>
		<?php
	}
}



/* -----------------------------------------------------------------------------
 * Site Social Links
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_the_site_social_links' ) ) {
	function presso_the_site_social_links( $size = 'small' ) {
		echo '<span class="vw-site-social-links vw-social-icons">';

		presso_render_social_icon( 'Delicious', 'icon-social-delicious', presso_get_theme_option( 'social_delicious' ), $size );

		presso_render_social_icon( 'Digg', 'icon-social-digg', presso_get_theme_option( 'social_digg' ), $size );

		presso_render_social_icon( 'Dribbble', 'icon-social-dribbble', presso_get_theme_option( 'social_dribbble' ), $size );

		presso_render_social_icon( 'Facebook', 'icon-social-facebook', presso_get_theme_option( 'social_facebook' ), $size );

		presso_render_social_icon( 'Flickr', 'icon-social-flickr', presso_get_theme_option( 'social_flickr' ), $size );

		presso_render_social_icon( 'Forrst', 'icon-social-forrst', presso_get_theme_option( 'social_forrst' ), $size );

		presso_render_social_icon( 'GitHub', 'icon-social-github', presso_get_theme_option( 'social_github' ), $size );

		presso_render_social_icon( 'Google+', 'icon-social-gplus', presso_get_theme_option( 'social_googleplus' ), $size );

		presso_render_social_icon( 'Instagram', 'icon-social-instagram', presso_get_theme_option( 'social_instagram' ), $size );

		presso_render_social_icon( 'LinkedIn', 'icon-social-linkedin', presso_get_theme_option( 'social_linkedin' ), $size );

		presso_render_social_icon( 'Last.fm', 'icon-social-lastfm', presso_get_theme_option( 'social_lastfm' ), $size );

		presso_render_social_icon( 'Pinterest', 'icon-social-pinterest', presso_get_theme_option( 'social_pinterest' ), $size );

		presso_render_social_icon( 'RSS', 'icon-social-rss', presso_get_theme_option( 'social_rss' ), $size );

		presso_render_social_icon( 'Skype', 'icon-social-skype', presso_get_theme_option( 'social_skype' ), $size );

		presso_render_social_icon( 'Tumblr', 'icon-social-tumblr', presso_get_theme_option( 'social_tumblr' ), $size );
		
		presso_render_social_icon( 'Twitter', 'icon-social-twitter', presso_get_theme_option( 'social_twitter' ), $size );

		presso_render_social_icon( 'Vimeo', 'icon-social-vimeo', presso_get_theme_option( 'social_vimeo' ), $size );

		presso_render_social_icon( 'Yahoo', 'icon-social-yahoo', presso_get_theme_option( 'social_yahoo' ), $size );

		presso_render_social_icon( 'Youtube', 'icon-social-youtube', presso_get_theme_option( 'social_youtube' ), $size );

		echo '</span>';
	}
}



/* -----------------------------------------------------------------------------
 * Add User Social Icons
 * -------------------------------------------------------------------------- */

add_filter( 'user_contactmethods', 'presso_user_social_links' );
if ( ! function_exists( 'presso_user_social_links' ) ) {
	function presso_user_social_links( $contact_methods ) {
		$contact_methods['public_email'] = 'Public Email';
		$contact_methods['twitter'] = 'Twitter';
		$contact_methods['facebook'] = 'Facebook';
		$contact_methods['gplus'] = 'Google+';
		$contact_methods['pinterest'] = 'Pinterest';
		$contact_methods['tumblr'] = 'Tumblr';
		$contact_methods['instagram'] = 'Instagram';
		$contact_methods['500px'] = '500px';
		$contact_methods['dribbble'] = 'Dribbble';
		$contact_methods['flickr'] = 'Flickr';
		$contact_methods['linkedin'] = 'LinkedIn';
		$contact_methods['skype'] = 'Skype';
		$contact_methods['soundcloud'] = 'SoundCloud';
		$contact_methods['youtube'] = 'YouTube';
		$contact_methods['vimeo'] = 'Vimeo';

		return $contact_methods;
	}
}



/* -----------------------------------------------------------------------------
 * User Social Icons
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_the_user_social_links' ) ) {
	function presso_the_user_social_links( $size = 'medium', $userID = null ) {

		if ( empty( $userID ) ) {
			$userID = get_the_author_meta( 'ID' );
		}

		ob_start();

		presso_render_social_icon( 'Twitter', 'icon-social-twitter', get_the_author_meta( 'twitter', $userID ), $size );

		presso_render_social_icon( 'Facebook', 'icon-social-facebook', get_the_author_meta( 'facebook', $userID ), $size );

		presso_render_social_icon( 'Google+', 'icon-social-gplus', get_the_author_meta( 'gplus', $userID ), $size );

		presso_render_social_icon( 'Pinterest', 'icon-social-pinterest', get_the_author_meta( 'pinterest', $userID ), $size );

		presso_render_social_icon( 'Tumblr', 'icon-social-tumblr', get_the_author_meta( 'tumblr', $userID ), $size );

		presso_render_social_icon( 'Instagram', 'icon-social-instagram', get_the_author_meta( 'instagram', $userID ), $size );

		presso_render_social_icon( '500px', 'icon-social-fivehundredpx', get_the_author_meta( '500px', $userID ), $size );

		presso_render_social_icon( 'Dribbble', 'icon-social-dribbble', get_the_author_meta( 'dribbble', $userID ), $size );

		presso_render_social_icon( 'Flickr', 'icon-social-flickr', get_the_author_meta( 'flickr', $userID ), $size );

		presso_render_social_icon( 'Linkedin', 'icon-social-linkedin', get_the_author_meta( 'linkedin', $userID ), $size );

		presso_render_social_icon( 'Skype', 'icon-social-skype', get_the_author_meta( 'skype', $userID ), $size );

		presso_render_social_icon( 'SoundCloud', 'icon-social-soundcloud', get_the_author_meta( 'soundcloud', $userID ), $size );

		presso_render_social_icon( 'Youtube', 'icon-social-youtube', get_the_author_meta( 'youtube', $userID ), $size );

		presso_render_social_icon( 'Vimeo', 'icon-social-vimeo', get_the_author_meta( 'vimeo', $userID ), $size );

		presso_render_social_icon( 'Email', 'icon-social-email', get_the_author_meta( 'public_email', $userID ), $size );

		$ob_buffer = ob_get_clean();
		if ( ! empty( $ob_buffer ) ) {
			echo '<span class="vw-user-social-links vw-social-icons vw-social-icons--solid">'.$ob_buffer; // Escaped
			echo '</span>';
		}
	}
}