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

$wp_customize->add_section(
	'news_steam_pagination',
	array(
		'panel' => 'news_steam_theme_options',
		'title' => esc_html__( 'Pagination', 'news-steam' ),
	)
);

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

$wp_customize->add_control(
	new News_Steam_Toggle_Switch_Custom_Control(
		$wp_customize,
		'news_steam_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'news-steam' ),
			'section'  => 'news_steam_pagination',
			'settings' => 'news_steam_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'news_steam_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'news-steam' ),
		'section'         => 'news_steam_pagination',
		'settings'        => 'news_steam_pagination_type',
		'active_callback' => 'news_steam_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'news-steam' ),
			'numeric' => __( 'Numeric', 'news-steam' ),
		),
	)
);
