<?php
/**
* Page options
*
* @package GridFeel WordPress Theme
* @copyright Copyright (C) 2025 ThemesDNA
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
* @author ThemesDNA <themesdna@gmail.com>
*/

function gridfeel_page_options($wp_customize) {

    $wp_customize->add_section( 'gridfeel_section_page', array( 'title' => esc_html__( 'Page Options', 'gridfeel' ), 'panel' => 'gridfeel_main_options_panel', 'priority' => 190 ) );

    $wp_customize->add_setting( 'gridfeel_options[thumbnail_link_page]', array( 'default' => 'yes', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_yes_no' ) );

    $wp_customize->add_control( 'gridfeel_thumbnail_link_page_control', array( 'label' => esc_html__( 'Featured Image Link', 'gridfeel' ), 'description' => esc_html__('Do you want the featured image in a page to be linked to its page?', 'gridfeel'), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[thumbnail_link_page]', 'type' => 'select', 'choices' => array( 'yes' => esc_html__('Yes', 'gridfeel'), 'no' => esc_html__('No', 'gridfeel') ) ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_page_thumbnail]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_page_thumbnail_control', array( 'label' => esc_html__( 'Hide Featured Image from Single Page', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_page_thumbnail]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[featured_media_under_page_title]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_featured_media_under_page_title_control', array( 'label' => esc_html__( 'Move Featured Image to Bottom of Page Title', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[featured_media_under_page_title]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_page_title]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_page_title_control', array( 'label' => esc_html__( 'Hide Page Header from Single Page', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_page_title]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[remove_page_title_link]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_remove_page_title_link_control', array( 'label' => esc_html__( 'Remove Link from Single Page Title', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[remove_page_title_link]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_page_date]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_page_date_control', array( 'label' => esc_html__( 'Hide Page Date from Single Page', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_page_date]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[page_date_type]', array( 'default' => 'published', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_date_type' ) );

    $wp_customize->add_control( 'gridfeel_page_date_type_control', array( 'label' => esc_html__( 'Page Date Type', 'gridfeel' ), 'description' => esc_html__('You can choose to display published or updated date of your page.', 'gridfeel'), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[page_date_type]', 'type' => 'select', 'choices' => array( 'published' => esc_html__('Published', 'gridfeel'), 'updated' => esc_html__('Updated', 'gridfeel') ) ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_page_author]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_page_author_control', array( 'label' => esc_html__( 'Hide Page Author from Single Page', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_page_author]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_page_comments]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_page_comments_control', array( 'label' => esc_html__( 'Hide Comment Link from Single Page', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_page_comments]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_page_comment_form]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_page_comment_form_control', array( 'label' => esc_html__( 'Hide Comments/Comment Form from Single Page', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_page_comment_form]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_page_edit]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_page_edit_control', array( 'label' => esc_html__( 'Hide Edit Link from Single Page', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_page_edit]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_static_page_title]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_static_page_title_control', array( 'label' => esc_html__( 'Hide Page Header from Static Homepage', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_static_page_title]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[hide_static_page_meta]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridfeel_hide_static_page_meta_control', array( 'label' => esc_html__( 'Hide Page Meta Data (Page Date, Page Author, Comment Link) from Static Homepage', 'gridfeel' ), 'section' => 'gridfeel_section_page', 'settings' => 'gridfeel_options[hide_static_page_meta]', 'type' => 'checkbox', ) );

}