<?php

if ( class_exists( 'leatherhouse_Customize_Range_Control' ) ) {

	$wp_customize->add_setting(
		'leatherhouse_breadcrumb_height',
		array(
			'default'           => 450,
			'capability'        => 'edit_theme_options',
			'sanitize_callback' => 'leatherhouse_sanitize_range_value',
			'transport'         => 'postMessage',
		)
	);
	$wp_customize->add_control(
		new leatherhouse_Customize_Range_Control(
			$wp_customize,
			'leatherhouse_breadcrumb_height',
			array(
				'label'           => __( 'Content Height', 'leather-house' ),
				'section'         => 'leatherhouse_theme_breadcrumb',
				'priority'        => 8,
				'input_attrs'     => array(
					'min'  => 1,
					'max'  => 800,
					'step' => 1,
					// 'suffix' => 'px', //optional suffix
				),
				'active_callback' => 'leatherhouse_breadcrumb_height',
			)
		)
	);
}

// Background Image.
$wp_customize->add_setting(
	'leatherhouse_breadcrumb_bg_img',
	array(
		'default'           => esc_url( get_template_directory_uri() . '/assets/images/breadcrumb/breadcrumb.webp' ),
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'leatherhouse_sanitize_url',
		'priority'          => 10,
	)
);

$wp_customize->add_control(
	new WP_Customize_Image_Control(
		$wp_customize,
		'leatherhouse_breadcrumb_bg_img',
		array(
			'label'           => esc_html__( 'Background Image', 'leather-house' ),
			'section'         => 'leatherhouse_theme_breadcrumb',
			'active_callback' => 'leatherhouse_breadcrumb_bg_img',
		),
	)
);

// Background Attachment.
$wp_customize->add_setting(
	'leatherhouse_breadcrumb_back_attach',
	array(
		'default'           => 'inherit',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'leatherhouse_sanitize_select',
		'priority'          => 10,
	)
);

$wp_customize->add_control(
	'leatherhouse_breadcrumb_back_attach',
	array(
		'label'           => __( 'Background Attachment', 'leather-house' ),
		'section'         => 'leatherhouse_theme_breadcrumb',
		'type'            => 'select',
		'choices'         =>
		array(
			'inherit' => __( 'Inherit', 'leather-house' ),
			'scroll'  => __( 'Scroll', 'leather-house' ),
			'fixed'   => __( 'Fixed', 'leather-house' ),
		),
		'active_callback' => 'leatherhouse_breadcrumb_back_attach',
	)
);


