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

$wp_customize->add_section(
	'cosmic_blog_pagination',
	array(
		'panel' => 'cosmic_blog_theme_options',
		'title' => esc_html__( 'Pagination', 'cosmic-blog' ),
	)
);

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

$wp_customize->add_control(
	new Cosmic_Blog_Toggle_Switch_Custom_Control(
		$wp_customize,
		'cosmic_blog_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'cosmic-blog' ),
			'section'  => 'cosmic_blog_pagination',
			'settings' => 'cosmic_blog_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'cosmic_blog_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'cosmic-blog' ),
		'section'         => 'cosmic_blog_pagination',
		'settings'        => 'cosmic_blog_pagination_type',
		'active_callback' => 'cosmic_blog_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'cosmic-blog' ),
			'numeric' => __( 'Numeric', 'cosmic-blog' ),
		),
	)
);
