<?php

/**
 * Pagination
 *
 * @package Charity_Elite
 */

$wp_customize->add_section(
	'charity_elite_pagination',
	array(
		'panel' => 'charity_elite_theme_options',
		'title' => esc_html__( 'Pagination', 'charity-elite' ),
	)
);

// Pagination - Enable Pagination.
$wp_customize->add_setting(
	'charity_elite_enable_pagination',
	array(
		'default'           => true,
		'sanitize_callback' => 'charity_elite_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Charity_Elite_Toggle_Switch_Custom_Control(
		$wp_customize,
		'charity_elite_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'charity-elite' ),
			'section'  => 'charity_elite_pagination',
			'settings' => 'charity_elite_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

// Pagination - Pagination Type.
$wp_customize->add_setting(
	'charity_elite_pagination_type',
	array(
		'default'           => 'default',
		'sanitize_callback' => 'charity_elite_sanitize_select',
	)
);

$wp_customize->add_control(
	'charity_elite_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'charity-elite' ),
		'section'         => 'charity_elite_pagination',
		'settings'        => 'charity_elite_pagination_type',
		'active_callback' => 'charity_elite_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'charity-elite' ),
			'numeric' => __( 'Numeric', 'charity-elite' ),
		),
	)
);
