<?php

/**
 * Header Options
 *
 * @package Charity_Elite
 */

$wp_customize->add_section(
	'charity_elite_header_options',
	array(
		'panel' => 'charity_elite_theme_options',
		'title' => esc_html__( 'Header Options', 'charity-elite' ),
	)
);

// Header Options - Enable Topbar.
$wp_customize->add_setting(
	'charity_elite_enable_topbar',
	array(
		'sanitize_callback' => 'charity_elite_sanitize_switch',
		'default'           => false,
	)
);

$wp_customize->add_control(
	new Charity_Elite_Toggle_Switch_Custom_Control(
		$wp_customize,
		'charity_elite_enable_topbar',
		array(
			'label'   => esc_html__( 'Enable Topbar', 'charity-elite' ),
			'section' => 'charity_elite_header_options',
		)
	)
);

// Header Options - Contact Number.
$wp_customize->add_setting(
	'charity_elite_contact_number',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'charity_elite_contact_number',
	array(
		'label'           => esc_html__( 'Contact Number', 'charity-elite' ),
		'section'         => 'charity_elite_header_options',
		'type'            => 'text',
		'active_callback' => 'charity_elite_is_topbar_enabled',
	)
);

// Header Options - Email Address.
$wp_customize->add_setting(
	'charity_elite_email_address',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'charity_elite_email_address',
	array(
		'label'           => esc_html__( 'Email Address', 'charity-elite' ),
		'section'         => 'charity_elite_header_options',
		'type'            => 'text',
		'active_callback' => 'charity_elite_is_topbar_enabled',
	)
);

// Header Options - Custom Button Label.
$wp_customize->add_setting(
	'charity_elite_menu_custom_button_label',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'charity_elite_menu_custom_button_label',
	array(
		'label'    => esc_html__( 'Menu Custom Button Label', 'charity-elite' ),
		'section'  => 'charity_elite_header_options',
		'settings' => 'charity_elite_menu_custom_button_label',
		'type'     => 'text',
	)
);

// Header Options - Custom Button URL.
$wp_customize->add_setting(
	'charity_elite_menu_custom_button_url',
	array(
		'default'           => '#',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'charity_elite_menu_custom_button_url',
	array(
		'label'    => esc_html__( 'Menu Button URL', 'charity-elite' ),
		'section'  => 'charity_elite_header_options',
		'settings' => 'charity_elite_menu_custom_button_url',
		'type'     => 'url',
	)
);
