<?php
/**
 * Customizer: Add Panels and Sections
 *
 * Adds custom panels and sections to the WordPress Customizer.
 * 
 * @package Purenote
 */ 

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

add_action( 'customize_register', 'purenote_register_customizer_panels_sections' );

if ( ! function_exists( 'purenote_register_customizer_panels_sections' ) ) :
    
    /**
     * Implement the Theme Customizer for Theme Settings.
     *
     * @param WP_Customize_Manager $wp_customize Customizer object.
     */
    function purenote_register_customizer_panels_sections( $wp_customize ) {

        /*
         * Failsafe is safe
         */
        if ( ! isset( $wp_customize ) ) {
            return;
        }
    /*--------------------------- Add Panels -------------------------------------*/
        
        /**
         * Add Panel for General Settings
         * 
         * Customize > General Settings
         * 
         * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */
        $wp_customize->add_panel( 'purenote_panel_general',
            array(
                'priority'  => 5,
                'title'     => __( 'General Settings', 'purenote' )
            )
        );

         /**
         * Add Panel for Header Settings
         * 
         * Customize > Header Settings
         * 
         * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */
        $wp_customize->add_panel( 'purenote_panel_header',
            array(
                'priority'  => 10,
                'title'     => __( 'Header Settings', 'purenote' )
            )
        );

         /**
         * Add Panel for Front Page Settings
         * 
         * customize > Front Page Settings
         * 
         * @uses $wp_customize-> add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */

        $wp_customize -> add_panel('purenote_panel_front_page',
            array(
                'priority'  => 20,
                'title'     => __('Front Page Settings', 'purenote')
            )
        );
        
        /**
         * Add Panel for Inner Page Settings
         * customize > Inner Page Settings
         * 
         * @uses $wp_customize-> add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */

         $wp_customize -> add_panel('purenote_panel_inner_page',
            array(
                'priority'  => 25,
                'title' => __('Inner Page Settings', 'purenote')
            )
        ); 

         /**
         * Add Panel for Footer Settings
         * 
         * Customize > Footer Settings
         * 
         * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */
        $wp_customize->add_panel( 'purenote_panel_footer',
            array(
                'priority'  => 25,
                'title'     => __( 'Footer Settings', 'purenote' )
            )
        );
    }
    
endif;