<?php
/**
 * Archive Settings
 *
 * @package Neblue
 */

// Add new section
$wp_customize->add_section( 'archive_section', array(
  'title'                => esc_html__( 'Archive Settings', 'neblue' ),
  'priority'             => 27,
) );

// Sidebar
$wp_customize->add_setting( 'archive_sidebar', array(
  'default'              => 'right',
  'sanitize_callback'    => 'vs_sanitize_sidebar',
) );
$wp_customize->add_control( 'archive_sidebar', array(
  'label'                => esc_html__( 'Sidebar', 'neblue' ),
  'section'              => 'archive_section',
  'type'                 => 'radio',
  'choices'              => array(
    'right'              => esc_html__( 'Right Sidebar', 'neblue' ),
    'left'               => esc_html__( 'Left Sidebar', 'neblue' ),
    'disabled'           => esc_html__( 'No Sidebar', 'neblue' ),
  ),
) );

// Post Summary
$wp_customize->add_setting( 'archive_summary', array(
  'default'              => 'excerpt',
  'sanitize_callback'    => 'vs_sanitize_summary',
) );
$wp_customize->add_control( 'archive_summary', array(
  'label'                => esc_html__( 'Post Summary', 'neblue' ),
  'section'              => 'archive_section',
  'type'                 => 'radio',
  'choices'              => array(
    'excerpt'            => esc_html__( 'Use Excerpts', 'neblue' ),
    'content'            => esc_html__( 'Use Read More Tag', 'neblue' ),
  ),
) );

// Excerpt Length (Number Of Words)
$wp_customize->add_setting( 'archive_excerpt_length', array(
  'default'              => 50,
  'sanitize_callback'    => 'vs_sanitize_number',
) );
$wp_customize->add_control( new vs_customize_number_control( $wp_customize, 'archive_excerpt_length', array(
  'label'                => esc_html__( 'Excerpt Length (Number of Words)', 'neblue' ),
  'section'              => 'archive_section',
) ) );

// Heading
$wp_customize->add_setting( 'archive_heading_post_meta', array(
  'sanitize_callback'    => 'esc_html',
) );
$wp_customize->add_control( new vs_customize_control_heading( $wp_customize, 'archive_heading_post_meta', array(
  'label'                => esc_html__( 'Post Meta', 'neblue' ),
  'section'              => 'archive_section',
) ) );

// Display Date
$wp_customize->add_setting( 'archive_date', array(
  'default'              => 1,
  'sanitize_callback'    => 'vs_sanitize_checkbox',
) );
$wp_customize->add_control( 'archive_date', array(
  'label'                => esc_html__( 'Display Date', 'neblue' ),
  'section'              => 'archive_section',
  'type'                 => 'checkbox',
) );

// Display Categorys
$wp_customize->add_setting( 'archive_categorys', array(
  'default'              => 1,
  'sanitize_callback'    => 'vs_sanitize_checkbox',
) );
$wp_customize->add_control( 'archive_categorys', array(
  'label'                => esc_html__( 'Display Categorys', 'neblue' ),
  'section'              => 'archive_section',
  'type'                 => 'checkbox',
) );

// Display Comments
$wp_customize->add_setting( 'archive_comments', array(
  'default'              => 1,
  'sanitize_callback'    => 'vs_sanitize_checkbox',
) );
$wp_customize->add_control( 'archive_comments', array(
  'label'                => esc_html__( 'Display Comments', 'neblue' ),
  'section'              => 'archive_section',
  'type'                 => 'checkbox',
) );

// Display Read More
$wp_customize->add_setting( 'archive_read_more', array(
  'default'              => 0,
  'sanitize_callback'    => 'vs_sanitize_checkbox',
) );
$wp_customize->add_control( 'archive_read_more', array(
  'label'                => esc_html__( 'Display Read More', 'neblue' ),
  'section'              => 'archive_section',
  'type'                 => 'checkbox',
) );
