$social_site ) { $label = ucfirst( $key ); if ( $key == 'google-plus' ) { $label = __('Google Plus', 'startup-blog'); } elseif ( $key == 'rss' ) { $label = __('RSS', 'startup-blog'); } elseif ( $key == 'soundcloud' ) { $label = __('SoundCloud', 'startup-blog'); } elseif ( $key == 'slideshare' ) { $label = __('SlideShare', 'startup-blog'); } elseif ( $key == 'codepen' ) { $label = __('CodePen', 'startup-blog'); } elseif ( $key == 'stumbleupon' ) { $label = __('StumbleUpon', 'startup-blog'); } elseif ( $key == 'deviantart' ) { $label = __('DeviantArt', 'startup-blog'); } elseif ( $key == 'hacker-news' ) { $label = __('Hacker News', 'startup-blog'); } elseif ( $key == 'whatsapp' ) { $label = __('WhatsApp', 'startup-blog'); } elseif ( $key == 'qq' ) { $label = __('QQ', 'startup-blog'); } elseif ( $key == 'vk' ) { $label = __('VK', 'startup-blog'); } elseif ( $key == 'wechat' ) { $label = __('WeChat', 'startup-blog'); } elseif ( $key == 'tencent-weibo' ) { $label = __('Tencent Weibo', 'startup-blog'); } elseif ( $key == 'paypal' ) { $label = __('PayPal', 'startup-blog'); } elseif ( $key == 'email-form' ) { $label = __('Contact Form', 'startup-blog'); } elseif ( $key == 'google-wallet' ) { $label = __('Google Wallet', 'startup-blog'); } elseif ( $key == 'ok-ru' ) { $label = __('OK.ru', 'startup-blog'); } elseif ( $key == 'stack-overflow' ) { $label = __('Stack Overflow', 'startup-blog'); } ?>

'/>
$social_site ) { if ( $key == 'email' ) { // if email, only accept 'mailto' protocol if ( isset( $_POST["$key-profile"] ) ) { update_user_meta( $user_id, $social_site, sanitize_email( wp_unslash( $_POST["$key-profile"] ) ) ); } } elseif ( $key == 'skype' ) { // accept skype protocol if ( isset( $_POST["$key-profile"] ) ) { update_user_meta( $user_id, $social_site, esc_url_raw( wp_unslash( $_POST["$key-profile"] ), array( 'http', 'https', 'skype' ) ) ); } } else { if ( isset( $_POST["$key-profile"] ) ) { update_user_meta( $user_id, $social_site, esc_url_raw( wp_unslash( $_POST["$key-profile"] ) ) ); } } } } } add_action( 'personal_options_update', 'startup_blog_save_social_profiles' ); add_action( 'edit_user_profile_update', 'startup_blog_save_social_profiles' );