<?php
/**
 * Pagination
 *
 * @package Construktly
 */

$wp_customize->add_section(
	'construktly_pagination',
	array(
		'panel' => 'construktly_theme_options',
		'title' => esc_html__( 'Pagination', 'construktly' ),
	)
);

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

$wp_customize->add_control(
	new Construktly_Toggle_Switch_Custom_Control(
		$wp_customize,
		'construktly_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'construktly' ),
			'section'  => 'construktly_pagination',
			'settings' => 'construktly_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'construktly_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'construktly' ),
		'section'         => 'construktly_pagination',
		'settings'        => 'construktly_pagination_type',
		'active_callback' => 'construktly_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'construktly' ),
			'numeric' => __( 'Numeric', 'construktly' ),
		),
	)
);
