<?php
/*** Header Social Icon
 *
 * @package Newsxo
 */

$newsxo_default = newsxo_get_default_theme_options();

// Social Icon Setting
Newsxo_Customizer_Control::add_section(
	'social_icon_options',
	array(
		'title' => esc_html__( 'Social Icons', 'newsxo' ), 
        'panel' => 'header_option_panel',
        'priority' => 35,
	)
);
    
    //Enable and disable social icon
    Newsxo_Customizer_Control::add_field( 
        array(
            'type'     => 'toggle', 
            'settings'  => 'social_icon_header_enable',
            'label' => esc_html__('Hide/Show on Header', 'newsxo'),
            'section'  => 'social_icon_options',
            'priority' => 103,
            'default' => true,
            'sanitize_callback' => 'newsxo_sanitize_checkbox',
        )
    );
    //Enable and disable social icon
    Newsxo_Customizer_Control::add_field( 
        array(
            'type'     => 'toggle', 
            'settings'  => 'footer_social_icon_enable',
            'label' => esc_html__('Hide/Show on Footer', 'newsxo'),
            'section'  => 'social_icon_options',
            'priority' => 103,
            'default' => true,
            'sanitize_callback' => 'newsxo_sanitize_checkbox',
        )
    );
    // Social Icon Repaeter
    $wp_customize->add_setting(
        'newsxo_social_icons',
        array(
            'default'           => newsxo_get_social_icon_default(),
            'sanitize_callback' => 'newsxo_repeater_sanitize'
        )
    );
    $wp_customize->add_control(
        new Newsxo_Repeater_Control(
            $wp_customize,
            'newsxo_social_icons',
            array(
                'label'                            => esc_html__( 'Social Icons', 'newsxo' ),
                'section'                          => 'social_icon_options',
                'priority'                         =>  104,
                'add_field_label'                  => esc_html__( 'Add New Social', 'newsxo' ),
                'item_name'                        => esc_html__( 'Social', 'newsxo' ),
                'customizer_repeater_icon_control' => true,
                'customizer_repeater_link_control' => true,
                'customizer_repeater_checkbox_control' => true,
            )
        )
    );
    Newsxo_Customizer_Control::add_field( 
        array(
            'type'     => 'pro-text', 
            'settings'  => 'footer_social_icon_pro',
            'section'  => 'social_icon_options',
            'priority' => 153,
            'default' => '',
            'sanitize_callback' => 'newsxo_sanitize_checkbox',
        )
    );