<?php


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


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


  //Add Section 2
		
  $wp_customize->add_section('wrockmetro_postmetasingle_section',
  array(
      'title'       => __( 'Post Meta Section Single', 'wrock-metro' ),
      'capability'  => 'edit_theme_options',						
      'panel'			=> 'wrockmetro_single_postsset',
      'priority'    => apply_filters( 'wrockmetro_postmetasingle_section_priority', 10 ),
  ));

        // $wp_customize->add_setting(
		// 	'wrockmetro_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,
		// 		'wrockmetro_enable_postmeta',
		// 		array(
		// 			'label'       => __( 'Post Footer Meta', 'wrock-metro' ),
		// 			'description' => __( 'Enable or disable post footer meta Date, Author, Read more etc.', 'wrock-metro' ),
		// 			'section'     => 'wrockmetro_postmetasingle_section',
		// 			'type'        => 'select',
		// 			'choices'     => array(
		// 				'disable' => __( 'Disable', 'wrock-metro' ),
		// 				'enable' => __( 'Enable', 'wrock-metro' ),
		// 			),
		// 			'priority'    => apply_filters( 'wrockmetro_bootstrap_version_priority', 10 ),
		// 		)
		// 	)
		// );
		
		//Hide Post date
		$wp_customize->add_setting('wrockmetro_single_meta',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'wrockmetro_customize_sanitize_select'
			));
		$wp_customize->add_control('wrockmetro_single_meta',
			 array (                             
				'type' => 'radio',
				'label' => __('Post date','wrock-metro'),
				'settings'   => 'wrockmetro_single_meta',
				'section' => 'wrockmetro_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','wrock-metro'),
					'disable' => __('Disable','wrock-metro'),
				 ),
			 ));
		
		//Hide Post author
		$wp_customize->add_setting('wrockmetro_singlemeta_author',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'wrockmetro_customize_sanitize_select'
			));
		$wp_customize->add_control('wrockmetro_singlemeta_author',
			 array (                             
				'type' => 'radio',
				'label' => __('Post Author Name','wrock-metro'),
				'description' => __('This option control only author name not Author profile','wrock-metro'),
				'settings'   => 'wrockmetro_singlemeta_author',
				'section' => 'wrockmetro_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','wrock-metro'),
					'disable' => __('Disable','wrock-metro'),
				 ),
			 ));
		
	
		//Hide View Count
		$wp_customize->add_setting('wrockmetro_single_viewcount',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'wrockmetro_customize_sanitize_select'
			));
		$wp_customize->add_control('wrockmetro_single_viewcount',
			 array (                             
				'type' => 'radio',
				'label' => __('View Count','wrock-metro'),
				'settings'   => 'wrockmetro_single_viewcount',
				'section' => 'wrockmetro_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','wrock-metro'),
					'disable' => __('Disable','wrock-metro'),
				 ),
			 ));	 
		//Hide Post Categories
		$wp_customize->add_setting('wrockmetro_singlemeta_category',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'wrockmetro_customize_sanitize_select'
			));
		$wp_customize->add_control('wrockmetro_singlemeta_category',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post Categories','wrock-metro'),
				'settings'   => 'wrockmetro_singlemeta_category',
				'section' => 'wrockmetro_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','wrock-metro'),
					'disable' => __('Disable','wrock-metro'),
				 ),
			 ));
		//Hide Post Tags
		$wp_customize->add_setting('wrockmetro_singlemeta_tags',	
			array(
				'default'			=> 'disable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'wrockmetro_customize_sanitize_select'
			));
		$wp_customize->add_control('wrockmetro_singlemeta_tags',
			 array (                             
				'type' => 'radio',
				'label' => __('Hide post tags','wrock-metro'),
				'settings'   => 'wrockmetro_singlemeta_tags',
				'section' => 'wrockmetro_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','wrock-metro'),
					'disable' => __('Disable','wrock-metro'),
				 ),
			 ));
			 
			// Hide website in comment	
		$wp_customize->add_setting('wrockmetro_website_field',	
			array(
				'default'			=> 'enable',
				'type'				=> 'theme_mod',
				'capability'		=> 'edit_theme_options',
				'sanitize_callback'	=> 'wrockmetro_customize_sanitize_select'
			));
		$wp_customize->add_control('wrockmetro_website_field',
			 array (                             
				'type' => 'radio',
				'label' => __('Show Website Field in Comments','wrock-metro'),
				'settings'   => 'wrockmetro_website_field',
				'section' => 'wrockmetro_postmetasingle_section',
				'choices' => array(
					'enable' => __('Enable','wrock-metro'),
					'disable' => __('Disable','wrock-metro'),
				 ),
			 ));	





     
		//Featured Image
		$wp_customize->add_section(
			'wrockmetro_poststhumbnail_settings',
			array(
				'title'       => __( 'Featured Thumbnail', 'wrock-metro' ),
				'capability'  => 'edit_theme_options',
				'description' => __( 'Default Post Excerpt "20"', 'wrock-metro' ),							
				'panel'			=> 'wrockmetro_theme_postsset',
			));	
		// Featured image Single
		$wp_customize->add_setting(
			'wrockmetro_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,	'wrockmetro_featured_single',
				array(
					'label'       => __( 'Featured Post Image in Single Posts', 'wrock-metro' ),
					'description' => __( 'Enable or disable Featured Image', 'wrock-metro' ),
					'section'     => 'wrockmetro_poststhumbnail_settings',
					'type'        => 'select',
					'choices'     => array(
						'disable' => __( 'Disable', 'wrock-metro' ),
						'enable' => __( 'Enable', 'wrock-metro' ),
					),
					'priority'    => apply_filters( 'wrockmetro_bootstrap_version_priority', 10 ),
				)));	
		                
       
	      //*******Post title
          $wp_customize->add_section(
            'wrockmetro_postsingletitle_section',
            array(
                'title'       => __( 'Post Title', 'wrock-metro' ),
                'capability'  => 'edit_theme_options',
                'panel'			=> 'wrockmetro_single_postsset',
            ));	
		// Title Font		
		 $wp_customize->add_setting('wrockmetro_postsingle_color', array(
			'default' => '#333333', // Default font color
			'sanitize_callback' => 'sanitize_hex_color',
		));

		$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'wrockmetro_postsingle_color', array(
			'label' => __('Font Color', 'wrock-metro'),
			'section' => 'wrockmetro_postsingletitle_section',
			'settings' => 'wrockmetro_postsingle_color',
		)));
		 $wp_customize->add_setting('wrockmetro_postsingle_size', array(
			'default' => '32', // Default font size
			'sanitize_callback' => 'absint',
		));

		$wp_customize->add_control('wrockmetro_postsingle_size', array(
			'label' => __('Font Size - px', 'wrock-metro'),
			'section' => 'wrockmetro_postsingletitle_section',
			'settings' => 'wrockmetro_postsingle_size',
			'type' => 'number',
		));
