<?php
/**
 * Theme Customizer Custom
 *
 * @package Buzz_Agency
 */
/**
 * Add new options the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */

function buzz_agency_custom_customize_register( $wp_customize ) { 

	// Buzz Agency Category Posts List.
	$buzz_agency_category_lists = buzz_agency_category_lists(); 

	$wp_customize->add_panel('buzz_agency_default_setups',
		array(
			'priority' => 10,
			'capability' => 'edit_theme_options',
			'theme_supports' => '',
			'title' => esc_html__('Default/Basic Setting','buzz-agency'),
	));

	/****************  Add Default Sections to General Panel ************/
	$wp_customize->get_section('title_tagline')->panel = 'buzz_agency_default_setups'; //priority 20
	$wp_customize->get_section('colors')->panel = 'buzz_agency_default_setups'; //priority 40
	$wp_customize->get_section('background_image')->panel = 'buzz_agency_default_setups'; //priority 80
	$wp_customize->get_section('static_front_page')->panel = 'buzz_agency_default_setups'; //priority 120

	$wp_customize->get_section( 'header_image' )->panel = 'buzz_agency_general_panel';
	$wp_customize->get_section( 'header_image' )->title = esc_html__( 'Header Breadcrub Image', 'buzz-agency' );
	$wp_customize->get_section( 'header_image' )->priority = 25;

	$wp_customize->add_setting('site_identity_options', 
	    array(
	    'default'           => 'title-text',
	    'sanitize_callback' => 'buzz_agency_sanitize_select'
	    )
	);
	$wp_customize->add_control('site_identity_options', 
	    array(    
	    'priority' => 20,  
	    'label'     => esc_html__('Choose Options', 'buzz-agency'),
	    'section'   => 'title_tagline',
	    'settings'  => 'site_identity_options',
	    'type'      => 'radio',
	    'choices'   =>  array(
	          'logo-only'     => esc_html__('Logo Only', 'buzz-agency'),
	          'logo-text'     => esc_html__('Logo + Tagline', 'buzz-agency'),
	          'title-only'    => esc_html__('Title Only', 'buzz-agency'),
	          'title-text'    => esc_html__('Title + Tagline', 'buzz-agency')
	        )
	    )
	);

	/***********************************  Starting Heading Section ***********************/
	$wp_customize->add_panel('buzz_agency_heading_setups',
		array(
			'priority' => '1',
			'capability' => 'edit_theme_options',
			'theme_supports' => '',
			'title' => esc_html__('Header Setting ','buzz-agency'),
	));

	/***********************************  Starting Heading  ********************/
  	$wp_customize->add_section('buzz_agency_header_setups',
	    array(
	      'priority' => '1',
	      'capability' => 'edit_theme_options',
	      'theme_supports' => '',
	      'title' => esc_html__('Header Menu Section','buzz-agency'),
	      'panel' => 'buzz_agency_heading_setups'
    ));

   	$wp_customize->add_setting('buzz_agency_header_layout_options',
          array(
              'default'           => 'horizontal-menu-open',
              'sanitize_callback' => 'buzz_agency_sanitize_select',
          )
  	);      
	$wp_customize->add_control('buzz_agency_header_layout_options',
		array(
			'label'    => esc_html__( 'Header Menu Layout', 'buzz-agency' ),
			'description' => esc_html__ ('ie. Horizantal Menu (It will display menu Horizantally after clicking on menu text.), Vertical(It will display menu vertically after clicking on menu text )','buzz-agency'),
			'section'  => 'buzz_agency_header_setups',
			'type' => 'radio',
			'choices'  => array(
				'horizontal-menu-open' => esc_html__( 'Horizontal Menu', 'buzz-agency' ),
				'vertical-menu-open' => esc_html__( 'vertical Menu', 'buzz-agency' ),
			),
			'priority' => 1
		)
	);

  	/***********************************  Starting Home PanelSetting **************************************/

	$wp_customize->add_panel('buzz_agency_homepage_setups',
	 array(
	   'priority' => 16,
	   'capability' => 'edit_theme_options',
	   'theme_supports' => '',
	   'title' => esc_html__('Home Sections ','buzz-agency'),
   	));

	// Home Page Content
	$wp_customize->add_section('buzz_agency_home_content',
	  array(
	    'priority' => 1,
	    'capability' => 'edit_theme_options',
	    'theme_supports' => '',
	    'title' => esc_html__('Home Content','buzz-agency'),
	    'panel' => 'buzz_agency_homepage_setups'
  	));   

	$wp_customize->add_setting('buzz_agency_homepage_content_show',
		array(
			'default' => 0,
			'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
			)
	);
	$wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_content_show',

		array(
			'priority'      =>  1,
			'type' => 'switch',
			'label' => esc_html__('Enable Home Page Content', 'buzz-agency'),
			'section' => 'buzz_agency_home_content',
			)
		)
	);  		

	/***********************************  Starting Home Slider Sections **************************************/

	$wp_customize->add_section('buzz_agency_banner_setups',
	  array(
	    'priority' => 1,
	    'capability' => 'edit_theme_options',
	    'theme_supports' => '',
	    'title' => esc_html__('Slider Section','buzz-agency'),
	    'panel' => 'buzz_agency_homepage_setups'
  	));

	$wp_customize->add_setting('buzz_agency_homepage_setting_slider_option',
		array(
			'default' => 0,
			'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
			)
	);
	$wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_slider_option',

		array(
			'priority'      =>  1,
			'type' => 'switch',
			'label' => esc_html__('Enable Slider', 'buzz-agency'),
			'description' => esc_html__ ('Select Yes to show Slider on homepage.','buzz-agency'),
			'section' => 'buzz_agency_banner_setups',
			)
		)
	);

	//Select Category For Slider  Section
	$wp_customize->add_setting('buzz_agency_slider_section_cat',
	  array(
	      'default'           =>  0,
	      'sanitize_callback' =>  'buzz_agency_sanitize_category_select',
	      )
	    );	
	$wp_customize->add_control('buzz_agency_slider_section_cat',
	      array(
	      'priority'      =>  2,
	      'label'         =>  esc_html__('Select Category For Slider Section','buzz-agency'),
	      'section'       =>  'buzz_agency_banner_setups',
	      'setting'       =>  'buzz_agency_slider_section_cat',
	      'type'          =>  'select',
	      'choices'       =>  $buzz_agency_category_lists,
	    )
	  );
    //Slider Read More Text
    $wp_customize->add_setting('buzz_agency_slider_readmore',
			array(
				'default'           =>  esc_html__('Learn More','buzz-agency'),
				'sanitize_callback' =>  'sanitize_text_field',
			)
			);
    $wp_customize->add_control('buzz_agency_slider_readmore',
    		array(
	            'priority'      =>  3,
	            'label'         =>  esc_html__('Learn More Text','buzz-agency'),
	            'section'       =>  'buzz_agency_banner_setups',
	            'setting'       =>  'buzz_agency_slider_readmore',
	            'type'          =>  'text',  
            )                                     
	 );

	 // Slider Post Number Count
	$wp_customize->add_setting('buzz_agency_slider_num', 
	      array(
	        'default' => 5,
	        'sanitize_callback' => 'buzz_agency_sanitize_number',
	      )
	  );
	    
	 $wp_customize->add_control('buzz_agency_slider_num',
	    array(
	    	'priority'      =>  4,
	        'type' => 'number',
	        'label' => esc_html__('No. of Slider','buzz-agency'),
	        'section' => 'buzz_agency_banner_setups',
	        'setting' => 'buzz_agency_slider_num',
	        'input_attrs' => array(
	        'min' => 1,
	        'max' => 9,
	      ),
	    )
	  );	

	/*****************  Starting Home Feature Sections **************************************/

	$wp_customize->add_section('buzz_agency_feature_setups',
	  array(
	    'priority' => 1,
	    'capability' => 'edit_theme_options',
	    'theme_supports' => '',
	    'title' => esc_html__('Feature Section','buzz-agency'),
	    'panel' => 'buzz_agency_homepage_setups'
	  ));

	$wp_customize->add_setting('buzz_agency_homepage_setting_feature_option',
		array(
			'default' => 0,
			'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
			)
		);
	$wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_feature_option',

			array(
				'priority'      =>  1,
				'type' => 'switch',
				'label' => esc_html__('Enable Feature', 'buzz-agency'),
				'description' => esc_html__ ('Select Yes to show Feature Section on homepage.','buzz-agency'),
				'section' => 'buzz_agency_feature_setups',
				)
			)
	);

	//FEATURED PAGES
	for( $i = 1; $i < 4; $i++ ){
		$wp_customize->add_setting(
			'buzz_agency_featured_header'.$i,
			array(
				'sanitize_callback' => 'buzz_agency_sanitize_text'
			)
		);

		$wp_customize->add_control(
			new Buzz_Agency_Customize_Heading(
				$wp_customize,
				'buzz_agency_featured_header'.$i,
				array(
					'settings'		=> 'buzz_agency_featured_header'.$i,
					'section'		=> 'buzz_agency_feature_setups',
					'label'			=> esc_html__( 'Featured Page ', 'buzz-agency' ).$i
				)
			)
		);
		$wp_customize->add_setting(
			'buzz_agency_featured_page'.$i,
			array(
				'sanitize_callback' => 'absint'
			)
		);

		$wp_customize->add_control(
			'buzz_agency_featured_page'.$i,
			array(
				'settings'		=> 'buzz_agency_featured_page'.$i,
				'section'		=> 'buzz_agency_feature_setups',
				'type'			=> 'dropdown-pages',
				'label'			=> esc_html__( 'Select a Page', 'buzz-agency' )
			)
		);

		$wp_customize->add_setting(
			'buzz_agency_featured_page_icon'.$i,
			array(
				'default'			=> 'fa fa-bell',
				'sanitize_callback' => 'buzz_agency_sanitize_text'
			)
		);

		$wp_customize->add_control(
			new Buzz_Agency_Fontawesome_Icon_Chooser(
				$wp_customize,
				'buzz_agency_featured_page_icon'.$i,
				array(
					'settings'		=> 'buzz_agency_featured_page_icon'.$i,
					'section'		=> 'buzz_agency_feature_setups',
					'type'			=> 'icon',
					'label'			=> esc_html__( 'FontAwesome Icon', 'buzz-agency' ),
				)
			)
		);
	}

	/*****************  Starting Home About Sections **************************************/

	$wp_customize->add_section('buzz_agency_about_setups',
	  array(
	    'priority' => 1,
	    'capability' => 'edit_theme_options',
	    'theme_supports' => '',
	    'title' => esc_html__('About Section','buzz-agency'),
	    'panel' => 'buzz_agency_homepage_setups'
	  ));

	$wp_customize->add_setting('buzz_agency_homepage_setting_about_option',
		array(
			'default' => 0,
			'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
			)
		);
	$wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_about_option',

			array(
				'priority'      =>  1,
				'type' => 'switch',
				'label' => esc_html__('Enable About', 'buzz-agency'),
				'description' => esc_html__ ('Select Yes to show About Section on homepage.','buzz-agency'),
				'section' => 'buzz_agency_about_setups',
				)
			)
	);

	//About PAGES
	$wp_customize->add_setting(
		'buzz_agency_about_header',
		array(
			'sanitize_callback' => 'buzz_agency_sanitize_text'
		)
	);

	$wp_customize->add_control(
		new Buzz_Agency_Customize_Heading(
			$wp_customize,
			'buzz_agency_about_header',
			array(
				'priority'      =>  3,
				'settings'		=> 'buzz_agency_about_header',
				'section'		=> 'buzz_agency_about_setups',
				'label'			=> esc_html__( 'About Page One', 'buzz-agency' )
			)
		)
	);

	// About Section Title And Descriptions
	$wp_customize->add_setting('buzz_agency_about_page',
	  array(
	    'default'           =>  0,
	    'sanitize_callback' =>  'buzz_agency_sanitize_dropdown_pages',
	  )
	);

	$wp_customize->add_control('buzz_agency_about_page',
	  array(
	    'priority'=>    4,
	    'label'   =>    esc_html__( 'Select Page For  About Section','buzz-agency' ),
	    'description'   =>  esc_html__('It will Display About Section Title And Description. ','buzz-agency'),
	    'section' =>    'buzz_agency_about_setups',
	    'setting' =>    'buzz_agency_about_page',
	    'type'    =>    'dropdown-pages',
	  )                                     
	);
	//About PAGES
	$wp_customize->add_setting(
		'buzz_agency_about_header_two',
		array(
			'sanitize_callback' => 'buzz_agency_sanitize_text'
		)
	);

	$wp_customize->add_control(
		new Buzz_Agency_Customize_Heading(
			$wp_customize,
			'buzz_agency_about_header_two',
			array(
				'priority'      =>  5,
				'settings'		=> 'buzz_agency_about_header_two',
				'section'		=> 'buzz_agency_about_setups',
				'label'			=> esc_html__( 'About Page Two', 'buzz-agency' )
			)
		)
	);
	// About Section Title And Descriptions
	$wp_customize->add_setting('buzz_agency_about_page_two',
	  array(
	    'default'           =>  0,
	    'sanitize_callback' =>  'buzz_agency_sanitize_dropdown_pages',
	  )
	);

	$wp_customize->add_control('buzz_agency_about_page_two',
	  array(
	    'priority'=>    6,
	    'label'   =>    esc_html__( 'Select Page For  About Section','buzz-agency' ),
	    'description'   =>  esc_html__('It will Display About Section Title And Description. ','buzz-agency'),
	    'section' =>    'buzz_agency_about_setups',
	    'setting' =>    'buzz_agency_about_page_two',
	    'type'    =>    'dropdown-pages',
	  )                                     
	);
    //About Read More Text
    $wp_customize->add_setting('buzz_agency_about_readmore',
			array(
				'default'           =>  esc_html__('Discover More','buzz-agency'),
				'sanitize_callback' =>  'sanitize_text_field',
			)
			);
    $wp_customize->add_control('buzz_agency_about_readmore',
    		array(
	            'priority'      =>  7,
	            'label'         =>  esc_html__('Discover More','buzz-agency'),
	            'section'       =>  'buzz_agency_about_setups',
	            'setting'       =>  'buzz_agency_about_readmore',
	            'type'          =>  'text',  
            )                                     
	 );

 
    /*****************  Starting Home Counter Sections **************************************/

    $wp_customize->add_section('buzz_agency_counter_setups',
      array(
        'priority' => 1,
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => esc_html__('Counter Section','buzz-agency'),
        'panel' => 'buzz_agency_homepage_setups'
      ));

    $wp_customize->add_setting('buzz_agency_homepage_setting_counter_option',
    	array(
    		'default' => 0,
    		'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
    		)
    	);
    $wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_counter_option',

    		array(
    			'priority'      =>  1,
    			'type' => 'switch',
    			'label' => esc_html__('Enable Counter Secions', 'buzz-agency'),
    			'description' => esc_html__ ('Select Yes to show Counter Section on homepage.','buzz-agency'),
    			'section' => 'buzz_agency_counter_setups',
    			)
    		)
    );

    // Counter
    $wp_customize->add_setting( 'theme_options_counter_secton', array(
        'sanitize_callback' => 'buzz_agency_html_sanitize_repeater',
        'default' => json_encode(
            array(
                array(
                    'counter_number'=> '',
                    'counter_title' => '',
                    'counter_icon'  => '',
                )
            )
        )
    ));

    $wp_customize->add_control(  new Buzz_Agency_Repeater_Controler( $wp_customize, 'theme_options_counter_secton', 
        array(
            'label'                        => esc_html__('Counter Options','buzz-agency'),
            'section'                      => 'buzz_agency_counter_setups',
            'box_label'         => esc_html__('Counter','buzz-agency'),
            'box_add_control'   => esc_html__('Add Counter','buzz-agency'),  
        ),
        array(
            'counter_number' => array(
            'type'        => 'number',
            'label'       => esc_html__( 'Number', 'buzz-agency' ),
            'default'     => '',	            
            ),  

            'counter_icon' => array(
            'type'        => 'icon',
            'label'       => esc_html__( 'Icon', 'buzz-agency' ),        
            'default'     => '',		       
        	),             
                
            'counter_title' => array(
            'type'        => 'text',
            'label'       => esc_html__( 'Title', 'buzz-agency' ),
            'default'     => '',		       
        	),	
        )
    ));


    /*****************  Starting Home Process Sections **************************************/

    $wp_customize->add_section('buzz_agency_process_setups',
      array(
        'priority' => 1,
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => esc_html__('Process Section','buzz-agency'),
        'panel' => 'buzz_agency_homepage_setups'
      ));

    $wp_customize->add_setting('buzz_agency_homepage_setting_process_option',
    	array(
    		'default' => 0,
    		'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
    		)
    	);
    $wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_process_option',

    		array(
    			'priority'      =>  1,
    			'type' => 'switch',
    			'label' => esc_html__('Enable Process Secions', 'buzz-agency'),
    			'description' => esc_html__ ('Select Yes to show Process Section on homepage.','buzz-agency'),
    			'section' => 'buzz_agency_process_setups',
    			)
    		)
    );
    // Process Section Title And Descriptions
    $wp_customize->add_setting('buzz_agency_process_page',
      array(
        'default'           =>  0,
        'sanitize_callback' =>  'buzz_agency_sanitize_dropdown_pages',
      )
    );

    $wp_customize->add_control('buzz_agency_process_page',
      array(
        'priority'=>    2,
        'label'   =>    esc_html__( 'Select Page For  Process Section','buzz-agency' ),
        'description'   =>  esc_html__('It will Display Process Section Title And Description. ','buzz-agency'),
        'section' =>    'buzz_agency_process_setups',
        'setting' =>    'buzz_agency_process_page',
        'type'    =>    'dropdown-pages',
      )                                     
    );

    //Process Text
    $wp_customize->add_setting('buzz_agency_process_text_one',
			array(
				'default'           =>  esc_html__('Research','buzz-agency'),
				'sanitize_callback' =>  'sanitize_text_field',
			)
			);
    $wp_customize->add_control('buzz_agency_process_text_one',
    		array(
	            'priority'      =>  7,
	            'label'         =>  esc_html__('Research','buzz-agency'),
	            'section'       =>  'buzz_agency_process_setups',
	            'setting'       =>  'buzz_agency_process_text_one',
	            'type'          =>  'text',  
            )                                     
	 );

    //Process Text
    $wp_customize->add_setting('buzz_agency_process_text_two',
			array(
				'default'           =>  esc_html__('Planning','buzz-agency'),
				'sanitize_callback' =>  'sanitize_text_field',
			)
			);
    $wp_customize->add_control('buzz_agency_process_text_two',
    		array(
	            'priority'      =>  8,
	            'label'         =>  esc_html__(' Planning','buzz-agency'),
	            'section'       =>  'buzz_agency_process_setups',
	            'setting'       =>  'buzz_agency_process_text_two',
	            'type'          =>  'text',  
            )                                     
	 );

    //Process Text
    $wp_customize->add_setting('buzz_agency_process_text_three',
			array(
				'default'           =>  esc_html__('Apply','buzz-agency'),
				'sanitize_callback' =>  'sanitize_text_field',
			)
			);
    $wp_customize->add_control('buzz_agency_process_text_three',
    		array(
	            'priority'      =>  9,
	            'label'         =>  esc_html__(' Apply','buzz-agency'),
	            'section'       =>  'buzz_agency_process_setups',
	            'setting'       =>  'buzz_agency_process_text_three',
	            'type'          =>  'text',  
            )                                     
	 );

    //Process Read More Text
    $wp_customize->add_setting('buzz_agency_process_readmore',
			array(
				'default'           =>  esc_html__('Discover More','buzz-agency'),
				'sanitize_callback' =>  'sanitize_text_field',
			)
			);
    $wp_customize->add_control('buzz_agency_process_readmore',
    		array(
	            'priority'      =>  10,
	            'label'         =>  esc_html__('Discover More','buzz-agency'),
	            'section'       =>  'buzz_agency_process_setups',
	            'setting'       =>  'buzz_agency_process_readmore',
	            'type'          =>  'text',  
            )                                     
	 );

    $wp_customize->add_setting('buzz_agency_process_image',
      array(
        'default' => '',
        'sanitize_callback' => 'esc_url_raw'
      )
    );
    $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_process_image',
      array(
        'label'      => esc_html__( ' Process Section Image ', 'buzz-agency' ),
        'section'    => 'buzz_agency_process_setups',
        'settings'   => 'buzz_agency_process_image',
        'priority' => 9,
      )
    )
    );

    $wp_customize->add_setting('buzz_agency_process_section_bg_image',
      array(
        'default' => '',
        'sanitize_callback' => 'esc_url_raw'
      )
    );
    $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_process_section_bg_image',
      array(
        'label'      => esc_html__( ' Process Section Background Image ', 'buzz-agency' ),
        'section'    => 'buzz_agency_process_setups',
        'settings'   => 'buzz_agency_process_section_bg_image',
        'priority' => 9,
      )
    )
    );


    /*****************  Starting Home Sertvice Sections **************************************/

    $wp_customize->add_section('buzz_agency_service_setups',
      array(
        'priority' => 1,
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => esc_html__('Service Section','buzz-agency'),
        'panel' => 'buzz_agency_homepage_setups'
      ));

    $wp_customize->add_setting('buzz_agency_homepage_setting_service_option',
    	array(
    		'default' => 0,
    		'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
    		)
    	);
    $wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_service_option',

    		array(
    			'priority'      =>  1,
    			'type' => 'switch',
    			'label' => esc_html__('Enable Service Secions', 'buzz-agency'),
    			'description' => esc_html__ ('Select Yes to show Service Section on homepage.','buzz-agency'),
    			'section' => 'buzz_agency_service_setups',
    			)
    		)
    );

    // Section Title And Descriptions
    $wp_customize->add_setting('buzz_agency_service_page',
      array(
        'default'           =>  0,
        'sanitize_callback' =>  'buzz_agency_sanitize_dropdown_pages',
      )
    );

    $wp_customize->add_control('buzz_agency_service_page',
      array(
        'priority'=>    2,
        'label'   =>    esc_html__( 'Select Page For  Service Section','buzz-agency' ),
        'description'   =>  esc_html__('It will Display Service Section Title And Description. ','buzz-agency'),
        'section' =>    'buzz_agency_service_setups',
        'setting' =>    'buzz_agency_service_page',
        'type'    =>    'dropdown-pages',
      )                                     
    );

  //Select Category For Service Section

  $wp_customize->add_setting('buzz_agency_service_section_cat',
    array(
        'default'           =>  0,
        'sanitize_callback' =>  'buzz_agency_sanitize_category_select',
        )
      );
  $wp_customize->add_control('buzz_agency_service_section_cat',
        array(
        'priority'      => 3,
        'label'         =>  esc_html__('Select Category For Service Section','buzz-agency'),
        'section'       =>  'buzz_agency_service_setups',
        'setting'       =>  'buzz_agency_service_section_cat',
        'type'          =>  'select',
        'choices'       =>  $buzz_agency_category_lists,
      )
    );

 
	 // Post Number Count
	$wp_customize->add_setting('agency_service_num', 
	      array(
	        'default' => 5,
	          'sanitize_callback' => 'buzz_agency_sanitize_number',
	      )
	  );
	    
	 $wp_customize->add_control('agency_service_num',
	    array(
	    	'priority'      =>  5,
	        'type' => 'number',
	        'label' => esc_html__('No. of Service Posts','buzz-agency'),
	        'section' => 'buzz_agency_service_setups',
	        'setting' => 'agency_service_num',
	        'input_attrs' => array(
	        'min' => 1,
	        'max' => 9,
	      ),
	    )
	  );

     //Servcie Read More Text
     $wp_customize->add_setting('agency_services_readmore',
 			array(
 				'default'           =>  esc_html__('Discover More ','buzz-agency'),
 				'sanitize_callback' =>  'sanitize_text_field',
 			)
 			);
     $wp_customize->add_control('agency_services_readmore',
     		array(
 	            'priority'      =>  3,
 	            'label'         =>  esc_html__(' Discover More','buzz-agency'),
 	            'section'       =>  'buzz_agency_service_setups',
 	            'setting'       =>  'agency_services_readmore',
 	            'type'          =>  'text',  
             )                                     
 	 );

 	 $wp_customize->add_setting('buzz_agency_servie_image_one',
 	   array(
 	     'default' => '',
 	     'sanitize_callback' => 'esc_url_raw'
 	   )
 	 );
 	 $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_servie_image_one',
 	   array(
 	     'label'      => esc_html__( ' Service Section Image ', 'buzz-agency' ),
 	     'section'    => 'buzz_agency_service_setups',
 	     'settings'   => 'buzz_agency_servie_image_one',
 	     'priority' => 9,
 	   )
 	 )
 	 );


 	 $wp_customize->add_setting('buzz_agency_servie_image_two',
 	   array(
 	     'default' => '',
 	     'sanitize_callback' => 'esc_url_raw'
 	   )
 	 );
 	 $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_servie_image_two',
 	   array(
 	     'label'      => esc_html__( ' Service Section Background Image ', 'buzz-agency' ),
 	     'section'    => 'buzz_agency_service_setups',
 	     'settings'   => 'buzz_agency_servie_image_two',
 	     'priority' => 9,
 	   )
 	 )
 	 );


    /*****************  Starting Home Client Sections **************************************/

    $wp_customize->add_section('buzz_agency_client_setups',
      array(
        'priority' => 1,
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => esc_html__('Client Section','buzz-agency'),
        'panel' => 'buzz_agency_homepage_setups'
      ));

    $wp_customize->add_setting('buzz_agency_homepage_setting_client_option',
    	array(
    		'default' => 0,
    		'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
    		)
    	);
    $wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_client_option',

    		array(
    			'priority'      =>  1,
    			'type' => 'switch',
    			'label' => esc_html__('Enable Client Secions', 'buzz-agency'),
    			'description' => esc_html__ ('Select Yes to show Client Section on homepage.','buzz-agency'),
    			'section' => 'buzz_agency_client_setups',
    			)
    		)
    );

    //CLIENTS LOGOS
    $wp_customize->add_setting(
    	'buzz_agency_client_logo_image',
    	array(
    		'sanitize_callback' => 'buzz_agency_sanitize_text'
    	)
    );

    $wp_customize->add_control(
    	new Buzz_Agency_Display_Gallery_Control(
    		$wp_customize,
    		'buzz_agency_client_logo_image',
    	array(
    		'priority' => 5,
    		'settings'		=> 'buzz_agency_client_logo_image',
    		'section'		=> 'buzz_agency_client_setups',
    		'label'			=> esc_html__( 'Upload Clients Logos', 'buzz-agency' ),
    	)
    	)
    );

    $wp_customize->add_setting('buzz_agency_client_section_bg_image',
      array(
        'default' => '',
        'sanitize_callback' => 'esc_url_raw'
      )
    );
    $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_client_section_bg_image',
      array(
        'label'      => esc_html__( ' Client Section Background Image ', 'buzz-agency' ),
        'section'    => 'buzz_agency_client_setups',
        'settings'   => 'buzz_agency_client_section_bg_image',
        'priority' => 9,
      )
    )
    );

    /*****************  Starting Home Testimonial Sections **************************************/

    $wp_customize->add_section('buzz_agency_testimonial_setups',
      array(
        'priority' => 1,
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => esc_html__('Testimonial Section','buzz-agency'),
        'panel' => 'buzz_agency_homepage_setups'
      ));

    $wp_customize->add_setting('buzz_agency_homepage_setting_testimonial_option',
    	array(
    		'default' => 0,
    		'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
    		)
    	);
    $wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_testimonial_option',

    		array(
    			'priority'      =>  1,
    			'type' => 'switch',
    			'label' => esc_html__('Enable Testimonial Secions', 'buzz-agency'),
    			'description' => esc_html__ ('Select Yes to show Testimonial Section on homepage.','buzz-agency'),
    			'section' => 'buzz_agency_testimonial_setups',
    			)
    		)
    );
    $wp_customize->add_setting(
    	'buzz_agency_testimonial_header',
    	array(
    		'sanitize_callback' => 'buzz_agency_sanitize_text'
    	)
    );

    $wp_customize->add_control(
    	new Buzz_Agency_Customize_Heading(
    		$wp_customize,
    		'buzz_agency_testimonial_header',
    		array(
    			'priority'      =>  3,
    			'settings'		=> 'buzz_agency_testimonial_header',
    			'section'		=> 'buzz_agency_testimonial_setups',
    			'label'			=> esc_html__( 'Testimonial Page One', 'buzz-agency' )
    		)
    	)
    );

    $wp_customize->add_setting('buzz_agency_testimonial_page',
      array(
        'default'           =>  0,
        'sanitize_callback' =>  'buzz_agency_sanitize_dropdown_pages',
      )
    );

    $wp_customize->add_control('buzz_agency_testimonial_page',
      array(
        'priority'=>    4,
        'label'   =>    esc_html__( 'Select Page For  Testimonial Section','buzz-agency' ),
        'description'   =>  esc_html__('It will Display Testimonial Section Title And Description. ','buzz-agency'),
        'section' =>    'buzz_agency_testimonial_setups',
        'setting' =>    'buzz_agency_testimonial_page',
        'type'    =>    'dropdown-pages',
      )                                     
    );
    //Select Category For testimonial  Section

    $wp_customize->add_setting('buzz_agency_testimonial_section_cat',
      array(
          'default'           =>  0,
          'sanitize_callback' =>  'buzz_agency_sanitize_category_select',
          )
        );
    $wp_customize->add_control('buzz_agency_testimonial_section_cat',
          array(
          'priority'      =>  8,
          'label'         =>  esc_html__('Select Category','buzz-agency'),
          'section'       =>  'buzz_agency_testimonial_setups',
          'setting'       =>  'buzz_agency_testimonial_section_cat',
          'type'          =>  'select',
          'choices'       =>  $buzz_agency_category_lists,
        )
      );
     // Testimonial Post Number Count
	$wp_customize->add_setting('buzz_agency_testimonial_num', 
	      array(
	        'default' => 5,
	          'sanitize_callback' => 'buzz_agency_sanitize_number',
	      )
	  );
	    
	 $wp_customize->add_control('buzz_agency_testimonial_num',
	    array(
	    	'priority'      =>  9,
	        'type' => 'number',
	        'label' => esc_html__('No. of Post','buzz-agency'),
	        'section' => 'buzz_agency_testimonial_setups',
	        'setting' => 'buzz_agency_testimonial_num',
	        'input_attrs' => array(
	        'min' => 1,
	        'max' => 9,
	      ),
	    )
	  );

	$wp_customize->add_setting('buzz_agency_testimonial_image',
		array(
		  'default' => '',
		  'sanitize_callback' => 'esc_url_raw'
		)
	);
	$wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_testimonial_image',
		array(
		  'label'      => esc_html__( ' Testimonial Section Background Image ', 'buzz-agency' ),
		  'section'    => 'buzz_agency_testimonial_setups',
		  'settings'   => 'buzz_agency_testimonial_image',
		  'priority' => 9,
		)
		)
	);	

  	/***********************************  Starting Footer PanelSetting **************************************/

	$wp_customize->add_panel('buzz_agency_homepage_footer_setups',
	 array(
	   'priority' => 16,
	   'capability' => 'edit_theme_options',
	   'theme_supports' => '',
	   'title' => esc_html__('Footer Sections ','buzz-agency'),
	   ));

	/*****************  Starting Home Footer Sections **************************************/

	$wp_customize->add_section('buzz_agency_footer_setups',
	  array(
	    'priority' => 1,
	    'capability' => 'edit_theme_options',
	    'theme_supports' => '',
	    'title' => esc_html__('Footer Section','buzz-agency'),
	    'panel' => 'buzz_agency_homepage_footer_setups'
	  ));

	$wp_customize->add_setting('buzz_agency_homepage_setting_footer_option',
		array(
			'default' => 0,
			'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
			)
		);
	$wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_homepage_setting_footer_option',

			array(
				'priority'      =>  1,
				'type' => 'switch',
				'label' => esc_html__('Enable Footer Sections Social Icons', 'buzz-agency'),
				'description' => esc_html__ ('Select Yes to show Footer Section on homepage.','buzz-agency'),
				'section' => 'buzz_agency_footer_setups',
				)
			)
	);

	$wp_customize->add_setting( 'buzz_agency_copyright_text',
	  array(
	    'default' => esc_html__( 'Copyright All Rights Reserved ', 'buzz-agency' ),
	    'sanitize_callback' => 'sanitize_text_field',
	  )
	);
	$wp_customize->add_control('buzz_agency_copyright_text',
	  array(
	    'type' => 'text',
	    'label' => esc_html__( 'Copyright Text', 'buzz-agency' ),
	    'section' => 'buzz_agency_footer_setups',
	    'priority' => 5
	  )
	);

	$wp_customize->add_setting('buzz_agency_process_footer_bg_image',
	  array(
	    'default' => '',
	    'sanitize_callback' => 'esc_url_raw'
	  )
	);
	$wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_process_footer_bg_image',
	  array(
	    'label'      => esc_html__( ' Footer Background Image ', 'buzz-agency' ),
	    'section'    => 'buzz_agency_footer_setups',
	    'settings'   => 'buzz_agency_process_footer_bg_image',
	    'priority' => 9,
	  )
	)
	);

   /***********************************  Starting General  Settings  **************************************/

    $wp_customize->add_panel('buzz_agency_general_panel',
     array(
       'priority' => '77',
       'capability' => 'edit_theme_options',
       'theme_supports' => '',
       'title' => esc_html__('General Setting ','buzz-agency'),
       ));

    $wp_customize->add_section('buzz_agency_general_setups',
      array(
        'priority' => '2',
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => esc_html__('General Section','buzz-agency'),
        'panel' => 'buzz_agency_general_panel'
      ));

    $wp_customize->add_setting('general_section_options_section',
    	array(
    		'default' => 0,
    		'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
    		)
    	);
    $wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'general_section_options_section',

    		array(
    			'priority'      =>  1,
    			'type' => 'switch',
    			'label' => esc_html__('Enable/Disable Header Breadcrumb', 'buzz-agency'),
    			'description' => esc_html__ ('Select Yes to show.','buzz-agency'),
    			'section' => 'buzz_agency_general_setups',
    			)
    		)
    );

 
   $wp_customize->add_setting('pagination_theme_options', 
	     array(
		     'default'       => 'default',
		     'type'              => 'theme_mod',
		     'capability'        => 'edit_theme_options',
		     'sanitize_callback' => 'buzz_agency_sanitize_select'
	     )
   );

   $wp_customize->add_control('pagination_theme_options', 
	     array(    
		     'label'   => esc_html__('Pagination Options', 'buzz-agency'),
		     'section'   => 'buzz_agency_general_setups',
		     'settings'  => 'pagination_theme_options',
		     'type'    => 'radio',
		     'choices'   => array(   
		       'default'     => esc_html__('Default', 'buzz-agency'),             
		       'numeric'     => esc_html__('Numeric', 'buzz-agency'),   
		       ),  
	     )
   ); 


   $wp_customize->add_setting('buzz_agency_404_bg_image',
     array(
       'default' => '',
       'sanitize_callback' => 'esc_url_raw'
     )
   );
   $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize,'buzz_agency_404_bg_image',
     array(
       'label'      => esc_html__( '404  Image ', 'buzz-agency' ),
       'section'    => 'buzz_agency_general_setups',
       'settings'   => 'buzz_agency_404_bg_image',
       'priority' => 9,
     )
   )
   );

   /***********************************  Archive Settings **********************************************/


   $wp_customize->add_panel('buzz_agency_archive_section', 
     array(
       'capabitity' => 'edit_theme_options',
       'priority' => 38,
       'title' => esc_html__('Archive Settings', 'buzz-agency')
       )
   );

   $wp_customize->add_section('buzz_agency_archive',
         array(
           'title' => esc_html__('Archive Sidebar Settings', 'buzz-agency'),
           'panel' => 'buzz_agency_archive_section'
           )
       );

     $wp_customize->add_setting('buzz_agency_archive_setting_sidebar_option',
         array(
           'default' =>  'right-sidebar',
           'sanitize_callback' =>  'buzz_agency_sanitize_select'
           )
         );  

     $wp_customize->add_control('buzz_agency_archive_setting_sidebar_option',
         array(
           'description' => esc_html__('Choose the sidebar Layout for the archive page','buzz-agency'),
           'section' => 'buzz_agency_archive',
           'type'    =>  'radio',
           'choices' =>  array(
               'left-sidebar' =>  esc_html__('Sidebar Left','buzz-agency'),
               'right-sidebar' =>  esc_html__('Sidebar Right','buzz-agency'),
               'both-sidebar' =>  esc_html__('Sidebar Both','buzz-agency'),
               'no-sidebar' =>  esc_html__('Sidebar No','buzz-agency'),
             )
           )
       );

     $wp_customize->add_setting('buzz_agency_archive_setting_sidebar_option_search',
         array(
           'default' =>  'right-sidebar',
           'sanitize_callback' =>  'buzz_agency_sanitize_select'
           )
         );  

     $wp_customize->add_control('buzz_agency_archive_setting_sidebar_option_search',
         array(
           'description' => esc_html__('Choose the sidebar Layout for the Search  page','buzz-agency'),
           'section' => 'buzz_agency_archive',
           'type'    =>  'radio',
           'choices' =>  array(
               'left-sidebar' =>  esc_html__('Sidebar Left','buzz-agency'),
               'right-sidebar' =>  esc_html__('Sidebar Right','buzz-agency'),
               'both-sidebar' =>  esc_html__('Sidebar Both','buzz-agency'),
               'no-sidebar' =>  esc_html__('Sidebar No','buzz-agency'),
             )
           )
       );


       $wp_customize->add_setting('buzz_agency_archive_section_redmore_optons',
       	array(
       		'default' => 0,
       		'sanitize_callback' => 'buzz_agency_sanitize_checkbox'
       		)
       	);
       $wp_customize->add_control(new Buzz_Agency_WP_Customize_Switch_Control($wp_customize,'buzz_agency_archive_section_redmore_optons',

       		array(
       			'priority'      =>  1,
       			'type' => 'switch',
       			'label' => esc_html__('Enable/Disable Read More', 'buzz-agency'),
       			'description' => esc_html__ ('Select Yes to show Archive Page .','buzz-agency'),
       			'section' => 'buzz_agency_general_setups',
       			)
       		)
       );
       
       $wp_customize->add_setting('buzz_agency_archive_submit',array(
                     'default'           =>  esc_html__('Read More ','buzz-agency'),
                     'sanitize_callback' =>  'sanitize_text_field',
                     )
                 );

      $wp_customize->add_control('buzz_agency_archive_submit',array(
                     'priority'      =>  4,
                     'label'         =>  esc_html__('Read More ','buzz-agency'),
                     'section'       =>  'buzz_agency_archive',
                     'setting'       =>  'buzz_agency_archive_submit',
                     'type'          =>  'text',  
                     )                                     
                 );


}
add_action( 'customize_register', 'buzz_agency_custom_customize_register' );