<?php
/**
* Custom Functions.
*
* @package Omega Design Agency
*/

if( !function_exists( 'omega_design_agency_sanitize_sidebar_option' ) ) :

    // Sidebar Option Sanitize.
    function omega_design_agency_sanitize_sidebar_option( $omega_design_agency_input ){

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

            return $omega_design_agency_input;

        }

        return;

    }

endif;

if ( ! function_exists( 'omega_design_agency_sanitize_checkbox' ) ) :

	/**
	 * Sanitize checkbox.
	 */
	function omega_design_agency_sanitize_checkbox( $omega_design_agency_checked ) {

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

	}

endif;


if ( ! function_exists( 'omega_design_agency_sanitize_select' ) ) :

    /**
     * Sanitize select.
     */
    function omega_design_agency_sanitize_select( $omega_design_agency_input, $omega_design_agency_setting ) {
        $omega_design_agency_input = sanitize_text_field( $omega_design_agency_input );
        $omega_design_agency_choices = $omega_design_agency_setting->manager->get_control( $omega_design_agency_setting->id )->choices;
        return ( array_key_exists( $omega_design_agency_input, $omega_design_agency_choices ) ? $omega_design_agency_input : $omega_design_agency_setting->default );
    }

endif;