<?php
/**
 * Theme Customizer Controls
 *
 * @package Legacy Wellness Coach
 */

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

    $wp_customize->add_section(
        'legacy_wellness_coach_home_header_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'title'         => esc_html__( 'Header Settings', 'legacy-wellness-coach' )
        )
    );

    // topbar buttons

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

    $wp_customize->add_control( 
        new Legacy_Wellness_Coach_Title_Info_Control( $wp_customize, 'legacy_wellness_coach_label_header_button_settings_title', 
        array(
            'label'       => esc_html__( 'Tobar Button', 'legacy-wellness-coach' ),
            'section'     => 'legacy_wellness_coach_home_header_settings',
            'type'        => 'legacy-wellness-coach-title',
            'settings'    => 'legacy_wellness_coach_label_header_button_settings_title',
        ) 
    ));

    $wp_customize->add_setting(
        'legacy_wellness_coach_topbar_book_button_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );

    $wp_customize->add_control(
        'legacy_wellness_coach_topbar_book_button_link',
        array(
            'label'           => sprintf( esc_html__( 'Topbar Join Button Link', 'legacy-wellness-coach' ), ),
            'section'         => 'legacy_wellness_coach_home_header_settings',
            'settings'        => 'legacy_wellness_coach_topbar_book_button_link' ,
            'type'            => 'url',
        )
    );
}
endif;

add_action( 'customize_register', 'legacy_wellness_coach_customizer_header_register' );