<?php
/**
 * Excerpt
 *
 * @package News Revolution
 */

$wp_customize->add_section(
	'news_revolution_excerpt_options',
	array(
		'panel' => 'news_revolution_theme_options',
		'title' => esc_html__( 'Excerpt', 'news-revolution' ),
	)
);

// Excerpt - Excerpt Length.
$wp_customize->add_setting(
	'news_revolution_excerpt_length',
	array(
		'default'           => 20,
		'sanitize_callback' => 'news_revolution_sanitize_number_range',
		'validate_callback' => 'news_revolution_validate_excerpt_length',
	)
);

$wp_customize->add_control(
	'news_revolution_excerpt_length',
	array(
		'label'       => esc_html__( 'Excerpt Length (no. of words)', 'news-revolution' ),
		'description' => esc_html__( 'Note: Min 1 & Max 100. Please input the valid number and save. Then refresh the page to see the change.', 'news-revolution' ),
		'section'     => 'news_revolution_excerpt_options',
		'settings'    => 'news_revolution_excerpt_length',
		'type'        => 'number',
		'input_attrs' => array(
			'min'  => 1,
			'max'  => 100,
			'step' => 1,
		),
	)
);
