<?php
/**
 * Theme Customizer Controls
 *
 * @package Ticket Booking
 */

if ( ! function_exists( 'ticket_booking_customizer_global_color_setting_register' ) ) :
function ticket_booking_customizer_global_color_setting_register( $wp_customize ) {
 
 	$wp_customize->add_section(
        'ticket_booking_global_color_settings',
        array (
            'priority'      => 40,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Global Color Settings', 'ticket-booking' )
        )
    );

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

	$wp_customize->add_control( 
		new Ticket_Booking_Title_Info_Control( $wp_customize, 'ticket_booking_theme_color_settings', 
		array(
		    'label'       => esc_html__( 'Global Color Settings', 'ticket-booking' ),
		    'section'     => 'ticket_booking_global_color_settings',
		    'type'        => 'ticket-booking-title',
		    'settings'    => 'ticket_booking_theme_color_settings',
		) 
	));

	$wp_customize->add_setting('ticket_booking_global_color1',
        array(
            'type' => 'theme_mod',
            'default'           => '#9449f3',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'ticket_booking_global_color1',
            array(
                'label'      => esc_html__( 'Global Color1', 'ticket-booking' ),
                'section'    => 'ticket_booking_global_color_settings',
                'settings'   => 'ticket_booking_global_color1',
            )
        )
    );   

}
endif;

add_action( 'customize_register', 'ticket_booking_customizer_global_color_setting_register' );