<?php
/**
 * Pagination
 *
 * @package Minimalistic Blog
 */

$wp_customize->add_section(
	'minimalistic_blog_pagination',
	array(
		'panel' => 'minimalistic_blog_theme_options',
		'title' => esc_html__( 'Pagination', 'minimalistic-blog' ),
	)
);

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

$wp_customize->add_control(
	new Minimalistic_Blog_Toggle_Switch_Custom_Control(
		$wp_customize,
		'minimalistic_blog_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'minimalistic-blog' ),
			'section'  => 'minimalistic_blog_pagination',
			'settings' => 'minimalistic_blog_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

// Pagination - Pagination Type.
$wp_customize->add_setting(
	'minimalistic_blog_pagination_type',
	array(
		'default'           => 'default',
		'sanitize_callback' => 'minimalistic_blog_sanitize_select',
	)
);

$wp_customize->add_control(
	'minimalistic_blog_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'minimalistic-blog' ),
		'section'         => 'minimalistic_blog_pagination',
		'settings'        => 'minimalistic_blog_pagination_type',
		'active_callback' => 'minimalistic_blog_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'minimalistic-blog' ),
			'numeric' => __( 'Numeric', 'minimalistic-blog' ),
		),
	)
);
