<?php
/**
 * Pagination
 *
 * @package Routine News
 */

$wp_customize->add_section(
	'routine_news_pagination',
	array(
		'panel' => 'routine_news_theme_options',
		'title' => esc_html__( 'Pagination', 'routine-news' ),
	)
);

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

$wp_customize->add_control(
	new Routine_News_Toggle_Switch_Custom_Control(
		$wp_customize,
		'routine_news_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'routine-news' ),
			'section'  => 'routine_news_pagination',
			'settings' => 'routine_news_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

// Pagination - Pagination Type.
$wp_customize->add_setting(
	'routine_news_pagination_type',
	array(
		'default'           => 'numeric',
		'sanitize_callback' => 'routine_news_sanitize_select',
	)
);

$wp_customize->add_control(
	'routine_news_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'routine-news' ),
		'section'         => 'routine_news_pagination',
		'settings'        => 'routine_news_pagination_type',
		'active_callback' => 'routine_news_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'routine-news' ),
			'numeric' => __( 'Numeric', 'routine-news' ),
		),
	)
);
