<?php
/**
 * Excerpt
 *
 * @package Majestic Blog
 */

$wp_customize->add_section(
	'majestic_blog_excerpt_options',
	array(
		'panel' => 'majestic_blog_theme_options',
		'title' => esc_html__( 'Excerpt', 'majestic-blog' ),
	)
);

// Excerpt - Excerpt Length.
$wp_customize->add_setting(
	'majestic_blog_excerpt_length',
	array(
		'default'           => 20,
		'sanitize_callback' => 'majestic_blog_sanitize_number_range',
		'validate_callback' => 'majestic_blog_validate_excerpt_length',
	)
);

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