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

$wp_customize->add_section(
	'mindful_blog_pagination',
	array(
		'panel' => 'mindful_blog_theme_options',
		'title' => esc_html__( 'Pagination', 'mindful-blog' ),
	)
);

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

$wp_customize->add_control(
	new Mindful_Blog_Toggle_Switch_Custom_Control(
		$wp_customize,
		'mindful_blog_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'mindful-blog' ),
			'section'  => 'mindful_blog_pagination',
			'settings' => 'mindful_blog_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'mindful_blog_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'mindful-blog' ),
		'section'         => 'mindful_blog_pagination',
		'settings'        => 'mindful_blog_pagination_type',
		'active_callback' => 'mindful_blog_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'mindful-blog' ),
			'numeric' => __( 'Numeric', 'mindful-blog' ),
		),
	)
);
