<?php
/**
* Search and 404 Page options
*
* @package BoldWP 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 boldwp_search_404_options($wp_customize) {

    $wp_customize->add_section( 'boldwp_section_search_404', array( 'title' => esc_html__( 'Search and 404 Pages Options', 'boldwp' ), 'panel' => 'boldwp_main_options_panel', 'priority' => 340 ) );

    $wp_customize->add_setting( 'boldwp_options[hide_search_results_heading]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'boldwp_hide_search_results_heading_control', array( 'label' => esc_html__( 'Hide Search Results Heading', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[hide_search_results_heading]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'boldwp_options[search_results_heading]', array( 'default' => esc_html__( 'Search Results for:', 'boldwp' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_html', ) );

    $wp_customize->add_control( 'boldwp_search_results_heading_control', array( 'label' => esc_html__( 'Search Results Heading', 'boldwp' ), 'description' => esc_html__( 'Enter a sentence to display before the search query.', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[search_results_heading]', 'type' => 'textarea' ) );

    $wp_customize->add_setting( 'boldwp_options[no_search_heading]', array( 'default' => esc_html__( 'Nothing Found', 'boldwp' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_html', ) );

    $wp_customize->add_control( 'boldwp_no_search_heading_control', array( 'label' => esc_html__( 'No Search Results Heading', 'boldwp' ), 'description' => esc_html__( 'Enter a heading to display when no search results are found.', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[no_search_heading]', 'type' => 'textarea' ) );

    $wp_customize->add_setting( 'boldwp_options[no_search_results]', array( 'default' => esc_html__( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'boldwp' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_html', ) );

    $wp_customize->add_control( 'boldwp_no_search_results_control', array( 'label' => esc_html__( 'No Search Results Message', 'boldwp' ), 'description' => esc_html__( 'Enter a message to display when no search results are found.', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[no_search_results]', 'type' => 'textarea' ) );

    $wp_customize->add_setting( 'boldwp_options[error_404_heading]', array( 'default' => esc_html__( 'Oops! That page can not be found.', 'boldwp' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_html', ) );

    $wp_customize->add_control( 'boldwp_error_404_heading_control', array( 'label' => esc_html__( '404 Error Page Heading', 'boldwp' ), 'description' => esc_html__( 'Enter the heading for the 404 error page.', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[error_404_heading]', 'type' => 'textarea' ) );

    $wp_customize->add_setting( 'boldwp_options[error_404_message]', array( 'default' => esc_html__( 'It looks like nothing was found at this location. Maybe try one of the links below or a search?', 'boldwp' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_html', ) );

    $wp_customize->add_control( 'boldwp_error_404_message_control', array( 'label' => esc_html__( 'Error 404 Message', 'boldwp' ), 'description' => esc_html__( 'Enter a message to display on the 404 error page.', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[error_404_message]', 'type' => 'textarea', ) );

    $wp_customize->add_setting( 'boldwp_options[hide_404_search]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_checkbox', ) );

    $wp_customize->add_control( 'boldwp_hide_404_search_control', array( 'label' => esc_html__( 'Hide Search Box from 404 Page', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[hide_404_search]', 'type' => 'checkbox', ) );

    //$wp_customize->add_setting( 'boldwp_options[hide_404_recent_posts]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_checkbox', ) );

    //$wp_customize->add_control( 'boldwp_hide_404_recent_posts_control', array( 'label' => esc_html__( 'Hide Recent Posts from 404 Page', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[hide_404_recent_posts]', 'type' => 'checkbox', ) );

    //$wp_customize->add_setting( 'boldwp_options[hide_404_cats]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_checkbox', ) );

    //$wp_customize->add_control( 'boldwp_hide_404_cats_control', array( 'label' => esc_html__( 'Hide Categories from 404 Page', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[hide_404_cats]', 'type' => 'checkbox', ) );

    //$wp_customize->add_setting( 'boldwp_options[hide_404_tags]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_checkbox', ) );

    //$wp_customize->add_control( 'boldwp_hide_404_tags_control', array( 'label' => esc_html__( 'Hide Tags from 404 Page', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[hide_404_tags]', 'type' => 'checkbox', ) );

    //$wp_customize->add_setting( 'boldwp_options[hide_404_archives]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'boldwp_sanitize_checkbox', ) );

    //$wp_customize->add_control( 'boldwp_hide_404_archives_control', array( 'label' => esc_html__( 'Hide Archives from 404 Page', 'boldwp' ), 'section' => 'boldwp_section_search_404', 'settings' => 'boldwp_options[hide_404_archives]', 'type' => 'checkbox', ) );

}