<?php
/**
 * Homepage Settings
 *
 * @package Chic Lifestyle
 */

add_action( 'customize_register', 'chic_lifestyle_customize_register_homepage_panel' );

function chic_lifestyle_customize_register_homepage_panel( $wp_customize ) {
    // Add the homepage panel using the native Customizer API.
    $wp_customize->add_panel( 'chic_lifestyle_homepage_panel', array(
        'priority'    => 12,
        'title'       => esc_attr__( 'Theme Options', 'chic-lifestyle' ),
        'description' => esc_attr__( 'Theme Options', 'chic-lifestyle' ),
    ) );

    // Move Header Image and Background Image Sections to the new homepage panel.
    // if ( $wp_customize->get_section( 'header_image' ) ) {
    //     $wp_customize->get_section( 'header_image' )->panel    = 'chic_lifestyle_homepage_panel';
    //     $wp_customize->get_section( 'header_image' )->priority = 202;
    // }
    if ( $wp_customize->get_section( 'background_image' ) ) {
        $wp_customize->get_section( 'background_image' )->panel    = 'chic_lifestyle_homepage_panel';
        $wp_customize->get_section( 'background_image' )->priority = 202;
    }
}
