<?php
/**
 * Theme Customizer Controls
 *
 * @package Lawyer Consultant
 */


if ( ! function_exists( 'lawyer_consultant_customizer_header_register' ) ) :
function lawyer_consultant_customizer_header_register( $wp_customize ) {

    $wp_customize->add_section(
        'lawyer_consultant_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'lawyer-consultant' )
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'lawyer_consultant_label_header_settings_title', 
        array(
            'sanitize_callback' => 'lawyer_consultant_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Lawyer_Consultant_Title_Info_Control( $wp_customize, 'lawyer_consultant_label_header_settings_title', 
        array(
            'label'       => esc_html__( 'Header Buttons', 'lawyer-consultant' ),
            'section'     => 'lawyer_consultant_home_header_settings',
            'type'        => 'lawyer-consultant-title',
            'settings'    => 'lawyer_consultant_label_header_settings_title',
        ) 
    ));

    // Register Link
    $wp_customize->add_setting(
        'lawyer_consultant_header_register_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_header_register_link',
        array(
            'label'           => sprintf( esc_html__( 'Register Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_header_register_link' ,
            'type'            => 'url',
        )
    );

    // Login Link
    $wp_customize->add_setting(
        'lawyer_consultant_header_login_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_header_login_link',
        array(
            'label'           => sprintf( esc_html__( 'Login Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_header_login_link' ,
            'type'            => 'url',
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'lawyer_consultant_label_social_meida_settings_title', 
        array(
            'sanitize_callback' => 'lawyer_consultant_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Lawyer_Consultant_Title_Info_Control( $wp_customize, 'lawyer_consultant_label_social_meida_settings_title', 
        array(
            'label'       => esc_html__( 'Social Media Links', 'lawyer-consultant' ),
            'section'     => 'lawyer_consultant_home_header_settings',
            'type'        => 'lawyer-consultant-title',
            'settings'    => 'lawyer_consultant_label_social_meida_settings_title',
        ) 
    ));

    // Facebook Link
    $wp_customize->add_setting(
        'lawyer_consultant_social_media1_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_social_media1_heading',
        array(
            'label'           => sprintf( esc_html__( 'Facebook Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_social_media1_heading' ,
            'type'            => 'url',
        )
    );

    // Instagram Link
    $wp_customize->add_setting(
        'lawyer_consultant_social_media2_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_social_media2_heading',
        array(
            'label'           => sprintf( esc_html__( 'Instagram Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_social_media2_heading' ,
            'type'            => 'url',
        )
    );

    // Twitter Link
    $wp_customize->add_setting(
        'lawyer_consultant_social_media3_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_social_media3_heading',
        array(
            'label'           => sprintf( esc_html__( 'Twitter Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_social_media3_heading' ,
            'type'            => 'url',
        )
    );

    // Youtube Link
    $wp_customize->add_setting(
        'lawyer_consultant_social_media4_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_social_media4_heading',
        array(
            'label'           => sprintf( esc_html__( 'Youtube Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_social_media4_heading' ,
            'type'            => 'url',
        )
    );

    // Pinterest Link
    $wp_customize->add_setting(
        'lawyer_consultant_social_media5_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_social_media5_heading',
        array(
            'label'           => sprintf( esc_html__( 'Pinterest Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_social_media5_heading' ,
            'type'            => 'url',
        )
    );

    // Linkedin Link
    $wp_customize->add_setting(
        'lawyer_consultant_social_media6_heading',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'lawyer_consultant_social_media6_heading',
        array(
            'label'           => sprintf( esc_html__( 'Linkedin Link', 'lawyer-consultant' ), ),
            'section'         => 'lawyer_consultant_home_header_settings',
            'settings'        => 'lawyer_consultant_social_media6_heading' ,
            'type'            => 'url',
        )
    );

}
endif;

add_action( 'customize_register', 'lawyer_consultant_customizer_header_register' );