<?php
/**
 * Header Options
 *
 * @package Rising News
 */

$wp_customize->add_section(
	'rising_news_header_options',
	array(
		'panel' => 'rising_news_theme_options',
		'title' => esc_html__( 'Header Options', 'rising-news' ),
	)
);

// Header Section - Topbar Menu.
$wp_customize->add_setting(
	'rising_news_enable_topbar_section',
	array(
		'default'           => true,
		'sanitize_callback' => 'rising_news_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Rising_News_Toggle_Switch_Custom_Control(
		$wp_customize,
		'rising_news_enable_topbar_section',
		array(
			'label'    => esc_html__( 'Topbar Section', 'rising-news' ),
			'section'  => 'rising_news_header_options',
			'settings' => 'rising_news_enable_topbar_section',
		)
	)
);

// Header Options - Header Button Custom Label.
$wp_customize->add_setting(
	'rising_news_header_custom_button_label',
	array(
		'default'           => __( 'Subscribe', 'rising-news' ),
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'rising_news_header_custom_button_label',
	array(
		'label'    => esc_html__( 'Header Custom Button', 'rising-news' ),
		'section'  => 'rising_news_header_options',
		'settings' => 'rising_news_header_custom_button_label',
		'type'     => 'text',
	)
);

// Header Options - Header Button Custom URL.
$wp_customize->add_setting(
	'rising_news_header_custom_button_url',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'rising_news_header_custom_button_url',
	array(
		'label'    => esc_html__( 'Button Link', 'rising-news' ),
		'section'  => 'rising_news_header_options',
		'settings' => 'rising_news_header_custom_button_url',
		'type'     => 'url',
	)
);

// Header Section - Advertisement.
$wp_customize->add_setting(
	'rising_news_header_advertisement',
	array(
		'sanitize_callback' => 'rising_news_sanitize_image',
	)
);

$wp_customize->add_control(
	new WP_Customize_Image_Control(
		$wp_customize,
		'rising_news_header_advertisement',
		array(
			'label'    => esc_html__( 'Advertisement Image', 'rising-news' ),
			'section'  => 'rising_news_header_options',
			'settings' => 'rising_news_header_advertisement',
		)
	)
);

// Header Section - Advertisement URL.
$wp_customize->add_setting(
	'rising_news_header_advertisement_url',
	array(
		'default'           => '#',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'rising_news_header_advertisement_url',
	array(
		'label'    => esc_html__( 'Advertisement URL', 'rising-news' ),
		'section'  => 'rising_news_header_options',
		'settings' => 'rising_news_header_advertisement_url',
		'type'     => 'url',
	)
);
