<?php
/**
 * Advertisement Section options
 *
 * @package Theme Palace
 * @subpackage enlightme Pro
 * @since enlightme Pro 1.0.0
 */

// Add Advertisement section
$wp_customize->add_section( 'enlightme_pro_advertisement_section', array(
	'title'             => esc_html__( 'Advertisement','enlightme-pro' ),
	'description'       => esc_html__( 'Advertisement Section options.', 'enlightme-pro' ),
	'panel'             => 'enlightme_pro_front_page_panel',
	'active_callback'   => function( $control ) {
        return (
            enlightme_pro_is_third_layout( $control )
        );
    },
) );

// Advertisement content enable control and setting
$wp_customize->add_setting( 'enlightme_pro_theme_options[advertisement_section_enable]', array(
	'default'			=> 	$options['advertisement_section_enable'],
	'sanitize_callback' => 'enlightme_pro_sanitize_switch_control',
) );

$wp_customize->add_control( new Enlightme_Pro_Switch_Control( $wp_customize, 'enlightme_pro_theme_options[advertisement_section_enable]', array(
	'label'             => esc_html__( 'Advertisement Section Enable', 'enlightme-pro' ),
	'section'           => 'enlightme_pro_advertisement_section',
	'on_off_label' 		=> enlightme_pro_switch_options(),
) ) );

// advertisement image setting and control.
$wp_customize->add_setting( 'enlightme_pro_theme_options[advertisement_image]', array(
	'sanitize_callback' => 'enlightme_pro_sanitize_image'
) );

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'enlightme_pro_theme_options[advertisement_image]',
		array(
		'label'       		=> esc_html__( 'Advertisement Image', 'enlightme-pro' ),
		'section'     		=> 'enlightme_pro_advertisement_section',
		'active_callback'	=> 'enlightme_pro_is_advertisement_section_enable',
) ) );

// about btn link setting and control
$wp_customize->add_setting( 'enlightme_pro_theme_options[advertisement_link]', array(
	'sanitize_callback' => 'esc_url_raw',
) );

$wp_customize->add_control( 'enlightme_pro_theme_options[advertisement_link]', array(
	'label'           	=> esc_html__( 'Advertisement', 'enlightme-pro' ),
	'section'        	=> 'enlightme_pro_advertisement_section',
	'active_callback' 	=> 'enlightme_pro_is_advertisement_section_enable',
	'type'				=> 'url',
) );
