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

$wp_customize->add_section(
	'hyper_news_pagination',
	array(
		'panel' => 'hyper_news_theme_options',
		'title' => esc_html__( 'Pagination', 'hyper-news' ),
	)
);

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

$wp_customize->add_control(
	new Hyper_News_Toggle_Switch_Custom_Control(
		$wp_customize,
		'hyper_news_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'hyper-news' ),
			'section'  => 'hyper_news_pagination',
			'settings' => 'hyper_news_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'hyper_news_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'hyper-news' ),
		'section'         => 'hyper_news_pagination',
		'settings'        => 'hyper_news_pagination_type',
		'active_callback' => 'hyper_news_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'hyper-news' ),
			'numeric' => __( 'Numeric', 'hyper-news' ),
		),
	)
);
