<?php


/*********************
post-settings
*******************/


// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
$wp_customize->add_panel( 'digital_single_postsset', array(
			'priority' => 30,
			'capability' => 'edit_theme_options',
			'description' => __( 'Single Posts', 'digital' ),
			'priority'    => apply_filters( 'digital_single_postsset_priority', 170 ),
			'title' => __( 'Single Posts', 'digital' )
		) );


  //Add Section 2
		
  $wp_customize->add_section('digital_postmetasingle_section',
  array(
      'title'       => __( 'Post Meta Section Single', 'digital' ),
      'capability'  => 'edit_theme_options',						
      'panel'			=> 'digital_single_postsset',
      'priority'    => apply_filters( 'digital_postmetasingle_section_priority', 10 ),
  ));

        // $wp_customize->add_setting(
		// 	'digital_enable_postmeta',
		// 	array(
		// 		'default'           => 'enable',
		// 		'type'              => 'theme_mod',
		// 		'sanitize_callback' => 'sanitize_text_field',
		// 		'capability'        => 'edit_theme_options',
		// 	)
		// );

		// $wp_customize->add_control(
		// 	new WP_Customize_Control(
		// 		$wp_customize,
		// 		'digital_enable_postmeta',
		// 		array(
		// 			'label'       => __( 'Post Footer Meta', 'digital' ),
		// 			'description' => __( 'Enable or disable post footer meta Date, Author, Read more etc.', 'digital' ),
		// 			'section'     => 'digital_postmetasingle_section',
		// 			'type'        => 'select',
		// 			'choices'     => array(
		// 				'disable' => __( 'Disable', 'digital' ),
		// 				'enable' => __( 'Enable', 'digital' ),
		// 			),
		// 			'priority'    => apply_filters( 'digital_bootstrap_version_priority', 10 ),
		// 		)
		// 	)
		// );
		
		//Hide Post date
		$wp_customize->add_setting('digital_single_meta',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'digital_customize_sanitize_select'
			));
		$wp_customize->add_control('digital_single_meta',
			 array (                             
				'type' => 'radio',
				'label' => __('Post date','digital'),
				'settings'   => 'digital_single_meta',
				'section' => 'digital_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','digital'),
					'disable' => __('Disable','digital'),
				 ),
			 ));
		
		//Hide Post author
		$wp_customize->add_setting('digital_singlemeta_author',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'digital_customize_sanitize_select'
			));
		$wp_customize->add_control('digital_singlemeta_author',
			 array (                             
				'type' => 'radio',
				'label' => __('Post Author Name','digital'),
				'description' => __('This option control only author name not Author profile','digital'),
				'settings'   => 'digital_singlemeta_author',
				'section' => 'digital_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','digital'),
					'disable' => __('Disable','digital'),
				 ),
			 ));
		
	
		//Hide View Count
		$wp_customize->add_setting('digital_single_viewcount',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'digital_customize_sanitize_select'
			));
		$wp_customize->add_control('digital_single_viewcount',
			 array (                             
				'type' => 'radio',
				'label' => __('View Count','digital'),
				'settings'   => 'digital_single_viewcount',
				'section' => 'digital_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','digital'),
					'disable' => __('Disable','digital'),
				 ),
			 ));	 
		//Hide Post Categories
		$wp_customize->add_setting('digital_singlemeta_category',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'digital_customize_sanitize_select'
			));
		$wp_customize->add_control('digital_singlemeta_category',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post Categories','digital'),
				'settings'   => 'digital_singlemeta_category',
				'section' => 'digital_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','digital'),
					'disable' => __('Disable','digital'),
				 ),
			 ));
		//Hide Post Tags
		$wp_customize->add_setting('digital_singlemeta_tags',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'digital_customize_sanitize_select'
			));
		$wp_customize->add_control('digital_singlemeta_tags',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post tags','digital'),
				'settings'   => 'digital_singlemeta_tags',
				'section' => 'digital_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','digital'),
					'disable' => __('Disable','digital'),
				 ),
			 ));
			 
			// Hide website in comment	
		$wp_customize->add_setting('digital_website_field',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'digital_customize_sanitize_select'
			));
		$wp_customize->add_control('digital_website_field',
			 array (                             
				'type' => 'radio',
				'label' => __('Show Website Field in Comments','digital'),
				'settings'   => 'digital_website_field',
				'section' => 'digital_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','digital'),
					'disable' => __('Disable','digital'),
				 ),
			 ));	





     
		//Featured Image
		$wp_customize->add_section(
			'digital_poststhumbnail_settings',
			array(
				'title'       => __( 'Featured Thumbnail', 'digital' ),
				'capability'  => 'edit_theme_options',
				'description' => __( 'Default Post Excerpt "20"', 'digital' ),							
				'panel'			=> 'digital_single_postsset',
			));	
		// Featured image Single
		$wp_customize->add_setting(
			'digital_featured_single',
			array(
				'default'           => 'enable',
				'type'              => 'theme_mod',
				'sanitize_callback' => 'sanitize_text_field',
				'capability'        => 'edit_theme_options',
			));
		$wp_customize->add_control(
			new WP_Customize_Control($wp_customize,	'digital_featured_single',
				array(
					'label'       => __( 'Featured Post Image in Single Posts', 'digital' ),
					'description' => __( 'Enable or disable Featured Image', 'digital' ),
					'section'     => 'digital_poststhumbnail_settings',
					'type'        => 'select',
					'choices'     => array(
						'disable' => __( 'Disable', 'digital' ),
						'enable' => __( 'Enable', 'digital' ),
					),
					'priority'    => apply_filters( 'digital_bootstrap_version_priority', 10 ),
				)));	
		                
       
	      //*******Post title
          $wp_customize->add_section(
            'digital_postsingletitle_section',
            array(
                'title'       => __( 'Post Title', 'digital' ),
                'capability'  => 'edit_theme_options',
                'panel'			=> 'digital_single_postsset',
            ));	
		// Title Font		
		 $wp_customize->add_setting('digital_postsingle_color', array(
			'default' => '#333333', // Default font color
			'sanitize_callback' => 'sanitize_hex_color',
		));

		$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'digital_postsingle_color', array(
			'label' => __('Font Color', 'digital'),
			'section' => 'digital_postsingletitle_section',
			'settings' => 'digital_postsingle_color',
		)));
		 $wp_customize->add_setting('digital_postsingle_size', array(
			'default' => '32', // Default font size
			'sanitize_callback' => 'absint',
		));

		$wp_customize->add_control('digital_postsingle_size', array(
			'label' => __('Font Size - px', 'digital'),
			'section' => 'digital_postsingletitle_section',
			'settings' => 'digital_postsingle_size',
			'type' => 'number',
		));
