<?php
/**
 * Theme Customizer Controls
 *
 * @package pawwell
 */

defined( 'ABSPATH' ) || exit;


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

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

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

    $wp_customize->add_control(
        new Pawwell_Title_Info_Control( $wp_customize, 'pawwell_page_title_label',
        array(
            'label'    => esc_html__( 'Page Title Settings', 'pawwell' ),
            'section'  => 'pawwell_page_settings',
            'type'     => 'pawwell-title',
            'settings' => 'pawwell_page_title_label',
        )
    ));

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

    $wp_customize->add_control(
        new Pawwell_Toggle_Control( $wp_customize, 'pawwell_enable_page_title',
        array(
            'label'       => esc_html__( 'Enable Page Title', 'pawwell' ),
            'description' => esc_html__( 'Enable/Disable page title on inner pages except the front page.', 'pawwell' ),
            'section'     => 'pawwell_page_settings',
            'type'        => 'pawwell-toggle',
            'settings'    => 'pawwell_enable_page_title',
        )
    ));

    // Title label - Breadcrumb
    $wp_customize->add_setting(
        'pawwell_breadcrumb_label',
        array(
            'sanitize_callback' => 'pawwell_sanitize_title',
        )
    );

    $wp_customize->add_control(
        new Pawwell_Title_Info_Control( $wp_customize, 'pawwell_breadcrumb_label',
        array(
            'label'    => esc_html__( 'Breadcrumb Settings', 'pawwell' ),
            'section'  => 'pawwell_page_settings',
            'type'     => 'pawwell-title',
            'settings' => 'pawwell_breadcrumb_label',
        )
    ));

    // Enable/Disable Breadcrumb
    $wp_customize->add_setting(
        'pawwell_enable_breadcrumb',
        array(
            'default'           => true,
            'type'              => 'theme_mod',
            'sanitize_callback' => 'pawwell_sanitize_checkbox',
            'transport'         => 'refresh',
        )
    );

    $wp_customize->add_control(
        new Pawwell_Toggle_Control( $wp_customize, 'pawwell_enable_breadcrumb',
        array(
            'label'       => esc_html__( 'Enable Breadcrumb', 'pawwell' ),
            'description' => esc_html__( 'Enable/Disable breadcrumb on inner pages except the front page.', 'pawwell' ),
            'section'     => 'pawwell_page_settings',
            'type'        => 'pawwell-toggle',
            'settings'    => 'pawwell_enable_breadcrumb',
        )
    ));
}
endif;

add_action( 'customize_register', 'pawwell_customizer_page_settings_register' );