<?php
/*** Header Date & Time
 *
 * @package Newsxo
 */

$newsxo_default = newsxo_get_default_theme_options();

// Add Section.
Newsxo_Customizer_Control::add_section(
    'date_time_section',
    array(
        'title' => __('Date & Time', 'newsxo'),
        'priority' => 30,
        'panel' => 'header_option_panel',
    )
);
    Newsxo_Customizer_Control::add_field(
        array(
            'type'     => 'hidden', 
            'settings'  => 'date_settings',
            'label' => esc_html__('Date', 'newsxo'),
            'section'  => 'date_time_section',
            'sanitize_callback' => 'newsxo_sanitize_text',
        )
    );

    Newsxo_Customizer_Control::add_field( 
        array(
            'type'     => 'toggle', 
            'settings'  => 'header_date_enable',
            'label' => esc_html__('Hide/Show', 'newsxo'),
            'section'  => 'date_time_section',
            'default' => true, 
            'sanitize_callback' => 'newsxo_sanitize_checkbox',
        )
    );

    Newsxo_Customizer_Control::add_field(
        array(
            'type'     => 'hidden', 
            'settings'  => 'time_settings',
            'label' => esc_html__('Time', 'newsxo'),
            'section'  => 'date_time_section',
            'sanitize_callback' => 'newsxo_sanitize_text',
        )
    );

    Newsxo_Customizer_Control::add_field( 
        array(
            'type'     => 'toggle', 
            'settings'  => 'header_time_enable',
            'label' => esc_html__('Hide/Show', 'newsxo'),
            'section'  => 'date_time_section',
            'default' => true, 
            'sanitize_callback' => 'newsxo_sanitize_checkbox',
        )
    );
    Newsxo_Customizer_Control::add_field( 
        array(
            'type'     => 'select', 
            'settings'  => 'newsxo_date_time_show_type',
            'label'    => esc_html__( 'Display Type:', 'newsxo' ),
            'section'  => 'date_time_section',
            'default' => 'newsxo_default',
            'choices'  => array(
                'newsxo_default'          => esc_html__( 'Theme Default Setting', 'newsxo' ),
                'wordpress_date_setting' => esc_html__( 'From WordPress Setting', 'newsxo' ),
            ),
            'sanitize_callback' => 'newsxo_sanitize_select',
        )
    );