//Font Weight
$wp_customize->add_setting(
	'digital_postsingle_weight',
	array(
		'default'           => '600',
		'type'              => 'theme_mod',
		'sanitize_callback' => 'sanitize_text_field',
		'capability'        => 'edit_theme_options',
	));
$wp_customize->add_control(
	new WP_Customize_Control($wp_customize,	'digital_postsingle_weight',
		array(
			'label'       => __( 'Font Weight', 'digital' ),
			'section'     => 'digital_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'100' => __( '100', 'digital' ),
				'200' => __( '200', 'digital' ),
				'400' => __( '400', 'digital' ),
				'600' => __( '600', 'digital' ),
				'800' => __( '800', 'digital' ),
			),
		)));
//font style

$wp_customize->add_setting(
	'digital_postsingle_style',
	array(
		'default'           => 'normal',
		'type'              => 'theme_mod',
		'sanitize_callback' => 'sanitize_text_field',
		'capability'        => 'edit_theme_options',
	));
$wp_customize->add_control(
	new WP_Customize_Control($wp_customize,	'digital_postsingle_style',
		array(
			'label'       => __( 'Font Style', 'digital' ),
			'section'     => 'digital_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'normal' => __( 'Normal', 'digital' ),
				'italic' => __( 'Italic', 'digital' ),
			),
		)));
//Text Transform
$wp_customize->add_setting(
	'digital_postsingle_transform',
	array(
		'default'           => 'none',
		'type'              => 'theme_mod',
		'sanitize_callback' => 'sanitize_text_field',
		'capability'        => 'edit_theme_options',
	));
$wp_customize->add_control(
	new WP_Customize_Control($wp_customize,	'digital_postsingle_transform',
		array(
			'label'       => __( 'Text Transform', 'digital' ),
			'section'     => 'digital_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'none' => __( 'None', 'digital' ),
				'capitalize' => __( 'Capitalize', 'digital' ),
				'lowercase' => __( 'Lowercase', 'digital' ),
				'uppercase' => __( 'Uppercase', 'digital' ),
			),
		)));