<?php
/**
* Header Options.
*
* @package Vintuna
*/

$vintuna_default = vintuna_get_default_theme_options();
$vintuna_post_category_list = vintuna_post_category_list();
$wp_customize->add_section( 'top_bar_setting',
	array(
	'title'      => esc_html__( 'Header Mid-Bar', 'vintuna' ),
	'priority'   => 13,
	'capability' => 'edit_theme_options',
    'panel'      => 'theme_option_panel',
	)
);

$wp_customize->add_setting('ed_ticker_bar_social_nav',
    array(
        'default' => $vintuna_default['ed_ticker_bar_social_nav'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'vintuna_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_ticker_bar_social_nav',
    array(
        'label' => esc_html__('Enable Social Nav', 'vintuna'),
        'section' => 'top_bar_setting',
        'type' => 'checkbox',
    )
);


$wp_customize->add_setting('ed_header_subscription_news',
    array(
        'default' => $vintuna_default['ed_header_subscription_news'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'vintuna_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_header_subscription_news',
    array(
        'label' => esc_html__('Enable Subscription', 'vintuna'),
        'section' => 'top_bar_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'ed_header_subscription_button_text',
    array(
    'default'           => $vintuna_default['ed_header_subscription_button_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'ed_header_subscription_button_text',
    array(
    'label'       => esc_html__( 'Subscription Button Text', 'vintuna' ),
    'section'     => 'top_bar_setting',
    'type'        => 'text',
    )
);


$wp_customize->add_setting( 'ed_header_subscription_posts_title',
    array(
    'default'           => $vintuna_default['ed_header_subscription_posts_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'ed_header_subscription_posts_title',
    array(
    'label'       => esc_html__( 'Subscription PopUp Title', 'vintuna' ),
    'section'     => 'top_bar_setting',
    'type'        => 'text',
    )
);


$wp_customize->add_setting('header_subscription_image',
    array(
        'default' => '',
        'sanitize_callback' => 'esc_url_raw'
    )
);
$wp_customize->add_control( new WP_Customize_Image_Control(
    $wp_customize,
    'header_subscription_image',
        array(
            'label'      => esc_html__( 'Header Subscription Image', 'vintuna' ),
            'section'    => 'top_bar_setting',
        )
    )
);

$wp_customize->add_setting( 'ed_header_subscription_shortcode',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'ed_header_subscription_shortcode',
    array(
    'label'       => esc_html__( 'Subscription Shortcode', 'vintuna' ),
    'section'     => 'top_bar_setting',
    'type'        => 'textarea',
    )
);


$wp_customize->add_section( 'header_news_section',
    array(
    'title'      => esc_html__( 'Ticker/Breaking News Area', 'vintuna' ),
    'priority'   => 15,
    'capability' => 'edit_theme_options',
    'panel'      => 'theme_option_panel',
    )
);

$wp_customize->add_setting('ed_header_ticker_posts',
    array(
        'default' => $vintuna_default['ed_header_ticker_posts'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'vintuna_sanitize_checkbox',
    )
);
$wp_customize->add_control('ed_header_ticker_posts',
    array(
        'label' => esc_html__('Enable Ticker Posts', 'vintuna'),
        'section' => 'header_news_section',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'ed_header_ticker_posts_title',
    array(
    'default'           => $vintuna_default['ed_header_ticker_posts_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'ed_header_ticker_posts_title',
    array(
    'label'       => esc_html__( 'Ticker Section Title', 'vintuna' ),
    'section'     => 'header_news_section',
    'type'        => 'text',
    )
);


$wp_customize->add_setting( 'vintuna_header_ticker_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'vintuna_sanitize_select',
    )
);
$wp_customize->add_control( 'vintuna_header_ticker_cat',
    array(
    'label'       => esc_html__( 'Ticker Posts Category', 'vintuna' ),
    'section'     => 'header_news_section',
    'type'        => 'select',
    'choices'     => $vintuna_post_category_list,
    )
);
