<?php
/**
 * Special Offer Settings
 *
 * @package Travel Tour
 */

if ( class_exists( 'Wp_Travel_Engine' ) ) {
  add_action( 'customize_register', 'travel_tour_customize_special_offer' );
}

function travel_tour_customize_special_offer( $wp_customize ) {

	$wp_customize->add_section( 'travel_tour_special_offer_section', array(
    'title'          => esc_html__( 'Special Offer', 'travel-tour' ),
    'description'    => esc_html__( 'Special Offer & Packages :', 'travel-tour' ),
    'panel'          => 'travel_tour_homepage_panel',
    'priority'       => 6,
	) );

	$wp_customize->add_setting( 'travel_tour_special_offer_display_option', array(
    'sanitize_callback'     =>  'travel_tour_sanitize_checkbox',
    'default'               =>  true
  ) );

  $wp_customize->add_control( new Travel_Tour_Toggle_Control(
  	$wp_customize, 'travel_tour_special_offer_display_option', array(
      'label' => esc_html__( 'Hide / Show','travel-tour' ),
      'section' => 'travel_tour_special_offer_section',
      'settings' => 'travel_tour_special_offer_display_option',
      'type'=> 'toggle',
  	)
  ) );

  $wp_customize->selective_refresh->add_partial( 'travel_tour_special_offer_display_option', array(
      'selector' => '.special-offer .container-xl',
  ) ); 

  $wp_customize->add_setting( 'travel_tour_special_offer_trip_posttype', array(
    'capability'  => 'edit_theme_options',        
    'sanitize_callback' => 'sanitize_text_field',
    'default'     => '',
  ) );

  $wp_customize->add_control( new Travel_Tour_Dropdown_Posttype(
  	$wp_customize, 'travel_tour_special_offer_trip_posttype', array(
      'label' => esc_html__( 'Choose package','travel-tour' ),
      'section' => 'travel_tour_special_offer_section',
      'settings' => 'travel_tour_special_offer_trip_posttype',
      'posttype'  =>  'trip'
  	)
  ) );

}