<?php
/**
 * Theme Customizer Controls
 *
 * @package somalite
 */


if ( ! function_exists( 'somalite_customizer_sticky_header_register' ) ) :
function somalite_customizer_sticky_header_register( $wp_customize ) {
    
    //Sticky Header Settings
    $wp_customize->add_section(
        'soma_sticky_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'theme_supports'=> '',
            'title'         => esc_html__( 'Sticky Header Settings', 'somalite' )
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'somalite_label_sticky_header_settings', 
        array(
              'sanitize_callback' => 'somalite_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Somalite_Title_Info_Control( $wp_customize, 'somalite_label_sticky_header_settings', 
        array(
            'label'       => esc_html__( 'Sticky Header Settings', 'somalite' ),
            'section'     => 'soma_sticky_header_settings',
            'type'        => 'somalite-title',
            'settings'    => 'somalite_label_sticky_header_settings',
        ) 
    ));

    //enable sticky menu
    $wp_customize->add_setting(
        'sm_sticky_menu',
        array(
            'type' => 'theme_mod',
            'default'           => false,
            'sanitize_callback' => 'somalite_sanitize_checkbox'
        )
    );

    $wp_customize->add_control( 
        new Somalite_Toggle_Control( $wp_customize, 'sm_sticky_menu', 
        array(
            'section'     => 'soma_sticky_header_settings',
            'type'        => 'somalite-toggle',
            'settings'    => 'sm_sticky_menu',
            'label'         => esc_html__( 'Enable Sticky Header Feature:', 'somalite' ),
            'description'   => esc_html__( 'Choose whether to enable a sticky header feature for the site', 'somalite' ), 
        ) 
    ));

}
endif;

add_action( 'customize_register', 'somalite_customizer_sticky_header_register' );