<?php

function opening_shortly_lite_customize_register($wp_customize) {
    
    // Register custom section types.
    $wp_customize->register_section_type( 'opening_shortly_lite_customize_section_pro' );

    // Register sections.
    $wp_customize->add_section( new opening_shortly_lite_customize_section_pro(
        $wp_customize,
        'theme_go_pro',
        array(
            'priority' => 1,
            'title'    => esc_html__( 'Opening Shortly Pro', 'opening-shortly-lite' ),
            'pro_text' => esc_html__( 'Upgrade To Pro', 'opening-shortly-lite' ),
            'pro_url'  => 'https://www.themescave.com/themes/wordpress-template-opening-shortly-pro/',
        )
    ) );

    $wp_customize->add_section('opening_shortly_lite_header', array(
        'title'       => esc_html__(' Header Phone and email', 'opening-shortly-lite'),
        'description' => '',
        'priority'    => 30,
    ));

    $wp_customize->add_section('opening_shortly_lite_social', array(
        'title'       => esc_html__(' Social Link', 'opening-shortly-lite'),
        'description' => '',
        'priority'    => 35,
    ));
    $wp_customize->add_section('opening_shortly_lite_opening_date', array(
        'title'       => esc_html__('Opening Date', 'opening-shortly-lite'),
        'description' => '',
        'priority'    => 35,
    ));
    
    

    $wp_customize->add_section('opening_shortly_lite_footer', array(
        'title'       => esc_html__(' Footer', 'opening-shortly-lite'),
        'description' => '',
        'priority'    => 37,
    ));


    //  =============================
    //  = Text Input phone number                =
    //  =============================
    $wp_customize->add_setting('opening_shortly_lite_phone', array(
        'default'           => '',
        'sanitize_callback' => 'opening_shortly_lite_sanitize_phone_number'
    ));

    $wp_customize->add_control('opening_shortly_lite_phone', array(
        'label'   => esc_html__('Phone Number', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_header',
        'setting' => 'opening_shortly_lite_phone',
        'type'    => 'text'
    ));

    //  =============================
    //  = Text Input Email                =
    //  =============================
    $wp_customize->add_setting('opening_shortly_lite_email', array(
        'default'           => '',
        'sanitize_callback' => 'sanitize_email'
    ));

    $wp_customize->add_control('opening_shortly_lite_email', array(
        'label'   => esc_html__('Email', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_header',
        'setting' => 'opening_shortly_lite_email',
        'type'    => 'email'
    ));

    //  =============================
    //  = Text Input facebook                =
    //  =============================
    $wp_customize->add_setting('opening_shortly_lite_fb', array(
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw'
    ));

    $wp_customize->add_control('opening_shortly_lite_fb', array(
        'label'   => esc_html__('Facebook', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_social',
        'setting' => 'opening_shortly_lite_fb',
        'type'    => 'url'
    ));
    //  =============================
    //  = Text Input Twitter                =
    //  =============================
    $wp_customize->add_setting('opening_shortly_lite_twitter', array(
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw'
    ));

    $wp_customize->add_control('opening_shortly_lite_twitter', array(
        'label'   => esc_html__('Twitter', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_social',
        'setting' => 'opening_shortly_lite_twitter',
        'type'    => 'url'
    ));
    //  =============================
    //  = Text Input googleplus                =
    //  =============================
    $wp_customize->add_setting('opening_shortly_lite_youtube', array(
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw'
    ));

    $wp_customize->add_control('opening_shortly_lite_youtube', array(
        'label'   => esc_html__('YouTube', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_social',
        'setting' => 'opening_shortly_lite_youtube',
        'type'    => 'url'
    ));
    //  =============================
    //  = Text Input linkedin                =
    //  =============================
    $wp_customize->add_setting('opening_shortly_lite_in', array(
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw'
    ));

    $wp_customize->add_control('opening_shortly_lite_in', array(
        'label'   => esc_html__('Linkedin', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_social',
        'setting' => 'opening_shortly_lite_in',
        'type'    => 'url'
    ));

    //  =============================
    //  = Text Input pininterest                =
    //  =============================
    $wp_customize->add_setting('opening_shortly_lite_pin', array(
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw'
    ));

    $wp_customize->add_control('opening_shortly_lite_pin', array(
        'label'   => esc_html__('Pinterest', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_social',
        'setting' => 'opening_shortly_lite_pin',
        'type'    => 'url'
    ));
    
    
    //opening date start
     $wp_customize->add_control('opening_shortly_lite_opening_date_show_hide', array(
        'type'    => 'checkbox',
        'section' => 'opening_shortly_lite_opening_date', // Add a default or your own section
        'label'   => esc_html__('Clik to Hide this section', 'opening-shortly-lite'),
    ));

    $wp_customize->add_setting('opening_shortly_lite_opening_date_heading', array(
        'default'           => '',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('opening_shortly_lite_opening_date_heading', array(
        'label'   => esc_html__('Heading', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_opening_date',
        'setting' => 'opening_shortly_lite_opening_date_heading',
        'type'    => 'text'
    ));

    $wp_customize->add_setting('opening_shortly_lite_opening_date', array(
        'default'           => '',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('opening_shortly_lite_opening_date', array(
        'label'   => esc_html__('Opening Date', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_opening_date',
        'setting' => 'opening_shortly_lite_opening_date',
        'type'    => 'text'
    ));

    $wp_customize->add_setting('opening_shortly_lite_opening_month', array(
        'default'           => '',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('opening_shortly_lite_opening_month', array(
        'label'   => esc_html__('Opening Month ', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_opening_date',
        'setting' => 'opening_shortly_lite_opening_month',
        'type'    => 'text'
    ));

    $wp_customize->add_setting('opening_shortly_lite_opening_year', array(
        'default'           => '',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('opening_shortly_lite_opening_year', array(
        'label'   => esc_html__('Opening Year', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_opening_date',
        'setting' => 'opening_shortly_lite_opening_year',
        'type'    => 'text'
    ));
    // opening date end

    

    //  =============================
    //  = Footer              =
    //  =============================
    // Footer design and developed
    $wp_customize->add_setting('opening_shortly_lite_design', array(
        'default'           => '',
        'sanitize_callback' => 'sanitize_textarea_field'
    ));

    $wp_customize->add_control('opening_shortly_lite_design', array(
        'label'   => esc_html__('Design and developed', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_footer',
        'setting' => 'opening_shortly_lite_design',
        'type'    => 'textarea'
    ));
    // Footer copyright
    $wp_customize->add_setting('opening_shortly_lite_copyright', array(
        'default'           => '',
        'sanitize_callback' => 'sanitize_textarea_field'
    ));

    $wp_customize->add_control('opening_shortly_lite_copyright', array(
        'label'   => esc_html__('Copyright', 'opening-shortly-lite'),
        'section' => 'opening_shortly_lite_footer',
        'setting' => 'opening_shortly_lite_copyright',
        'type'    => 'textarea'
    ));
}

add_action('customize_register', 'opening_shortly_lite_customize_register');