<?php


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


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


  //Add Section 2
		
  $wp_customize->add_section('poster_postmetasingle_section',
  array(
      'title'       => __( 'Post Meta Section Single', 'poster' ),
      'capability'  => 'edit_theme_options',						
      'panel'			=> 'poster_single_postsset',
      'priority'    => apply_filters( 'poster_postmetasingle_section_priority', 10 ),
  ));

        // $wp_customize->add_setting(
		// 	'poster_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,
		// 		'poster_enable_postmeta',
		// 		array(
		// 			'label'       => __( 'Post Footer Meta', 'poster' ),
		// 			'description' => __( 'Enable or disable post footer meta Date, Author, Read more etc.', 'poster' ),
		// 			'section'     => 'poster_postmetasingle_section',
		// 			'type'        => 'select',
		// 			'choices'     => array(
		// 				'disable' => __( 'Disable', 'poster' ),
		// 				'enable' => __( 'Enable', 'poster' ),
		// 			),
		// 			'priority'    => apply_filters( 'poster_bootstrap_version_priority', 10 ),
		// 		)
		// 	)
		// );
		
		//Hide Post date
		$wp_customize->add_setting('poster_single_meta',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_single_meta',
			 array (                             
				'type' => 'radio',
				'label' => __('Post date','poster'),
				'settings'   => 'poster_single_meta',
				'section' => 'poster_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','poster'),
					'disable' => __('Disable','poster'),
				 ),
			 ));
		
		//Hide Post author
		$wp_customize->add_setting('poster_singlemeta_author',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_singlemeta_author',
			 array (                             
				'type' => 'radio',
				'label' => __('Post Author Name','poster'),
				'description' => __('This option control only author name not Author profile','poster'),
				'settings'   => 'poster_singlemeta_author',
				'section' => 'poster_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','poster'),
					'disable' => __('Disable','poster'),
				 ),
			 ));
		
	
		//Hide View Count
		$wp_customize->add_setting('poster_single_viewcount',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_single_viewcount',
			 array (                             
				'type' => 'radio',
				'label' => __('View Count','poster'),
				'settings'   => 'poster_single_viewcount',
				'section' => 'poster_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','poster'),
					'disable' => __('Disable','poster'),
				 ),
			 ));	 
		//Hide Post Categories
		$wp_customize->add_setting('poster_singlemeta_category',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_singlemeta_category',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post Categories','poster'),
				'settings'   => 'poster_singlemeta_category',
				'section' => 'poster_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','poster'),
					'disable' => __('Disable','poster'),
				 ),
			 ));
		//Hide Post Tags
		$wp_customize->add_setting('poster_singlemeta_tags',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_singlemeta_tags',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post tags','poster'),
				'settings'   => 'poster_singlemeta_tags',
				'section' => 'poster_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','poster'),
					'disable' => __('Disable','poster'),
				 ),
			 ));
			 
			// Hide website in comment	
		$wp_customize->add_setting('poster_website_field',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'poster_customize_sanitize_select'
			));
		$wp_customize->add_control('poster_website_field',
			 array (                             
				'type' => 'radio',
				'label' => __('Show Website Field in Comments','poster'),
				'settings'   => 'poster_website_field',
				'section' => 'poster_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','poster'),
					'disable' => __('Disable','poster'),
				 ),
			 ));	





     
		//Featured Image
		$wp_customize->add_section(
			'poster_poststhumbnail_settings',
			array(
				'title'       => __( 'Featured Thumbnail', 'poster' ),
				'capability'  => 'edit_theme_options',
				'description' => __( 'Default Post Excerpt "20"', 'poster' ),							
				'panel'			=> 'poster_theme_postsset',
			));	
		// Featured image Single
		$wp_customize->add_setting(
			'poster_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,	'poster_featured_single',
				array(
					'label'       => __( 'Featured Post Image in Single Posts', 'poster' ),
					'description' => __( 'Enable or disable Featured Image', 'poster' ),
					'section'     => 'poster_poststhumbnail_settings',
					'type'        => 'select',
					'choices'     => array(
						'disable' => __( 'Disable', 'poster' ),
						'enable' => __( 'Enable', 'poster' ),
					),
					'priority'    => apply_filters( 'poster_bootstrap_version_priority', 10 ),
				)));	
		                
       
	      //*******Post title
          $wp_customize->add_section(
            'poster_postsingletitle_section',
            array(
                'title'       => __( 'Post Title', 'poster' ),
                'capability'  => 'edit_theme_options',
                'panel'			=> 'poster_single_postsset',
            ));	
		// Title Font		
		 $wp_customize->add_setting('poster_postsingle_color', array(
			'default' => '#333333', // Default font color
			'sanitize_callback' => 'sanitize_hex_color',
		));

		$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'poster_postsingle_color', array(
			'label' => __('Font Color', 'poster'),
			'section' => 'poster_postsingletitle_section',
			'settings' => 'poster_postsingle_color',
		)));
		 $wp_customize->add_setting('poster_postsingle_size', array(
			'default' => '32', // Default font size
			'sanitize_callback' => 'absint',
		));

		$wp_customize->add_control('poster_postsingle_size', array(
			'label' => __('Font Size - px', 'poster'),
			'section' => 'poster_postsingletitle_section',
			'settings' => 'poster_postsingle_size',
			'type' => 'number',
		));
//Font Weight
$wp_customize->add_setting(
	'poster_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,	'poster_postsingle_weight',
		array(
			'label'       => __( 'Font Weight', 'poster' ),
			'section'     => 'poster_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'100' => __( '100', 'poster' ),
				'200' => __( '200', 'poster' ),
				'400' => __( '400', 'poster' ),
				'600' => __( '600', 'poster' ),
				'800' => __( '800', 'poster' ),
			),
		)));
//font style

$wp_customize->add_setting(
	'poster_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,	'poster_postsingle_style',
		array(
			'label'       => __( 'Font Style', 'poster' ),
			'section'     => 'poster_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'normal' => __( 'Normal', 'poster' ),
				'italic' => __( 'Italic', 'poster' ),
			),
		)));
//Text Transform
$wp_customize->add_setting(
	'poster_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,	'poster_postsingle_transform',
		array(
			'label'       => __( 'Text Transform', 'poster' ),
			'section'     => 'poster_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'none' => __( 'None', 'poster' ),
				'capitalize' => __( 'Capitalize', 'poster' ),
				'lowercase' => __( 'Lowercase', 'poster' ),
				'uppercase' => __( 'Uppercase', 'poster' ),
			),
		)));