<?php
	$wp_customize->add_setting(
		'leatherhouse_excerpt_length',
		array(
			'capability'        => 'edit_theme_options',
			'default'           => 30,
			'sanitize_callback' => 'absint',
		)
	);

	$wp_customize->add_control(
		'leatherhouse_excerpt_length',
		array(
			'type'            => 'number',
			'section'         => 'leatherhouse_excerpt_general', // Add a default or your own section.
			'label'           => esc_html__( 'Text Count', 'leather-house' ),
			'description'     => esc_html__( 'excerpt number of words', 'leather-house' ),
			'input_attrs'     => array(
				'min'   => 10,
				'max'   => 300,
				'step'  => 5,
				'style' => 'width: 60px;',
			),
			'active_callback' => 'leatherhouse_excerpt_length_count',
		)
	);

	$wp_customize->add_setting(
		'leatherhouse_excerpt_more_text',
		array(
			'capability'        => 'edit_theme_options',
			'sanitize_callback' => 'sanitize_text_field',
			'default'           => esc_html__( 'Read More', 'leather-house' ),
		)
	);

	$wp_customize->add_control(
		'leatherhouse_excerpt_more_text',
		array(
			'label'           => esc_html__( 'Button Text', 'leather-house' ),
			'section'         => 'leatherhouse_excerpt_general',
			'type'            => 'text',
			'active_callback' => 'leatherhouse_excerpt_more_text',
		)
	);

	function leatherhouse_excerpt_disabled( $control ) {
		return true === ( $control->manager->get_setting( 'leatherhouse_excerpt_disabled' )->value() == true );
	}

	function leatherhouse_excerpt_length_count( $control ) {
		return true === ( $control->manager->get_setting( 'leatherhouse_excerpt_disabled' )->value() == true );
	}
	function leatherhouse_excerpt_more_text( $control ) {
		return true === ( $control->manager->get_setting( 'leatherhouse_excerpt_disabled' )->value() == true );
	}

