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

$wp_customize->add_section(
	'corporaze_pagination',
	array(
		'panel' => 'corporaze_theme_options',
		'title' => esc_html__( 'Pagination', 'corporaze' ),
	)
);

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

$wp_customize->add_control(
	new Corporaze_Toggle_Switch_Custom_Control(
		$wp_customize,
		'corporaze_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'corporaze' ),
			'section'  => 'corporaze_pagination',
			'settings' => 'corporaze_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'corporaze_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'corporaze' ),
		'section'         => 'corporaze_pagination',
		'settings'        => 'corporaze_pagination_type',
		'active_callback' => 'corporaze_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'corporaze' ),
			'numeric' => __( 'Numeric', 'corporaze' ),
		),
	)
);
