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

$wp_customize->add_section(
	'scope_news_pagination',
	array(
		'panel' => 'scope_news_theme_options',
		'title' => esc_html__( 'Pagination', 'scope-news' ),
	)
);

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

$wp_customize->add_control(
	new Scope_News_Toggle_Switch_Custom_Control(
		$wp_customize,
		'scope_news_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'scope-news' ),
			'section'  => 'scope_news_pagination',
			'settings' => 'scope_news_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'scope_news_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'scope-news' ),
		'section'         => 'scope_news_pagination',
		'settings'        => 'scope_news_pagination_type',
		'active_callback' => 'scope_news_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'scope-news' ),
			'numeric' => __( 'Numeric', 'scope-news' ),
		),
	)
);
