Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************
- :: Get social profiles
- ***************************************************/
- if (!function_exists('kleo_get_social_profiles')):
- function kleo_get_social_profiles($args=false)
- {
- $output = '';
- $icons = '';
- $all_options = get_option("kleo_".KLEO_DOMAIN);
- $defaults = array(
- 'container' => 'ul',
- 'item_tag' => 'li',
- 'target' => '_blank'
- );
- // Parse incomming $args into an array and merge it with $defaults
- $args = wp_parse_args( $args, $defaults );
- $args = apply_filters('kleo_get_social_profiles_args', $args);
- //get social data from theme options
- if (!empty($all_options)) {
- foreach ($all_options as $k => $opt)
- {
- if (substr( $k, 0, 7 ) === 'social_' && !empty($opt) ) {
- $k = str_replace('social_','',$k);
- $title = str_replace(
- array('gplus', 'vimeo-squared', 'pinterest-circled', 'instagramm'),
- array('Google+', 'Vimeo','Pinterest', 'Instagram'),
- $k
- );
- $icons .= '<' . $args['item_tag'] . '>';
- $icons .= '<a rel="nofollow" target="'.$args['target'].'" href="'.$opt.'"><i class="icon-'.$k.'"></i><div class="ts-text">'.ucfirst($title).'</div></a>';
- $icons .= '</' . $args['item_tag'] . '>';
- }
- }
- }
- $icons = apply_filters('kleo_get_social_profiles', $icons);
- if ($icons != '') {
- $output .= '<' . $args['container'] . ' class="kleo-social-icons">';
- $output .= $icons;
- $output .= '</' . $args['container'] . '>';
- }
- return $output;
- }
- add_shortcode( 'kleo_social_icons', 'kleo_get_social_profiles' );
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement