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

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

// Breadcrumb - Enable Breadcrumb.
$wp_customize->add_setting(
	'prime_mag_enable_breadcrumb',
	array(
		'sanitize_callback' => 'prime_mag_sanitize_switch',
		'default'           => true,
	)
);

$wp_customize->add_control(
	new Prime_Mag_Toggle_Switch_Custom_Control(
		$wp_customize,
		'prime_mag_enable_breadcrumb',
		array(
			'label'   => esc_html__( 'Enable Breadcrumb', 'prime-mag' ),
			'section' => 'prime_mag_breadcrumb',
		)
	)
);

// Breadcrumb - Separator.
$wp_customize->add_setting(
	'prime_mag_breadcrumb_separator',
	array(
		'sanitize_callback' => 'sanitize_text_field',
		'default'           => '/',
	)
);

$wp_customize->add_control(
	'prime_mag_breadcrumb_separator',
	array(
		'label'           => esc_html__( 'Separator', 'prime-mag' ),
		'active_callback' => 'prime_mag_is_breadcrumb_enabled',
		'section'         => 'prime_mag_breadcrumb',
	)
);
