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

    $wp_customize->add_section( 'gridfeel_section_header', array( 'title' => esc_html__( 'Header Options', 'gridfeel' ), 'panel' => 'gridfeel_main_options_panel', 'priority' => 120 ) );

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

    $wp_customize->add_control( 'gridfeel_hide_tagline_control', array( 'label' => esc_html__( 'Hide Tagline', 'gridfeel' ), 'section' => 'gridfeel_section_header', 'settings' => 'gridfeel_options[hide_tagline]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_header_content_control', array( 'label' => esc_html__( 'Hide Header Content', 'gridfeel' ), 'section' => 'gridfeel_section_header', 'settings' => 'gridfeel_options[hide_header_content]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[logo_location]', array( 'default' => 'above-title', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridfeel_sanitize_logo_location' ) );

    $wp_customize->add_control( 'gridfeel_logo_location_control', array( 'label' => esc_html__( 'Logo Location', 'gridfeel' ), 'description' => esc_html__('Select how you want to display the site logo with site title and tagline.', 'gridfeel'), 'section' => 'title_tagline', 'settings' => 'gridfeel_options[logo_location]', 'type' => 'select', 'choices' => array( 'beside-title' => esc_html__( 'Before Site Title and Tagline', 'gridfeel' ), 'above-title' => esc_html__( 'Above Site Title and Tagline', 'gridfeel' ) ), 'priority'   => 8 ) );

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

    $wp_customize->add_control( 'gridfeel_hide_header_image_control', array( 'label' => esc_html__( 'Hide Header Image from Everywhere', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[hide_header_image]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_remove_header_image_link_control', array( 'label' => esc_html__( 'Remove Link from Header Image', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[remove_header_image_link]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_header_image_details_control', array( 'label' => esc_html__( 'Hide both Title and Description from Header Image', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[hide_header_image_details]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_header_image_title_control', array( 'label' => esc_html__( 'Hide Title from Header Image', 'gridfeel' ), 'description' => esc_html__('If you checked this option, header image title will be hidden from all screen sizes. This option has no effect if you have checked the option: "Hide both Title and Description from Header Image"', 'gridfeel'), 'section' => 'header_image', 'settings' => 'gridfeel_options[hide_header_image_title]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_hide_header_image_description_control', array( 'label' => esc_html__( 'Hide Description from Header Image', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[hide_header_image_description]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_header_image_title_mobile_control', array( 'label' => esc_html__( 'Show Header Image Title on Smaller Screens', 'gridfeel' ), 'description' => esc_html__('This option has no effect if you have checked any of these options: "Hide both Title and Description from Header Image", "Hide Title from Header Image"', 'gridfeel'), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_title_mobile]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_header_image_description_mobile_control', array( 'label' => esc_html__( 'Show Header Image Description on Smaller Screens', 'gridfeel' ), 'description' => esc_html__('This option has no effect if you have checked any of these options: "Hide both Title and Description from Header Image", "Hide Description from Header Image"', 'gridfeel'), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_description_mobile]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_header_image_custom_text_control', array( 'label' => esc_html__( 'Add Custom Title/Custom Description to Header Image', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_custom_text]', 'type' => 'checkbox', ) );

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

    $wp_customize->add_control( 'gridfeel_header_image_custom_title_control', array( 'label' => esc_html__( 'Header Image Custom Title', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_custom_title]', 'type' => 'text', ) );

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

    $wp_customize->add_control( 'gridfeel_header_image_custom_description_control', array( 'label' => esc_html__( 'Header Image Custom Description', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_custom_description]', 'type' => 'text', ) );

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

    $wp_customize->add_control( 'gridfeel_header_image_destination_control', array( 'label' => esc_html__( 'Header Image Destination URL', 'gridfeel' ), 'description' => esc_html__( 'Enter the URL a visitor should go when he/she click on the header image. If you did not enter a URL below, header image will be linked to the homepage of your website.', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_destination]', 'type' => 'text' ) );

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

    $wp_customize->add_control( 'gridfeel_header_image_cover_control', array( 'label' => esc_html__( 'Add a Minimum Height to Header Image on Smaller Screens', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_cover]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridfeel_options[header_image_height_mobile]', array( 'default' => '200px', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) );

    $wp_customize->add_control( 'gridfeel_header_image_height_mobile_control', array( 'label' => esc_html__( 'Header Image Minimum Height on Smaller Screens', 'gridfeel' ), 'description' => esc_html__('Enter the minimum height value for header image height. Default is "200px". Note: This option has no effect until you check "Add a Minimum Height to Header Image on Smaller Screens" option.', 'gridfeel'), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_height_mobile]', 'type' => 'text' ) );

    $wp_customize->add_setting( 'gridfeel_options[header_padding]', array( 'default' => '10px', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field' ) );

    $wp_customize->add_control( 'gridfeel_header_padding_control', array( 'label' => esc_html__( 'Header Padding', 'gridfeel' ), 'description' => esc_html__('Enter the padding value for header content. Default is "10px".', 'gridfeel'), 'section' => 'gridfeel_section_header', 'settings' => 'gridfeel_options[header_padding]', 'type' => 'text' ) );

   $wp_customize->add_setting( 'gridfeel_options[header_image_alt_text]', array( 'default' => get_bloginfo( 'name' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) );

    $wp_customize->add_control( 'gridfeel_header_image_alt_text_control', array( 'label' => esc_html__( 'Header Image Alt Text', 'gridfeel' ), 'section' => 'header_image', 'settings' => 'gridfeel_options[header_image_alt_text]', 'type' => 'text', ) );

    $wp_customize->add_setting( 'gridfeel_options[search_box_placeholder_text]', array( 'default' => esc_html__( 'Enter your search keyword...', 'gridfeel' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) );

    $wp_customize->add_control( 'gridfeel_search_box_placeholder_text_control', array( 'label' => esc_html__( 'Search Box Placeholder Text', 'gridfeel' ), 'section' => 'gridfeel_section_header', 'settings' => 'gridfeel_options[search_box_placeholder_text]', 'type' => 'text', ) );

}