<?php
/**
 * Theme Header Panel Customizer
 *
 * @package mediapulse
*/

function mediapulse_theme_header_panel_customizer ( $wp_customize ) {

    $wp_customize->add_section('news_theme_header',
        array(
            'title'         => esc_html__('Theme Header', 'mediapulse' ),
            'priority'      => 2
        )
    );

    // enable/disable site title
    $wp_customize->add_setting('hide_show_search_icon',
        array(
			'type'              => 'theme_mod',
            'default'           => true,
            'sanitize_callback' => 'mediapulse_sanitize_checkbox'
        )
    );
    $wp_customize->add_control(new mediapulse_Toggle_Control( $wp_customize, 'hide_show_search_icon',
        array(
            'label'     =>  esc_html__( 'Enable/Disable Search Icon', 'mediapulse'),
            'section'   =>  'news_theme_header',
            'settings'   =>  'hide_show_search_icon',
            'type'      =>  'toggle',
            'priority'  =>  4
        )
    ));

    // enable/disable header sticky
    $wp_customize->add_setting('hide_show_date',
        array(
			'type'              => 'theme_mod',
            'default'           => true,
            'sanitize_callback' => 'mediapulse_sanitize_checkbox'
        )
    );
    $wp_customize->add_control(new mediapulse_Toggle_Control( $wp_customize, 'hide_show_date',
        array(
            'label'     =>  esc_html__( 'Enable/Disable Date', 'mediapulse'),
            'section'   =>  'news_theme_header',
            'settings'   =>  'hide_show_date',
            'type'      =>  'toggle',
            'priority'  =>  5
        )
    ));
	
	// enable/disable header sticky
    $wp_customize->add_setting('hide_show_trending',
        array(
			'type'              => 'theme_mod',
            'default'           => true,
            'sanitize_callback' => 'mediapulse_sanitize_checkbox'
        )
    );
    $wp_customize->add_control(new mediapulse_Toggle_Control( $wp_customize, 'hide_show_trending',
        array(
            'label'     =>  esc_html__( 'Enable/Disable Trending News', 'mediapulse'),
            'section'   =>  'news_theme_header',
            'settings'   =>  'hide_show_trending',
            'type'      =>  'toggle',
            'priority'  =>  5
        )
    ));
	
	$wp_customize->add_setting( 'sale_header_image', array(
			'type'              => 'theme_mod',
			'default'           => '',
			'capability'        => 'edit_theme_options',
			'sanitize_callback' => 'esc_url_raw',
	) );

	$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'sale_header_image', array(
		'label'    => __( 'header image for sale or advertisement', 'mediapulse' ),
		'description'    => __( 'Please use image size : width - 700px, height - 90px', 'mediapulse' ),
		'section'  => 'news_theme_header',
		'settings' => 'sale_header_image'
	) ) );


}
add_action( 'customize_register', 'mediapulse_theme_header_panel_customizer' );