<?php
/**
 * Advertisement Section options
 *
 * @package Theme Palace
 * @subpackage Power News
 * @since Power News 1.0.0
 */

// Add advertisement section
$wp_customize->add_section( 'power_news_advertisement_section', array(
	'title'             => esc_html__( 'Advertisement','power-news' ),
	'description'       => esc_html__( 'Advertisement Section options.', 'power-news' ),
	'panel'             => 'power_news_front_page_panel',
) );

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

$wp_customize->add_control( new Power_News_Switch_Control( $wp_customize, 'power_news_theme_options[advertisement_section_enable]', array(
	'label'             => esc_html__( 'Advertisement Section Enable', 'power-news' ),
	'section'           => 'power_news_advertisement_section',
	'on_off_label' 		=> power_news_switch_options(),
) ) );

// ads image setting and control.
$wp_customize->add_setting( 'power_news_theme_options[ads_image]', array(
	'sanitize_callback' => 'power_news_sanitize_image'
) );

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'power_news_theme_options[ads_image]',
		array(
		'label'       		=> esc_html__( 'Ads Image', 'power-news' ),
		'description' 		=> sprintf( esc_html__( 'Recommended size: %1$dpx x %2$dpx ', 'power-news' ), 900, 100 ),
		'section'     		=> 'power_news_advertisement_section',
		'active_callback' 	=> 'power_news_is_advertisement_section_enable',

) ) );

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

$wp_customize->add_control( 'power_news_theme_options[ads_url]', array(
	'label'           	=> esc_html__( 'Ads Url', 'power-news' ),
	'section'        	=> 'power_news_advertisement_section',
	'type'				=> 'url',
	'active_callback' 	=> 'power_news_is_advertisement_section_enable',
) );