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


if ( ! function_exists( 'somalite_customizer_misc_register' ) ) :
function somalite_customizer_misc_register( $wp_customize ) {
     
    // Preloader Settings
    $wp_customize->add_section(
        'soma_misc_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'theme_supports'=> '',
            'title'         => esc_html__( 'Misc Settings', 'somalite' )
        )
    );

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

    $wp_customize->add_control( 
        new Somalite_Title_Info_Control( $wp_customize, 'somalite_label_misc_settings', 
        array(
            'label'       => esc_html__( 'Misc Settings', 'somalite' ),
            'section'     => 'soma_misc_settings',
            'type'        => 'somalite-title',
            'settings'    => 'somalite_label_misc_settings',
        ) 
    ));

    // Animation Enable radio button 
    $wp_customize->add_setting(
        'sm_animation_display',
        array(
            'type' => 'theme_mod',
            'default'           => true,
            'sanitize_callback' => 'somalite_sanitize_checkbox'
        )
    );

    $wp_customize->add_control( 
        new Somalite_Toggle_Control( $wp_customize, 'sm_animation_display', 
        array(
            'section'     => 'soma_misc_settings',
            'type'        => 'somalite-toggle',
            'settings'    => 'sm_animation_display',
            'label'         => esc_html__( 'Enable Animation for site:', 'somalite' ),
            'description'         => esc_html__( 'Note: This will only disable the default animations not the Elementor animations:', 'somalite' ),
        ) 
    ));

}
endif;

add_action( 'customize_register', 'somalite_customizer_misc_register' );