<?php
/**
 * Pagination
 *
 * @package Prime Mag
 */

$wp_customize->add_section(
	'prime_mag_pagination',
	array(
		'panel' => 'prime_mag_theme_options',
		'title' => esc_html__( 'Pagination', 'prime-mag' ),
	)
);

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

$wp_customize->add_control(
	new Prime_Mag_Toggle_Switch_Custom_Control(
		$wp_customize,
		'prime_mag_enable_pagination',
		array(
			'label'    => esc_html__( 'Enable Pagination', 'prime-mag' ),
			'section'  => 'prime_mag_pagination',
			'settings' => 'prime_mag_enable_pagination',
			'type'     => 'checkbox',
		)
	)
);

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

$wp_customize->add_control(
	'prime_mag_pagination_type',
	array(
		'label'           => esc_html__( 'Pagination Type', 'prime-mag' ),
		'section'         => 'prime_mag_pagination',
		'settings'        => 'prime_mag_pagination_type',
		'active_callback' => 'prime_mag_is_pagination_enabled',
		'type'            => 'select',
		'choices'         => array(
			'default' => __( 'Default (Older/Newer)', 'prime-mag' ),
			'numeric' => __( 'Numeric', 'prime-mag' ),
		),
	)
);
