<?php
/**
 * Pagination
 *
 * @package Neo Magazine
 */

$wp_customize->add_section(
	'neo_magazine_pagination',
	array(
		'panel' => 'neo_magazine_theme_options',
		'title' => esc_html__( 'Pagination', 'neo-magazine' ),
	)
);

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

$wp_customize->add_control(
	new Neo_Magazine_Toggle_Switch_Custom_Control(
		$wp_customize,
		'neo_magazine_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'neo-magazine' ),
			'section'  => 'neo_magazine_pagination',
			'settings' => 'neo_magazine_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'neo_magazine_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'neo-magazine' ),
		'section'         => 'neo_magazine_pagination',
		'settings'        => 'neo_magazine_pagination_type',
		'active_callback' => 'neo_magazine_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'neo-magazine' ),
			'numeric' => __( 'Numeric', 'neo-magazine' ),
		),
	)
);
