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

$newsnation_default = newsnation_get_default_theme_options();
$newsnation_post_category_list = newsnation_post_category_list();
$wp_customize->add_section( 'top_bar_setting',
	array(
	'title'      => esc_html__( 'Header Mid-Bar', 'newsnation' ),
	'priority'   => 13,
	'capability' => 'edit_theme_options',
    'panel'      => 'theme_option_panel',
	)
);

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


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

$wp_customize->add_setting( 'ed_header_subscription_button_text',
    array(
    'default'           => $newsnation_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', 'newsnation' ),
    'section'     => 'top_bar_setting',
    'type'        => 'text',
    )
);


$wp_customize->add_setting( 'ed_header_subscription_posts_title',
    array(
    'default'           => $newsnation_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', 'newsnation' ),
    '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', 'newsnation' ),
            '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', 'newsnation' ),
    'section'     => 'top_bar_setting',
    'type'        => 'textarea',
    )
);


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

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

$wp_customize->add_setting( 'ed_header_ticker_posts_title',
    array(
    'default'           => $newsnation_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', 'newsnation' ),
    'section'     => 'header_news_section',
    'type'        => 'text',
    )
);


$wp_customize->add_setting( 'newsnation_header_ticker_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'newsnation_sanitize_select',
    )
);
$wp_customize->add_control( 'newsnation_header_ticker_cat',
    array(
    'label'       => esc_html__( 'Ticker Posts Category', 'newsnation' ),
    'section'     => 'header_news_section',
    'type'        => 'select',
    'choices'     => $newsnation_post_category_list,
    )
);
