<?php 
function converio_customize_register_social($wp_customize) {
	$wp_customize->add_section('social', array(
		'title' => esc_attr__('Social media profiles', 'converio'),
		'priority' => 32
	));

	$socials = array(
		'facebook',
		'twitter',
		'google',
		'googleplus',
		'linkedin',
		'instagram',
		'picasa',
		'flickr',
		'vimeo',
		'youtube',
		'yahoo',
		'delicious',
		'pinterest',
		'evernote',
		'stumbleupon',
		'dribbble',
		'behance',
		'tumblr',
		'blogger',
		'github',
		'lastfm',
		'skype',
		'aim',
		'hi5',
		'bing',
		'bebo',
		'technorati',
		'wordpress',
		'location',
		'tripadvisor',
		'path',
		'livejournal',
		'envato',
		'deviantart',
		'forrst',
		'friendfeed',
		'grooveshark',
		'sharethis',
		'reddit',
		'digg',
		'myspace',
		'amazon',
		'googleplay',
		'apple',
		'appstore',
		'windows',
		'msn',
		'android',
		'xing',
		'spotify',
		'qik',
		'netvibes',
		'disqus',
		'orkut',
		'squidoo',
		'rdio',
		'metacafe',
		'feedburner',
		'yelp',
		'soundcloud',
		'quora',
		'icloud',
		'netlog',
		'newsvine',
		'vk',
		'vkontakte',
		'odnoklassniki',
		'designfloat',
		'yandex',
		'mailru',
		'badoo',
		'vine',
		'mixi',
		'fotolog',
		'sonico',
		'tagged',
		'formspring',
		'skyrock',
		'friendster',
		'classmates',
		'askfm',
		'foursquare',
		'aboutme',
		'weibo',
		'qzone',
		'renren',
		'douban',
		'baidu',
		'cyworld',
		'tuenti',
		'treehouse',
		'zerply',
		'justgiving',
		'kickstarter',
		'user',
		'dropbox',
		'heart',
		'ebay',
		'email',
		'rss'
	);
    $socials_names = array(
		'Facebook',
		'Twitter',
		'Google',
		'Google Plus',
		'LinkedIn',
		'Instagram',
		'Picasa',
		'Flickr',
		'Vimeo',
		'Youtube',
		'Yahoo',
		'Delicious',
		'Pinterest',
		'Evernote',
		'Stumbleupon',
		'Dribbble',
		'Behance',
		'Tumblr',
		'Blogger',
		'Github',
		'Lastfm',
		'Skype',
		'Aim',
		'Hi5',
		'Bing',
		'Bebo',
		'Technorati',
		'WordPress',
		'Location',
		'TripAdvisor',
		'Path',
		'LiveJournal',
		'Envato',
		'Deviantart',
		'Forrst',
		'Friendfeed',
		'Grooveshark',
		'ShareThis',
		'Reddit',
		'Digg',
		'Myspace',
		'Amazon',
		'Google Play',
		'Apple',
		'App Store',
		'Windows',
		'MSN',
		'Android',
		'Xing',
		'Spotify',
		'Qik',
		'Netvibes',
		'Disqus',
		'Orkut',
		'Squidoo',
		'Rdio',
		'Metacafe',
		'feedburner',
		'Yelp',
		'SoundCloud',
		'Quora',
		'iCloud',
		'Netlog',
		'Newsvine',
		'vk',
		'VKontakte',
		'Odnoklassniki',
		'DesignFloat',
		'Yandex',
		'Mail.ru',
		'Badoo',
		'Vine',
		'Mixi',
		'Fotolog',
		'Sonico',
		'Tagged',
		'Formspring',
		'Skyrock',
		'Friendster',
		'Classmates',
		'Ask.fm',
		'Foursquare',
		'About.me',
		'Weibo',
		'Qzone',
		'Renren',
		'Douban',
		'Baidu',
		'Cyworld',
		'Tuenti',
		'Treehouse',
		'Zerply',
		'JustGiving',
		'Kickstarter',
		'User',
		'Dropbox',
		'Heart',
		'Bay',
		'E-mail',
		'RSS'
    );

    $wp_customize->add_setting('show_rss', array(
		'default' => 0,
		'sanitize_callback' => ''
	));
	$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'show_rss',
        array(
            'label'     => esc_attr__('Disable RSS link', 'converio'),
            'section'   => 'social',
            'settings'  => 'show_rss',
            'type'      => 'checkbox',
            'priority'  => 0
        )
	));

    foreach($socials as $k=>$v) {
    	if($v == 'rss') continue; 
    	$setting_name = 'social_' . $v;
    	$wp_customize->add_setting($setting_name, array(
    		'sanitize_callback' => ''
    	));
		$wp_customize->add_control($setting_name, array(
			'label' => $socials_names[$k],
			'section' => 'social',
			'settings' => $setting_name,
			'priority' => $k + 1
		));	
    }
}

add_action('customize_register', 'converio_customize_register_social');
?>