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

$wp_customize->add_section(
	'majestic_blog_pagination',
	array(
		'panel' => 'majestic_blog_theme_options',
		'title' => esc_html__( 'Pagination', 'majestic-blog' ),
	)
);

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

$wp_customize->add_control(
	new Majestic_Blog_Toggle_Switch_Custom_Control(
		$wp_customize,
		'majestic_blog_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'majestic-blog' ),
			'section'  => 'majestic_blog_pagination',
			'settings' => 'majestic_blog_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'majestic_blog_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'majestic-blog' ),
		'section'         => 'majestic_blog_pagination',
		'settings'        => 'majestic_blog_pagination_type',
		'active_callback' => 'majestic_blog_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'majestic-blog' ),
			'numeric' => __( 'Numeric', 'majestic-blog' ),
		),
	)
);
