<?php
/**
 * Theme Customizer Controls
 *
 * @package shop-zen
 */

defined( 'ABSPATH' ) || exit;


if ( ! function_exists( 'shop_zen_customizer_page_settings_register' ) ) :
function shop_zen_customizer_page_settings_register( $wp_customize ) {

 	/**
     * Page Settings Section
     */
    $wp_customize->add_section(
        'shop_zen_page_settings',
        array(
            'priority'   => 20,
            'capability' => 'edit_theme_options',
            'title'      => esc_html__( 'Page Settings', 'shop-zen' ),
        )
    );

    // Title label - Page Title
    $wp_customize->add_setting(
        'shop_zen_page_title_label',
        array(
            'sanitize_callback' => 'shop_zen_sanitize_title',
        )
    );

    $wp_customize->add_control(
        new Shop_Zen_Title_Info_Control( $wp_customize, 'shop_zen_page_title_label',
        array(
            'label'    => esc_html__( 'Page Title Settings', 'shop-zen' ),
            'section'  => 'shop_zen_page_settings',
            'type'     => 'shop-zen-title',
            'settings' => 'shop_zen_page_title_label',
        )
    ));

    // Enable/Disable Page Title
    $wp_customize->add_setting(
        'shop_zen_enable_page_title',
        array(
            'default'           => true,
            'type'              => 'theme_mod',
            'sanitize_callback' => 'shop_zen_sanitize_checkbox',
            'transport'         => 'refresh',
        )
    );

    $wp_customize->add_control(
        new Shop_Zen_Toggle_Control( $wp_customize, 'shop_zen_enable_page_title',
        array(
            'label'       => esc_html__( 'Enable Page Title', 'shop-zen' ),
            'description' => esc_html__( 'Enable or disable the page title for inner pages', 'shop-zen' ),
            'section'     => 'shop_zen_page_settings',
            'type'        => 'shop-zen-toggle',
            'settings'    => 'shop_zen_enable_page_title',
        )
    ));	
}
endif;

add_action( 'customize_register', 'shop_zen_customizer_page_settings_register' );