<?php
/**
 * Important functions for theme customizer
 * 
 */


function portfolio_one_sanitize_integer($input){
	return intval( $input );
}



function portfolio_one_sanitize_sidebar( $input ) {
	$valid_keys = array(
		'sidebar-left' => array(
			'image'=> get_template_directory_uri().'/assets/img/sidebar-layouts/left-sidebar.png',
			'name'=> esc_html__('Left Sidebar', 'portfolio-one')
		),
		'sidebar-right' => array(
			'image'=> get_template_directory_uri().'/assets/img/sidebar-layouts/right-sidebar.png',
			'name'=> esc_html__('Right Sidebar', 'portfolio-one')
		),
		'sidebar-none' => array(
			'image'=> get_template_directory_uri().'/assets/img/sidebar-layouts/no-sidebar.png',
			'name'=> esc_html__('No Sidebar', 'portfolio-one')
		),
		
	);

	if ( array_key_exists( $input, $valid_keys ) ) {
		return $input;
	} else {
		return '';
	}
}


function portfolio_one_header_cta_cb($control){
	$cww_header_cta_enable = get_theme_mod('cww_header_cta_enable', 1 );
	if( $cww_header_cta_enable ){
		return true;
	}else{
		return false;
	}
}