<?php

/**
 * Excerpt
 *
 * @package Charity_Elite
 */

$wp_customize->add_section(
	'charity_elite_excerpt_options',
	array(
		'panel' => 'charity_elite_theme_options',
		'title' => esc_html__( 'Excerpt', 'charity-elite' ),
	)
);

// Excerpt - Excerpt Length.
$wp_customize->add_setting(
	'charity_elite_excerpt_length',
	array(
		'default'           => 20,
		'sanitize_callback' => 'charity_elite_sanitize_number_range',
		'validate_callback' => 'charity_elite_validate_excerpt_length',
	)
);

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