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

$wp_customize->add_section(
	'routine_news_excerpt_options',
	array(
		'panel' => 'routine_news_theme_options',
		'title' => esc_html__( 'Excerpt', 'routine-news' ),
	)
);

// Excerpt - Excerpt Length.
$wp_customize->add_setting(
	'routine_news_excerpt_length',
	array(
		'default'           => 20,
		'sanitize_callback' => 'routine_news_sanitize_number_range',
		'validate_callback' => 'routine_news_validate_excerpt_length',
	)
);

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