<?php
/**
* The template for adding additional theme options in Customizer
*
* @package Catch Themes
* @subpackage Gridalicious
* @since Gridalicious 1.0
*/


//Theme Options
$wp_customize->add_panel( 'gridalicious_theme_options', array(
    'description'    => esc_html__( 'Basic theme Options', 'gridalicious-pro' ),
    'capability'     => 'edit_theme_options',
    'priority'       => 200,
    'title'    		 => esc_html__( 'Theme Options', 'gridalicious-pro' ),
) );

// Breadcrumb Option
$wp_customize->add_section( 'gridalicious_breadcumb_options', array(
	'description'	=> esc_html__( 'Breadcrumbs are a great way of letting your visitors find out where they are on your site with just a glance. You can enable/disable them on homepage and entire site.', 'gridalicious-pro' ),
	'panel'			=> 'gridalicious_theme_options',
	'title'    		=> esc_html__( 'Breadcrumb Options', 'gridalicious-pro' ),
	'priority' 		=> 201,
) );

$wp_customize->add_setting( 'gridalicious_theme_options[breadcumb_option]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['breadcumb_option'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox'
) );

$wp_customize->add_control( 'gridalicious_theme_options[breadcumb_option]', array(
	'label'    => esc_html__( 'Check to enable Breadcrumb', 'gridalicious-pro' ),
	'section'  => 'gridalicious_breadcumb_options',
	'settings' => 'gridalicious_theme_options[breadcumb_option]',
	'type'     => 'checkbox',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[breadcumb_onhomepage]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['breadcumb_onhomepage'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox'
) );

$wp_customize->add_control( 'gridalicious_theme_options[breadcumb_onhomepage]', array(
	'label'    => esc_html__( 'Check to enable Breadcrumb on Homepage', 'gridalicious-pro' ),
	'section'  => 'gridalicious_breadcumb_options',
	'settings' => 'gridalicious_theme_options[breadcumb_onhomepage]',
	'type'     => 'checkbox',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[breadcumb_seperator]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['breadcumb_seperator'],
	'sanitize_callback'	=> 'sanitize_text_field',
) );

$wp_customize->add_control( 'gridalicious_theme_options[breadcumb_seperator]', array(
	'input_attrs' => array(
    		'style' => 'width: 40px;'
		),
	'label'    	=> esc_html__( 'Seperator between Breadcrumbs', 'gridalicious-pro' ),
	'section' 	=> 'gridalicious_breadcumb_options',
	'settings' 	=> 'gridalicious_theme_options[breadcumb_seperator]',
	'type'     	=> 'text'
	)
);
	// Breadcrumb Option End

	// Comment Option
$wp_customize->add_section( 'gridalicious_comment_option', array(
	'description'	=> esc_html__( 'Comments can also be disabled on a per post/page basis when creating/editing posts/pages.', 'gridalicious-pro' ),
	'panel' 		=> 'gridalicious_theme_options',
	'priority'		=> 202,
	'title'   		=> esc_html__( 'Comment Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[comment_option]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['comment_option'],
	'sanitize_callback' => 'gridalicious_sanitize_select',
) );

$wp_customize->add_control( 'gridalicious_theme_options[comment_option]', array(
		'choices'  	=> gridalicious_comment_options(),
		'label'		=> esc_html__( 'Comment Option', 'gridalicious-pro' ),
        'priority'	=> 1,
		'section'   => 'gridalicious_comment_option',
        'settings'  => 'gridalicious_theme_options[comment_option]',
        'type'	  	=> 'select',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[disable_notes]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['disable_notes'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
) );

$wp_customize->add_control( 'gridalicious_theme_options[disable_notes]', array(
	'label'		=> esc_html__( 'Check to Disable Notes', 'gridalicious-pro' ),
	'section'   => 'gridalicious_comment_option',
    'settings'  => 'gridalicious_theme_options[disable_notes]',
	'type'		=> 'checkbox',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[disable_website_field]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['disable_website_field'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
) );

$wp_customize->add_control( 'gridalicious_theme_options[disable_website_field]', array(
	'label'		=> esc_html__( 'Check to Disable Website Field', 'gridalicious-pro' ),
	'section'   => 'gridalicious_comment_option',
    'settings'  => 'gridalicious_theme_options[disable_website_field]',
	'type'		=> 'checkbox',
) );
	// Comment End

/**
 *  Remove Custom CSS option from WordPress 4.7 onwards
 *  //@remove Remove if block and custom_css when WordPress 5.0 is released
 */
if ( !function_exists( 'wp_update_custom_css_post' ) ) {
   	// Custom CSS Option
	$wp_customize->add_section( 'gridalicious_custom_css', array(
		'description'	=> esc_html__( 'Custom/Inline CSS', 'gridalicious-pro'),
		'panel'  		=> 'gridalicious_theme_options',
		'priority' 		=> 203,
		'title'    		=> esc_html__( 'Custom CSS Options', 'gridalicious-pro' ),
	) );

	$wp_customize->add_setting( 'gridalicious_theme_options[custom_css]', array(
		'capability'		=> 'edit_theme_options',
		'default'			=> $defaults['custom_css'],
		'sanitize_callback' => 'gridalicious_sanitize_custom_css',
	) );

	$wp_customize->add_control( 'gridalicious_theme_options[custom_css]', array(
			'label'		=> esc_html__( 'Enter Custom CSS', 'gridalicious-pro' ),
	        'priority'	=> 1,
			'section'   => 'gridalicious_custom_css',
	        'settings'  => 'gridalicious_theme_options[custom_css]',
			'type'		=> 'textarea',
	) );
   	// Custom CSS End
}

	// Excerpt Options
$wp_customize->add_section( 'gridalicious_excerpt_options', array(
	'panel'  	=> 'gridalicious_theme_options',
	'priority' 	=> 204,
	'title'    	=> esc_html__( 'Excerpt Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[excerpt_length]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['excerpt_length'],
	'sanitize_callback' => 'gridalicious_sanitize_number_range',
) );

$wp_customize->add_control( 'gridalicious_theme_options[excerpt_length]', array(
	'description' => esc_html__('Excerpt length. Default is 40 words', 'gridalicious-pro'),
	'input_attrs' => array(
        'min'   => 10,
        'max'   => 200,
        'step'  => 5,
        'style' => 'width: 60px;'
        ),
    'label'    => esc_html__( 'Excerpt Length (words)', 'gridalicious-pro' ),
	'section'  => 'gridalicious_excerpt_options',
	'settings' => 'gridalicious_theme_options[excerpt_length]',
	'type'	   => 'number',
	)
);

$wp_customize->add_setting( 'gridalicious_theme_options[excerpt_more_text]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['excerpt_more_text'],
	'sanitize_callback'	=> 'sanitize_text_field',
) );

$wp_customize->add_control( 'gridalicious_theme_options[excerpt_more_text]', array(
	'label'    => esc_html__( 'Read More Text', 'gridalicious-pro' ),
	'section'  => 'gridalicious_excerpt_options',
	'settings' => 'gridalicious_theme_options[excerpt_more_text]',
	'type'	   => 'text',
) );
// Excerpt Options End

// Feed Redirect
$wp_customize->add_section( 'gridalicious_feed_redirect', array(
	'panel'			=> 'gridalicious_theme_options',
	'description'	=> esc_html__( 'If your custom feed(s) are not handled by Feedblitz or Feedburner, do not use the redirect options.', 'gridalicious-pro' ),
	'priority' 		=> 205,
	'title'    		=> esc_html__( 'Feed Redirect', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[feed_redirect]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['feed_redirect'],
	'sanitize_callback' => 'esc_url_raw',
) );

$wp_customize->add_control( 'gridalicious_theme_options[feed_redirect]', array(
	'label'    => esc_html__( 'Feed Redirect', 'gridalicious-pro' ),
	'section'  => 'gridalicious_feed_redirect',
	'settings' => 'gridalicious_theme_options[feed_redirect]',
	'type'	   => 'text',
) );
// Feed Redirect End

// Font Family Options
$wp_customize->add_section( 'gridalicious_font_family', array(
	'panel'  => 'gridalicious_theme_options',
	'priority'	=> 206,
	'title'    	=> esc_html__( 'Font Family Options', 'gridalicious-pro' ),
) );

$avaliable_fonts = gridalicious_avaliable_fonts();

$choices = array();

foreach ( $avaliable_fonts as $avaliable_font ) {
	$choices[ $avaliable_font[ 'value' ] ] = str_replace( '"', '', $avaliable_font[ 'label' ] );
}

$font_family_options = array(
	'title_font' 		=> esc_html__( 'Site Title Font Family', 'gridalicious-pro' ),
	'body_font' 		=> esc_html__( 'Default Font Family', 'gridalicious-pro' ),
	'tagline_font' 		=> esc_html__( 'Site Tagline Font Family', 'gridalicious-pro' ),
	'content_title_font'=> esc_html__( 'Content Title Font Family', 'gridalicious-pro' ),
	'content_font' 		=> esc_html__( 'Content Body Font Family', 'gridalicious-pro' ),
	'headings_font' 	=> esc_html__( 'Headings Tags from h1 to h6 Font Family', 'gridalicious-pro' )
);

foreach ( $font_family_options as $key => $font_family_option ) {
	$wp_customize->add_setting( 'gridalicious_theme_options['. $key . ']', array(
		'capability'		=> 'edit_theme_options',
		'default'			=> $defaults[ $key ],
		'sanitize_callback' => 'gridalicious_sanitize_select',
	) );

	$wp_customize->add_control( 'gridalicious_theme_options['. $key . ']', array(
		'choices'  => $choices,
		'label'    => $font_family_option,
		'section'  => 'gridalicious_font_family',
		'settings' => 'gridalicious_theme_options['. $key . ']',
		'type'	   => 'select',
	) );
}

$wp_customize->add_setting( 'gridalicious_theme_options[reset_typography]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['reset_typography'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
	'transport'			=> 'postMessage'
) );

$wp_customize->add_control( 'gridalicious_theme_options[reset_typography]', array(
	'label'		=> esc_html__( 'Check to reset fonts', 'gridalicious-pro' ),
	'section'	=> 'gridalicious_font_family',
	'settings'	=> 'gridalicious_theme_options[reset_typography]',
	'type'		=> 'checkbox',
) );
// Font Family Options End

// Footer Editor Options
$wp_customize->add_section( 'gridalicious_footer_options', array(
	'description'	=> esc_html__( 'You can either add html or plain text', 'gridalicious-pro'),
	'panel'  => 'gridalicious_theme_options',
	'priority' 		=> 207,
	'title'    		=> esc_html__( 'Footer Editor Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[footer_left_content]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['footer_left_content'],
	'sanitize_callback'	=> 'gridalicious_sanitize_footer_code',
) );

$wp_customize->add_control( 'gridalicious_theme_options[footer_left_content]', array(
		'description' 	=> esc_html__( 'You can add custom shortcodes, which will be automatically inserted into your theme. Some shorcodes: [the-year], [site-link] and [privacy-policy-link] for current year, site link and privacy policy link respectively.', 'gridalicious-pro' ),
		'label'		=> esc_html__( 'Footer Left Content', 'gridalicious-pro' ),
		'label'		=> esc_html__( 'Footer Left Content', 'gridalicious-pro' ),
        'priority'	=> 1,
		'section'   => 'gridalicious_footer_options',
        'settings'  => 'gridalicious_theme_options[footer_left_content]',
		'type'		=> 'textarea',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[footer_right_content]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['footer_right_content'],
	'sanitize_callback'	=> 'gridalicious_sanitize_footer_code',
) );

$wp_customize->add_control( 'gridalicious_theme_options[footer_right_content]', array(
		'label'		=> esc_html__( 'Footer Right Content', 'gridalicious-pro' ),
        'priority'	=> 2,
		'section'   => 'gridalicious_footer_options',
        'settings'  => 'gridalicious_theme_options[footer_right_content]',
		'type'		=> 'textarea',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[reset_footer_content]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['reset_footer_content'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
	'transport'			=> 'postMessage'
) );

$wp_customize->add_control( 'gridalicious_theme_options[reset_footer_content]', array(
	'label'		=> esc_html__( 'Check to reset Footer Content', 'gridalicious-pro' ),
	'priority'	=> 3,
	'settings'	=> 'gridalicious_theme_options[reset_footer_content]',
	'section'	=> 'gridalicious_footer_options',
	'type'		=> 'checkbox',
) );
// Footer Options End

// Header Right Sidebar Option
$wp_customize->add_section( 'gridalicious_header_right', array(
	'panel'    => 'gridalicious_theme_options',
	'priority' => 208,
	'title'    => esc_html__( 'Header Right Sidebar Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[disable_header_right_sidebar]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['disable_header_right_sidebar'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox'
) );

$wp_customize->add_control( 'gridalicious_theme_options[disable_header_right_sidebar]', array(
	'label'    	=> esc_html__( 'Check to disable Header Right Sidebar', 'gridalicious-pro' ),
	'section'  	=> 'gridalicious_header_right',
	'settings' 	=> 'gridalicious_theme_options[disable_header_right_sidebar]',
	'type'     	=> 'checkbox',
) );
// Header Right Sidebar Option End

//Homepage / Frontpage Options
$wp_customize->add_section( 'gridalicious_homepage_options', array(
	'description'	=> esc_html__( 'Only posts that belong to the categories selected here will be displayed on the front page', 'gridalicious-pro' ),
	'panel'			=> 'gridalicious_theme_options',
	'priority' 		=> 209,
	'title'   	 	=> esc_html__( 'Homepage / Frontpage Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[front_page_category]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['front_page_category'],
	'sanitize_callback'	=> 'gridalicious_sanitize_category_list',
) );

$wp_customize->add_control( new Gridalicious_Customize_Dropdown_Categories_Control( $wp_customize, 'gridalicious_theme_options[front_page_category]', array(
    'label'   	=> esc_html__( 'Select Categories', 'gridalicious-pro' ),
    'name'	 	=> 'gridalicious_theme_options[front_page_category]',
	'priority'	=> '6',
    'section'  	=> 'gridalicious_homepage_options',
    'settings' 	=> 'gridalicious_theme_options[front_page_category]',
    'type'     	=> 'dropdown-categories',
) ) );
//Homepage / Frontpage Settings End

// Layout Options
$wp_customize->add_section( 'gridalicious_layout', array(
	'capability'=> 'edit_theme_options',
	'panel'		=> 'gridalicious_theme_options',
	'priority'	=> 211,
	'title'		=> esc_html__( 'Layout Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[theme_layout]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['theme_layout'],
	'sanitize_callback' => 'gridalicious_sanitize_select',
) );

$wp_customize->add_control( 'gridalicious_theme_options[theme_layout]', array(
	'choices'  => gridalicious_layouts(),
	'label'    => esc_html__( 'Default Layout', 'gridalicious-pro' ),
	'priority' => 1,
	'section'  => 'gridalicious_layout',
	'settings' => 'gridalicious_theme_options[theme_layout]',
	'type'     => 'select',
) );

if ( class_exists( 'WooCommerce' ) ) {
	$wp_customize->add_setting( 'gridalicious_theme_options[woocommerce_layout]', array(
		'capability'		=> 'edit_theme_options',
		'default'			=> $defaults['woocommerce_layout'],
		'sanitize_callback' => 'gridalicious_sanitize_select',
	) );

	$wp_customize->add_control( 'gridalicious_theme_options[woocommerce_layout]', array(
		'choices'  => gridalicious_layouts(),
		'label'    => esc_html__( 'WooCommerce Layout', 'gridalicious-pro' ),
		'priority' => 2,
		'section'  => 'gridalicious_layout',
		'settings' => 'gridalicious_theme_options[woocommerce_layout]',
		'type'     => 'select',
	) );
}

$wp_customize->add_setting( 'gridalicious_theme_options[content_layout]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['content_layout'],
	'sanitize_callback' => 'gridalicious_sanitize_select',
) );

$wp_customize->add_control( 'gridalicious_theme_options[content_layout]', array(
	'choices'   => gridalicious_get_archive_content_layout(),
	'label'		=> esc_html__( 'Archive Content Layout', 'gridalicious-pro' ),
	'section'   => 'gridalicious_layout',
	'settings'  => 'gridalicious_theme_options[content_layout]',
	'type'      => 'select',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[single_post_image_layout]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['single_post_image_layout'],
	'sanitize_callback' => 'gridalicious_sanitize_select',
) );

$wp_customize->add_control( 'gridalicious_theme_options[single_post_image_layout]', array(
		'label'		=> esc_html__( 'Single Page/Post Image Layout ', 'gridalicious-pro' ),
		'section'   => 'gridalicious_layout',
        'settings'  => 'gridalicious_theme_options[single_post_image_layout]',
        'type'	  	=> 'select',
		'choices'  	=> gridalicious_single_post_image_layout_options(),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[hide_archive_meta]', array(
	'capability'        => 'edit_theme_options',
	'default'           => $defaults['hide_archive_meta'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox'
) );

$wp_customize->add_control( 'gridalicious_theme_options[hide_archive_meta]', array(
	'label'    => esc_html__( 'Check to hide meta information on archive pages', 'gridalicious-pro' ),
	'section'  => 'gridalicious_layout',
	'settings' => 'gridalicious_theme_options[hide_archive_meta]',
	'type'     => 'checkbox',
) );

	// Layout Options End

// Pagination Options
$pagination_type	= $options['pagination_type'];

$gridalicious_navigation_description = sprintf( esc_html__( 'Numeric Option requires <a target="_blank" href="%1$s">WP-PageNavi Plugin</a>.<br/>Infinite Scroll Options requires <a target="_blank" href="%2$s">JetPack Plugin</a> with Infinite Scroll module Enabled.', 'gridalicious-pro' ), esc_url( 'https://wordpress.org/plugins/wp-pagenavi' ), esc_url( 'https://wordpress.org/plugins/jetpack/' ) );

/**
 * Check if navigation type is Jetpack Infinite Scroll and if it is enabled
 */
if ( ( 'infinite-scroll-click' == $pagination_type || 'infinite-scroll-scroll' == $pagination_type ) ) {
	if ( ! (class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'infinite-scroll' ) ) ) {
		$gridalicious_navigation_description = sprintf( esc_html__( 'Infinite Scroll Options requires <a target="_blank" href="%s">JetPack Plugin</a> with Infinite Scroll module Enabled.', 'gridalicious-pro' ), esc_url( 'https://wordpress.org/plugins/jetpack/' ) );
	}
	else {
		$gridalicious_navigation_description = '';
	}
}
/**
* Check if navigation type is numeric and if Wp-PageNavi Plugin is enabled
*/
else if ( 'numeric' == $pagination_type ) {
	if ( !function_exists( 'wp_pagenavi' ) ) {
		$gridalicious_navigation_description = sprintf( esc_html__( 'Numeric Option requires <a target="_blank" href="%s">WP-PageNavi Plugin</a>.', 'gridalicious-pro' ), esc_url( 'https://wordpress.org/plugins/wp-pagenavi' ) );
	}
	else {
		$gridalicious_navigation_description = '';
	}
}

$wp_customize->add_section( 'gridalicious_pagination_options', array(
	'description'	=> $gridalicious_navigation_description,
	'panel'  		=> 'gridalicious_theme_options',
	'priority'		=> 212,
	'title'    		=> esc_html__( 'Pagination Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[pagination_type]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['pagination_type'],
	'sanitize_callback' => 'gridalicious_sanitize_select',
) );

$wp_customize->add_control( 'gridalicious_theme_options[pagination_type]', array(
	'choices'  => gridalicious_get_pagination_types(),
	'label'    => esc_html__( 'Pagination type', 'gridalicious-pro' ),
	'section'  => 'gridalicious_pagination_options',
	'settings' => 'gridalicious_theme_options[pagination_type]',
	'type'	   => 'select',
) );
// Pagination Options End

//Promotion Headline Options
$wp_customize->add_section( 'gridalicious_promotion_headline_options', array(
	'description'	=> esc_html__( 'To disable the fields, simply leave them empty.', 'gridalicious-pro' ),
	'panel'			=> 'gridalicious_theme_options',
	'priority' 		=> 213,
	'title'   	 	=> esc_html__( 'Promotion Headline Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[promotion_headline_option]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['promotion_headline_option'],
	'sanitize_callback' => 'gridalicious_sanitize_select',
) );

$wp_customize->add_control( 'gridalicious_theme_options[promotion_headline_option]', array(
	'choices'  	=> gridalicious_featured_grid_content_options(),
	'label'    	=> esc_html__( 'Enable Promotion Headline on', 'gridalicious-pro' ),
	'priority'	=> '0.5',
	'section'  	=> 'gridalicious_promotion_headline_options',
	'settings' 	=> 'gridalicious_theme_options[promotion_headline_option]',
	'type'	  	=> 'select',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[promotion_headline]', array(
	'capability'		=> 'edit_theme_options',
	'default' 			=> $defaults['promotion_headline'],
	'sanitize_callback'	=> 'wp_kses_post'
) );

$wp_customize->add_control( 'gridalicious_theme_options[promotion_headline]', array(
	'description'	=> esc_html__( 'Appropriate Words: 10', 'gridalicious-pro' ),
	'label'    	=> esc_html__( 'Promotion Headline Text', 'gridalicious-pro' ),
	'priority'	=> '1',
	'section' 	=> 'gridalicious_promotion_headline_options',
	'settings'	=> 'gridalicious_theme_options[promotion_headline]',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[promotion_subheadline]', array(
	'capability'		=> 'edit_theme_options',
	'default' 			=> $defaults['promotion_subheadline'],
	'sanitize_callback'	=> 'wp_kses_post'
) );

$wp_customize->add_control( 'gridalicious_theme_options[promotion_subheadline]', array(
	'description'	=> esc_html__( 'Appropriate Words: 15', 'gridalicious-pro' ),
	'label'    	=> esc_html__( 'Promotion Subheadline Text', 'gridalicious-pro' ),
	'priority'	=> '2',
	'section' 	=> 'gridalicious_promotion_headline_options',
	'settings'	=> 'gridalicious_theme_options[promotion_subheadline]',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[promotion_headline_button]', array(
	'capability'		=> 'edit_theme_options',
	'default' 			=> $defaults['promotion_headline_button'],
	'sanitize_callback'	=> 'sanitize_text_field'
) );

$wp_customize->add_control( 'gridalicious_theme_options[promotion_headline_button]', array(
	'description'	=> esc_html__( 'Appropriate Words: 3', 'gridalicious-pro' ),
	'label'    	=> esc_html__( 'Promotion Headline Button Text ', 'gridalicious-pro' ),
	'priority'	=> '3',
	'section' 	=> 'gridalicious_promotion_headline_options',
	'settings'	=> 'gridalicious_theme_options[promotion_headline_button]',
	'type'		=> 'text',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[promotion_headline_url]', array(
	'capability'		=> 'edit_theme_options',
	'default' 			=> $defaults['promotion_headline_url'],
	'sanitize_callback'	=> 'esc_url_raw'
) );

$wp_customize->add_control( 'gridalicious_theme_options[promotion_headline_url]', array(
	'label'    	=> esc_html__( 'Promotion Headline Link', 'gridalicious-pro' ),
	'priority'	=> '4',
	'section' 	=> 'gridalicious_promotion_headline_options',
	'settings'	=> 'gridalicious_theme_options[promotion_headline_url]',
	'type'		=> 'text',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[promotion_headline_target]', array(
	'capability'		=> 'edit_theme_options',
	'default' 			=> $defaults['promotion_headline_target'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
) );

$wp_customize->add_control( 'gridalicious_theme_options[promotion_headline_target]', array(
	'label'    	=> esc_html__( 'Check to Open Link in New Window/Tab', 'gridalicious-pro' ),
	'priority'	=> '5',
	'section'  	=> 'gridalicious_promotion_headline_options',
	'settings' 	=> 'gridalicious_theme_options[promotion_headline_target]',
	'type'     	=> 'checkbox',
) );
// Promotion Headline Options End

// Responsive Options
$wp_customize->add_section( 'gridalicious_responsive_options', array(
	'panel'  => 'gridalicious_theme_options',
	'priority' => 214,
	'title'    => esc_html__( 'Responsive Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[responsive_select]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['responsive_select'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
) );

$wp_customize->add_control( 'gridalicious_theme_options[responsive_select]', array(
	'label'    => esc_html__( 'Check to disable responsive style', 'gridalicious-pro' ),
	'section'  => 'gridalicious_responsive_options',
	'settings' => 'gridalicious_theme_options[responsive_select]',
	'type'     => 'checkbox',
) );
	// Responsive Options End

// Scrollup
$wp_customize->add_section( 'gridalicious_scrollup', array(
	'panel'    => 'gridalicious_theme_options',
	'priority' => 215,
	'title'    => esc_html__( 'Scrollup Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[disable_scrollup]', array(
	'capability'		=> 'edit_theme_options',
    'default'			=> $defaults['disable_scrollup'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
) );

$wp_customize->add_control( 'gridalicious_theme_options[disable_scrollup]', array(
	'label'		=> esc_html__( 'Check to disable Scroll Up', 'gridalicious-pro' ),
	'section'   => 'gridalicious_scrollup',
    'settings'  => 'gridalicious_theme_options[disable_scrollup]',
	'type'		=> 'checkbox',
) );
// Scrollup End

// Search Options
$wp_customize->add_section( 'gridalicious_search_options', array(
	'description'=> esc_html__( 'Change default placeholder text in Search.', 'gridalicious-pro'),
	'panel'  => 'gridalicious_theme_options',
	'priority' => 216,
	'title'    => esc_html__( 'Search Options', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[search_text]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['search_text'],
	'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control( 'gridalicious_theme_options[search_text]', array(
	'label'		=> esc_html__( 'Default Display Text in Search', 'gridalicious-pro' ),
	'section'   => 'gridalicious_search_options',
    'settings'  => 'gridalicious_theme_options[search_text]',
	'type'		=> 'text',
) );
// Search Options End

// Single Post Navigation
$wp_customize->add_section( 'gridalicious_single_post_navigation', array(
	'panel'  => 'gridalicious_theme_options',
	'priority' => 217,
	'title'    => esc_html__( 'Single Post Navigation', 'gridalicious-pro' ),
) );

$wp_customize->add_setting( 'gridalicious_theme_options[disable_single_post_navigation]', array(
	'capability'		=> 'edit_theme_options',
    'default'			=> $defaults['disable_single_post_navigation'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
) );

$wp_customize->add_control( 'gridalicious_theme_options[disable_single_post_navigation]', array(
	'label'		=> esc_html__( 'Check to disable Single Post Navigation', 'gridalicious-pro' ),
	'section'   => 'gridalicious_single_post_navigation',
    'settings'  => 'gridalicious_theme_options[disable_single_post_navigation]',
	'type'		=> 'checkbox',
) );
// Single Post Navigation End

// Update Notifier
$wp_customize->add_section( 'gridalicious_update_notifier', array(
	'title'    => esc_html__( 'Update Notifier', 'gridalicious-pro' ),
	'priority' => 217,
	'panel'    => 'gridalicious_theme_options',
) );

$wp_customize->add_setting( 'gridalicious_theme_options[update_notifier]', array(
	'capability'		=> 'edit_theme_options',
	'default'			=> $defaults['update_notifier'],
	'sanitize_callback' => 'gridalicious_sanitize_checkbox',
) );

$wp_customize->add_control( 'gridalicious_theme_options[update_notifier]', array(
	'label'		=> esc_html__( 'Check to disable update notifications', 'gridalicious-pro' ),
	'section'   => 'gridalicious_update_notifier',
    'settings'  => 'gridalicious_theme_options[update_notifier]',
	'type'		=> 'checkbox',
) );
// Update Notifier End
//Theme Option End