<?php
/**
* Menu options
*
* @package GridMini 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 gridmini_menu_options($wp_customize) {

    $wp_customize->add_section( 'gridmini_section_menu_options', array( 'title' => esc_html__( 'Menu Options', 'gridmini' ), 'panel' => 'gridmini_main_options_panel', 'priority' => 100 ) );

    $wp_customize->add_setting( 'gridmini_options[primary_menu_text]', array( 'default' => esc_html__( 'Menu', 'gridmini' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) );

    $wp_customize->add_control( 'gridmini_primary_menu_text_control', array( 'label' => esc_html__( 'Primary Menu Mobile Text', 'gridmini' ), 'section' => 'gridmini_section_menu_options', 'settings' => 'gridmini_options[primary_menu_text]', 'type' => 'text', ) );

    $wp_customize->add_setting( 'gridmini_options[disable_primary_menu]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridmini_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridmini_disable_primary_menu_control', array( 'label' => esc_html__( 'Disable Primary Menu', 'gridmini' ), 'section' => 'gridmini_section_menu_options', 'settings' => 'gridmini_options[disable_primary_menu]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridmini_options[secondary_menu_text]', array( 'default' => esc_html__( 'Menu', 'gridmini' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) );

    $wp_customize->add_control( 'gridmini_secondary_menu_text_control', array( 'label' => esc_html__( 'Secondary Menu Mobile Text', 'gridmini' ), 'section' => 'gridmini_section_menu_options', 'settings' => 'gridmini_options[secondary_menu_text]', 'type' => 'text', ) );

    $wp_customize->add_setting( 'gridmini_options[disable_menu_social_bar]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridmini_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridmini_disable_menu_social_bar_control', array( 'label' => esc_html__( 'Disable Secondary Menu + Social Area', 'gridmini' ), 'description' => esc_html__('If you checked this option, secondary menu and all buttons will disappear. There is no any effect from these options: "Disable Secondary Menu", "Hide Social Area", "Hide Search Button", "Show Login/Logout Button", "Show Random Post Button".', 'gridmini'), 'section' => 'gridmini_section_menu_options', 'settings' => 'gridmini_options[disable_menu_social_bar]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridmini_options[disable_secondary_menu]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridmini_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridmini_disable_secondary_menu_control', array( 'label' => esc_html__( 'Disable Secondary Menu', 'gridmini' ), 'description' => esc_html__('This option has no effect if you have checked the option: "Disable Secondary Menu + Social Area".', 'gridmini'), 'section' => 'gridmini_section_menu_options', 'settings' => 'gridmini_options[disable_secondary_menu]', 'type' => 'checkbox', ) );

    $wp_customize->add_setting( 'gridmini_options[secondary_menu_location]', array( 'default' => 'before-header', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridmini_sanitize_secondary_menu_location' ) );

    $wp_customize->add_control( 'gridmini_secondary_menu_location_control', array( 'label' => esc_html__( 'Select Secondary Menu Location', 'gridmini' ), 'description' => esc_html__('Select where you want to display secondary menu.', 'gridmini'), 'section' => 'gridmini_section_menu_options', 'settings' => 'gridmini_options[secondary_menu_location]', 'type' => 'select', 'choices' => array( 'before-header' => esc_html__('Before Header', 'gridmini'), 'after-header' => esc_html__('After Header', 'gridmini'), 'before-footer' => esc_html__('Before Footer', 'gridmini'), 'after-footer' => esc_html__('After Footer', 'gridmini') ) ) );

    $wp_customize->add_setting( 'gridmini_options[center_secondary_menu]', array( 'default' => false, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'gridmini_sanitize_checkbox', ) );

    $wp_customize->add_control( 'gridmini_center_secondary_menu_control', array( 'label' => esc_html__( 'Center Secondary Menu', 'gridmini' ), 'section' => 'gridmini_section_menu_options', 'settings' => 'gridmini_options[center_secondary_menu]', 'type' => 'checkbox', ) );

}