<?php
/**
 * Header Options
 *
 * @package Prime Mag
 */

$wp_customize->add_section(
	'prime_mag_header_options',
	array(
		'panel' => 'prime_mag_theme_options',
		'title' => esc_html__( 'Header Options', 'prime-mag' ),
	)
);

// Header Section - Enable Topbar Section.
$wp_customize->add_setting(
	'prime_mag_enable_topbar_section',
	array(
		'default'           => true,
		'sanitize_callback' => 'prime_mag_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Prime_Mag_Toggle_Switch_Custom_Control(
		$wp_customize,
		'prime_mag_enable_topbar_section',
		array(
			'label'    => esc_html__( 'Enable Topbar Section', 'prime-mag' ),
			'section'  => 'prime_mag_header_options',
			'settings' => 'prime_mag_enable_topbar_section',
		)
	)
);

// Header Options - Header Button Custom Label.
$wp_customize->add_setting(
	'prime_mag_header_custom_button_label',
	array(
		'default'           => __( 'Subscribe', 'prime-mag' ),
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'prime_mag_header_custom_button_label',
	array(
		'label'    => esc_html__( 'Header Custom Button', 'prime-mag' ),
		'section'  => 'prime_mag_header_options',
		'settings' => 'prime_mag_header_custom_button_label',
		'type'     => 'text',
	)
);

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

$wp_customize->add_control(
	'prime_mag_header_custom_button_url',
	array(
		'label'    => esc_html__( 'Button Link', 'prime-mag' ),
		'section'  => 'prime_mag_header_options',
		'settings' => 'prime_mag_header_custom_button_url',
		'type'     => 'url',
	)
);

// Header Options - Custom Button Icon.
$wp_customize->add_setting(
	'prime_mag_custom_button_fontawesome_icon',
	array(
		'default'           => 'fa-solid fa-bell',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'prime_mag_custom_button_fontawesome_icon',
	array(
		'label'       => esc_html__( 'Fontawesome Icon', 'prime-mag' ),
		'description' => sprintf( '<a href=" ' . esc_url( 'https://fontawesome.com/v6/icons?o=r&m=free' ) . ' " target="_blank"> %1$s </a> %2$s', esc_html__( 'Click Here ', 'prime-mag' ), esc_html__( ' to select a FontAwesome icon. Click the icon you want to add to the button, and then add the icons class, such as "fa-regular fa-bell".', 'prime-mag' ) ),
		'section'     => 'prime_mag_header_options',
		'settings'    => 'prime_mag_custom_button_fontawesome_icon',
		'type'        => 'text',
	)
);
