<?php
/**
 * Breadcrumb
 *
 * @package Rhythm Blog
 */

$wp_customize->add_section(
	'rhythm_blog_breadcrumb',
	array(
		'title' => esc_html__( 'Breadcrumb', 'rhythm-blog' ),
		'panel' => 'rhythm_blog_theme_options',
	)
);

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

$wp_customize->add_control(
	new Rhythm_Blog_Toggle_Switch_Custom_Control(
		$wp_customize,
		'rhythm_blog_enable_breadcrumb',
		array(
			'label'   => esc_html__( 'Enable Breadcrumb', 'rhythm-blog' ),
			'section' => 'rhythm_blog_breadcrumb',
		)
	)
);

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

$wp_customize->add_control(
	'rhythm_blog_breadcrumb_separator',
	array(
		'label'           => esc_html__( 'Separator', 'rhythm-blog' ),
		'active_callback' => 'rhythm_blog_is_breadcrumb_enabled',
		'section'         => 'rhythm_blog_breadcrumb',
	)
);
