<?php


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


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


  //Add Section 2
		
  $wp_customize->add_section('magazinestyle_postmetasingle_section',
  array(
      'title'       => __( 'Post Meta Section Single', 'magazine-style' ),
      'capability'  => 'edit_theme_options',						
      'panel'			=> 'magazinestyle_single_postsset',
      'priority'    => apply_filters( 'magazinestyle_postmetasingle_section_priority', 10 ),
  ));

        // $wp_customize->add_setting(
		// 	'magazinestyle_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,
		// 		'magazinestyle_enable_postmeta',
		// 		array(
		// 			'label'       => __( 'Post Footer Meta', 'magazine-style' ),
		// 			'description' => __( 'Enable or disable post footer meta Date, Author, Read more etc.', 'magazine-style' ),
		// 			'section'     => 'magazinestyle_postmetasingle_section',
		// 			'type'        => 'select',
		// 			'choices'     => array(
		// 				'disable' => __( 'Disable', 'magazine-style' ),
		// 				'enable' => __( 'Enable', 'magazine-style' ),
		// 			),
		// 			'priority'    => apply_filters( 'magazinestyle_bootstrap_version_priority', 10 ),
		// 		)
		// 	)
		// );
		
		//Hide Post date
		$wp_customize->add_setting('magazinestyle_single_meta',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'magazinestyle_customize_sanitize_select'
			));
		$wp_customize->add_control('magazinestyle_single_meta',
			 array (                             
				'type' => 'radio',
				'label' => __('Post date','magazine-style'),
				'settings'   => 'magazinestyle_single_meta',
				'section' => 'magazinestyle_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','magazine-style'),
					'disable' => __('Disable','magazine-style'),
				 ),
			 ));
		
		//Hide Post author
		$wp_customize->add_setting('magazinestyle_singlemeta_author',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'magazinestyle_customize_sanitize_select'
			));
		$wp_customize->add_control('magazinestyle_singlemeta_author',
			 array (                             
				'type' => 'radio',
				'label' => __('Post Author Name','magazine-style'),
				'description' => __('This option control only author name not Author profile','magazine-style'),
				'settings'   => 'magazinestyle_singlemeta_author',
				'section' => 'magazinestyle_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','magazine-style'),
					'disable' => __('Disable','magazine-style'),
				 ),
			 ));
		
	
		//Hide View Count
		$wp_customize->add_setting('magazinestyle_single_viewcount',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'magazinestyle_customize_sanitize_select'
			));
		$wp_customize->add_control('magazinestyle_single_viewcount',
			 array (                             
				'type' => 'radio',
				'label' => __('View Count','magazine-style'),
				'settings'   => 'magazinestyle_single_viewcount',
				'section' => 'magazinestyle_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','magazine-style'),
					'disable' => __('Disable','magazine-style'),
				 ),
			 ));	 
		//Hide Post Categories
		$wp_customize->add_setting('magazinestyle_singlemeta_category',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'magazinestyle_customize_sanitize_select'
			));
		$wp_customize->add_control('magazinestyle_singlemeta_category',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post Categories','magazine-style'),
				'settings'   => 'magazinestyle_singlemeta_category',
				'section' => 'magazinestyle_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','magazine-style'),
					'disable' => __('Disable','magazine-style'),
				 ),
			 ));
		//Hide Post Tags
		$wp_customize->add_setting('magazinestyle_singlemeta_tags',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'magazinestyle_customize_sanitize_select'
			));
		$wp_customize->add_control('magazinestyle_singlemeta_tags',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post tags','magazine-style'),
				'settings'   => 'magazinestyle_singlemeta_tags',
				'section' => 'magazinestyle_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','magazine-style'),
					'disable' => __('Disable','magazine-style'),
				 ),
			 ));
			 
			// Hide website in comment	
		$wp_customize->add_setting('magazinestyle_website_field',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'magazinestyle_customize_sanitize_select'
			));
		$wp_customize->add_control('magazinestyle_website_field',
			 array (                             
				'type' => 'radio',
				'label' => __('Show Website Field in Comments','magazine-style'),
				'settings'   => 'magazinestyle_website_field',
				'section' => 'magazinestyle_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','magazine-style'),
					'disable' => __('Disable','magazine-style'),
				 ),
			 ));	





     
		//Featured Image
		$wp_customize->add_section(
			'magazinestyle_poststhumbnail_settings',
			array(
				'title'       => __( 'Featured Thumbnail', 'magazine-style' ),
				'capability'  => 'edit_theme_options',
				'description' => __( 'Default Post Excerpt "20"', 'magazine-style' ),							
				'panel'			=> 'magazinestyle_single_postsset',
			));	
		// Featured image Single
		$wp_customize->add_setting(
			'magazinestyle_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,	'magazinestyle_featured_single',
				array(
					'label'       => __( 'Featured Post Image in Single Posts', 'magazine-style' ),
					'description' => __( 'Enable or disable Featured Image', 'magazine-style' ),
					'section'     => 'magazinestyle_poststhumbnail_settings',
					'type'        => 'select',
					'choices'     => array(
						'disable' => __( 'Disable', 'magazine-style' ),
						'enable' => __( 'Enable', 'magazine-style' ),
					),
					'priority'    => apply_filters( 'magazinestyle_bootstrap_version_priority', 10 ),
				)));	
		                
       
	      //*******Post title
          $wp_customize->add_section(
            'magazinestyle_postsingletitle_section',
            array(
                'title'       => __( 'Post Title', 'magazine-style' ),
                'capability'  => 'edit_theme_options',
                'panel'			=> 'magazinestyle_single_postsset',
            ));			
		 $wp_customize->add_setting('magazinestyle_postsingle_size', array(
			'default' => '32', // Default font size
			'sanitize_callback' => 'absint',
		));

		$wp_customize->add_control('magazinestyle_postsingle_size', array(
			'label' => __('Font Size - px', 'magazine-style'),
			'section' => 'magazinestyle_postsingletitle_section',
			'settings' => 'magazinestyle_postsingle_size',
			'type' => 'number',
		));
