<?php
/**
* Custom Functions.
*
* @package Aerial Drone
*/

if( !function_exists( 'aerial_drone_sanitize_sidebar_option' ) ) :

    // Sidebar Option Sanitize.
    function aerial_drone_sanitize_sidebar_option( $aerial_drone_input ){

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

            return $aerial_drone_input;

        }

        return;

    }

endif;

if ( ! function_exists( 'aerial_drone_sanitize_checkbox' ) ) :

	/**
	 * Sanitize checkbox.
	 */
	function aerial_drone_sanitize_checkbox( $aerial_drone_checked ) {

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

	}

endif;


if ( ! function_exists( 'aerial_drone_sanitize_select' ) ) :

    /**
     * Sanitize select.
     */
    function aerial_drone_sanitize_select( $aerial_drone_input, $aerial_drone_setting ) {
        $aerial_drone_input = sanitize_text_field( $aerial_drone_input );
        $choices = $aerial_drone_setting->manager->get_control( $aerial_drone_setting->id )->choices;
        return ( array_key_exists( $aerial_drone_input, $choices ) ? $aerial_drone_input : $aerial_drone_setting->default );
    }

endif;