<?php
/* Add Customizer Panel */
add_action( 'customize_register', 'unify_customizer' );
function unify_customizer( $wp_customize ) {
	$unify_theme_options = unify_theme_options();
	/* Genral section */
	$wp_customize->add_panel( 'unify_option_panel', array(
    'title' => __( 'Matrix Options','unify' ),
    'priority' => 2, // Mixed with top-level-section hierarchy.
	) );
	 $wp_customize->add_section('general_sec',
	array(
		'title' => __('General Options','unify'),
		'panel' => 'unify_option_panel',
		'capability' => 'edit_theme_options',
		'priority' => 35, // Mixed with top-level-section hierarchy.
		)
	);
	$wp_customize->add_setting('unify_theme_options[color_scheme_child]',
		array(
			'type'    => 'option',
			'default'=>$unify_theme_options['color_scheme_child'],
			'sanitize_callback'=>'unify_sanitize_text',
			'capability'        => 'edit_theme_options',
		)
	);
	$wp_customize->add_control('color_scheme_child',array(
			'label' => __('Select Color Scheme', 'unify'),
			'section' => 'general_sec',
			'settings' => 'unify_theme_options[color_scheme_child]',
			'type' => 'select',
			'choices' => array(
				'blue' => __('Default', 'unify'),
				'red' => __('Red', 'unify'),
				'green' => __('Green', 'unify'),
				'cyan' => __('Cyan', 'unify')
			),
		)
	);
	
	$wp_customize->add_setting(
		'matrix_theme_options[social_pinterest_link]',
		array(
			'type'    => 'option',
			'default'=>'',
			'sanitize_callback'=>'esc_url_raw',
			'capability'        => 'edit_theme_options',
		)
	);
	$wp_customize->add_control('social_pinterest_link',array(
		'label' => __('Pinterest Link','unify'),
		'section' => 'social_sec',
		'settings' => 'matrix_theme_options[social_pinterest_link]',
		'type' => 'text',
		'priority' => 150,
		)
	);

	$wp_customize->add_setting(
		'unify_theme_options[slider_dark_bg]',
		array(
			'type'    => 'option',
			'default'=>0,
			'sanitize_callback'=>'matrix_sanitize_checkbox',
			'capability'        => 'edit_theme_options',
		)
	);
	$wp_customize->add_control('slider_dark_bg',array(
		'label' => __('Add dark transparent backgorund on slider text','unify'),
		'section' => 'slider_sec',
		'settings' => 'unify_theme_options[slider_dark_bg]',
		'type' => 'checkbox',
		'priority' => 0,
		)
	);
} 

/* Custom Sanitization Function  */
function unify_sanitize_text($input)
{
    return wp_kses_post(force_balance_tags($input));
}
?>