<?php

/**
 * Colors Settings
 *
 * @package Travel Tour
 */
add_action( 'customize_register', 'travel_tour_customize_colors' );
function travel_tour_customize_colors(  $wp_customize  ) {
    $wp_customize->get_section( 'colors' )->priority = 1;
    $wp_customize->get_section( 'colors' )->title = esc_html__( 'Colors', 'travel-tour' );
    $wp_customize->get_section( 'colors' )->panel = 'travel_tour_general_panel';
    $wp_customize->add_setting( 'primary_colors', array(
        'capability'        => 'edit_theme_options',
        'default'           => '#1bb0ce',
        'sanitize_callback' => 'travel_tour_sanitize_hex_color',
        'transport'         => 'refresh',
    ) );
    $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'primary_colors', array(
        'label'    => esc_html__( 'Primary Color', 'travel-tour' ),
        'section'  => 'colors',
        'settings' => 'primary_colors',
        'priority' => 1,
    )) );
    $wp_customize->add_setting( 'secondary_colors', array(
        'capability'        => 'edit_theme_options',
        'default'           => '#f59410',
        'sanitize_callback' => 'travel_tour_sanitize_hex_color',
        'transport'         => 'refresh',
    ) );
    $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'secondary_colors', array(
        'label'    => esc_html__( 'Secondary Color', 'travel-tour' ),
        'section'  => 'colors',
        'settings' => 'secondary_colors',
        'priority' => 2,
    )) );
    if ( fs_travel_tour()->is_free_plan() ) {
        $wp_customize->add_setting( 'travel_tour_colors_upgrade_to_pro', array(
            'sanitize_callback' => null,
        ) );
        $wp_customize->add_control( new Travel_Tour_Control_Upgrade_To_Pro($wp_customize, 'travel_tour_colors_upgrade_to_pro', array(
            'section'     => 'colors',
            'settings'    => 'travel_tour_colors_upgrade_to_pro',
            'title'       => __( 'Choose colors that perfectly align with your brand.', 'travel-tour' ),
            'items'       => array(
                'one' => array(
                    'title' => __( 'Additional color options for various parts of your website.', 'travel-tour' ),
                ),
            ),
            'button_url'  => esc_url( 'https://thebootstrapthemes.com/travel-tour/#free-vs-pro' ),
            'button_text' => __( 'Upgrade Now', 'travel-tour' ),
        )) );
    }
}
