<?php
/**
* Custom Functions.
*
* @package Omega Food Delivery
*/

if( !function_exists( 'omega_food_delivery_sanitize_sidebar_option' ) ) :

    // Sidebar Option Sanitize.
    function omega_food_delivery_sanitize_sidebar_option( $omega_food_delivery_input ){

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

            return $omega_food_delivery_input;

        }

        return;

    }

endif;

if ( ! function_exists( 'omega_food_delivery_sanitize_checkbox' ) ) :

	/**
	 * Sanitize checkbox.
	 */
	function omega_food_delivery_sanitize_checkbox( $omega_food_delivery_checked ) {

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

	}

endif;


if ( ! function_exists( 'omega_food_delivery_sanitize_select' ) ) :

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

endif;