<?php
/**
 * Blog & News options.
 *
 * @package Party Planner Bell
 */

$default = party_planner_bell_get_default_theme_options();

// Blog & News Section
$wp_customize->add_section( 'section_home_mustread',
	array(
		'title'      => __( 'Blog And News', 'party-planner-bell' ),
		'capability' => 'edit_theme_options',
		'panel'      => 'home_page_panel',
		'active_callback' => 'party_planner_bell_mustread_design_enable',
		)
);

$wp_customize->add_setting( 'theme_options[disable_mustread_section]',
	array(
		'default'           => $default['disable_mustread_section'],
		'type'              => 'theme_mod',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'party_planner_bell_sanitize_switch_control',
	)
);
$wp_customize->add_control( new Party_Planner_Bell_Switch_Control( $wp_customize, 'theme_options[disable_mustread_section]',
    array(
		'label' 			=> __('Enable/Disable Blog & News Section', 'party-planner-bell'),
		'section'    		=> 'section_home_mustread',
		 'settings'  		=> 'theme_options[disable_mustread_section]',
		'on_off_label' 		=> party_planner_bell_switch_options(),
    )
) );

$wp_customize->add_setting( 'theme_options[mustread_background_color]', array(
    'sanitize_callback' => 'sanitize_hex_color', // The hue is stored as a positive integer.
    'default' 			=> $default['mustread_background_color'],
    
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'theme_options[mustread_background_color]', array(
    'label'    => esc_html__( 'Background Color', 'party-planner-bell' ),
    'section'  => 'section_home_mustread',
    'active_callback' => 'party_planner_bell_mustread_active',
) ) );

// Add arrow enable setting and control.
$wp_customize->add_setting( 'theme_options[mustread_content_align]', array(
	'default'           => $default['mustread_content_align'],
	'sanitize_callback' => 'party_planner_bell_sanitize_select',
) );

$wp_customize->add_control( 'theme_options[mustread_content_align]', array(
	'label'             => esc_html__( 'Choose Content Align', 'party-planner-bell' ),
	'section'           => 'section_home_mustread',
	'type'              => 'radio',
	'active_callback' => 'party_planner_bell_mustread_active',
	'choices'				=> array( 
		'content-right'     => esc_html__( 'Right Side', 'party-planner-bell' ), 
		'content-center'     => esc_html__( 'Center Side', 'party-planner-bell' ), 
		'content-left'     => esc_html__( 'Left Side', 'party-planner-bell' ), 
		'content-justify'     => esc_html__( 'Justify', 'party-planner-bell' )
		)
) );

//Blog & News Section title
$wp_customize->add_setting('theme_options[mustread_title]', 
	array(
	'default'           => $default['mustread_title'],
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control('theme_options[mustread_title]', 
	array(
	'label'       => __('Section Title', 'party-planner-bell'),
	'section'     => 'section_home_mustread',   
	'settings'    => 'theme_options[mustread_title]',
	'active_callback' => 'party_planner_bell_mustread_active',		
	'type'        => 'text'
	)
);

//Popular Section title
$wp_customize->add_setting('theme_options[mustread_subtitle]', 
	array(
	'default'           => $default['mustread_subtitle'],
	'type'              => 'theme_mod',
	'capability'        => 'edit_theme_options',	
	'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control('theme_options[mustread_subtitle]', 
	array(
	'label'       => __('Section Sub Title', 'party-planner-bell'),
	'section'     => 'section_home_mustread',   
	'settings'    => 'theme_options[mustread_subtitle]',
	'active_callback' => 'party_planner_bell_mustread_active',		
	'type'        => 'text'
	)
);

// Add category enable setting and control.
$wp_customize->add_setting( 'theme_options[mustread_category_enable]', array(
	'default'           => $default['mustread_category_enable'],
	'sanitize_callback' => 'party_planner_bell_sanitize_checkbox',
) );

$wp_customize->add_control( 'theme_options[mustread_category_enable]', array(
	'label'             => esc_html__( 'Enable Category', 'party-planner-bell' ),
	'section'           => 'section_home_mustread',
	'type'              => 'checkbox',
	'active_callback' => 'party_planner_bell_mustread_active',
) );	

// Setting  Team Category.
$wp_customize->add_setting( 'theme_options[mustread_category]',
	array(

	'capability'        => 'edit_theme_options',
	'sanitize_callback' => 'absint',
	)
);
$wp_customize->add_control(
	new Party_Planner_Bell_Dropdown_Taxonomies_Control( $wp_customize, 'theme_options[mustread_category]',
		array(
		'label'    => __( 'Select Category', 'party-planner-bell' ),
		'section'  => 'section_home_mustread',
		'settings' => 'theme_options[mustread_category]',	
		'active_callback' => 'party_planner_bell_mustread_active',		
		)
	)
);
