<?php
    //Display top social icons
    //Check if open link in new window
    $tg_topbar_social_link = kirki_get_option('tg_topbar_social_link');
?>
<div class="social_wrapper">
    <ul>
    	<?php
    		$pp_facebook_url = get_option('pp_facebook_url');
    		
    		if(!empty($pp_facebook_url))
    		{
    	?>
    	<li class="facebook"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> href="<?php echo esc_url($pp_facebook_url); ?>"><i class="fa fa-facebook"></i></a></li>
    	<?php
    		}
    	?>
    	<?php
    		$pp_twitter_username = get_option('pp_twitter_username');
    		
    		if(!empty($pp_twitter_username))
    		{
    	?>
    	<li class="twitter"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> href="https://twitter.com/<?php echo esc_attr($pp_twitter_username); ?>"><i class="fa fa-twitter"></i></a></li>
    	<?php
    		}
    	?>
    	<?php
    		$pp_flickr_username = get_option('pp_flickr_username');
    		
    		if(!empty($pp_flickr_username))
    		{
    	?>
    	<li class="flickr"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Flickr" href="https://flickr.com/people/<?php echo esc_attr($pp_flickr_username); ?>"><i class="fa fa-flickr"></i></a></li>
    	<?php
    		}
    	?>
    	<?php
    		$pp_youtube_url = get_option('pp_youtube_url');
    		
    		if(!empty($pp_youtube_url))
    		{
    	?>
    	<li class="youtube"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Youtube" href="<?php echo esc_url($pp_youtube_url); ?>"><i class="fa fa-youtube"></i></a></li>
    	<?php
    		}
    	?>
    	<?php
    		$pp_vimeo_username = get_option('pp_vimeo_username');
    		
    		if(!empty($pp_vimeo_username))
    		{
    	?>
    	<li class="vimeo"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Vimeo" href="https://vimeo.com/<?php echo esc_attr($pp_vimeo_username); ?>"><i class="fa fa-vimeo-square"></i></i></a></li>
    	<?php
    		}
    	?>
    	<?php
    		$pp_tumblr_username = get_option('pp_tumblr_username');
    		
    		if(!empty($pp_tumblr_username))
    		{
    	?>
    	<li class="tumblr"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Tumblr" href="https://<?php echo esc_attr($pp_tumblr_username); ?>.tumblr.com"><i class="fa fa-tumblr"></i></a></li>
    	<?php
    		}
    	?>
    	<?php
    		$pp_dribbble_username = get_option('pp_dribbble_username');
    		
    		if(!empty($pp_dribbble_username))
    		{
    	?>
    	<li class="dribbble"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Dribbble" href="https://dribbble.com/<?php echo esc_attr($pp_dribbble_username); ?>"><i class="fa fa-dribbble"></i></a></li>
    	<?php
    		}
    	?>
    	<?php
    		$pp_linkedin_url = get_option('pp_linkedin_url');
    		
    		if(!empty($pp_linkedin_url))
    		{
    	?>
    	<li class="linkedin"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Linkedin" href="<?php echo esc_url($pp_linkedin_url); ?>"><i class="fa fa-linkedin"></i></a></li>
    	<?php
    		}
    	?>
    	<?php
            $pp_pinterest_username = get_option('pp_pinterest_username');
            
            if(!empty($pp_pinterest_username))
            {
        ?>
        <li class="pinterest"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Pinterest" href="https://pinterest.com/<?php echo esc_attr($pp_pinterest_username); ?>"><i class="fa fa-pinterest"></i></a></li>
        <?php
            }
        ?>
        <?php
        	$pp_instagram_username = get_option('pp_instagram_username');
        	
        	if(!empty($pp_instagram_username))
        	{
        ?>
        <li class="instagram"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Instagram" href="https://instagram.com/<?php echo esc_attr($pp_instagram_username); ?>"><i class="fa fa-instagram"></i></a></li>
        <?php
        	}
        ?>
        <?php
        	$pp_behance_username = get_option('pp_behance_username');
        	
        	if(!empty($pp_behance_username))
        	{
        ?>
        <li class="behance"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Behance" href="https://behance.net/<?php echo esc_attr($pp_behance_username); ?>"><i class="fa fa-behance-square"></i></a></li>
        <?php
        	}
        ?>
        <?php
		    $pp_tripadvisor_url = get_option('pp_tripadvisor_url');
		    
		    if(!empty($pp_tripadvisor_url))
		    {
		?>
		<li class="tripadvisor"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Tripadvisor" href="<?php echo $pp_tripadvisor_url; ?>"><i class="fa fa-tripadvisor"></i></a></li>
		<?php
		    }
		?>
		<?php
		    $pp_yelp_url = get_option('pp_yelp_url');
		    
		    if(!empty($pp_yelp_url))
		    {
		?>
		<li class="yelp"><a <?php if(!empty($tg_topbar_social_link)) { ?>target="_blank"<?php } ?> title="Yelp" href="<?php echo $pp_yelp_url; ?>"><i class="fa fa-yelp"></i></a></li>
		<?php
		    }
		?>
    </ul>
</div>