add_section( 'automobile_social_links', array(
'priority' => 700,
'title' => __( 'Social Links', 'automobile' ),
) );
$automobile_social_icons = automobile_get_social_icons_list();
foreach ( $automobile_social_icons as $key => $value ){
if( 'skype_link' == $key ){
$wp_customize->add_setting( 'automobile_theme_options['. $key .']', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_attr',
) );
$wp_customize->add_control( 'automobile_theme_options['. $key .']', array(
'description' => __( 'Skype link can be of formats:
callto://+{number}
skype:{username}?{action}. More Information in readme file', 'automobile' ),
'label' => $value['label'],
'section' => 'automobile_social_links',
'settings' => 'automobile_theme_options['. $key .']',
'type' => 'url',
) );
}
else {
if( 'email_link' == $key ){
$wp_customize->add_setting( 'automobile_theme_options['. $key .']', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_email',
) );
}
else if( 'handset_link' == $key || 'phone_link' == $key ){
$wp_customize->add_setting( 'automobile_theme_options['. $key .']', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_text_field',
) );
}
else {
$wp_customize->add_setting( 'automobile_theme_options['. $key .']', array(
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw',
) );
}
$wp_customize->add_control( 'automobile_theme_options['. $key .']', array(
'label' => $value['label'],
'section' => 'automobile_social_links',
'settings' => 'automobile_theme_options['. $key .']',
'type' => 'url',
) );
}
}
// Social Icons End