Created
April 29, 2014 10:00
-
-
Save anonymous/11395792 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Catch Box Child Theme functions and definitions | |
* | |
*/ | |
if ( ! function_exists( 'catchbox_socialprofile' ) ): | |
/** | |
* Social Profles | |
* | |
* @since Catch Box 1.0 | |
*/ | |
function catchbox_socialprofile() { | |
//delete_transient( 'catchbox_socialprofile' ); | |
$options = get_option('catchbox_options_social_links'); | |
$flag = 0; | |
if( !empty( $options ) ) { | |
foreach( $options as $option ) { | |
if( $option ) { | |
$flag = 1; | |
} | |
else { | |
$flag = 0; | |
} | |
if( $flag == 1) { | |
break; | |
} | |
} | |
} | |
if( ( !$catchbox_socialprofile = get_transient( 'catchbox_socialprofile' ) ) && ($flag == 1) ) { | |
echo '<!-- refreshing cache -->'; | |
$catchbox_socialprofile = ' | |
<div class="social-profile"> | |
Volg mij: | |
<ul>'; | |
if ($options['social_facebook']) { | |
$catchbox_socialprofile .= '<li class="facebook"><a href="'.$options['social_facebook'].'" title="Facebook" target="_blank">Facebook</a></li>'; | |
} | |
if ($options['social_twitter']) { | |
$catchbox_socialprofile .= '<li class="twitter"><a href="'.$options['social_twitter'].'" title="Twitter" target="_blank">Twitter</a></li>'; | |
} | |
//Google+ | |
if ($options['social_google']) { | |
$catchbox_socialprofile .= '<li class="google-plus"><a href="'.$options['social_google'].'" title="Google Plus" target="_blank">Google Plus</a></li>'; | |
} | |
if ($options['social_linkedin']) { | |
$catchbox_socialprofile .= '<li class="linkedin"><a href="'.$options['social_linkedin'].'" title="Linkedin" target="_blank">Linkedin</a></li>'; | |
} | |
if ($options['social_pinterest']) { | |
$catchbox_socialprofile .= '<li class="pinterest"><a href="'.$options['social_pinterest'].'" title="Pinterest" target="_blank">Pinterest</a></li>'; | |
} | |
//Youtube | |
if ($options['social_youtube']) { | |
$catchbox_socialprofile .= '<li class="you-tube"><a href="'.$options['social_youtube'].'" title="YouTube" target="_blank">YouTube</a></li>'; | |
} | |
//RSS Feed | |
if ($options['social_rss']) { | |
$catchbox_socialprofile .= '<li class="rss"><a href="'.$options['social_rss'].'" title="RSS Feed" target="_blank">RSS Feed</a></li>'; | |
} | |
//Deviantart | |
if ($options['social_deviantart']) { | |
$catchbox_socialprofile .= '<li class="deviantart"><a href="'.$options['social_deviantart'].'" title="Deviantart" target="_blank">Deviantart</a></li>'; | |
} | |
//Tumblr | |
if ($options['social_tumblr']) { | |
$catchbox_socialprofile .= '<li class="tumblr"><a href="'.$options['social_tumblr'].'" title="Tumblr" target="_blank">Tumblr</a></li>'; | |
} | |
//Vimeo | |
if ($options['social_viemo']) { | |
$catchbox_socialprofile .= '<li class="vimeo"><a href="'.$options['social_viemo'].'" title="Vimeo" target="_blank">Vimeo</a></li>'; | |
} | |
//Dribbble | |
if ($options['social_dribbble']) { | |
$catchbox_socialprofile .= '<li class="dribbble"><a href="'.$options['social_dribbble'].'" title="Dribbble" target="_blank">Dribbble</a></li>'; | |
} | |
//MySpace | |
if ($options['social_myspace']) { | |
$catchbox_socialprofile .= '<li class="my-space"><a href="'.$options['social_myspace'].'" title="MySpace" target="_blank">MySpace</a></li>'; | |
} | |
//Aim | |
if ($options['social_aim']) { | |
$catchbox_socialprofile .= '<li class="aim"><a href="'.$options['social_aim'].'" title="Aim" target="_blank">Aim</a></li>'; | |
} | |
//Flickr | |
if ($options['social_flickr']) { | |
$catchbox_socialprofile .= '<li class="flickr"><a href="'.$options['social_flickr'].'" title="Flickr" target="_blank">Flickr</a></li>'; | |
} | |
//Slideshare | |
if ( !empty( $options[ 'social_slideshare' ] ) ) { | |
$catchbox_socialprofile .= '<li class="slideshare"><a href="'.$options[ 'social_slideshare' ].'" title="Slideshare" target="_blank">Slideshare</a></li>'; | |
} | |
if ( !empty( $options[ 'social_instagram' ] ) ) { | |
$catchbox_socialprofile .= '<li class="instagram"><a href="'.$options[ 'social_instagram' ].'" title="Instagram" target="_blank">Instagram</a></li>'; | |
} | |
//skype | |
if ( !empty( $options[ 'social_skype' ] ) ) { | |
$catchbox_socialprofile .= '<li class="skype"><a href="'.$options[ 'social_skype' ].'" title="Skype" target="_blank">Skype</a></li>'; | |
} | |
//Soundcloud | |
if ( !empty( $options[ 'social_soundcloud' ] ) ) { | |
$catchbox_socialprofile .= '<li class="soundcloud"><a href="'.$options[ 'social_soundcloud' ].'" title="Instagram" target="_blank">Soundcloud</a></li>'; | |
} | |
$catchbox_socialprofile .= ' | |
</ul> | |
</div>'; | |
set_transient( 'catchbox_socialprofile', $catchbox_socialprofile, 604800 ); | |
} | |
echo $catchbox_socialprofile; | |
} | |
endif; // catchbox_socialprofile | |
// Load Social Profile catchbox_site_generator hook | |
add_action('catchbox_site_generator', 'catchbox_socialprofile', 10 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment