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

$wp_customize->add_section(
	'headline_news_pagination',
	array(
		'panel' => 'headline_news_theme_options',
		'title' => esc_html__( 'Pagination', 'headline-news' ),
	)
);

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

$wp_customize->add_control(
	new Headline_News_Toggle_Switch_Custom_Control(
		$wp_customize,
		'headline_news_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'headline-news' ),
			'section'  => 'headline_news_pagination',
			'settings' => 'headline_news_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'headline_news_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'headline-news' ),
		'section'         => 'headline_news_pagination',
		'settings'        => 'headline_news_pagination_type',
		'active_callback' => 'headline_news_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'headline-news' ),
			'numeric' => __( 'Numeric', 'headline-news' ),
		),
	)
);
