<?php
/**
 * Moral Theme Customizer
 *
 * @package Moral
 *
 * Header panel
 */

// Header section
$wp_customize->add_section(
	'moral_magazine_header_section',
	array(
		'title' => esc_html__( 'Header', 'moral-magazine' ),
		'panel' => 'moral_magazine_general_panel',
	)
);


$wp_customize->add_setting( 'moral_magazine_header_bg_image', array(
	'sanitize_callback' => 'moral_magazine_sanitize_image',
) );

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'moral_magazine_header_bg_image',
	array(
	'label'       		=> esc_html__( 'BG Image', 'moral-magazine' ),
	'section'     		=> 'moral_magazine_header_section',
) ) );


// ads image setting and control.
$wp_customize->add_setting( 'moral_magazine_header_ads_image', array(
	'sanitize_callback' => 'moral_magazine_sanitize_image',
	'default'			=> get_template_directory_uri() . '/assets/img/site-advertisement.jpg',
) );

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'moral_magazine_header_ads_image',
	array(
	'label'       		=> esc_html__( 'Ads Image', 'moral-magazine' ),
	'description' 		=> sprintf( esc_html__( 'Recommended size: %1$dpx x %2$dpx ', 'moral-magazine' ), 810, 120 ),
	'section'     		=> 'moral_magazine_header_section',
) ) );

// ads link setting and control
$wp_customize->add_setting( 'moral_magazine_header_ads_image_url', array(
	'sanitize_callback' => 'esc_url_raw',
) );

$wp_customize->add_control( 'moral_magazine_header_ads_image_url', array(
	'label'           	=> esc_html__( 'Ads Url', 'moral-magazine' ),
	'section'        	=> 'moral_magazine_header_section',
	'type'				=> 'url',
) );
