<?php
/**
 * Breadcrumb
 *
 * @package Claritymag News
 */

$wp_customize->add_section(
	'claritymag_news_breadcrumb',
	array(
		'title' => esc_html__( 'Breadcrumb', 'claritymag-news' ),
		'panel' => 'claritymag_news_theme_options',
	)
);

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

$wp_customize->add_control(
	new Claritymag_News_Toggle_Switch_Custom_Control(
		$wp_customize,
		'claritymag_news_enable_breadcrumb',
		array(
			'label'   => esc_html__( 'Enable Breadcrumb', 'claritymag-news' ),
			'section' => 'claritymag_news_breadcrumb',
		)
	)
);

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

$wp_customize->add_control(
	'claritymag_news_breadcrumb_separator',
	array(
		'label'           => esc_html__( 'Separator', 'claritymag-news' ),
		'active_callback' => 'claritymag_news_is_breadcrumb_enabled',
		'section'         => 'claritymag_news_breadcrumb',
	)
);