//Font Weight
$wp_customize->add_setting(
	'magazinestyle_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,	'magazinestyle_postsingle_weight',
		array(
			'label'       => __( 'Font Weight', 'magazine-style' ),
			'section'     => 'magazinestyle_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'100' => __( '100', 'magazine-style' ),
				'200' => __( '200', 'magazine-style' ),
				'400' => __( '400', 'magazine-style' ),
				'600' => __( '600', 'magazine-style' ),
				'800' => __( '800', 'magazine-style' ),
			),
		)));
//font style

$wp_customize->add_setting(
	'magazinestyle_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,	'magazinestyle_postsingle_style',
		array(
			'label'       => __( 'Font Style', 'magazine-style' ),
			'section'     => 'magazinestyle_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'normal' => __( 'Normal', 'magazine-style' ),
				'italic' => __( 'Italic', 'magazine-style' ),
			),
		)));
//Text Transform
$wp_customize->add_setting(
	'magazinestyle_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,	'magazinestyle_postsingle_transform',
		array(
			'label'       => __( 'Text Transform', 'magazine-style' ),
			'section'     => 'magazinestyle_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'none' => __( 'None', 'magazine-style' ),
				'capitalize' => __( 'Capitalize', 'magazine-style' ),
				'lowercase' => __( 'Lowercase', 'magazine-style' ),
				'uppercase' => __( 'Uppercase', 'magazine-style' ),
			),
		)));

		$wp_customize->add_setting(
			'magazinestyle_postsinglcol_heading',
			array(
				'sanitize_callback' => 'wp_kses',
			));
	
		$wp_customize->add_control(
			new magazinestyle_Customizer_Heading_Control(
				$wp_customize,
				'magazinestyle_postsinglcol_heading',
				array(
					'label'    => esc_html__( 'Style Customize (Pro Only)', 'magazine-style' ),
					'section'  => 'magazinestyle_postsingletitle_section',
				)));
		// Title Font		
		$wp_customize->add_setting('magazinestyle_postsingle_color', array(
			'default' => '#333333', // Default font color
			'transport'   => 'postMessage',
			'sanitize_callback' => 'sanitize_hex_color',
		));

		$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'magazinestyle_postsingle_color', array(
			'label' => __('Font Color', 'magazine-style'),
			'section' => 'magazinestyle_postsingletitle_section',
			'settings' => 'magazinestyle_postsingle_color',
		)));