<?php
/**
* Custom Functions.
*
* @package Air Ticket Booking
*/

if( !function_exists( 'air_ticket_booking_sanitize_sidebar_option' ) ) :

    // Sidebar Option Sanitize.
    function air_ticket_booking_sanitize_sidebar_option( $air_ticket_booking_input ){

        $air_ticket_booking_metabox_options = array( 'global-sidebar','left-sidebar','right-sidebar','no-sidebar' );
        if( in_array( $air_ticket_booking_input,$air_ticket_booking_metabox_options ) ){

            return $air_ticket_booking_input;

        }

        return;

    }

endif;

if ( ! function_exists( 'air_ticket_booking_sanitize_checkbox' ) ) :

	/**
	 * Sanitize checkbox.
	 */
	function air_ticket_booking_sanitize_checkbox( $air_ticket_booking_checked ) {

		return ( ( isset( $air_ticket_booking_checked ) && true === $air_ticket_booking_checked ) ? true : false );

	}

endif;


if ( ! function_exists( 'air_ticket_booking_sanitize_select' ) ) :

    /**
     * Sanitize select.
     */
    function air_ticket_booking_sanitize_select( $air_ticket_booking_input, $air_ticket_booking_setting ) {
        $air_ticket_booking_input = sanitize_text_field( $air_ticket_booking_input );
        $air_ticket_booking_choices = $air_ticket_booking_setting->manager->get_control( $air_ticket_booking_setting->id )->choices;
        return ( array_key_exists( $air_ticket_booking_input, $air_ticket_booking_choices ) ? $air_ticket_booking_input : $air_ticket_booking_setting->default );
    }

endif;