<?php

/**
 * Customizer Other options
 * @package Glaciers
 * @since 1.0.0
 */

if (!defined('ABSPATH')) {
	exit; // Exit if accessed directly.
}

function glaciers_customize_register_other($wp_customize)
{

	$wp_customize->add_section('glaciers_other_settings', array(
		'title'      => esc_html__('Other Options', 'glaciers'),
		'priority'   => 38,
		'capability' => 'edit_theme_options',
	));

	// Hide  modal search
	$wp_customize->add_setting('glaciers_hide_search_modal', array(
		'default'           => false,
		'sanitize_callback' => 'glaciers_sanitize_checkbox',
	));

	$wp_customize->add_control(new Glaciers_Toggle_Control($wp_customize, 'glaciers_hide_search_modal', array(
		'label'    => esc_html__('Hide the Popup Search', 'glaciers'),
		'description' => esc_html__('Show or hide the search icon and the popup modal search overlay.', 'glaciers'),
		'section'  => 'glaciers_other_settings',
	)));

	// Hide back to top link
	$wp_customize->add_setting('glaciers_hide_backtotop', array(
		'default'           => false,
		'sanitize_callback' => 'glaciers_sanitize_checkbox',
	));

	$wp_customize->add_control(new Glaciers_Toggle_Control($wp_customize, 'glaciers_hide_backtotop', array(
		'label'    => esc_html__('Hide the Back to Top Link', 'glaciers'),
		'description' => esc_html__('Show or hide the footer Back To Top navigation link.', 'glaciers'),
		'section'  => 'glaciers_other_settings',
	)));

	// Hide banner captions
	$wp_customize->add_setting('glaciers_hide_banner_caption', array(
		'default'           => false,
		'sanitize_callback' => 'glaciers_sanitize_checkbox',
	));

	$wp_customize->add_control(new Glaciers_Toggle_Control($wp_customize, 'glaciers_hide_banner_caption', array(
		'label'    => esc_html__('Hide Banner Captions', 'glaciers'),
		'description' => esc_html__('Show or hide the banner sidebar image captions when using the image widget.', 'glaciers'),
		'section'  => 'glaciers_other_settings',
	)));

	// Hide featured image captions
	$wp_customize->add_setting('glaciers_hide_featured_caption', array(
		'default'           => false,
		'sanitize_callback' => 'glaciers_sanitize_checkbox',
	));

	$wp_customize->add_control(new Glaciers_Toggle_Control($wp_customize, 'glaciers_hide_featured_caption', array(
		'label'    => esc_html__('Hide Featured Image Captions', 'glaciers'),
		'description' => esc_html__('Show or hide featured image captions from the blog and full post views.', 'glaciers'),
		'section'  => 'glaciers_other_settings',
	)));

	// Hide edit link
	$wp_customize->add_setting('glaciers_hide_edit', array(
		'default'           => false,
		'transport'         => 'postMessage',
		'sanitize_callback' => 'glaciers_sanitize_checkbox',
	));

	$wp_customize->add_control(new Glaciers_Toggle_Control($wp_customize, 'glaciers_hide_edit', array(
		'label'    => esc_html__('Hide Edit Link', 'glaciers'),
		'description' => esc_html__('Show or hide the edit link from posts and pages. This will not show in the Customizer.', 'glaciers'),
		'section'  => 'glaciers_other_settings',
	)));
}
add_action('customize_register', 'glaciers_customize_register_other');
