<?php
/**
 * Theme Customizer Controls
 *
 * @package Corporate Businessmen
 */

if ( ! function_exists( 'corporate_businessmen_customizer_global_color_setting_register' ) ) :
function corporate_businessmen_customizer_global_color_setting_register( $wp_customize ) {
 
 	$wp_customize->add_section(
        'corporate_businessmen_global_color_settings',
        array (
            'priority'      => 40,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Global Color Settings', 'corporate-businessmen' )
        )
    );

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

	$wp_customize->add_control( 
		new Corporate_Businessmen_Title_Info_Control( $wp_customize, 'corporate_businessmen_theme_color_settings', 
		array(
		    'label'       => esc_html__( 'Global Color Settings', 'corporate-businessmen' ),
		    'section'     => 'corporate_businessmen_global_color_settings',
		    'type'        => 'corporate-businessmen-title',
		    'settings'    => 'corporate_businessmen_theme_color_settings',
		) 
	));

	$wp_customize->add_setting('corporate_businessmen_global_color1',
        array(
            'type' => 'theme_mod',
            'default'           => '#F16517',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'corporate_businessmen_global_color1',
            array(
                'label'      => esc_html__( 'Global Color 1', 'corporate-businessmen' ),
                'section'    => 'corporate_businessmen_global_color_settings',
                'settings'   => 'corporate_businessmen_global_color1',
            )
        )
    );  

}
endif;

add_action( 'customize_register', 'corporate_businessmen_customizer_global_color_setting_register' );