<?php

/**
 * Post Settings
 * @package Glaciers
 * @since 1.0.0
 */

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

if (!function_exists('glaciers_customize_register_post')) :
	function glaciers_customize_register_post($wp_customize)
	{

		// Heading - Post show hide
		$wp_customize->add_control(new Glaciers_Note_Control(
			$wp_customize,
			'glaciers_post_showhide_note',
			array(
				'label' => esc_html__('Show or Hide Settings', 'glaciers'),
				'section' => 'glaciers_post_options',
				'priority' => 3,
				'settings' => array(),
			)
		));

		/** Post Options */
		$wp_customize->add_section(
			'glaciers_post_options',
			array(
				'title'    => esc_html__('Post Options', 'glaciers'),
				'priority' => 23,
			)
		);

		// Hide Author Bio
		$wp_customize->add_setting('glaciers_hide_author_bio', array(
			'default'           => false,
			'transport'         => 'postMessage',
			'sanitize_callback' => 'glaciers_sanitize_checkbox'
		));

		$wp_customize->add_control(new Glaciers_Toggle_Control(
			$wp_customize,
			'glaciers_hide_author_bio',
			array(
				'section'     => 'glaciers_post_options',
				'priority' => 8,
				'label'	      => esc_html__('Hide Author Bio', 'glaciers'),
				'description' => esc_html__('Show or hide the post author biography.', 'glaciers'),
			)
		));

		// Hide Post Navigation
		$wp_customize->add_setting('glaciers_hide_post_navigation', array(
			'default'           => false,
			'transport'         => 'postMessage',
			'sanitize_callback' => 'glaciers_sanitize_checkbox'
		));

		$wp_customize->add_control(new Glaciers_Toggle_Control(
			$wp_customize,
			'glaciers_hide_post_navigation',
			array(
				'section'     => 'glaciers_post_options',
				'priority' => 9,
				'label'	      => esc_html__('Hide the Post Navigation', 'glaciers'),
				'description' => esc_html__('Show or hide the post navigation - Previous and Next Post.', 'glaciers'),
			)
		));
	}
endif;

add_action('customize_register', 'glaciers_customize_register_post');