//Font Weight
$wp_customize->add_setting(
	'wrockmetro_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,	'wrockmetro_postsingle_weight',
		array(
			'label'       => __( 'Font Weight', 'wrock-metro' ),
			'section'     => 'wrockmetro_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'100' => __( '100', 'wrock-metro' ),
				'200' => __( '200', 'wrock-metro' ),
				'400' => __( '400', 'wrock-metro' ),
				'600' => __( '600', 'wrock-metro' ),
				'800' => __( '800', 'wrock-metro' ),
			),
		)));
//font style

$wp_customize->add_setting(
	'wrockmetro_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,	'wrockmetro_postsingle_style',
		array(
			'label'       => __( 'Font Style', 'wrock-metro' ),
			'section'     => 'wrockmetro_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'normal' => __( 'Normal', 'wrock-metro' ),
				'italic' => __( 'Italic', 'wrock-metro' ),
			),
		)));
//Text Transform
$wp_customize->add_setting(
	'wrockmetro_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,	'wrockmetro_postsingle_transform',
		array(
			'label'       => __( 'Text Transform', 'wrock-metro' ),
			'section'     => 'wrockmetro_postsingletitle_section',
			'type'        => 'select',
			'choices'     => array(
				'none' => __( 'None', 'wrock-metro' ),
				'capitalize' => __( 'Capitalize', 'wrock-metro' ),
				'lowercase' => __( 'Lowercase', 'wrock-metro' ),
				'uppercase' => __( 'Uppercase', 'wrock-metro' ),
			),
		)));