<?php
/**
 * Customizer settings: pages
 *
 * @package Multi
 */

if ( ! defined( 'ABSPATH' ) ) {
	die;
}

/**
 * Customizer settings for pages
 */
class Multimagazine_Customize_Pages {

	/**
	 * Registers the section and fires the extension hook.
	 *
	 * @param WP_Customize_Manager $wp_customize Customizer manager instance.
	 */
	public static function register_section( $wp_customize ) {
		$wp_customize->add_section(
			'pages',
			array(
				'title'    => __( 'Pages', 'multimagazine' ),
				'priority' => 56,
			)
		);
		do_action( 'multimagazine_customize_pages', $wp_customize );
	}

	/**
	 * Registers the show page nav setting.
	 */
	public static function register_show_page_nav() {
		global $multimagazine_customize;
		$multimagazine_customize->checkbox_setting( 'multi_pages_show_page_nav', 'pages', __( 'Enable links to next/previous page', 'multimagazine' ) );
	}

	/**
	 * Registers the show sticky page nav setting.
	 */
	public static function register_show_sticky_page_nav() {
		global $multimagazine_customize;
		$multimagazine_customize->checkbox_setting( 'multi_pages_show_sticky_page_nav', 'pages', __( 'Enable sticky links to next/previous page', 'multimagazine' ) );
	}
}

add_action( 'customize_register', array( 'Multimagazine_Customize_Pages', 'register_section' ) );
add_action( 'multimagazine_customize_pages', array( 'Multimagazine_Customize_Pages', 'register_show_page_nav' ), 10 );
add_action( 'multimagazine_customize_pages', array( 'Multimagazine_Customize_Pages', 'register_show_sticky_page_nav' ), 15 );
