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

$wp_customize->add_section(
	'newsbreeze_pagination',
	array(
		'panel' => 'newsbreeze_theme_options',
		'title' => esc_html__( 'Pagination', 'newsbreeze' ),
	)
);

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

$wp_customize->add_control(
	new Newsbreeze_Toggle_Switch_Custom_Control(
		$wp_customize,
		'newsbreeze_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'newsbreeze' ),
			'section'  => 'newsbreeze_pagination',
			'settings' => 'newsbreeze_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'newsbreeze_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'newsbreeze' ),
		'section'         => 'newsbreeze_pagination',
		'settings'        => 'newsbreeze_pagination_type',
		'active_callback' => 'newsbreeze_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'newsbreeze' ),
			'numeric' => __( 'Numeric', 'newsbreeze' ),
		),
	)
);
