<?php
/**
* Post 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_post_options($wp_customize) {

    $wp_customize->add_section( 'gridfeel_section_post', array( 'title' => esc_html__( 'Post Options', 'gridfeel' ), 'panel' => 'gridfeel_main_options_panel', 'priority' => 180 ) );

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

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

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

    $wp_customize->add_control( 'gridfeel_hide_thumbnail_control', array( 'label' => esc_html__( 'Hide Featured Image from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_thumbnail]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_featured_media_under_post_title_control', array( 'label' => esc_html__( 'Move Featured Image to Bottom of Full Post Title', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[featured_media_under_post_title]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_auto_width_thumbnail_control', array( 'label' => esc_html__( 'Do not Stretch Small Featured Image in Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[auto_width_thumbnail]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_post_title_control', array( 'label' => esc_html__( 'Hide Post Header from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_post_title]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_remove_post_title_link_control', array( 'label' => esc_html__( 'Remove Link from Full Post Title', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[remove_post_title_link]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_post_categories_control', array( 'label' => esc_html__( 'Hide Post Categories from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_post_categories]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_post_author_control', array( 'label' => esc_html__( 'Hide Post Author from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_post_author]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_posted_date_control', array( 'label' => esc_html__( 'Hide Post Date from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_posted_date]', 'type' => 'checkbox', ) );

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

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

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

    $wp_customize->add_control( 'gridfeel_hide_comments_link_control', array( 'label' => esc_html__( 'Hide Comment Link from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_comments_link]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_comment_form_control', array( 'label' => esc_html__( 'Hide Comments/Comment Form from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_comment_form]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_post_edit_control', array( 'label' => esc_html__( 'Hide Post Edit Link', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_post_edit]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_post_tags_control', array( 'label' => esc_html__( 'Hide Post Tags from Full Post', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_post_tags]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_author_bio_box_control', array( 'label' => esc_html__( 'Hide Author Bio Box', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[hide_author_bio_box]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_no_underline_content_links_control', array( 'label' => esc_html__( 'Do not Underline the Links within the Content', 'gridfeel' ), 'section' => 'gridfeel_section_post', 'settings' => 'gridfeel_options[no_underline_content_links]', 'type' => 'checkbox', ) );

}