<?php
/**
 * Videography: Customizer
 *
 * @subpackage Videography
 * @since 1.0
 */

use WPTRT\Customize\Section\Videography_Button;

add_action( 'customize_register', function( $manager ) {

	$manager->register_section_type( Videography_Button::class );

	$manager->add_section(
		new Videography_Button( $manager, 'videography_pro', [
			'title'      => __( 'Videography Pro', 'videography' ),
			'priority'    => 0,
			'button_text' => __( 'Go Pro', 'videography' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/videographer-wordpress-theme/', 'videography')
		] )
	);

} );

// Load the JS and CSS.
add_action( 'customize_controls_enqueue_scripts', function() {

	$version = wp_get_theme()->get( 'Version' );

	wp_enqueue_script(
		'videography-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/js/customize-controls.js' ),
		[ 'customize-controls' ],
		$version,
		true
	);

	wp_enqueue_style(
		'videography-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/css/customize-controls.css' ),
		[ 'customize-controls' ],
 		$version
	);

} );

function videography_customize_register( $wp_customize ) {

	$wp_customize->add_setting('videography_logo_size',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_logo_size',array(
		'type' => 'range',
		'description' => __('Logo Size (0-100%)','videography'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('videography_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('videography_logo_padding',array(
		'label' => __('Logo Padding','videography'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('videography_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','videography'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('videography_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','videography'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('videography_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','videography'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('videography_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','videography'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('videography_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'videography_sanitize_checkbox'
	));
	$wp_customize->add_control('videography_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','videography'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('videography_show_site_title_color',array(
		'default' => '#002a45',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('videography_show_site_title_color',array(
		'type' => 'color',
		'label' => __('Site Title Color','videography'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('videography_site_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_site_title_font_size',array(
		'type' => 'number',
		'label' => __('Site Title Font Size','videography'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('videography_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'videography_sanitize_checkbox'
	));
	$wp_customize->add_control('videography_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','videography'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('videography_site_tagline_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_site_tagline_font_size',array(
		'type' => 'number',
		'label' => __('Site Tagline Font Size','videography'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_panel( 'videography_panel_id', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'theme_supports' => '',
		'title' => __( 'Theme Settings', 'videography' ),
		'description' => __( 'Description of what this panel does.', 'videography' ),
	) );

	$wp_customize->add_section( 'videography_theme_options_section', array(
    	'title'      => __( 'General Settings', 'videography' ),
		'priority'   => 30,
		'panel' => 'videography_panel_id'
	) );

	$wp_customize->add_setting('videography_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'videography_sanitize_choices'
	));
	$wp_customize->add_control('videography_theme_options',array(
		'type' => 'radio',
		'label' => __('Do you want this section','videography'),
		'section' => 'videography_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','videography'),
		   'Right Sidebar' => __('Right Sidebar','videography'),
		   'One Column' => __('One Column','videography'),
		   'Three Columns' => __('Three Columns','videography'),
		   'Four Columns' => __('Four Columns','videography'),
		   'Grid Layout' => __('Grid Layout','videography')
		),
	));

	$wp_customize->add_setting( 'videography_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'videography_sanitize_choices'
	));
	
	$wp_customize->add_control( 'videography_boxfull_width', array(
		'label'    => __( 'Section Width', 'videography' ),
		'section'  => 'videography_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'videography'),
			'container-fluid' => __('Full Width', 'videography'),
			'none' => __('None', 'videography')
		),
	));

	$wp_customize->add_setting( 'videography_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'videography_sanitize_choices'
	));
	$wp_customize->add_control( 'videography_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'videography' ),
		'section'  => 'videography_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'videography'),
			'fadeInUp' => __('fadeInUp', 'videography'),
			'zoomIn'    => __('zoomIn', 'videography'),
			'None'    => __('None', 'videography')
		),
	));

	//Top Header
	$wp_customize->add_section( 'videography_top_header_section' , array(
    	'title'    => __( 'Top Header', 'videography' ),
		'priority' => null,
		'panel' => 'videography_panel_id'
	) );

	$wp_customize->add_setting('videography_hide_show_topbar',array(
    	'default' => false,
    	'sanitize_callback'	=> 'videography_sanitize_checkbox'
	));
	$wp_customize->add_control('videography_hide_show_topbar',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Topbar','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_mail',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_email'
	));
	$wp_customize->add_control('videography_topheader_mail',array(
   	'type' => 'text',
   	'label' => __('Add Email Address','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_phone_no',array(
    	'default' => '',
    	'sanitize_callback'	=> 'videography_sanitize_phone_number'
	));
	$wp_customize->add_control('videography_topheader_phone_no',array(
   	'type' => 'text',
   	'label' => __('Add Phone Number','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_text',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('videography_topheader_text',array(
   	'type' => 'text',
   	'label' => __('Add Text','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_facebook_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('videography_topheader_facebook_url',array(
   	'type' => 'url',
   	'label' => __('Add Facebook URL','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_twitter_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('videography_topheader_twitter_url',array(
   	'type' => 'url',
   	'label' => __('Add Twitter URL','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_linkedin_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('videography_topheader_linkedin_url',array(
   	'type' => 'url',
   	'label' => __('Add Linkedin URL','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_instagram_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('videography_topheader_instagram_url',array(
   	'type' => 'url',
   	'label' => __('Add Instagram URL','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting('videography_topheader_pinterest_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('videography_topheader_pinterest_url',array(
   	'type' => 'url',
   	'label' => __('Add Pinterest URL','videography'),
   	'section' => 'videography_top_header_section',
	));

	$wp_customize->add_setting( 'videography_topbar_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_topbar_color', array(
		'label' => 'Text & Icon Color',
		'section' => 'videography_top_header_section',
	)));

	$wp_customize->add_setting( 'videography_topbarbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_topbarbg_color', array(
		'label' => 'Background Color',
		'section' => 'videography_top_header_section',
	)));

	//Header section
	$wp_customize->add_section( 'videography_header_section' , array(
    	'title'    => __( 'Header Section', 'videography' ),
		'priority' => null,
		'panel' => 'videography_panel_id'
	) );

	$wp_customize->add_setting('videography_studio_btn_text',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('videography_studio_btn_text',array(
   	'type' => 'text',
   	'label' => __('Add Join Studio Button Text','videography'),
   	'section' => 'videography_header_section',
	));

	$wp_customize->add_setting( 'videography_studio_btn_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_studio_btn_text_color', array(
		'label' => 'Button Text Color',
		'section' => 'videography_header_section',
	)));

	$wp_customize->add_setting( 'videography_studio_btnbg_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_studio_btnbg_text_color', array(
		'label' => 'Button Bg Color',
		'section' => 'videography_header_section',
	)));

	$wp_customize->add_setting('videography_studio_btn_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('videography_studio_btn_url',array(
   	'type' => 'url',
   	'label' => __('Add Join Studio Button URL','videography'),
   	'section' => 'videography_header_section',
	));

	$wp_customize->add_setting('videography_quote_btn_text',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('videography_quote_btn_text',array(
   	'type' => 'text',
   	'label' => __('Add Quote Button Text','videography'),
   	'section' => 'videography_header_section',
	));

	$wp_customize->add_setting( 'videography_quote_btn_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_quote_btn_text_color', array(
		'label' => 'Button Text Color',
		'section' => 'videography_header_section',
	)));

	$wp_customize->add_setting( 'videography_quote_btnbg_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_quote_btnbg_text_color', array(
		'label' => 'Button Bg Color',
		'section' => 'videography_header_section',
	)));

	$wp_customize->add_setting('videography_quote_btn_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('videography_quote_btn_url',array(
   	'type' => 'url',
   	'label' => __('Add Quote Button URL','videography'),
   	'section' => 'videography_header_section',
	));

	//home page slider
	$wp_customize->add_section( 'videography_slider_section' , array(
    	'title'    => __( 'Slider Settings', 'videography' ),
		'priority' => null,
		'panel' => 'videography_panel_id'
	) );

	$wp_customize->add_setting('videography_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'videography_sanitize_checkbox'
	));
	$wp_customize->add_control('videography_slider_hide_show',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Slider','videography'),
		'section' => 'videography_slider_section',
	));

	$wp_customize->add_setting( 'videography_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'videography_sanitize_choices'
	));
	$wp_customize->add_control( 'videography_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'videography' ),
		'section'  => 'videography_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'videography'),
			'bounceInRight' => __('bounceInRight', 'videography'),
			'bounceInUp'    => __('bounceInUp', 'videography'),
			'bounceInDown'    => __('bounceInDown', 'videography'),
			'zoomIn'  => __('zoomIn', 'videography'),
			'zoomOut' => __('zoomOut', 'videography'),
			'fadeInDown'    => __('fadeInDown', 'videography'),
			'fadeInUp'    => __('fadeInUp', 'videography'),
			'fadeInLeft'  => __('fadeInLeft', 'videography'),
			'fadeInRight' => __('fadeInRight', 'videography'),
			'flip-up'    => __('flip-up', 'videography'),
			'none'    => __('none', 'videography')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'videography_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'videography_sanitize_dropdown_pages'
		));
		$wp_customize->add_control( 'videography_slider' . $count, array(
			'label' => __('Select Slider Image Page', 'videography' ),
			'section' => 'videography_slider_section',
			'type' => 'dropdown-pages'
		));
	}

	$wp_customize->add_setting('videography_slider_excerpt_length',array(
		'default' => '20',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','videography'),
		'section' => 'videography_slider_section',
	));

	$wp_customize->add_setting('videography_slider_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_slider_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','videography'),
		'section' => 'videography_slider_section',
	));

	$wp_customize->add_setting('videography_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','videography'),
		'section' => 'videography_slider_section',
	));

	$wp_customize->add_setting('videography_slider_opacity',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_slider_opacity',array(
		'type' => 'range',
		'label' => __('Image Opacity','videography'),
		'section' => 'videography_slider_section',
		'input_attrs' => array(
			'min'  => 0,
			'max'  => 1,
			'step' => 0.1,
		),
	));

	$wp_customize->add_setting( 'videography_slider_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_slider_title_color', array(
		'label' => 'Title Color',
		'section' => 'videography_slider_section',
	)));

	$wp_customize->add_setting( 'videography_slider_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_slider_text_color', array(
		'label' => 'Text Color',
		'section' => 'videography_slider_section',
	)));

	$wp_customize->add_setting( 'videography_slider_btn_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_slider_btn_text_color', array(
		'label' => 'Button Text Color',
		'section' => 'videography_slider_section',
	)));

	$wp_customize->add_setting( 'videography_slider_btnbg_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_slider_btnbg_text_color', array(
		'label' => 'Button Bg Color',
		'section' => 'videography_slider_section',
	)));

	//Featured Videos Section
	$wp_customize->add_section('videography_featured_videos',array(
		'title'	=> __('Featured Videos Section','videography'),
		'description'=> __('<b>Note : </b>This section will appear below the slider.','videography'),
		'panel' => 'videography_panel_id',
	));

	$wp_customize->add_setting('videography_videos_section_heading',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('videography_videos_section_heading',array(
   	'type' => 'text',
   	'label' => __('Add Section Heading','videography'),
   	'section' => 'videography_featured_videos',
	));

	$wp_customize->add_setting( 'videography_feature_heading_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_feature_heading_color', array(
		'label' => 'Color',
		'section' => 'videography_featured_videos',
	)));

	$wp_customize->add_setting('videography_videos_section_small_heading',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('videography_videos_section_small_heading',array(
   	'type' => 'text',
   	'label' => __('Add Section Text','videography'),
   	'section' => 'videography_featured_videos',
	));

	$wp_customize->add_setting( 'videography_feature_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_feature_text_color', array(
		'label' => 'Color',
		'section' => 'videography_featured_videos',
	)));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_pst[]= 'select';
	foreach($categories as $category){
		if($i==0){
			$default = $category->slug;
			$i++;
		}
		$cat_pst[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('videography_category_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'videography_sanitize_choices',
	));
	$wp_customize->add_control('videography_category_setting',array(
		'type' => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','videography'),
		'section' => 'videography_featured_videos',
	));

	$wp_customize->add_setting('videography_feature_img_size',array(
    	'default' => '',
    	'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_feature_img_size',array(
		'type' => 'number',
		'label' => __('Image Size','videography'),
		'section' => 'videography_featured_videos',
	));

	$wp_customize->add_setting('videography_video_section_padding',array(
    	'default' => '',
    	'sanitize_callback'	=> 'videography_sanitize_float'
	));
	$wp_customize->add_control('videography_video_section_padding',array(
		'type' => 'number',
		'label' => __('Section Top Bottom Padding','videography'),
		'section' => 'videography_featured_videos',
	));

   $wp_customize->add_setting( 'videography_feature_boxtitle_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_feature_boxtitle_color', array(
		'label' => 'Box Title Color',
		'section' => 'videography_featured_videos',
	)));

	$wp_customize->add_setting( 'videography_feature_boxtext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_feature_boxtext_color', array(
		'label' => 'Box Text Color',
		'section' => 'videography_featured_videos',
	)));

	$wp_customize->add_setting( 'videography_feature_boxbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_feature_boxbg_color', array(
		'label' => 'Box Bg Color',
		'section' => 'videography_featured_videos',
	)));

	//Footer
   $wp_customize->add_section( 'videography_footer', array(
    	'title'  => __( 'Footer Settings', 'videography' ),
		'priority' => null,
		'panel' => 'videography_panel_id'
	) );

	$wp_customize->add_setting('videography_show_back_totop',array(
 		'default' => true,
   	'sanitize_callback'	=> 'videography_sanitize_checkbox'
	));
	$wp_customize->add_control('videography_show_back_totop',array(
   	'type' => 'checkbox',
   	'label' => __('Show / Hide Back to Top','videography'),
   	'section' => 'videography_footer'
	));

   $wp_customize->add_setting('videography_footer_copy',array(
		'default' => 'Videography WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('videography_footer_copy',array(
		'label'	=> __('Copyright Text','videography'),
		'section' => 'videography_footer',
		'setting' => 'videography_footer_copy',
		'type' => 'text'
	));

	$wp_customize->add_setting('videography_copyright_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'videography_sanitize_float'
 	));
 	$wp_customize->add_control('videography_copyright_padding',array(
		'type' => 'number',
		'label' => __('Copyright Top Bottom Padding','videography'),
		'section' => 'videography_footer',
	));

	$wp_customize->add_setting( 'videography_copyright_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_copyright_color', array(
		'label' => 'Copyright Text Color',
		'section' => 'videography_footer',
	)));

	$wp_customize->add_setting( 'videography_copyrightbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_copyrightbg_color', array(
		'label' => 'Copyright Background Color',
		'section' => 'videography_footer',
	)));

	$wp_customize->add_setting( 'videography_footer_widget_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_footer_widget_color', array(
		'label' => 'Widgets Title Color',
		'section' => 'videography_footer',
	)));

	$wp_customize->add_setting( 'videography_footer_widget_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_footer_widget_text_color', array(
		'label' => 'Widgets Text Color',
		'section' => 'videography_footer',
	)));

	$wp_customize->add_setting( 'videography_footerbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'videography_footerbg_color', array(
		'label' => 'Footer Background Color',
		'section' => 'videography_footer',
	)));

	$wp_customize->register_section_type( Videography_Button::class );

	$wp_customize->add_section(
		new Videography_Button( $wp_customize, 'videography_pro_under_panel', [
			'title'      => __( 'Videography Pro', 'videography' ),
			'priority'    => null,
			'button_text' => __( 'Go Pro', 'videography' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/products/videographer-wordpress-theme/', 'videography'),
			'panel' => 'videography_panel_id'
		] )
	);

	$wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';

	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.site-title a',
		'render_callback' => 'videography_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'videography_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'videography_customize_register' );

function videography_customize_partial_blogname() {
	bloginfo( 'name' );
}

function videography_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

function videography_is_static_front_page() {
	return ( is_front_page() && ! is_home() );
}

function videography_is_view_with_layout_option() {
	// This option is available on all pages. It's also available on archives when there isn't a sidebar.
	return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );
}