<?php
/**
 * Excerpt
 *
 * @package Construktly
 */

$wp_customize->add_section(
	'construktly_excerpt_options',
	array(
		'panel' => 'construktly_theme_options',
		'title' => esc_html__( 'Excerpt', 'construktly' ),
	)
);

// Excerpt - Excerpt Length.
$wp_customize->add_setting(
	'construktly_excerpt_length',
	array(
		'default'           => 20,
		'sanitize_callback' => 'absint',
	)
);

$wp_customize->add_control(
	'construktly_excerpt_length',
	array(
		'label'       => esc_html__( 'Excerpt Length (no. of words)', 'construktly' ),
		'section'     => 'construktly_excerpt_options',
		'settings'    => 'construktly_excerpt_length',
		'type'        => 'number',
		'input_attrs' => array(
			'min'  => 10,
			'max'  => 200,
			'step' => 1,
		),
	)
);

// Excerpt - Read More Text.
$wp_customize->add_setting(
	'construktly_excerpt_more_text',
	array(
		'default'           => esc_html__( 'Read More', 'construktly' ),
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'construktly_excerpt_more_text',
	array(
		'label'    => esc_html__( 'Read More Text', 'construktly' ),
		'section'  => 'construktly_excerpt_options',
		'settings' => 'construktly_excerpt_more_text',
		'type'     => 'text',
	)
);
