<?php
/**
 * Header Panel
 *
 * @package Excel_Blog
 */
 
function excel_blog_customize_register_home( $wp_customize ) {
	
    $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
    $wp_customize->get_setting( 'background_color' )->transport = 'refresh';
    $wp_customize->get_setting( 'background_image' )->transport = 'refresh';
    
    /** Header Panel */    
    $wp_customize->add_panel( 
        'header_panel',
         array(
            'priority'   => 10,
            'capability' => 'edit_theme_options',
            'title'      => __( 'Header Settings', 'excel-blog' ),
        ) 
    );
    
    //Move Site Title and Description section to Header Panel.
    $wp_customize->get_section( 'title_tagline' )->panel = 'header_panel';
    
    /** Misc Settings */
    $wp_customize->add_section( 'header_misc_setting', array(
        'title'    => __( 'Misc Settings', 'excel-blog' ),
        'priority' => 30,
        'panel'    => 'header_panel',
    ) );
    
    /** Header Email */
    $wp_customize->add_setting(
        'header_email',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_email',
        )
    );
    
    $wp_customize->add_control(
	   'header_email',
		array(
			'section'     => 'header_misc_setting',
			'label'	      => __( 'Header Email', 'excel-blog' ),
            'description' => __( 'Add Email address here.', 'excel-blog' ),
            'type'        => 'text'
		)		
	);
    
    /** Header Phone */
    $wp_customize->add_setting(
        'header_phone',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );
    
    $wp_customize->add_control(
        'header_phone',
        array(
            'label'       => __( 'Header Phone', 'excel-blog' ),
            'description' => __( 'Add Telephone here.', 'excel-blog' ),
            'section'     => 'header_misc_setting',
            'type'        => 'text',
        )
    );
    
}
add_action( 'customize_register', 'excel_blog_customize_register_home' );