<?php
/**
* Custom Addons.
*
* @package Travel Destination
*/

$wp_customize->add_section( 'travel_destination_theme_pagination_options',
    array(
    'title'      => esc_html__( 'Customizer Custom Settings', 'travel-destination' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'travel_destination_theme_addons_panel',
    )
);

$wp_customize->add_setting('travel_destination_theme_loader',
    array(
        'default' => $travel_destination_default['travel_destination_theme_loader'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'travel_destination_sanitize_checkbox',
    )
);
$wp_customize->add_control('travel_destination_theme_loader',
    array(
        'label' => esc_html__('Enable Preloader', 'travel-destination'),
        'section' => 'travel_destination_theme_pagination_options',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'travel_destination_enable_pagination', 
    array(
        'default'           => true,
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'travel_destination_sanitize_enable_pagination',
    )
);

$wp_customize->add_control( 'travel_destination_enable_pagination', 
    array(
        'label'    => esc_html__( 'Enable Pagination', 'travel-destination' ),
        'section'  => 'travel_destination_theme_pagination_options',
        'type'     => 'checkbox',
    )
);

$wp_customize->add_setting( 'travel_destination_theme_pagination_type', 
    array(
        'default'           => 'numeric',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'travel_destination_sanitize_pagination_type',
    )
);

$wp_customize->add_control( 'travel_destination_theme_pagination_type',
    array(
        'label'       => esc_html__( 'Pagination Style', 'travel-destination' ),
        'section'     => 'travel_destination_theme_pagination_options',
        'type'        => 'select',
        'choices'     => array(
            'numeric'      => esc_html__( 'Numeric (Page Numbers)', 'travel-destination' ),
            'newer_older'  => esc_html__( 'Newer/Older (Previous/Next)', 'travel-destination' ),
        ),
    )
);

$wp_customize->add_setting( 'travel_destination_theme_pagination_options_alignment',
    array(
    'default'           => $travel_destination_default['travel_destination_theme_pagination_options_alignment'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'travel_destination_sanitize_pagination_meta',
    )
);
$wp_customize->add_control( 'travel_destination_theme_pagination_options_alignment',
    array(
    'label'       => esc_html__( 'Pagination Alignment', 'travel-destination' ),
    'section'     => 'travel_destination_theme_pagination_options',
    'type'        => 'select',
    'choices'     => array(
        'Center'    => esc_html__( 'Center', 'travel-destination' ),
        'Right' => esc_html__( 'Right', 'travel-destination' ),
        'Left'  => esc_html__( 'Left', 'travel-destination' ),
        ),
    )
);

$wp_customize->add_setting('travel_destination_theme_breadcrumb_enable',
array(
    'default' => $travel_destination_default['travel_destination_theme_breadcrumb_enable'],
    'capability' => 'edit_theme_options',
    'sanitize_callback' => 'travel_destination_sanitize_checkbox',
)
);
$wp_customize->add_control('travel_destination_theme_breadcrumb_enable',
    array(
        'label' => esc_html__('Enable Breadcrumb', 'travel-destination'),
        'section' => 'travel_destination_theme_pagination_options',
        'type' => 'checkbox',
    )
);


$wp_customize->add_setting( 'travel_destination_theme_breadcrumb_options_alignment',
    array(
    'default'           => $travel_destination_default['travel_destination_theme_breadcrumb_options_alignment'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'travel_destination_sanitize_pagination_meta',
    )
);
$wp_customize->add_control( 'travel_destination_theme_breadcrumb_options_alignment',
    array(
    'label'       => esc_html__( 'Breadcrumb Alignment', 'travel-destination' ),
    'section'     => 'travel_destination_theme_pagination_options',
    'type'        => 'select',
    'choices'     => array(
        'Center'    => esc_html__( 'Center', 'travel-destination' ),
        'Right' => esc_html__( 'Right', 'travel-destination' ),
        'Left'  => esc_html__( 'Left', 'travel-destination' ),
        ),
    )
);

$wp_customize->add_setting('travel_destination_breadcrumb_font_size',
    array(
        'default'           => $travel_destination_default['travel_destination_breadcrumb_font_size'],
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'travel_destination_sanitize_number_range',
    )
);
$wp_customize->add_control('travel_destination_breadcrumb_font_size',
    array(
        'label'       => esc_html__('Breadcrumb Font Size', 'travel-destination'),
        'section'     => 'travel_destination_theme_pagination_options',
        'type'        => 'number',
        'input_attrs' => array(
           'min'   => 1,
           'max'   => 45,
           'step'   => 1,
        ),
    )
);