<?php
// function xrprompt_theme_customize_register( $wp_customize ) {

    
//     //Theme general settings panel
//     $wp_customize->add_panel( 'xrprompt_theme_settings', array(
//       'title' => esc_html__( 'XRprompt: Theme Settings', 'xrprompt' ),
//       'description' => esc_html__( 'Customize theme settings', 'xrprompt'),
//       'priority' => 1
//     ));

//           //General Settings - Settings 1
//           $wp_customize->add_section( 'general_settings' , array(
//             'title' => __('General Settings', 'xrprompt'),
//             'panel' => 'xrprompt_theme_settings'
//           ));

//                 //Body Background Color settings
//                 $wp_customize->add_setting( 'body_bg' , array(
//                     'default'     => '#ffffff',
//                     'transport'   => 'refresh',
//                     'sanitize_callback' => 'clean_customizer_code'
//                 ));

//                 //Body Background Color control
//                 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bodybg', array(
//                       'label'    => __( 'Page Background Color', 'xrprompt' ),
//                       'section'  => 'general_settings',
//                       'settings' => 'body_bg'
//                     )) 
//                 );

                
//                 //Website logo settings
//                 $wp_customize->add_setting( 'sw_logo',
//                   array(
//                     'default' => true,
//                     'transport' => 'refresh',
//                     'sanitize_callback' => 'clean_customizer_code'
//                   ));

//                 //Website Logo: Control
//                 $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'website_logo', array(
//                     'label'    => __( 'Website Logo', 'xrprompt' ),
//                     'section'  => 'general_settings',
//                     'settings' => 'sw_logo',
//                 )));

//                 //Website bg settings
//                 $wp_customize->add_setting( 'bg_img',
//                   array(
//                     'default' => true,
//                     'transport' => 'refresh',
                    
//                   ));

//                 //Website Logo: Control
//                 $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'website_logo2', array(
//                     'label'    => __( 'Background Image', 'xrprompt' ),
//                     'section'  => 'general_settings',
//                     'settings' => 'bg_img',
//                 )));


          
    




// }



// add_action( 'customize_register', 'xrprompt_theme_customize_register' );




  // ========================================================
  // Get Website Style Sanitize
  // ========================================================

  if ( ! function_exists( 'clean_customizer_code' ) ) {
    function get_website_style( $input, $setting ) {
      //input must be a slug: lowercase alphanumeric characters, dashes and underscores are allowed only
            $input = sanitize_key($input);
  
            //get the list of possible select options 
            $choices = $setting->manager->get_control( $setting->id )->choices;
                              
            //return input if valid or return default option
            return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); 
    }
  }













?>







