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


if ( ! function_exists( 'somalite_customizer_site_title_register' ) ) :
function somalite_customizer_site_title_register( $wp_customize ) {

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

    $wp_customize->add_control( 
        new Somalite_Title_Info_Control( $wp_customize, 'somalite_label_site_title_settings', 
        array(
            'label'       => esc_html__( 'Site Title Settings', 'somalite' ),
            'section'     => 'title_tagline',
            'type'        => 'somalite-title',
            'settings'    => 'somalite_label_site_title_settings',
        ) 
    ));

    // Display Site Title and Tagline
    $wp_customize->add_setting( 
        'soma_display_site_title_tagline', 
        array(
            'default'           => true,
            'type'              => 'theme_mod',
            'sanitize_callback' => 'somalite_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control( 
        new Somalite_Toggle_Control( $wp_customize, 'soma_display_site_title_tagline', 
        array(
            'label'       => esc_html__( 'Display Site Title and Tagline', 'somalite' ),
            'section'     => 'title_tagline',
            'type'        => 'somalite-toggle',
            'settings'    => 'soma_display_site_title_tagline',
        ) 
    ));


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

    $wp_customize->add_control( 
        new Somalite_Title_Info_Control( $wp_customize, 'somalite_label_site_favicon_settings', 
        array(
            'label'       => esc_html__( 'Site Icon Settings', 'somalite' ),
            'section'     => 'title_tagline',
            'type'        => 'somalite-title',
            'settings'    => 'somalite_label_site_favicon_settings',
        ) 
    ));

}
endif;

add_action( 'customize_register', 'somalite_customizer_site_title_register' );