<?php
/**
 * Excerpt
 *
 * @package Prime Mag
 */

$wp_customize->add_section(
	'prime_mag_excerpt_options',
	array(
		'panel' => 'prime_mag_theme_options',
		'title' => esc_html__( 'Excerpt', 'prime-mag' ),
	)
);

// Excerpt - Excerpt Length.
$wp_customize->add_setting(
	'prime_mag_excerpt_length',
	array(
		'default'           => 20,
		'sanitize_callback' => 'prime_mag_sanitize_number_range',
		'validate_callback' => 'prime_mag_validate_excerpt_length',
	)
);

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